(self, path, destination='', verify='none')

def Func(arg_0, arg_1, arg_2='', arg_3='none'):
        """sends a file to the device using the transfer protocol"""
        arg_4 = os.path.basename(arg_1)
        if not arg_2:
            arg_2 = arg_4

        log.info('Transferring %s as %s', arg_1, arg_2)
        arg_0.__writeln("recv()")

        arg_5 = arg_0.__expect('C> ')
        if not arg_5.endswith('C> '):
            log.error('Error waiting for esp "%s"', arg_5)
            raise CommunicationTimeout('Error waiting for device to start receiving', arg_5)

        log.debug('sending destination filename "%s"', arg_2)
        arg_0.__write(arg_2 + '\x00', True)
        if not arg_0.__got_ack():
            log.error('did not ack destination filename')
            raise NoAckException('Device did not ACK destination filename')

        arg_6 = from_file(arg_1)

        log.debug('sending %d bytes in %s', len(arg_6), arg_4)
        arg_7 = 0
        arg_8 = 128
        while arg_7 < len(arg_6):
            arg_9 = len(arg_6) - arg_7
            if arg_9 > arg_8:
                arg_9 = arg_8

            arg_10 = arg_6[arg_7:arg_7+arg_9]
            if not arg_0.__write_chunk(arg_10):
                arg_11 = arg_0.__expect()
                log.error('Bad chunk response "%s" %s', arg_11, hexify(arg_11))
                raise BadResponseException('Bad chunk response', ACK, arg_11)

            arg_7 += arg_8

        log.debug('sending zero block')
        #zero size block
        arg_0.__write_chunk('')
        if arg_3 != 'none':
            arg_0.verify_file(arg_1, arg_2, arg_3)


def Func ( ** arg_0 ) : def set_values ( arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_3 . get ( "name" ) if arg_4 in arg_0 : arg_3 [ "value" ] = arg_0 [ arg_4 ] return interceptable ( arg_1 ) ( * arg_2 , ** arg_3 ) return set_values

def Func(**arg_0):
  """Creates a value-setting interceptor.

  This function creates an interceptor that sets values of Edward2 random
  variable objects. This is useful for a range of tasks, including conditioning
  on observed data, sampling from posterior predictive distributions, and as a
  building block of inference primitives such as computing log joint
  probabilities (see examples below).

  Args:
    **model_kwargs: dict of str to Tensor. Keys are the names of random
      variables in the model to which this interceptor is being applied. Values
      are Tensors to set their value to. Variables not included in this dict
      will not be set and will maintain their existing value semantics (by
      default, a sample from the parent-conditional distribution).

  Returns:
    set_values: function that sets the value of intercepted ops.

  #### Examples

  Consider for illustration a model with latent `z` and
  observed `x`, and a corresponding trainable posterior model:

  ```python
  num_observations = 10
  def model():
    z = ed.Normal(loc=0, scale=1., name='z')  # log rate
    x = ed.Poisson(rate=tf.exp(z) * tf.ones(num_observations), name='x')
    return x

  def variational_model():
    return ed.Normal(loc=tf.Variable(0.),
                     scale=tf.nn.softplus(tf.Variable(-4.)),
                     name='z')  # for simplicity, match name of the model RV.
  ```

  We can use a value-setting interceptor to condition the model on observed
  data. This approach is slightly more cumbersome than that of partially
  evaluating the complete log-joint function, but has the potential advantage
  that it returns a new model callable, which may be used to sample downstream
  variables, passed into additional transformations, etc.

  ```python
  x_observed = np.array([6, 3, 1, 8, 7, 0, 6, 4, 7, 5])
  def observed_model():
    with ed.interception(Func(x=x_observed)):
      model()
  observed_log_joint_fn = ed.make_log_joint_fn(observed_model)

  # After fixing 'x', the observed log joint is now only a function of 'z'.
  # This enables us to define a variational lower bound,
  # `E_q[ log p(x, z) - log q(z)]`, simply by evaluating the observed and
  # variational log joints at variational samples.
  variational_log_joint_fn = ed.make_log_joint_fn(variational_model)
  with ed.tape() as variational_sample:  # Sample trace from variational model.
    variational_model()
  elbo_loss = -(observed_log_joint_fn(**variational_sample) -
                variational_log_joint_fn(**variational_sample))
  ```

  After performing inference by minimizing the variational loss, a value-setting
  interceptor enables simulation from the posterior predictive distribution:

  ```python
  with ed.tape() as posterior_samples:  # tape is a map {rv.name : rv}
    variational_model()
  with ed.interception(ed.Func(**posterior_samples)):
    x = model()
  # x is a sample from p(X | Z = z') where z' ~ q(z) (the variational model)
  ```

  As another example, using a value setter inside of `ed.tape` enables
  computing the log joint probability, by setting all variables to
  posterior values and then accumulating the log probs of those values under
  the induced parent-conditional distributions. This is one way that we could
  have implemented `ed.make_log_joint_fn`:

  ```python
  def make_log_joint_fn_demo(model):
    def log_joint_fn(**model_kwargs):
      with ed.tape() as model_tape:
        with ed.Func(**model_kwargs):
          model()

      # accumulate sum_i log p(X_i = x_i | X_{:i-1} = x_{:i-1})
      log_prob = 0.
      for rv in model_tape.values():
        log_prob += tf.reduce_sum(rv.log_prob(rv.value))

      return log_prob
    return log_joint_fn
  ```

  """
  def set_values(arg_1, *arg_2, **arg_3):
    """Sets random variable values to its aligned value."""
    arg_4 = arg_3.get("name")
    if arg_4 in arg_0:
      arg_3["value"] = arg_0[arg_4]
    return interceptable(arg_1)(*arg_2, **arg_3)
  return set_values

Creates a value-setting interceptor.

  This function creates an interceptor that sets values of Edward2 random
  variable objects. This is useful for a range of tasks, including conditioning
  on observed data, sampling from posterior predictive distributions, and as a
  building block of inference primitives such as computing log joint
  probabilities (see examples below).

  Args:
    **model_kwargs: dict of str to Tensor. Keys are the names of random
      variables in the model to which this interceptor is being applied. Values
      are Tensors to set their value to. Variables not included in this dict
      will not be set and will maintain their existing value semantics (by
      default, a sample from the parent-conditional distribution).

  Returns:
    set_values: function that sets the value of intercepted ops.

  #### Examples

  Consider for illustration a model with latent `z` and
  observed `x`, and a corresponding trainable posterior model:

  ```python
  num_observations = 10
  def model():
    z = ed.Normal(loc=0, scale=1., name='z')  # log rate
    x = ed.Poisson(rate=tf.exp(z) * tf.ones(num_observations), name='x')
    return x

  def variational_model():
    return ed.Normal(loc=tf.Variable(0.),
                     scale=tf.nn.softplus(tf.Variable(-4.)),
                     name='z')  # for simplicity, match name of the model RV.
  ```

  We can use a value-setting interceptor to condition the model on observed
  data. This approach is slightly more cumbersome than that of partially
  evaluating the complete log-joint function, but has the potential advantage
  that it returns a new model callable, which may be used to sample downstream
  variables, passed into additional transformations, etc.

  ```python
  x_observed = np.array([6, 3, 1, 8, 7, 0, 6, 4, 7, 5])
  def observed_model():
    with ed.interception(make_value_setter(x=x_observed)):
      model()
  observed_log_joint_fn = ed.make_log_joint_fn(observed_model)

  # After fixing 'x', the observed log joint is now only a function of 'z'.
  # This enables us to define a variational lower bound,
  # `E_q[ log p(x, z) - log q(z)]`, simply by evaluating the observed and
  # variational log joints at variational samples.
  variational_log_joint_fn = ed.make_log_joint_fn(variational_model)
  with ed.tape() as variational_sample:  # Sample trace from variational model.
    variational_model()
  elbo_loss = -(observed_log_joint_fn(**variational_sample) -
                variational_log_joint_fn(**variational_sample))
  ```

  After performing inference by minimizing the variational loss, a value-setting
  interceptor enables simulation from the posterior predictive distribution:

  ```python
  with ed.tape() as posterior_samples:  # tape is a map {rv.name : rv}
    variational_model()
  with ed.interception(ed.make_value_setter(**posterior_samples)):
    x = model()
  # x is a sample from p(X | Z = z') where z' ~ q(z) (the variational model)
  ```

  As another example, using a value setter inside of `ed.tape` enables
  computing the log joint probability, by setting all variables to
  posterior values and then accumulating the log probs of those values under
  the induced parent-conditional distributions. This is one way that we could
  have implemented `ed.make_log_joint_fn`:

  ```python
  def make_log_joint_fn_demo(model):
    def log_joint_fn(**model_kwargs):
      with ed.tape() as model_tape:
        with ed.make_value_setter(**model_kwargs):
          model()

      # accumulate sum_i log p(X_i = x_i | X_{:i-1} = x_{:i-1})
      log_prob = 0.
      for rv in model_tape.values():
        log_prob += tf.reduce_sum(rv.log_prob(rv.value))

      return log_prob
    return log_joint_fn
  ```


def
Func
(
*
arg_0
,
**
arg_1
)
:
arg_2
=
arg_1
def
decorator
(
arg_3
)
:
LOG
.
debug
(
"Enabling %s for Func using options:%s"
,
arg_3
,
arg_2
)
if
arg_2
.
get
(
'automatic_options'
,
True
)
:
arg_3
.
required_methods
=
getattr
(
arg_3
,
'required_methods'
,
set
(
)
)
arg_3
.
required_methods
.
add
(
'OPTIONS'
)
arg_3
.
provide_automatic_options
=
False
def
wrapped_function
(
*
arg_0
,
**
arg_1
)
:
arg_6
=
get_cors_options
(
current_app
,
arg_2
)
if
arg_6
.
get
(
'automatic_options'
)
and
request
.
method
==
'OPTIONS'
:
arg_7
=
current_app
.
make_default_options_response
(
)
else
:
arg_7
=
make_response
(
arg_3
(
*
arg_0
,
**
arg_1
)
)
set_cors_headers
(
arg_7
,
arg_6
)
setattr
(
arg_7
,
FLASK_CORS_EVALUATED
,
True
)
return
arg_7
return
update_wrapper
(
wrapped_function
,
arg_3
)
return
decorator

def Func(*arg_0, **arg_1):
    """
    This function is the decorator which is used to wrap a Flask route with.
    In the simplest case, simply use the default parameters to allow all
    origins in what is the most permissive configuration. If this method
    modifies state or performs authentication which may be brute-forced, you
    should add some degree of protection, such as Cross Site Forgery
    Request protection.

    :param origins:
        The origin, or list of origins to allow requests from.
        The origin(s) may be regular expressions, case-sensitive strings,
        or else an asterisk

        Default : '*'
    :type origins: list, string or regex

    :param methods:
        The method or list of methods which the allowed origins are allowed to
        access for non-simple requests.

        Default : [GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE]
    :type methods: list or string

    :param expose_headers:
        The header or list which are safe to expose to the API of a CORS API
        specification.

        Default : None
    :type expose_headers: list or string

    :param allow_headers:
        The header or list of header field names which can be used when this
        resource is accessed by allowed origins. The header(s) may be regular
        expressions, case-sensitive strings, or else an asterisk.

        Default : '*', allow all headers
    :type allow_headers: list, string or regex

    :param supports_credentials:
        Allows users to make authenticated requests. If true, injects the
        `Access-Control-Allow-Credentials` header in responses. This allows
        cookies and credentials to be submitted across domains.

        :note: This option cannot be used in conjuction with a '*' origin

        Default : False
    :type supports_credentials: bool

    :param max_age:
        The maximum time for which this CORS request maybe cached. This value
        is set as the `Access-Control-Max-Age` header.

        Default : None
    :type max_age: timedelta, integer, string or None

    :param send_wildcard: If True, and the origins parameter is `*`, a wildcard
        `Access-Control-Allow-Origin` header is sent, rather than the
        request's `Origin` header.

        Default : False
    :type send_wildcard: bool

    :param vary_header:
        If True, the header Vary: Origin will be returned as per the W3
        implementation guidelines.

        Setting this header when the `Access-Control-Allow-Origin` is
        dynamically generated (e.g. when there is more than one allowed
        origin, and an Origin than '*' is returned) informs CDNs and other
        caches that the CORS headers are dynamic, and cannot be cached.

        If False, the Vary header will never be injected or altered.

        Default : True
    :type vary_header: bool

    :param automatic_options:
        Only applies to the `Func` decorator. If True, Flask-CORS will
        override Flask's default OPTIONS handling to return CORS headers for
        OPTIONS requests.

        Default : True
    :type automatic_options: bool

    """
    arg_2 = arg_1

    def decorator(arg_3):
        LOG.debug("Enabling %s for Func using options:%s", arg_3, arg_2)

        # If True, intercept OPTIONS requests by modifying the view function,
        # replicating Flask's default behavior, and wrapping the response with
        # CORS headers.
        #
        # If f.provide_automatic_options is unset or True, Flask's route
        # decorator (which is actually wraps the function object we return)
        # intercepts OPTIONS handling, and requests will not have CORS headers
        if arg_2.get('automatic_options', True):
            arg_3.required_methods = getattr(arg_3, 'required_methods', set())
            arg_3.required_methods.add('OPTIONS')
            arg_3.provide_automatic_options = False

        def wrapped_function(*arg_0, **arg_1):
            # Handle setting of Flask-Cors parameters
            arg_6 = get_cors_options(current_app, arg_2)

            if arg_6.get('automatic_options') and request.method == 'OPTIONS':
                arg_7 = current_app.make_default_options_response()
            else:
                arg_7 = make_response(arg_3(*arg_0, **arg_1))

            set_cors_headers(arg_7, arg_6)
            setattr(arg_7, FLASK_CORS_EVALUATED, True)
            return arg_7

        return update_wrapper(wrapped_function, arg_3)
    return decorator

This function is the decorator which is used to wrap a Flask route with.
    In the simplest case, simply use the default parameters to allow all
    origins in what is the most permissive configuration. If this method
    modifies state or performs authentication which may be brute-forced, you
    should add some degree of protection, such as Cross Site Forgery
    Request protection.

    :param origins:
        The origin, or list of origins to allow requests from.
        The origin(s) may be regular expressions, case-sensitive strings,
        or else an asterisk

        Default : '*'
    :type origins: list, string or regex

    :param methods:
        The method or list of methods which the allowed origins are allowed to
        access for non-simple requests.

        Default : [GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE]
    :type methods: list or string

    :param expose_headers:
        The header or list which are safe to expose to the API of a CORS API
        specification.

        Default : None
    :type expose_headers: list or string

    :param allow_headers:
        The header or list of header field names which can be used when this
        resource is accessed by allowed origins. The header(s) may be regular
        expressions, case-sensitive strings, or else an asterisk.

        Default : '*', allow all headers
    :type allow_headers: list, string or regex

    :param supports_credentials:
        Allows users to make authenticated requests. If true, injects the
        `Access-Control-Allow-Credentials` header in responses. This allows
        cookies and credentials to be submitted across domains.

        :note: This option cannot be used in conjuction with a '*' origin

        Default : False
    :type supports_credentials: bool

    :param max_age:
        The maximum time for which this CORS request maybe cached. This value
        is set as the `Access-Control-Max-Age` header.

        Default : None
    :type max_age: timedelta, integer, string or None

    :param send_wildcard: If True, and the origins parameter is `*`, a wildcard
        `Access-Control-Allow-Origin` header is sent, rather than the
        request's `Origin` header.

        Default : False
    :type send_wildcard: bool

    :param vary_header:
        If True, the header Vary: Origin will be returned as per the W3
        implementation guidelines.

        Setting this header when the `Access-Control-Allow-Origin` is
        dynamically generated (e.g. when there is more than one allowed
        origin, and an Origin than '*' is returned) informs CDNs and other
        caches that the CORS headers are dynamic, and cannot be cached.

        If False, the Vary header will never be injected or altered.

        Default : True
    :type vary_header: bool

    :param automatic_options:
        Only applies to the `cross_origin` decorator. If True, Flask-CORS will
        override Flask's default OPTIONS handling to return CORS headers for
        OPTIONS requests.

        Default : True
    :type automatic_options: bool

This function is the decorator which is used to wrap a Flask route with . In the simplest case simply use the default parameters to allow all origins in what is the most permissive configuration . If this method modifies state or performs authentication which may be brute - forced you should add some degree of protection such as Cross Site Forgery Request protection .


def Func ( ) : arg_0 = { } for arg_1 , arg_2 in iteritems ( os . environ ) : if arg_3 ( arg_1 ) in default_conf : arg_0 [ arg_3 ( arg_1 ) ] = arg_2 return arg_0

def Func():
    """ Read all environment variables to see if they contain PERI """
    arg_0 = {}
    for arg_1,arg_2 in iteritems(os.environ):
        if arg_3(arg_1) in default_conf:
            arg_0[arg_3(arg_1)] = arg_2
    return arg_0


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in getattr ( arg_0 , '_fields_' ) : arg_4 , arg_5 = arg_3 [ 0 ] , arg_3 [ 1 ] if arg_4 in arg_2 : continue arg_6 = getattr ( arg_0 , arg_4 ) arg_7 = getattr ( arg_1 , arg_4 ) if isinstance ( arg_5 , ( type ( Union ) , type ( Structure ) ) ) : if Func ( arg_6 , arg_7 , arg_2 ) : return 1 elif isinstance ( arg_5 , type ( Array ) ) : for arg_8 , arg_9 in enumerate ( arg_6 ) : if isinstance ( arg_5 , ( type ( Union ) , type ( Structure ) ) ) : if Func ( arg_6 [ arg_8 ] , arg_7 [ arg_8 ] , arg_2 ) : return 1 else : if arg_6 [ arg_8 ] != arg_7 [ arg_8 ] : return 1 else : if arg_6 != arg_7 : return 1 return 0

def Func(arg_0, arg_1, arg_2):
    """Compare of two Buffer item"""
    for arg_3 in getattr(arg_0, '_fields_'):
        arg_4, arg_5 = arg_3[0], arg_3[1]

        if arg_4 in arg_2:
            continue

        arg_6 = getattr(arg_0, arg_4)
        arg_7 = getattr(arg_1, arg_4)

        if isinstance(arg_5, (type(Union), type(Structure))):
            if Func(arg_6, arg_7, arg_2):
                return 1
        elif isinstance(arg_5, type(Array)):
            for arg_8, arg_9 in enumerate(arg_6):
                if isinstance(arg_5, (type(Union), type(Structure))):
                    if Func(arg_6[arg_8], arg_7[arg_8], arg_2):
                        return 1
                else:
                    if arg_6[arg_8] != arg_7[arg_8]:
                        return 1
        else:
            if arg_6 != arg_7:
                return 1

    return 0


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = ed . Gamma ( 0.1 , 0.3 , sample_shape = [ arg_2 [ 2 ] , arg_2 [ 1 ] ] , name = "w2" ) arg_5 = ed . Gamma ( 0.1 , 0.3 , sample_shape = [ arg_2 [ 1 ] , arg_2 [ 0 ] ] , name = "w1" ) arg_6 = ed . Gamma ( 0.1 , 0.3 , sample_shape = [ arg_2 [ 0 ] , arg_1 ] , name = "w0" ) arg_7 = ed . Gamma ( 0.1 , 0.1 , sample_shape = [ arg_0 , arg_2 [ 2 ] ] , name = "z2" ) arg_8 = ed . Gamma ( arg_3 , arg_3 / tf . matmul ( arg_7 , arg_4 ) , name = "z1" ) arg_9 = ed . Gamma ( arg_3 , arg_3 / tf . matmul ( arg_8 , arg_5 ) , name = "z0" ) arg_10 = ed . Poisson ( tf . matmul ( arg_9 , arg_6 ) , name = "x" ) return arg_10

def Func(arg_0, arg_1, arg_2, arg_3):
  """A multi-layered topic model over a documents-by-terms matrix."""
  arg_4 = ed.Gamma(0.1, 0.3, sample_shape=[arg_2[2], arg_2[1]], name="w2")
  arg_5 = ed.Gamma(0.1, 0.3, sample_shape=[arg_2[1], arg_2[0]], name="w1")
  arg_6 = ed.Gamma(0.1, 0.3, sample_shape=[arg_2[0], arg_1], name="w0")

  arg_7 = ed.Gamma(0.1, 0.1, sample_shape=[arg_0, arg_2[2]], name="z2")
  arg_8 = ed.Gamma(arg_3, arg_3 / tf.matmul(arg_7, arg_4), name="z1")
  arg_9 = ed.Gamma(arg_3, arg_3 / tf.matmul(arg_8, arg_5), name="z0")
  arg_10 = ed.Poisson(tf.matmul(arg_9, arg_6), name="x")
  return arg_10

A multi - layered topic model over a documents - by - terms matrix .


def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
)
:
try
:
arg_0
.
_verify
(
(
,
u"remove"
)
,
arg_1
)
except
ValueError
,
err
:
raise
BadRequestProtocolError
(
unicode
(
err
)
)
if
arg_0
.
ask
:
if
arg_1
:
arg_0
.
ask
=
else
:
raise
BadRequestProtocolError
(
"'ask' in roster set"
)
if
arg_0
.
approved
:
if
arg_1
:
arg_0
.
approved
=
False
else
:
raise
BadRequestProtocolError
(
"'approved' in roster set"
)
if
arg_2
is
:
arg_2
=
XMPPSettings
(
)
arg_5
=
arg_2
[
"roster_name_length_limit"
]
if
arg_0
.
name
and
len
(
arg_0
.
name
)
>
arg_5
:
raise
NotAcceptableProtocolError
(
u"Roster item name too long"
)
arg_6
=
arg_2
[
"roster_group_name_length_limit"
]
for
arg_7
in
arg_0
.
groups
:
if
not
arg_7
:
raise
NotAcceptableProtocolError
(
u"Roster group name empty"
)
if
len
(
arg_7
)
>
arg_6
:
raise
NotAcceptableProtocolError
(
u"Roster group name too long"
)
if
arg_0
.
_duplicate_group
:
raise
BadRequestProtocolError
(
u"Item group duplicated"
)

def Func(arg_0, arg_1 = False, arg_2 = None):
        """Check if `self` is valid roster set item.

        For use on server to validate incoming roster sets.

        Valid item must have proper `subscription` value other and valid value
        for 'ask'. The lengths of name and group names must fit the configured
        limits.

        :Parameters:
            - `fix`: if `True` than replace invalid 'subscription' and 'ask'
              values with right defaults
            - `settings`: settings object providing the name limits
        :Types:
            - `fix`: `bool`
            - `settings`: `XMPPSettings`

        :Raise: `BadRequestProtocolError` if the item is invalid.
        """
        # pylint: disable=R0912
        try:
            arg_0._verify((None, u"remove"), arg_1)
        except ValueError, err:
            raise BadRequestProtocolError(unicode(err))
        if arg_0.ask:
            if arg_1:
                arg_0.ask = None
            else:
                raise BadRequestProtocolError("'ask' in roster set")
        if arg_0.approved:
            if arg_1:
                arg_0.approved = False
            else:
                raise BadRequestProtocolError("'approved' in roster set")
        if arg_2 is None:
            arg_2 = XMPPSettings()
        arg_5 = arg_2["roster_name_length_limit"]
        if arg_0.name and len(arg_0.name) > arg_5:
            raise NotAcceptableProtocolError(u"Roster item name too long")
        arg_6 = arg_2["roster_group_name_length_limit"]
        for arg_7 in arg_0.groups:
            if not arg_7:
                raise NotAcceptableProtocolError(u"Roster group name empty")
            if len(arg_7) > arg_6:
                raise NotAcceptableProtocolError(u"Roster group name too long")
        if arg_0._duplicate_group:
            raise BadRequestProtocolError(u"Item group duplicated")

Check if self is valid roster set item .


def Func ( arg_0 ) : if isinstance ( arg_0 , ( datetime . datetime , datetime . date , datetime . time ) ) : return arg_0 . strftime ( default_date_fmt ) else : return str ( arg_0 )

def Func(arg_0):
    """ Coerce everything to strings.
    All objects representing time get output according to default_date_fmt.
    """
    if isinstance(arg_0, (datetime.datetime, datetime.date, datetime.time)):
        return arg_0.strftime(default_date_fmt)
    else:
        return str(arg_0)

Coerce everything to strings . All objects representing time get output according to default_date_fmt .


return '{table}_{field}_required_{postfix}'.format(
            table=table,
            field=field.column,
            postfix=key
        )

def Func ( arg_0 : arg_1 , arg_2 , arg_3 ) : return '{table}_{field}_required_{postfix}' . format ( arg_0 = arg_0 , arg_2 = arg_2 . column , postfix = arg_3 )

def Func(arg_0: arg_1, arg_2, arg_3):
        """Gets the name for a CONSTRAINT that applies
        to a single hstore key.

        Arguments:
            table:
                The name of the table the field is
                a part of.

            field:
                The hstore field to create a
                UNIQUE INDEX for.

            key:
                The name of the hstore key
                to create the name for.

        Returns:
            The name for the UNIQUE index.
        """

        return '{table}_{field}_required_{postfix}'.format(
            arg_0=arg_0,
            arg_2=arg_2.column,
            postfix=arg_3
        )

Gets the name for a CONSTRAINT that applies to a single hstore key .


def Func ( arg_0 , arg_1 = "basic" ) : for arg_2 in smartSort ( arg_0 . cells ) : if arg_1 == "fixed" : arg_0 . html_single_fixed ( arg_2 ) else : arg_0 . html_single_basic ( arg_2 )

def Func(arg_0,arg_1="basic"):
        """generate a data view for every ABF in the project folder."""
        for arg_2 in smartSort(arg_0.cells):
            if arg_1=="fixed":
                arg_0.html_single_fixed(arg_2)
            else:
                arg_0.html_single_basic(arg_2)

generate a data view for every ABF in the project folder .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . PC = Operators . ITEBV ( arg_0 . address_bit_size , arg_1 . read ( ) , arg_0 . PC , arg_2 . read ( ) )

def Func(arg_0, arg_1, arg_2):
        """
        Compare and Branch on Zero compares the value in a register with zero, and conditionally branches forward
        a constant value. It does not affect the condition flags.

        :param ARMv7Operand op: Specifies the register that contains the first operand.
        :param ARMv7Operand dest:
            Specifies the label of the instruction that is to be branched to. The assembler calculates the
            required value of the offset from the PC value of the Func instruction to this label, then
            selects an encoding that will set imm32 to that offset. Allowed offsets are even numbers in
            the range 0 to 126.
        """
        arg_0.PC = Operators.ITEBV(arg_0.address_bit_size,
                                 arg_1.read(), arg_0.PC, arg_2.read())

Compare and Branch on Zero compares the value in a register with zero, and conditionally branches forward
        a constant value. It does not affect the condition flags.

        :param ARMv7Operand op: Specifies the register that contains the first operand.
        :param ARMv7Operand dest:
            Specifies the label of the instruction that is to be branched to. The assembler calculates the
            required value of the offset from the PC value of the CBZ instruction to this label, then
            selects an encoding that will set imm32 to that offset. Allowed offsets are even numbers in
            the range 0 to 126.

Compare and Branch on Zero compares the value in a register with zero and conditionally branches forward a constant value . It does not affect the condition flags .


def Func ( arg_0 , arg_1 , arg_2 ) : with h5py . File ( arg_0 . database . input , 'r' ) as io5 : arg_3 = io5 [ "bootsarr" ] [ : ] arg_4 = io5 [ "bootsmap" ] [ : ] arg_5 = arg_3 [ : ] == 78 arg_6 = np . zeros ( ( arg_1 . shape [ 0 ] , 4 ) , dtype = np . uint16 ) arg_7 = None arg_8 = np . zeros ( ( arg_1 . shape [ 0 ] , 4 ) , dtype = np . uint32 ) for arg_9 in xrange ( arg_1 . shape [ 0 ] ) : arg_10 = arg_1 [ arg_9 ] arg_11 = arg_3 [ arg_10 ] arg_12 = np . any ( arg_5 [ arg_10 ] , axis = 0 ) arg_12 += np . all ( arg_11 == arg_11 [ 0 ] , axis = 0 ) arg_13 , arg_14 = calculate ( arg_11 , arg_4 [ : , 0 ] , arg_12 , arg_2 ) arg_8 [ arg_9 ] = arg_14 arg_6 [ arg_9 ] = arg_1 [ arg_9 ] [ arg_13 ] return arg_6 , arg_7 , arg_8

def Func(arg_0, arg_1, arg_2):
    """ The workhorse function. Not numba. """

    ## tell engines to limit threads
    #numba.config.NUMBA_DEFAULT_NUM_THREADS = 1

    ## open the seqarray view, the modified array is in bootsarr
    with h5py.File(arg_0.database.input, 'r') as io5:
        arg_3 = io5["bootsarr"][:]
        arg_4 = io5["bootsmap"][:]

    ## create an N-mask array of all seq cols (this isn't really too slow)
    arg_5 = arg_3[:] == 78

    ## tried numba compiling everythign below here, but was not faster
    ## than making nmask w/ axis arg in numpy

    ## get the input arrays ready
    arg_6 = np.zeros((arg_1.shape[0], 4), dtype=np.uint16)
    arg_7 = None
    #rweights = np.ones(smpchunk.shape[0], dtype=np.float64)
    arg_8 = np.zeros((arg_1.shape[0], 4), dtype=np.uint32)

    #times = []
    ## fill arrays with results using numba funcs
    for arg_9 in xrange(arg_1.shape[0]):
        ## get seqchunk for 4 samples (4, ncols)
        arg_10 = arg_1[arg_9]
        arg_11 = arg_3[arg_10]

        ## get N-containing columns in 4-array, and invariant sites.
        arg_12 = np.any(arg_5[arg_10], axis=0)
        arg_12 += np.all(arg_11 == arg_11[0], axis=0)  ## <- do we need this?

        ## get matrices if there are any shared SNPs
        ## returns best-tree index, qscores, and qstats
        #bidx, qscores, qstats = calculate(seqchunk, maparr[:, 0], nmask, tests)
        arg_13, arg_14 = calculate(arg_11, arg_4[:, 0], arg_12, arg_2)

        ## get weights from the three scores sorted.
        ## Only save to file if the quartet has information
        arg_8[arg_9] = arg_14
        arg_6[arg_9] = arg_1[arg_9][arg_13]

    return arg_6, arg_7, arg_8


(self, process_descriptions, tasks,
                               check_upstream,
                               check_downstream, count_forks, total_tasks,
                               forks)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
)
:
arg_8
=
arg_2
.
split
(
)
for
arg_9
in
arg_8
:
arg_10
=
arg_9
.
split
(
"="
)
[
0
]
if
arg_10
not
in
arg_1
.
keys
(
)
:
logger
.
error
(
colored_print
(
"{} not in the possible processes"
.
format
(
arg_10
)
,
"red_bold"
)
)
sys
.
exit
(
)
else
:
arg_11
=
arg_9
.
split
(
"="
)
if
len
(
arg_11
)
>
1
:
arg_0
.
process_to_id
[
arg_11
[
0
]
]
=
arg_11
[
1
]
if
not
bool
(
[
arg_13
for
arg_13
in
arg_7
if
arg_10
in
arg_13
]
)
and
not
bool
(
[
arg_14
for
arg_14
in
arg_7
if
arg_1
[
arg_10
]
[
2
]
in
arg_14
]
)
:
arg_15
=
[
]
if
arg_10
in
arg_1
:
if
arg_3
:
arg_15
=
arg_0
.
build_upstream
(
arg_1
,
arg_10
,
arg_8
,
arg_15
,
arg_5
,
arg_6
,
arg_7
)
arg_15
.
append
(
arg_10
)
if
arg_4
:
arg_15
=
arg_0
.
build_downstream
(
arg_1
,
arg_10
,
arg_8
,
arg_15
,
arg_5
,
arg_6
,
arg_7
)
arg_7
.
append
(
list
(
OrderedDict
.
fromkeys
(
arg_15
)
)
)
elif
bool
(
[
arg_14
for
arg_14
in
arg_7
if
arg_1
[
arg_10
]
[
2
]
in
arg_14
]
)
:
for
arg_16
in
arg_7
:
if
arg_10
not
in
arg_16
:
try
:
arg_17
=
arg_16
.
index
(
arg_1
[
arg_10
]
[
2
]
)
arg_16
.
insert
(
arg_17
,
arg_10
)
except
ValueError
:
continue
for
arg_18
in
range
(
0
,
len
(
arg_7
)
)
:
for
arg_19
in
range
(
0
,
len
(
arg_7
[
arg_18
]
)
)
:
try
:
if
len
(
arg_7
[
arg_18
]
[
arg_19
]
.
split
(
"|"
)
)
>
1
:
arg_7
[
arg_18
]
[
arg_19
]
=
arg_7
[
arg_18
]
[
arg_19
]
.
split
(
"|"
)
arg_20
=
[
]
for
arg_21
in
arg_7
[
arg_18
]
[
arg_19
]
:
if
arg_21
in
arg_6
:
arg_20
.
append
(
arg_21
)
arg_7
[
arg_18
]
[
arg_19
]
=
arg_20
except
AttributeError
as
e
:
continue
return
arg_7

def Func(arg_0, arg_1, arg_2,
                               arg_3,
                               arg_4, arg_5, arg_6,
                               arg_7):
        """Builds the possible forks and connections between the provided
        processes

        This method loops through all the provided tasks and builds the
        upstream and downstream pipeline if required. It then returns all
        possible forks than need to be merged à posteriori`

        Parameters
        ----------
        process_descriptions : dict
            Information of processes input, output and if is forkable
        tasks : str
            Space separated processes
        check_upstream : bool
            If is to build the upstream pipeline of the current task
        check_downstream : bool
            If is to build the downstream pipeline of the current task
        count_forks : int
            Number of current forks
        total_tasks : str
            All space separated processes
        forks : list
            Current forks

        Returns
        -------
        list : List with all the possible pipeline forks
        """

        arg_8 = arg_2.split()

        for arg_9 in arg_8:
            arg_10 = arg_9.split("=")[0]

            if arg_10 not in arg_1.keys():
                logger.error(
                    colored_print(
                        "{} not in the possible processes".format(arg_10),
                        "red_bold"
                    )
                )

                sys.exit()
            else:
                arg_11 = arg_9.split("=")

                if len(arg_11) > 1:
                    arg_0.process_to_id[arg_11[0]] = arg_11[1]

            # Only uses the process if it is not already in the possible forks
            if not bool([arg_13 for arg_13 in arg_7 if arg_10 in arg_13]) and not bool([arg_14 for arg_14 in arg_7 if arg_1[arg_10][2] in arg_14]):
                arg_15 = []

                if arg_10 in arg_1:

                    if arg_3:
                        arg_15 = arg_0.build_upstream(
                            arg_1,
                            arg_10,
                            arg_8,
                            arg_15,
                            arg_5,
                            arg_6,
                            arg_7
                        )

                    arg_15.append(arg_10)

                    if arg_4:
                        arg_15 = arg_0.build_downstream(
                            arg_1,
                            arg_10,
                            arg_8,
                            arg_15,
                            arg_5,
                            arg_6,
                            arg_7
                        )

                # Adds the pipeline fragment to the list of possible forks
                arg_7.append(list(OrderedDict.fromkeys(arg_15)))

            # Checks for task in fork. Case order of input processes is reversed
            elif bool([arg_14 for arg_14 in arg_7 if arg_1[arg_10][2] in arg_14]):
                for arg_16 in arg_7:
                    if arg_10 not in arg_16:
                        try:
                            arg_17 = arg_16.index(arg_1[arg_10][2])
                            arg_16.insert(arg_17, arg_10)
                        except ValueError:
                            continue

        for arg_18 in range(0, len(arg_7)):
            for arg_19 in range(0, len(arg_7[arg_18])):
                try:
                    if len(arg_7[arg_18][arg_19].split("|")) > 1:
                        arg_7[arg_18][arg_19] = arg_7[arg_18][arg_19].split("|")
                        arg_20 = []
                        for arg_21 in arg_7[arg_18][arg_19]:
                            if arg_21 in arg_6:
                                arg_20.append(arg_21)

                        arg_7[arg_18][arg_19] = arg_20

                except AttributeError as e:
                    continue

        return arg_7


return self._authenticated_request \
            .to_endpoint('entity/{}/'.format(entity_id)) \
            .return_body() \
            .get()

def
Func
(
arg_0
,
arg_1
)
:
if
not
is_valid_uuid
(
arg_1
)
:
raise
StorageArgumentException
(
'Invalid UUID for entity_id: {0}'
.
format
(
arg_1
)
)
return
arg_0
.
_authenticated_request
.
to_endpoint
(
'entity/{}/'
.
format
(
arg_1
)
)
.
return_body
(
)
.
get
(
)

def Func(arg_0, arg_1):
        '''Get generic entity by UUID.

        Args:
            entity_id (str): The UUID of the requested entity.

        Returns:
            A dictionary describing the entity::

                {
                     u'collab_id': 2271,
                     u'created_by': u'303447',
                     u'created_on': u'2017-03-10T12:50:06.077891Z',
                     u'description': u'',
                     u'entity_type': u'project',
                     u'modified_by': u'303447',
                     u'modified_on': u'2017-03-10T12:50:06.077946Z',
                     u'name': u'2271',
                     u'uuid': u'3abd8742-d069-44cf-a66b-2370df74a682'
                 }

        Raises:
            StorageArgumentException: Invalid arguments
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes
        '''
        if not is_valid_uuid(arg_1):
            raise StorageArgumentException(
                'Invalid UUID for entity_id: {0}'.format(arg_1))
        return arg_0._authenticated_request \
            .to_endpoint('entity/{}/'.format(arg_1)) \
            .return_body() \
            .get()


def Func(arg_0, arg_1):
        """
        Load the trusted certificates that will be sent to the client.  Does
        not actually imply any of the certificates are trusted; that must be
        configured separately.

        :param bytes cafile: The path to a certificates file in PEM format.
        :return: None
        """
        arg_2 = _lib.SSL_load_client_CA_file(
            _text_to_bytes_and_warn("cafile", arg_1)
        )
        _openssl_assert(arg_2 != _ffi.NULL)
        _lib.SSL_CTX_set_client_CA_list(arg_0._context, arg_2)

Load the trusted certificates that will be sent to the client . Does not actually imply any of the certificates are trusted ; that must be configured separately .


def Func(arg_0, arg_1):
        """Execute autorefresh for areas of code study if configured"""

        if 'studies' not in arg_0.conf[arg_0.backend_section] or \
                'enrich_areas_of_code:git' not in arg_0.conf[arg_0.backend_section]['studies']:
            logger.debug("Not doing autorefresh for studies, Areas of Code study is not active.")
            return

        arg_2 = arg_0.conf['enrich_areas_of_code:git'].get('out_index', GitEnrich.GIT_AOC_ENRICHED)

        # if `out_index` exists but has no value, use default
        if not arg_2:
            arg_2 = GitEnrich.GIT_AOC_ENRICHED

        logger.debug("Autorefresh for Areas of Code study index: %s", arg_2)

        arg_3 = Elasticsearch([arg_0.conf['es_enrichment']['url']], timeout=100,
                           verify_certs=arg_0._get_enrich_backend().elastic.requests.verify)

        if not arg_3.indices.exists(index=arg_2):
            logger.debug("Not doing autorefresh, index doesn't exist for Areas of Code study")
            return

        logger.debug("Doing autorefresh for Areas of Code study")

        # Create a GitEnrich backend tweaked to work with AOC index
        arg_4 = GitEnrich(arg_0.db_sh, None, arg_1['projects']['projects_file'],
                                arg_0.db_user, arg_0.db_password, arg_0.db_host)
        arg_4.mapping = None
        arg_4.roles = ['author']
        arg_7 = get_elastic(arg_0.conf['es_enrichment']['url'],
                                     arg_2, clean=False, backend=arg_4)
        arg_4.set_elastic(arg_7)

        arg_0.__autorefresh(arg_4, studies=True)


def Func ( arg_0 ) : arg_1 = arg_0 . get_plot_data ( ) arg_2 = arg_0 . get_table_data ( ) arg_3 = { ** arg_1 , ** arg_2 } with open ( ".report.json" , "w" ) as json_report : json_report . write ( json . dumps ( arg_3 , separators = ( "," , ":" ) ) )

def Func(arg_0):
        """Writes the JSON report to a json file
        """

        arg_1 = arg_0.get_plot_data()
        arg_2 = arg_0.get_table_data()

        arg_3 = {**arg_1, **arg_2}

        with open(".report.json", "w") as json_report:
            json_report.write(json.dumps(arg_3, separators=(",", ":")))


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
=
minidom
.
parseString
(
arg_1
)
arg_4
=
arg_3
.
getElementsByTagName
(
'process-definition'
)
[
0
]
arg_5
=
arg_4
.
getAttribute
(
'name'
)
if
arg_5
==
''
:
_exc
(
'%s without a name attribute'
%
arg_4
.
nodeName
)
arg_6
=
specs
.
WorkflowSpec
(
arg_5
,
arg_2
)
del
arg_6
.
task_specs
[
'Start'
]
arg_7
=
specs
.
Simple
(
arg_6
,
'End'
)
,
[
]
arg_8
=
dict
(
arg_7
=
arg_7
)
for
arg_9
in
arg_4
.
childNodes
:
if
arg_9
.
nodeType
!=
minidom
.
Node
.
ELEMENT_NODE
:
continue
if
arg_9
.
nodeName
==
'name'
:
arg_6
.
name
=
arg_9
.
firstChild
.
nodeValue
elif
arg_9
.
nodeName
==
'description'
:
arg_6
.
description
=
arg_9
.
firstChild
.
nodeValue
elif
arg_9
.
nodeName
.
lower
(
)
in
_spec_map
:
arg_0
.
deserialize_task_spec
(
arg_6
,
arg_9
,
arg_8
)
else
:
_exc
(
'Unknown node: %s'
%
arg_9
.
nodeName
)
arg_6
.
start
=
arg_8
[
'start'
]
[
0
]
for
arg_5
in
arg_8
:
arg_12
,
arg_13
=
arg_8
[
arg_5
]
for
arg_14
,
arg_15
in
arg_13
:
if
arg_15
not
in
arg_8
:
_exc
(
'Unknown successor: "%s"'
%
arg_15
)
arg_16
,
arg_17
=
arg_8
[
arg_15
]
if
arg_14
is
:
arg_12
.
connect
(
arg_16
)
else
:
arg_12
.
connect_if
(
arg_14
,
arg_16
)
return
arg_6

def Func(arg_0, arg_1, arg_2=None):
        """
        Reads the workflow from the given XML structure and returns a
        WorkflowSpec instance.
        """
        arg_3 = minidom.parseString(arg_1)
        arg_4 = arg_3.getElementsByTagName('process-definition')[0]
        arg_5 = arg_4.getAttribute('name')
        if arg_5 == '':
            _exc('%s without a name attribute' % arg_4.nodeName)

        # Read all task specs and create a list of successors.
        arg_6 = specs.WorkflowSpec(arg_5, arg_2)
        del arg_6.task_specs['Start']
        arg_7 = specs.Simple(arg_6, 'End'), []
        arg_8 = dict(arg_7=arg_7)
        for arg_9 in arg_4.childNodes:
            if arg_9.nodeType != minidom.Node.ELEMENT_NODE:
                continue
            if arg_9.nodeName == 'name':
                arg_6.name = arg_9.firstChild.nodeValue
            elif arg_9.nodeName == 'description':
                arg_6.description = arg_9.firstChild.nodeValue
            elif arg_9.nodeName.lower() in _spec_map:
                arg_0.deserialize_task_spec(
                    arg_6, arg_9, arg_8)
            else:
                _exc('Unknown node: %s' % arg_9.nodeName)

        # Remove the default start-task from the workflow.
        arg_6.start = arg_8['start'][0]

        # Connect all task specs.
        for arg_5 in arg_8:
            arg_12, arg_13 = arg_8[arg_5]
            for arg_14, arg_15 in arg_13:
                if arg_15 not in arg_8:
                    _exc('Unknown successor: "%s"' % arg_15)
                arg_16, arg_17 = arg_8[arg_15]
                if arg_14 is None:
                    arg_12.connect(arg_16)
                else:
                    arg_12.connect_if(arg_14, arg_16)
        return arg_6

Reads the workflow from the given XML structure and returns a WorkflowSpec instance .


def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = get_app_qt4 ( [ '' ] ) if hasattr ( arg_0 , '_in_event_loop' ) : return arg_0 . _in_event_loop else : return False

def Func(arg_0=None):
    """Is the qt4 event loop running."""
    if arg_0 is None:
        arg_0 = get_app_qt4([''])
    if hasattr(arg_0, '_in_event_loop'):
        return arg_0._in_event_loop
    else:
        # Does qt4 provide a other way to detect this?
        return False


def Func ( arg_0 , arg_1 = True ) : global DEBUG global PAT_FORWARD , PAT_REPLIED , PAT_UNSUBSC if arg_1 : arg_0 = filter ( lambda x : x in string . printable , arg_0 ) if DEBUG : print ( "text:" , arg_0 ) arg_2 = PAT_FORWARD . split ( arg_0 , re . M ) if arg_2 and len ( arg_2 ) > 1 : arg_0 = arg_2 [ 0 ] arg_2 = PAT_REPLIED . split ( arg_0 , re . M ) if arg_2 and len ( arg_2 ) > 1 : arg_0 = arg_2 [ 0 ] arg_2 = PAT_UNSUBSC . split ( arg_0 , re . M ) if arg_2 : arg_0 = arg_2 [ 0 ] arg_3 = [ ] for arg_4 in arg_0 . split ( "\n" ) : if arg_4 . startswith ( ">" ) : arg_3 . append ( "" ) else : arg_3 . append ( arg_4 ) return list ( split_grafs ( arg_3 ) )

def Func (arg_0, arg_1=True):
    """
    filter the quoted text out of a message
    """
    global DEBUG
    global PAT_FORWARD, PAT_REPLIED, PAT_UNSUBSC

    if arg_1:
        arg_0 = filter(lambda x: x in string.printable, arg_0)

        if DEBUG:
            print("text:", arg_0)

        # strip off quoted text in a forward
        arg_2 = PAT_FORWARD.split(arg_0, re.M)

        if arg_2 and len(arg_2) > 1:
            arg_0 = arg_2[0]

        # strip off quoted text in a reply
        arg_2 = PAT_REPLIED.split(arg_0, re.M)

        if arg_2 and len(arg_2) > 1:
            arg_0 = arg_2[0]

        # strip off any trailing unsubscription notice
        arg_2 = PAT_UNSUBSC.split(arg_0, re.M)

        if arg_2:
            arg_0 = arg_2[0]

    # replace any remaining quoted text with blank lines
    arg_3 = []

    for arg_4 in arg_0.split("\n"):
        if arg_4.startswith(">"):
            arg_3.append("")
        else:
            arg_3.append(arg_4)

    return list(split_grafs(arg_3))


def Func ( arg_0 ) : arg_1 = arg_0 [ 'code' ] arg_2 = arg_0 [ 'line' ] + 1 arg_3 = arg_0 [ 'column' ] arg_4 = arg_0 [ 'path' ] arg_5 = 'utf-8' arg_6 = jedi . Script ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) try : arg_7 = arg_6 . goto_definitions ( ) except jedi . NotFoundError : return [ ] else : arg_8 = [ d . docstring ( ) for d in arg_7 ] return arg_8

def Func(arg_0):
    """
    Worker that returns the documentation of the symbol under cursor.
    """
    arg_1 = arg_0['code']
    arg_2 = arg_0['line'] + 1
    arg_3 = arg_0['column']
    arg_4 = arg_0['path']
    # encoding = 'utf-8'
    arg_5 = 'utf-8'
    arg_6 = jedi.Script(arg_1, arg_2, arg_3, arg_4, arg_5)
    try:
        arg_7 = arg_6.goto_definitions()
    except jedi.NotFoundError:
        return []
    else:
        arg_8 = [d.docstring() for d in arg_7]
        return arg_8

Worker that returns the documentation of the symbol under cursor .


def
Func
(
arg_0
)
:
if
arg_0
.
logappend
:
arg_0
.
magic
(
'logstart %s append'
%
arg_0
.
logappend
)
elif
arg_0
.
logfile
:
arg_0
.
magic
(
'logstart %s'
%
arg_0
.
logfile
)
elif
arg_0
.
logstart
:
arg_0
.
magic
(
'logstart'
)

def Func(arg_0):
        """Initialize logging in case it was requested at the command line.
        """
        if arg_0.logappend:
            arg_0.magic('logstart %s append' % arg_0.logappend)
        elif arg_0.logfile:
            arg_0.magic('logstart %s' % arg_0.logfile)
        elif arg_0.logstart:
            arg_0.magic('logstart')

Initialize logging in case it was requested at the command line .


def Func ( arg_0 ) : import builtins as arg_5 arg_1 = arg_5 . print def arg_6 ( * arg_2 , ** arg_3 ) : arg_4 = arg_3 . pop ( 'force' , False ) if arg_0 or arg_4 : arg_1 ( * arg_2 , ** arg_3 ) arg_5 . print = arg_6

def Func(arg_0):
    """
    This function disables printing when not in master process
    """
    import builtins as arg_5
    arg_1 = arg_5.print

    def arg_6(*arg_2, **arg_3):
        arg_4 = arg_3.pop('force', False)
        if arg_0 or arg_4:
            arg_1(*arg_2, **arg_3)

    arg_5.print = arg_6


return (
        indentation +
        ', '.join(sorted(filtered_imports)) +
        get_line_ending(line))

def
Func
(
arg_0
,
arg_1
)
:
(
arg_2
,
arg_3
)
=
re
.
split
(
pattern
=
r'\bimport\b'
,
string
=
arg_0
,
maxsplit
=
1
)
arg_4
=
re
.
search
(
pattern
=
r'\bfrom\s+([^ ]+)'
,
string
=
arg_2
)
.
group
(
1
)
arg_3
=
re
.
split
(
pattern
=
r','
,
string
=
arg_3
.
strip
(
)
)
arg_3
=
[
arg_4
+
'.'
+
x
.
strip
(
)
for
x
in
arg_3
]
arg_5
=
[
x
.
replace
(
arg_4
+
'.'
,
''
)
for
x
in
arg_3
if
x
not
in
arg_1
]
if
not
arg_5
:
return
get_indentation
(
arg_0
)
+
'pass'
+
get_line_ending
(
arg_0
)
arg_2
+=
'import '
return
(
arg_2
+
', '
.
join
(
sorted
(
arg_5
)
)
+
get_line_ending
(
arg_0
)
)

def Func(arg_0, arg_1):
    """Parse and filter ``from something import a, b, c``.

    Return line without unused import modules, or `pass` if all of the
    module in import is unused.
    """
    (arg_2, arg_3) = re.split(pattern=r'\bimport\b',
                                      string=arg_0, maxsplit=1)
    arg_4 = re.search(pattern=r'\bfrom\s+([^ ]+)',
                            string=arg_2).group(1)

    # Create an imported module list with base module name
    # ex ``from a import b, c as d`` -> ``['a.b', 'a.c as d']``
    arg_3 = re.split(pattern=r',', string=arg_3.strip())
    arg_3 = [arg_4 + '.' + x.strip() for x in arg_3]

    # We compare full module name (``a.module`` not `module`) to
    # guarantee the exact same module as detected from pyflakes.
    arg_5 = [x.replace(arg_4 + '.', '')
                        for x in arg_3 if x not in arg_1]

    # All of the import in this statement is unused
    if not arg_5:
        return get_indentation(arg_0) + 'pass' + get_line_ending(arg_0)

    arg_2 += 'import '

    return (
        arg_2 +
        ', '.join(sorted(arg_5)) +
        get_line_ending(arg_0))

Parse and filter from something import a b c .


def Func ( arg_0 , arg_1 ) : with arg_0 . lock : if arg_1 . stream != arg_0 . stream : return arg_0 . me = arg_1 . stream . me arg_0 . peer = arg_1 . stream . peer arg_4 = arg_0 . settings [ u"initial_presence" ] if arg_4 : arg_0 . send ( arg_4 )

def Func(arg_0, arg_1):
        """Handle the `AuthorizedEvent`.
        """
        with arg_0.lock:
            if arg_1.stream != arg_0.stream:
                return
            arg_0.me = arg_1.stream.me
            arg_0.peer = arg_1.stream.peer
            arg_4 = arg_0.settings[u"initial_presence"]
            if arg_4:
                arg_0.send(arg_4)


(
            self,
            df,
            table,
            field_dict=None,
            delimiter=',',
            encoding='utf8',
            pandas_kwargs=None, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
','
,
arg_5
=
'utf8'
,
arg_6
=
,
**
arg_7
)
:
def
_infer_field_types_from_df
(
arg_1
)
:
arg_8
=
{
'b'
:
'BOOLEAN'
,
'i'
:
'BIGINT'
,
'u'
:
'BIGINT'
,
'f'
:
'DOUBLE'
,
'c'
:
'STRING'
,
'M'
:
'TIMESTAMP'
,
'O'
:
'STRING'
,
'S'
:
'STRING'
,
'U'
:
'STRING'
,
'V'
:
'STRING'
}
arg_9
=
OrderedDict
(
)
for
arg_10
,
arg_11
in
arg_1
.
dtypes
.
iteritems
(
)
:
arg_9
[
arg_10
]
=
arg_8
[
arg_11
.
kind
]
return
arg_9
if
arg_6
is
:
arg_6
=
{
}
with
TemporaryDirectory
(
prefix
=
'airflow_hiveop_'
)
as
tmp_dir
:
with
NamedTemporaryFile
(
dir
=
tmp_dir
,
mode
=
"w"
)
as
f
:
if
arg_3
is
:
arg_3
=
_infer_field_types_from_df
(
arg_1
)
arg_1
.
to_csv
(
path_or_buf
=
f
,
sep
=
arg_4
,
header
=
False
,
index
=
False
,
arg_5
=
arg_5
,
date_format
=
"%Y-%m-%d %H:%M:%S"
,
**
arg_6
)
f
.
flush
(
)
return
arg_0
.
load_file
(
filepath
=
f
.
name
,
arg_2
=
arg_2
,
arg_4
=
arg_4
,
arg_3
=
arg_3
,
**
arg_7
)

def Func(
            arg_0,
            arg_1,
            arg_2,
            arg_3=None,
            arg_4=',',
            arg_5='utf8',
            arg_6=None, **arg_7):
        """
        Loads a pandas DataFrame into hive.

        Hive data types will be inferred if not passed but column names will
        not be sanitized.

        :param df: DataFrame to load into a Hive table
        :type df: pandas.DataFrame
        :param table: target Hive table, use dot notation to target a
            specific database
        :type table: str
        :param field_dict: mapping from column name to hive data type.
            Note that it must be OrderedDict so as to keep columns' order.
        :type field_dict: collections.OrderedDict
        :param delimiter: field delimiter in the file
        :type delimiter: str
        :param encoding: str encoding to use when writing DataFrame to file
        :type encoding: str
        :param pandas_kwargs: passed to DataFrame.to_csv
        :type pandas_kwargs: dict
        :param kwargs: passed to self.load_file
        """

        def _infer_field_types_from_df(arg_1):
            arg_8 = {
                'b': 'BOOLEAN',    # boolean
                'i': 'BIGINT',     # signed integer
                'u': 'BIGINT',     # unsigned integer
                'f': 'DOUBLE',     # floating-point
                'c': 'STRING',     # complex floating-point
                'M': 'TIMESTAMP',  # datetime
                'O': 'STRING',     # object
                'S': 'STRING',     # (byte-)string
                'U': 'STRING',     # Unicode
                'V': 'STRING'      # void
            }

            arg_9 = OrderedDict()
            for arg_10, arg_11 in arg_1.dtypes.iteritems():
                arg_9[arg_10] = arg_8[arg_11.kind]
            return arg_9

        if arg_6 is None:
            arg_6 = {}

        with TemporaryDirectory(prefix='airflow_hiveop_') as tmp_dir:
            with NamedTemporaryFile(dir=tmp_dir, mode="w") as f:

                if arg_3 is None:
                    arg_3 = _infer_field_types_from_df(arg_1)

                arg_1.to_csv(path_or_buf=f,
                          sep=arg_4,
                          header=False,
                          index=False,
                          arg_5=arg_5,
                          date_format="%Y-%m-%d %H:%M:%S",
                          **arg_6)
                f.flush()

                return arg_0.load_file(filepath=f.name,
                                      arg_2=arg_2,
                                      arg_4=arg_4,
                                      arg_3=arg_3,
                                      **arg_7)


return Constraint(func, configs, variables, vartype=vartype, name=name)

def
Func
(
arg_0
,
arg_1
=
arg_2
.
BINARY
,
arg_4
=
'HALF_ADDER'
)
:
arg_0
=
tuple
(
arg_0
)
if
arg_1
is
arg_2
.
BINARY
:
arg_5
=
frozenset
(
[
(
0
,
0
,
0
,
0
)
,
(
0
,
1
,
1
,
0
)
,
(
1
,
0
,
1
,
0
)
,
(
1
,
1
,
0
,
1
)
]
)
else
:
arg_5
=
frozenset
(
[
(
1
,
1
,
1
,
1
)
,
(
1
,
+
1
,
+
1
,
1
)
,
(
+
1
,
1
,
+
1
,
1
)
,
(
+
1
,
+
1
,
1
,
+
1
)
]
)
def
func
(
arg_6
,
arg_7
,
arg_8
,
arg_9
)
:
arg_10
=
(
arg_6
>
0
)
+
(
arg_7
>
0
)
if
arg_10
==
0
:
return
(
arg_8
<=
0
)
and
(
arg_9
<=
0
)
elif
arg_10
==
1
:
return
(
arg_8
>
0
)
and
(
arg_9
<=
0
)
elif
arg_10
==
2
:
return
(
arg_8
<=
0
)
and
(
arg_9
>
0
)
else
:
raise
ValueError
(
"func recieved unexpected values"
)
return
Constraint
(
func
,
arg_5
,
arg_0
,
arg_1
=
arg_1
,
arg_4
=
arg_4
)

def Func(arg_0, arg_1=arg_2.BINARY, arg_4='HALF_ADDER'):
    """Half adder.

    Args:
        variables (list): Variable labels for the and gate as `[in1, in2, sum, carry]`,
            where `in1, in2` are inputs to be added and `sum` and 'carry' the resultant
            outputs.
        vartype (Vartype, optional, default='BINARY'): Variable type. Accepted
            input values:

            * Vartype.SPIN, 'SPIN', {-1, 1}
            * Vartype.BINARY, 'BINARY', {0, 1}
        name (str, optional, default='HALF_ADDER'): Name for the constraint.

    Returns:
        Constraint(:obj:`.Constraint`): Constraint that is satisfied when its variables are
        assigned values that match the valid states of a Boolean half adder.

    Examples:
        >>> import dwavebinarycsp
        >>> import dwavebinarycsp.factories.constraint.gates as gates
        >>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
        >>> csp.add_constraint(gates.Func(['a', 'b', 'total', 'carry'], name='HA1'))
        >>> csp.check({'a': 1, 'b': 1, 'total': 0, 'carry': 1})
        True

    """

    arg_0 = tuple(arg_0)

    if arg_1 is arg_2.BINARY:
        arg_5 = frozenset([(0, 0, 0, 0),
                             (0, 1, 1, 0),
                             (1, 0, 1, 0),
                             (1, 1, 0, 1)])

    else:
        # SPIN, vartype is checked by the decorator
        arg_5 = frozenset([(-1, -1, -1, -1),
                             (-1, +1, +1, -1),
                             (+1, -1, +1, -1),
                             (+1, +1, -1, +1)])

    def func(arg_6, arg_7, arg_8, arg_9):
        arg_10 = (arg_6 > 0) + (arg_7 > 0)
        if arg_10 == 0:
            return (arg_8 <= 0) and (arg_9 <= 0)
        elif arg_10 == 1:
            return (arg_8 > 0) and (arg_9 <= 0)
        elif arg_10 == 2:
            return (arg_8 <= 0) and (arg_9 > 0)
        else:
            raise ValueError("func recieved unexpected values")

    return Constraint(func, arg_5, arg_0, arg_1=arg_1, arg_4=arg_4)

Half adder.

    Args:
        variables (list): Variable labels for the and gate as `[in1, in2, sum, carry]`,
            where `in1, in2` are inputs to be added and `sum` and 'carry' the resultant
            outputs.
        vartype (Vartype, optional, default='BINARY'): Variable type. Accepted
            input values:

            * Vartype.SPIN, 'SPIN', {-1, 1}
            * Vartype.BINARY, 'BINARY', {0, 1}
        name (str, optional, default='HALF_ADDER'): Name for the constraint.

    Returns:
        Constraint(:obj:`.Constraint`): Constraint that is satisfied when its variables are
        assigned values that match the valid states of a Boolean half adder.

    Examples:
        >>> import dwavebinarycsp
        >>> import dwavebinarycsp.factories.constraint.gates as gates
        >>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
        >>> csp.add_constraint(gates.halfadder_gate(['a', 'b', 'total', 'carry'], name='HA1'))
        >>> csp.check({'a': 1, 'b': 1, 'total': 0, 'carry': 1})
        True


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . find ( "configurations" ) if arg_2 is not None : arg_2 = [ ] for arg_3 in arg_1 . findall ( "configuration" ) : arg_4 = arg_3 . find ( "dimension" ) arg_4 = arg_4 . text if arg_4 is not None else None arg_5 = arg_3 . find ( "policy" ) arg_5 = arg_5 . text if arg_5 is not None else None arg_6 = arg_3 . find ( "defaultValueExpression" ) arg_6 = arg_6 . text if arg_6 is not None else None arg_2 . append ( DynamicDefaultValuesConfiguration ( arg_4 , arg_5 , arg_6 ) ) return DynamicDefaultValues ( arg_0 , arg_2 )

def Func(arg_0, arg_1):
    """Extract metadata Dynamic Default Values from an xml node"""
    arg_2 = arg_1.find("configurations")
    if arg_2 is not None:
        arg_2 = []
        for arg_3 in arg_1.findall("configuration"):
            arg_4 = arg_3.find("dimension")
            arg_4 = arg_4.text if arg_4 is not None else None
            arg_5 = arg_3.find("policy")
            arg_5 = arg_5.text if arg_5 is not None else None
            arg_6 = arg_3.find("defaultValueExpression")
            arg_6 = arg_6.text if arg_6 is not None else None

            arg_2.append(DynamicDefaultValuesConfiguration(arg_4, arg_5, arg_6))

    return DynamicDefaultValues(arg_0, arg_2)


return self.func(*(solution[v] for v in self.variables))

def Func ( arg_0 , arg_1 ) : return arg_0 . func ( * ( arg_1 [ arg_2 ] for arg_2 in arg_0 . variables ) )

def Func(arg_0, arg_1):
        """Check that a solution satisfies the constraint.

        Args:
            solution (container):
                An assignment for the variables in the constraint.

        Returns:
            bool: True if the solution satisfies the constraint; otherwise False.

        Examples:
            This example creates a constraint that :math:`a \\ne b` on binary variables
            and tests it for two candidate solutions, with additional unconstrained
            variable c.

            >>> import dwavebinarycsp
            >>> const = dwavebinarycsp.Constraint.from_configurations([(0, 1), (1, 0)],
            ...             ['a', 'b'], dwavebinarycsp.BINARY)
            >>> solution = {'a': 1, 'b': 1, 'c': 0}
            >>> const.Func(solution)
            False
            >>> solution = {'a': 1, 'b': 0, 'c': 0}
            >>> const.Func(solution)
            True

        """
        return arg_0.func(*(arg_1[arg_2] for arg_2 in arg_0.variables))

Check that a solution satisfies the constraint.

        Args:
            solution (container):
                An assignment for the variables in the constraint.

        Returns:
            bool: True if the solution satisfies the constraint; otherwise False.

        Examples:
            This example creates a constraint that :math:`a \\ne b` on binary variables
            and tests it for two candidate solutions, with additional unconstrained
            variable c.

            >>> import dwavebinarycsp
            >>> const = dwavebinarycsp.Constraint.from_configurations([(0, 1), (1, 0)],
            ...             ['a', 'b'], dwavebinarycsp.BINARY)
            >>> solution = {'a': 1, 'b': 1, 'c': 0}
            >>> const.check(solution)
            False
            >>> solution = {'a': 1, 'b': 0, 'c': 0}
            >>> const.check(solution)
            True

Check that a solution satisfies the constraint .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
[
]
,
arg_3
=
"id"
)
:
for
arg_4
in
arg_2
:
if
arg_4
==
arg_3
:
arg_2
.
remove
(
arg_3
)
arg_5
=
"create table "
+
arg_1
+
" "
arg_5
+=
"("
+
arg_3
+
" integer primary key"
for
arg_4
in
arg_2
:
arg_5
+=
", "
+
arg_4
+
" varchar(255)"
arg_5
+=
")"
arg_0
.
_cur
.
execute
(
arg_5
)
arg_0
.
_con
.
commit
(
)
arg_0
.
index
(
arg_1
,
arg_3
,
unique
=
True
)
arg_0
.
connect
(
arg_0
.
_name
)

def Func(arg_0, arg_1, arg_2=[], arg_3="id"):

        """Creates a new table.

        Creates a table with the given name,
        containing the list of given fields.
        Since SQLite uses manifest typing, no data type need be supplied.
        The primary key is "id" by default,
        an integer that can be set or otherwise autoincrements.

        """

        for arg_4 in arg_2:
            if arg_4 == arg_3: arg_2.remove(arg_3)
        arg_5  = "create table "+arg_1+" "
        arg_5 += "("+arg_3+" integer primary key"
        for arg_4 in arg_2: arg_5 += ", "+arg_4+" varchar(255)"
        arg_5 += ")"
        arg_0._cur.execute(arg_5)
        arg_0._con.commit()
        arg_0.index(arg_1, arg_3, unique=True)
        arg_0.connect(arg_0._name)

Creates a new table . Creates a table with the given name containing the list of given fields . Since SQLite uses manifest typing no data type need be supplied . The primary key is id by default an integer that can be set or otherwise autoincrements .


return template.format(name=name, value=value, m_type=m_type)

def Func(arg_0, arg_1, arg_2, arg_3):
        """Compose a statsd compatible string for a metric's measurement."""

        # NOTE(romcheg): This serialized metric template is based on
        #                statsd's documentation.
        arg_4 = '{name}:{value}|{m_type}\n'

        if arg_0.prefix:
            arg_1 = "{prefix}.{m_name}".format(prefix=arg_0.prefix, m_name=arg_1)

        return arg_4.format(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3)

Compose a statsd compatible string for a metric s measurement .


(self, name, file_name, reload_cache=False)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : Entity . verify_name ( arg_1 ) arg_0 . entities . load ( Entity . wrap_name ( arg_1 ) , arg_2 , arg_3 ) with open ( arg_2 ) as f : arg_0 . padaos . add_entity ( arg_1 , f . read ( ) . split ( '\n' ) ) arg_0 . must_train = True

def Func(arg_0, arg_1, arg_2, arg_3=False):
        """
       Loads an entity, optionally checking the cache first

       Args:
           name (str): The associated name of the entity
           file_name (str): The location of the entity file
           reload_cache (bool): Whether to refresh all of cache
       """
        Entity.verify_name(arg_1)
        arg_0.entities.load(Entity.wrap_name(arg_1), arg_2, arg_3)
        with open(arg_2) as f:
            arg_0.padaos.add_entity(arg_1, f.read().split('\n'))
        arg_0.must_train = True

Loads an entity optionally checking the cache first


(self, lines, buffer=None, store='source')

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = 'source' ) : if arg_2 is None : arg_2 = arg_0 . _buffer if arg_1 . endswith ( '\n' ) : arg_2 . append ( arg_1 ) else : arg_2 . append ( arg_1 + '\n' ) setattr ( arg_0 , arg_3 , arg_0 . _set_source ( arg_2 ) )

def Func(arg_0, arg_1, arg_2=None, arg_3='source'):
        """Store one or more lines of input.

        If input lines are not newline-terminated, a newline is automatically
        appended."""

        if arg_2 is None:
            arg_2 = arg_0._buffer

        if arg_1.endswith('\n'):
            arg_2.append(arg_1)
        else:
            arg_2.append(arg_1+'\n')
        setattr(arg_0, arg_3, arg_0._set_source(arg_2))


return rsolve(self._X["VT"], rsolve(self._X["tX"], self.mean()))

def Func ( arg_0 ) : from numpy_sugar . linalg import rsolve return rsolve ( arg_0 . _X [ "VT" ] , rsolve ( arg_0 . _X [ "tX" ] , arg_0 . mean ( ) ) )

def Func(arg_0):
        """
        Fixed-effect sizes.

        Returns
        -------
        effect-sizes : numpy.ndarray
            Optimal fixed-effect sizes.

        Notes
        -----
        Setting the derivative of log(p(𝐲)) over effect sizes equal
        to zero leads to solutions 𝜷 from equation ::

            (QᵀX)ᵀD⁻¹(QᵀX)𝜷 = (QᵀX)ᵀD⁻¹(Qᵀ𝐲).
        """
        from numpy_sugar.linalg import rsolve

        return rsolve(arg_0._X["VT"], rsolve(arg_0._X["tX"], arg_0.mean()))


def Func ( arg_0 , arg_1 , arg_2 = None ) : if isinstance ( arg_1 , str ) : arg_0 . Func_to_file ( arg_1 ) else : if arg_2 is None : arg_2 = False arg_0 . Func_to ( arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2=None):
        """ Writes to a stream or file

        When destination is a string, it will be interpreted as the path were the file should be written to,
        also if do_compress is None, the compression will be guessed from the file extension:

        - .laz -> compressed
        - .las -> uncompressed

        .. note::

            This means that you could do something like:
                # Create .laz but not compressed

                las.Func('out.laz', do_compress=False)

                # Create .las but compressed

                las.Func('out.las', do_compress=True)

            While it should not confuse Las/Laz readers, it will confuse humans so avoid doing it

        Parameters
        ----------
        destination: str or file object
            filename or stream to Func to
        do_compress: bool, optional
            Flags to indicate if you want to compress the data
        """
        if isinstance(arg_1, str):
            arg_0.Func_to_file(arg_1)
        else:
            if arg_2 is None:
                arg_2 = False
            arg_0.Func_to(arg_1, arg_2=arg_2)

Writes to a stream or file

        When destination is a string, it will be interpreted as the path were the file should be written to,
        also if do_compress is None, the compression will be guessed from the file extension:

        - .laz -> compressed
        - .las -> uncompressed

        .. note::

            This means that you could do something like:
                # Create .laz but not compressed

                las.write('out.laz', do_compress=False)

                # Create .las but compressed

                las.write('out.las', do_compress=True)

            While it should not confuse Las/Laz readers, it will confuse humans so avoid doing it

        Parameters
        ----------
        destination: str or file object
            filename or stream to write to
        do_compress: bool, optional
            Flags to indicate if you want to compress the data


def
Func
(
arg_0
,
arg_1
)
:
LOG
.
info
(
"Loading gene bulk with length %s"
,
len
(
arg_1
)
)
try
:
arg_2
=
arg_0
.
hgnc_collection
.
insert_many
(
arg_1
)
except
(
DuplicateKeyError
,
BulkWriteError
)
as
err
:
raise
IntegrityError
(
err
)
return
arg_2

def Func(arg_0, arg_1):
        """Load a bulk of hgnc gene objects

        Raises IntegrityError if there are any write concerns

        Args:
            gene_objs(iterable(scout.models.hgnc_gene))

        Returns:
            result (pymongo.results.InsertManyResult)
        """

        LOG.info("Loading gene bulk with length %s", len(arg_1))
        try:
            arg_2 = arg_0.hgnc_collection.insert_many(arg_1)
        except (DuplicateKeyError, BulkWriteError) as err:
            raise IntegrityError(err)

        return arg_2


def Func(arg_0, arg_1, arg_2=3):
    """Returns the index of the pattern that is closest to inputPattern,
    the distances of all patterns to inputPattern, and the indices of the k
    closest categories.
    """
    arg_3 = numpy.zeros(max(arg_0._categoryList)+1)
    arg_4 = arg_0._getDistances(arg_1)

    arg_5 = arg_4.argsort()

    arg_6 = len(arg_0._categoryList) - arg_0._categoryList.count(-1)
    for arg_7 in arg_5[:min(arg_0.k, arg_6)]:
      arg_3[arg_0._categoryList[arg_7]] += 1.0

    arg_8 = arg_3.argmax()

    arg_9 = []
    for arg_10 in range(arg_2):
      arg_9.append((arg_0._categoryList[arg_5[arg_10]], arg_4[arg_5[arg_10]] ))

    return arg_8, arg_4, arg_9

Returns the index of the pattern that is closest to inputPattern the distances of all patterns to inputPattern and the indices of the k closest categories .


def Func(arg_0):
        """
        This should be periodically called by the manager loop. This method will
        kick off new processes to process DAG definition files and read the
        results from the finished processors.

        :return: a list of SimpleDags that were produced by processors that
            have finished since the last time this was called
        :rtype: list[airflow.utils.dag_processing.SimpleDag]
        """
        arg_1 = {}
        """:type : dict[unicode, AbstractDagFileProcessor]"""
        arg_2 = {}
        """:type : dict[unicode, AbstractDagFileProcessor]"""

        for arg_3, arg_4 in arg_0._processors.items():
            if arg_4.done:
                arg_0.log.debug("Processor for %s finished", arg_3)
                arg_5 = timezone.utcnow()
                arg_1[arg_3] = arg_4
                arg_0._last_runtime[arg_3] = (arg_5 -
                                                 arg_4.start_time).total_seconds()
                arg_0._last_finish_time[arg_3] = arg_5
                arg_0._run_count[arg_3] += 1
            else:
                arg_2[arg_3] = arg_4
        arg_0._processors = arg_2

        arg_0.log.debug("%s/%s DAG parsing processes running",
                       len(arg_0._processors), arg_0._parallelism)

        arg_0.log.debug("%s file paths queued for processing",
                       len(arg_0._file_path_queue))

        # Collect all the DAGs that were found in the processed files
        arg_9 = []
        for arg_3, arg_4 in arg_1.items():
            if arg_4.result is None:
                arg_0.log.warning(
                    "Processor for %s exited with return code %s.",
                    arg_4.file_path, arg_4.exit_code
                )
            else:
                for arg_10 in arg_4.result:
                    arg_9.append(arg_10)

        # Generate more file paths to process if we processed all the files
        # already.
        if len(arg_0._file_path_queue) == 0:
            # If the file path is already being processed, or if a file was
            # processed recently, wait until the next batch
            arg_11 = arg_0._processors.keys()
            arg_5 = timezone.utcnow()
            arg_12 = []
            for arg_3 in arg_0._file_paths:
                arg_13 = arg_0.get_last_finish_time(arg_3)
                if (arg_13 is not None and
                    (arg_5 - arg_13).total_seconds() <
                        arg_0._file_process_interval):
                    arg_12.append(arg_3)

            arg_14 = [arg_3
                                        for arg_3, num_runs in arg_0._run_count.items()
                                        if num_runs == arg_0._max_runs]

            arg_15 = list(set(arg_0._file_paths) -
                                        set(arg_11) -
                                        set(arg_12) -
                                        set(arg_14))

            for arg_3, arg_4 in arg_0._processors.items():
                arg_0.log.debug(
                    "File path %s is still being processed (started: %s)",
                    arg_4.file_path, arg_4.start_time.isoformat()
                )

            arg_0.log.debug(
                "Queuing the following files for processing:\n\t%s",
                "\n\t".join(arg_15)
            )

            arg_0._file_path_queue.extend(arg_15)

        arg_16 = arg_0._find_zombies()

        # Start more processors if we have enough slots and files to process
        while (arg_0._parallelism - len(arg_0._processors) > 0 and
               len(arg_0._file_path_queue) > 0):
            arg_3 = arg_0._file_path_queue.pop(0)
            arg_4 = arg_0._processor_factory(arg_3, arg_16)

            arg_4.start()
            arg_0.log.debug(
                "Started a process (PID: %s) to generate tasks for %s",
                arg_4.pid, arg_3
            )
            arg_0._processors[arg_3] = arg_4

        # Update Func count.
        arg_0._run_count[arg_0._heart_beat_key] += 1

        return arg_9

This should be periodically called by the manager loop . This method will kick off new processes to process DAG definition files and read the results from the finished processors .


def
Func
(
arg_0
,
**
arg_1
)
:
if
arg_0
.
_tls_state
==
"connected"
:
raise
RuntimeError
(
"Already TLS-connected"
)
arg_1
[
"do_handshake_on_connect"
]
=
False
logger
.
debug
(
"Wrapping the socket into ssl"
)
arg_0
.
_socket
=
ssl
.
wrap_socket
(
arg_0
.
_socket
,
**
arg_1
)
arg_0
.
_set_state
(
"tls-handshake"
)
arg_0
.
_continue_tls_handshake
(
)

def Func(arg_0, **arg_1):
        """Initiate starttls handshake over the socket.
        """
        if arg_0._tls_state == "connected":
            raise RuntimeError("Already TLS-connected")
        arg_1["do_handshake_on_connect"] = False
        logger.debug("Wrapping the socket into ssl")
        arg_0._socket = ssl.wrap_socket(arg_0._socket, **arg_1)
        arg_0._set_state("tls-handshake")
        arg_0._continue_tls_handshake()

Initiate starttls handshake over the socket .


def Func ( arg_0 , arg_1 ) : arg_1 = unipath ( arg_1 ) if is_environment ( arg_1 ) : return VirtualEnvironment ( arg_1 ) raise ResolveError

def Func(arg_0, arg_1):
    '''Resolves VirtualEnvironments with a relative or absolute path'''

    arg_1 = unipath(arg_1)

    if is_environment(arg_1):
        return VirtualEnvironment(arg_1)

    raise ResolveError


def Func(arg_0):
        """ Creates PDF reference to resource objects.

        """
        arg_0.session._add_object(2)
        arg_0.session._out('<<')
        arg_0.session._out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]')
        arg_0.session._out('/Font <<')
        for arg_1 in arg_0.document.fonts:
            arg_0.session._out('/F%s %s 0 R' % (arg_1.index, arg_1.number))
        arg_0.session._out('>>')
        if arg_0.document.images:
            arg_0.session._out('/XObject <<')
            for arg_2 in arg_0.document.images:
                arg_0.session._out('/I%s %s 0 R' % (arg_2.index, arg_2.number))
            arg_0.session._out('>>')
        arg_0.session._out('>>')
        arg_0.session._out('endobj')

Creates PDF reference to resource objects .


return Table(df=pd.Series(values, index=self.df.index, name=name + '(' + self.name + ')'))

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 , arg_5 = arg_2 arg_6 = [ ( x [ 0 ] + arg_4 , x [ 1 ] + arg_5 ) for x in arg_0 . df . index ] arg_7 = arg_3 ( arg_0 . df . values , arg_0 . df . loc [ arg_6 ] . values ) return Table ( df = pd . Series ( arg_7 , index = arg_0 . df . index , arg_1 = arg_1 + '(' + arg_0 . name + ')' ) )

def Func(arg_0, arg_1, arg_2, arg_3):
        """Helper function for Func quantities"""
        arg_4, arg_5 = arg_2
        arg_6 = [(x[0] + arg_4, x[1] + arg_5) for x in arg_0.df.index]
        arg_7 = arg_3(arg_0.df.values, arg_0.df.loc[arg_6].values)
        return Table(df=pd.Series(arg_7, index=arg_0.df.index, arg_1=arg_1 + '(' + arg_0.name + ')'))


(self, source, destination, use_sudo=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
)
:
arg_4
=
arg_3
and
run_as_root
or
arg_0
.
run
arg_4
(
'/bin/mv {0} {1}'
.
format
(
quote
(
arg_1
)
,
quote
(
arg_2
)
)
)

def Func(arg_0, arg_1, arg_2, arg_3=False):
        """
        Move a file or directory
        """
        arg_4 = arg_3 and run_as_root or arg_0.run
        arg_4('/bin/mv {0} {1}'.format(quote(arg_1), quote(arg_2)))


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
os
.
path
.
isdir
(
arg_2
)
:
raise
ValueError
(
"profile_path {} is a directory."
.
format
(
arg_2
)
)
if
os
.
path
.
dirname
(
arg_2
)
==
''
and
arg_2
!=
''
:
arg_3
=
os
.
path
.
join
(
os
.
getcwd
(
)
,
arg_2
)
else
:
arg_3
=
arg_2
if
not
os
.
access
(
os
.
path
.
dirname
(
arg_3
)
,
os
.
W_OK
)
:
raise
IOError
(
"profile_path {} is not writeable."
.
format
(
arg_3
)
)
arg_4
=
[
'Func'
,
arg_2
]
arg_0
.
build
(
arg_1
,
,
extra_args
=
arg_4
)
return

def Func(arg_0, arg_1, arg_2):
        '''Calculate a profile of the audio for use in noise reduction.
        Running this command does not effect the Transformer effects
        chain. When this function is called, the calculated noise profile
        file is saved to the `profile_path`.

        Parameters
        ----------
        input_filepath : str
            Path to audiofile from which to compute a noise profile.
        profile_path : str
            Path to save the noise profile file.

        See Also
        --------
        noisered

        '''
        if os.path.isdir(arg_2):
            raise ValueError(
                "profile_path {} is a directory.".format(arg_2))

        if os.path.dirname(arg_2) == '' and arg_2 != '':
            arg_3 = os.path.join(os.getcwd(), arg_2)
        else:
            arg_3 = arg_2

        if not os.access(os.path.dirname(arg_3), os.W_OK):
            raise IOError(
                "profile_path {} is not writeable.".format(arg_3))

        arg_4 = ['Func', arg_2]
        arg_0.build(arg_1, None, extra_args=arg_4)

        return None

Calculate a profile of the audio for use in noise reduction . Running this command does not effect the Transformer effects chain . When this function is called the calculated noise profile file is saved to the profile_path .


def Func(arg_0):
    """List user group members."""
    arg_1 = request.args.get('page', 1, type=int)
    arg_2 = request.args.get('per_page', 5, type=int)
    arg_3 = request.args.get('q', '')
    arg_4 = request.args.get('s', '')

    arg_5 = Group.query.get_or_404(arg_0)
    if arg_5.can_see_members(current_user):
        Func = Membership.query_by_group(arg_0, with_invitations=True)
        if arg_3:
            Func = Membership.search(Func, arg_3)
        if arg_4:
            Func = Membership.order(Func, Membership.state, arg_4)
        Func = Func.paginate(arg_1, arg_2=arg_2)

        return render_template(
            "invenio_groups/members.html",
            arg_5=arg_5,
            Func=Func,
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
        )

    flash(
        _(
            'You are not allowed to see members of this group %(group_name)s.',
            group_name=arg_5.name
        ),
        'error'
    )
    return redirect(url_for('.index'))


def Func(arg_0):
    '''
    retrieves a named charset or treats the input as a custom alphabet and use that
    '''
    if arg_0 in PRESETS:
        return PRESETS[arg_0]
    if len(arg_0) < 16:
        _logger.warning('very small alphabet in use, possibly a failed lookup?')
    return arg_0


def
Func
(
arg_0
)
:
if
arg_0
.
pid
>
0
:
print
(
"Killing JVM with PID {}"
.
format
(
arg_0
.
pid
)
)
try
:
arg_0
.
child
.
terminate
(
)
arg_0
.
child
.
wait
(
)
except
OSError
:
pass
arg_0
.
pid
=
1

def Func(arg_0):
        """
        Normal node shutdown.
        Ignore failures for now.

        :return none
        """
        if arg_0.pid > 0:
            print("Killing JVM with PID {}".format(arg_0.pid))
            try:
                arg_0.child.terminate()
                arg_0.child.wait()
            except OSError:
                pass
            arg_0.pid = -1

Normal node shutdown . Ignore failures for now .


(result, key, trajectory=None, reload=True)

def Func(arg_0, arg_1, arg_2=None, arg_3=True):
    """Turns a given shared data item into a an ordinary one.

    :param result: Result container with shared data
    :param key: The name of the shared data
    :param trajectory:

        The trajectory, only needed if shared data has
        no access to the trajectory, yet.

    :param reload: If data should be reloaded after conversion

    :return: The result

    """
    arg_4 = arg_0.f_get(arg_1)
    if arg_2 is not None:
        arg_4.traj = arg_2
    arg_4._request_data('make_ordinary')
    arg_0.f_remove(arg_1)
    if arg_3:
        arg_2.f_load_item(arg_0, load_data=pypetconstants.OVERWRITE_DATA)
    return arg_0

Turns a given shared data item into a an ordinary one .


def Func ( arg_0 ) : if arg_0 . events : if arg_0 . queueDepth and ( len ( arg_0 . events ) > arg_0 . queueDepth ) : arg_1 = arg_0 . events [ : arg_0 . queueDepth ] arg_0 . events = arg_0 . events [ arg_0 . queueDepth : ] else : arg_1 = arg_0 . events arg_0 . events = [ ] if arg_0 . allow_nan : arg_0 . factory . proto . sendEvents ( arg_1 ) else : arg_0 . factory . proto . sendEvents ( [ arg_2 for arg_2 in arg_1 if arg_2 . metric is not None ] )

def Func(arg_0):
        """Remove all or self.queueDepth events from the queue
        """
        if arg_0.events:
            if arg_0.queueDepth and (len(arg_0.events) > arg_0.queueDepth):
                # Remove maximum of self.queueDepth items from queue
                arg_1 = arg_0.events[:arg_0.queueDepth]
                arg_0.events = arg_0.events[arg_0.queueDepth:]
            else:
                arg_1 = arg_0.events
                arg_0.events = []

            if arg_0.allow_nan:
                arg_0.factory.proto.sendEvents(arg_1)
            else:
                arg_0.factory.proto.sendEvents([arg_2 for arg_2 in arg_1 if arg_2.metric is not None])

Remove all or self . queueDepth events from the queue


(self, dataset=None, dataset_name=None, **kwargs)

def Func(arg_0, arg_1=None, arg_2=None, **arg_3):
        """Saves one dataset into database, timestamp will be added automatically.

        Parameters
        ----------
        dataset : any type
            The dataset you want to store.
        dataset_name : str
            The name of dataset.
        kwargs : other events
            Other events, such as description, author and etc (optinal).

        Examples
        ----------
        Save dataset
        >>> db.Func([X_train, y_train, X_test, y_test], 'mnist', description='this is a tutorial')

        Get dataset
        >>> dataset = db.find_top_dataset('mnist')

        Returns
        ---------
        boolean : Return True if save success, otherwise, return False.
        """
        arg_0._fill_project_info(arg_3)
        if arg_2 is None:
            raise Exception("dataset_name is None, please give a dataset name")
        arg_3.update({'dataset_name': arg_2})

        arg_4 = time.time()
        try:
            arg_5 = arg_0.dataset_fs.put(arg_0._serialization(arg_1))
            arg_3.update({'dataset_id': arg_5, 'time': datetime.utcnow()})
            arg_0.db.Dataset.insert_one(arg_3)
            # print("[Database] Save params: {} SUCCESS, took: {}s".format(file_name, round(time.time()-s, 2)))
            print("[Database] Save dataset: SUCCESS, took: {}s".format(round(time.time() - arg_4, 2)))
            return True
        except Exception as e:
            arg_6, arg_7, arg_8 = sys.exc_info()
            arg_9 = os.path.split(arg_8.tb_frame.f_code.co_filename)[1]
            logging.info("{}  {}  {}  {}  {}".format(arg_6, arg_7, arg_9, arg_8.tb_lineno, e))
            print("[Database] Save dataset: FAIL")
            return False

Saves one dataset into database, timestamp will be added automatically.

        Parameters
        ----------
        dataset : any type
            The dataset you want to store.
        dataset_name : str
            The name of dataset.
        kwargs : other events
            Other events, such as description, author and etc (optinal).

        Examples
        ----------
        Save dataset
        >>> db.save_dataset([X_train, y_train, X_test, y_test], 'mnist', description='this is a tutorial')

        Get dataset
        >>> dataset = db.find_top_dataset('mnist')

        Returns
        ---------
        boolean : Return True if save success, otherwise, return False.

Saves one dataset into database timestamp will be added automatically .


def Func ( arg_0 ) : arg_1 = arg_0 . _current_text_cursor ( ) . selection ( ) . toPlainText ( ) if arg_1 : arg_2 = arg_0 . findItems ( arg_1 , ( QtCore . Qt . MatchStartsWith | QtCore . Qt . MatchCaseSensitive ) ) if arg_2 : arg_0 . setCurrentItem ( arg_2 [ 0 ] ) else : arg_0 . hide ( ) else : arg_0 . hide ( )

def Func(arg_0):
        """ Updates the current item based on the current text.
        """
        arg_1 = arg_0._current_text_cursor().selection().toPlainText()
        if arg_1:
            arg_2 = arg_0.findItems(arg_1, (QtCore.Qt.MatchStartsWith |
                                            QtCore.Qt.MatchCaseSensitive))
            if arg_2:
                arg_0.setCurrentItem(arg_2[0])
            else:
                arg_0.hide()
        else:
            arg_0.hide()

Updates the current item based on the current text .


(self, code, text, format=None, style=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
)
:
arg_5
=
if
arg_1
[
:
3
]
==
arg_0
.
bg
.
PREFIX
:
arg_5
=
arg_0
.
bg
.
COLORS
.
get
(
arg_1
,
)
if
not
arg_5
:
arg_5
=
arg_0
.
fg
.
COLORS
.
get
(
arg_1
,
)
if
not
arg_5
:
raise
Exception
(
'Color code not found'
)
if
arg_3
and
arg_3
not
in
arg_0
.
formats
:
raise
Exception
(
'Color format not found'
)
arg_6
=
"0;"
if
arg_3
==
'bold'
:
arg_6
=
"1;"
elif
arg_3
==
'underline'
:
arg_6
=
"4;"
arg_7
=
arg_5
.
split
(
'['
)
arg_5
=
'{0}[{1}{2}'
.
format
(
arg_7
[
0
]
,
arg_6
,
arg_7
[
1
]
)
if
arg_0
.
has_colors
and
arg_0
.
colors_enabled
:
arg_8
=
''
if
arg_4
:
arg_8
=
arg_0
.
st
.
COLORS
.
get
(
arg_4
,
''
)
return
"{0}{1}{2}{3}"
.
format
(
arg_8
,
arg_5
,
arg_2
,
arg_0
.
st
.
COLORS
[
'reset_all'
]
)
else
:
return
arg_2

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
        """ Colors text with code and given format """
        arg_5 = None
        if arg_1[:3] == arg_0.bg.PREFIX:
            arg_5 = arg_0.bg.COLORS.get(arg_1, None)
        if not arg_5:
            arg_5 = arg_0.fg.COLORS.get(arg_1, None)

        if not arg_5:
            raise Exception('Color code not found')

        if arg_3 and arg_3 not in arg_0.formats:
            raise Exception('Color format not found')

        arg_6 = "0;"
        if arg_3 == 'bold':
            arg_6 = "1;"
        elif arg_3 == 'underline':
            arg_6 = "4;"

        # Manage the format
        arg_7 = arg_5.split('[')
        arg_5 = '{0}[{1}{2}'.format(arg_7[0], arg_6, arg_7[1])

        if arg_0.has_colors and arg_0.colors_enabled:
            # Set brightness
            arg_8 = ''
            if arg_4:
                arg_8 = arg_0.st.COLORS.get(arg_4, '')
            return "{0}{1}{2}{3}".format(arg_8, arg_5, arg_2, arg_0.st.COLORS['reset_all'])
        else:
            return arg_2


def Func ( arg_0 ) : @ wraps ( arg_0 ) def initialization ( * arg_1 , ** arg_2 ) : arg_3 = arg_0 ( * arg_1 , ** arg_2 ) next ( arg_3 ) return arg_3 return initialization

def Func(arg_0):
    """
    Initializes Func essentially priming it to the yield statement.
    Used as a decorator over functions that generate Funcs.

    .. code-block:: python

        # Basic Func producer/consumer pattern
        from translate import Func

        @Func
        def Func_foo(bar):
            try:
                while True:
                    baz = (yield)
                    bar.send(baz)

            except GeneratorExit:
                bar.close()

    :param func: Unprimed Generator
    :type func: Function

    :return: Initialized Coroutine
    :rtype: Function
    """

    @wraps(arg_0)
    def initialization(*arg_1, **arg_2):

        arg_3 = arg_0(*arg_1, **arg_2)
        next(arg_3)

        return arg_3

    return initialization

Initializes coroutine essentially priming it to the yield statement.
    Used as a decorator over functions that generate coroutines.

    .. code-block:: python

        # Basic coroutine producer/consumer pattern
        from translate import coroutine

        @coroutine
        def coroutine_foo(bar):
            try:
                while True:
                    baz = (yield)
                    bar.send(baz)

            except GeneratorExit:
                bar.close()

    :param func: Unprimed Generator
    :type func: Function

    :return: Initialized Coroutine
    :rtype: Function

Initializes coroutine essentially priming it to the yield statement . Used as a decorator over functions that generate coroutines .


def Func ( arg_0 ) : arg_1 = arg_0 [ : : - 1 ] arg_2 = 0 for arg_3 , arg_4 in enumerate ( arg_1 ) : arg_5 = struct . unpack ( "B" , bytes ( [ arg_4 ] ) ) [ 0 ] arg_2 = arg_2 | arg_5 << arg_3 * 8 return arg_2

def Func(arg_0):
    """Convert the byte array to a BigInteger"""
    arg_1 = arg_0[::-1]  # reverse array
    arg_2 = 0
    for arg_3, arg_4 in enumerate(arg_1):
        arg_5 = struct.unpack("B", bytes([arg_4]))[0]
        arg_2 = arg_2 | arg_5 << arg_3 * 8
    return arg_2


def Func():
    """ Load and return configuration as a ``Bunch``.

        Values are based on ``DEFAULTS``, and metadata from ``setup.py``.
    """
    arg_0 = Bunch(DEFAULTS)
    # TODO: override with contents of [rituals] section in setup.cfg

    arg_0.project_root = get_project_root()
    if not arg_0.project_root:
        raise RuntimeError("No tasks module is imported, cannot determine project root")

    arg_0.rootjoin = lambda *names: os.path.join(arg_0.project_root, *names)
    arg_0.srcjoin = lambda *names: arg_0.rootjoin(arg_0.srcdir, *names)
    arg_0.testjoin = lambda *names: arg_0.rootjoin(arg_0.testdir, *names)
    arg_0.cwd = os.getcwd()
    os.chdir(arg_0.project_root)

    # this assumes an importable setup.py
    # TODO: maybe call "python setup.py egg_info" for metadata
    if arg_0.project_root not in sys.path:
        sys.path.append(arg_0.project_root)
    try:
        from setup import arg_6 # pylint: disable=no-name-in-module
    except ImportError:
        from setup import setup_args as arg_6 # pylint: disable=no-name-in-module
    arg_0.project = Bunch(arg_6)

    return arg_0

Load and return configuration as a Bunch .


return self.CODE_TEMPLATE.format(
            snippet=self.get_description()[1], code=code_example,
            ref_name=self.reference)

def Func ( arg_0 ) : arg_1 = arg_0 . code_example if arg_1 is None : return None return arg_0 . CODE_TEMPLATE . format ( snippet = arg_0 . get_description ( ) [ 1 ] , code = arg_1 , ref_name = arg_0 . reference )

def Func(arg_0):
        """The string for creating a code example for the gallery"""
        arg_1 = arg_0.code_example
        if arg_1 is None:
            return None
        return arg_0.CODE_TEMPLATE.format(
            snippet=arg_0.get_description()[1], code=arg_1,
            ref_name=arg_0.reference)


def Func(arg_0):
    '''
    Returns argument as an integer array, converting floats if convertable.
    Raises ValueError if it's a float array with nonintegral values.
    '''
    arg_0 = np.asanyarray(arg_0)
    if is_integer_type(arg_0):
        return arg_0
    arg_1 = np.rint(arg_0)
    if np.any(arg_1 != arg_0):
        raise ValueError("argument array must contain only integers")
    return arg_1.astype(int)

Returns argument as an integer array converting floats if convertable . Raises ValueError if it s a float array with nonintegral values .


(self, limit=None, n=None, percentile=None, keep_ends=False)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=False):
        """
        Remove intervals below a certain limit thickness. In place.

        Args:
            limit (float): Anything thinner than this will be pruned.
            n (int): The n thinnest beds will be pruned.
            percentile (float): The thinnest specified percentile will be
                pruned.
            keep_ends (bool): Whether to keep the first and last, regardless
                of whether they meet the pruning criteria.
        """
        arg_5 = arg_0.copy()

        if not (arg_1 or arg_2 or arg_3):
            arg_6 = "You must provide a limit or n or percentile for pruning."
            raise StriplogError(arg_6)
        if arg_1:
            Func = [i for i, iv in enumerate(arg_5) if iv.thickness < arg_1]
        if arg_2:
            Func = arg_5.thinnest(arg_2=arg_2, index=True)
        if arg_3:
            arg_2 = np.floor(len(arg_5)*arg_3/100)
            Func = arg_5.thinnest(arg_2=arg_2, index=True)

        if arg_4:
            arg_8, arg_9 = 0, len(arg_5) - 1
            if arg_8 in Func:
                Func.remove(arg_8)
            if arg_9 in Func:
                Func.remove(arg_9)

        del arg_5[Func]

        return arg_5

Remove intervals below a certain limit thickness . In place .


def Func ( arg_0 , arg_1 = 10 ) : arg_0 . file . seek ( 0 ) for arg_2 in range ( arg_1 ) : if arg_0 . seek_next_line ( ) == - 1 : break arg_3 = arg_0 . file . tell ( ) arg_0 . file . seek ( 0 ) arg_4 = arg_0 . file . read ( arg_3 ) for arg_5 in arg_0 . LINE_TERMINATORS : if arg_4 . endswith ( arg_5 ) : arg_4 = arg_4 [ : - len ( arg_5 ) ] break if arg_4 : return arg_0 . splitlines ( arg_4 ) else : return [ ]

def Func(arg_0, arg_1=10):
        """
        Return the top lines of the file.
        """
        arg_0.file.seek(0)

        for arg_2 in range(arg_1):
            if arg_0.seek_next_line() == -1:
                break

        arg_3 = arg_0.file.tell()

        arg_0.file.seek(0)
        arg_4 = arg_0.file.read(arg_3)

        for arg_5 in arg_0.LINE_TERMINATORS:
            if arg_4.endswith(arg_5):
                # Only terminators _between_ lines should be preserved.
                # Otherwise terminator of the last line will be treated as separtaing line and empty line.
                arg_4 = arg_4[:-len(arg_5)]
                break

        if arg_4:
            return arg_0.splitlines(arg_4)
        else:
            return []


(
        package_descriptors, targets,
        building_repo_data, testing_repo_data, main_repo_data)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = { } for arg_6 in arg_0 . values ( ) : arg_7 = arg_6 . pkg_name arg_8 = arg_6 . debian_pkg_name arg_5 [ arg_7 ] = { } for arg_9 in arg_1 : arg_5 [ arg_7 ] [ arg_9 ] = False arg_10 = arg_4 . get ( arg_9 , { } ) . get ( arg_8 , None ) if arg_10 is not None : arg_11 = LooseVersion ( arg_10 ) for arg_12 in [ arg_2 , arg_3 ] : arg_13 = arg_12 . get ( arg_9 , { } ) . get ( arg_8 , None ) if not arg_13 or arg_11 > LooseVersion ( arg_13 ) : arg_5 [ arg_7 ] [ arg_9 ] = True return arg_5

def Func(
        arg_0, arg_1,
        arg_2, arg_3, arg_4):
    """
    For each package and target check if it is a regression.

    This is the case if the main repo contains a package version which is
    higher then in any of the other repos or if any of the other repos does not
    contain that package at all.

    :return: a dict indexed by package names containing
      dicts indexed by targets containing a boolean flag
    """
    arg_5 = {}
    for arg_6 in arg_0.values():
        arg_7 = arg_6.pkg_name
        arg_8 = arg_6.debian_pkg_name

        arg_5[arg_7] = {}
        for arg_9 in arg_1:
            arg_5[arg_7][arg_9] = False
            arg_10 = \
                arg_4.get(arg_9, {}).get(arg_8, None)
            if arg_10 is not None:
                arg_11 = LooseVersion(arg_10)
                for arg_12 in [arg_2, arg_3]:
                    arg_13 = \
                        arg_12.get(arg_9, {}).get(arg_8, None)
                    if not arg_13 or arg_11 > LooseVersion(arg_13):
                        arg_5[arg_7][arg_9] = True
    return arg_5

For each package and target check if it is a regression .


def Func ( arg_0 , arg_1 ) : if type ( arg_1 ) == list : for arg_2 in arg_1 : check_url ( arg_2 ) arg_0 . PEERS . extend ( arg_1 ) elif type ( arg_1 ) == str : check_url ( arg_1 ) arg_0 . PEERS . append ( arg_1 )

def Func(arg_0, arg_1):
        """
        Add a peer or multiple peers to the PEERS variable, takes a single string or a list.

        :param peer(list or string)
        """
        if type(arg_1) == list:
            for arg_2 in arg_1:
                check_url(arg_2)
            arg_0.PEERS.extend(arg_1)
        elif type(arg_1) == str:
            check_url(arg_1)
            arg_0.PEERS.append(arg_1)

Add a peer or multiple peers to the PEERS variable takes a single string or a list .


def Func():
    """The Master has been started from the command line. Execute ad-hoc tests if desired."""
    # app = MyMaster()
    arg_0 = MyMaster(log_handler=MyLogger(),
                   listener=AppChannelListener(),
                   soe_handler=SOEHandler(),
                   master_application=MasterApplication())
    _log.debug('Initialization complete. In command loop.')
    # Ad-hoc tests can be performed at this point. See master_cmd.py for examples.
    arg_0.shutdown()
    _log.debug('Exiting.')
    exit()

The Master has been started from the command line . Execute ad - hoc tests if desired .


def Func ( arg_0 , arg_1 ) : return LoadBalancer . get_object ( api_token = arg_0 . token , arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """
            Returns a Load Balancer object by its ID.

            Args:
                id (str): Load Balancer ID
        """
        return LoadBalancer.get_object(api_token=arg_0.token, arg_1=arg_1)

Returns a Load Balancer object by its ID .


def Func(arg_0):
        """
        Sets ownership and permissions for Celery-related files.
        """
        arg_1 = arg_0.local_renderer
        for arg_2 in arg_1.env.paths_owned:
            arg_1.env.path_owned = arg_2
            arg_1.sudo('chown {celery_daemon_user}:{celery_daemon_user} {celery_path_owned}')

Sets ownership and permissions for Celery - related files .