(self, status=200, new_response=False, **kw)

def Func(arg_0, arg_1=200, arg_2=False, **arg_3):
        """
        Defines the mock response.

        Arguments:
            status (int, optional): response status code. Defaults to ``200``.
            **kw (dict): optional keyword arguments passed to ``pook.Response``
                constructor.

        Returns:
            pook.Response: mock response definition instance.
        """
        # Use or create a Response mock instance
        arg_4 = Response(**arg_3) if arg_2 else arg_0._response
        # Define HTTP mandatory response status
        arg_4.status(arg_1 or arg_4._status)
        # Expose current mock instance in response for self-reference
        arg_4.mock = arg_0
        # Define mock response
        arg_0._response = arg_4
        # Return response
        return arg_4


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , arg_4 = [ ] , [ ] for arg_5 in arg_1 : ( arg_4 if arg_0 in arg_5 . vars else arg_3 ) . append ( arg_5 ) arg_3 . append ( pointwise_product ( arg_4 , arg_2 ) . Func ( arg_0 , arg_2 ) ) return arg_3

def Func(arg_0, arg_1, arg_2):
    "Eliminate var from all factors by summing over its values."
    arg_3, arg_4 = [], []
    for arg_5 in arg_1:
        (arg_4 if arg_0 in arg_5.vars else arg_3).append(arg_5)
    arg_3.append(pointwise_product(arg_4, arg_2).Func(arg_0, arg_2))
    return arg_3

Eliminate var from all factors by summing over its values .


def
Func
(
arg_0
=
', '
,
**
arg_1
)
:
arg_2
,
arg_3
=
[
]
,
{
}
for
arg_4
,
arg_5
in
sorted
(
arg_1
.
items
(
)
,
arg_6
=
lambda
kv
:
kv
[
0
]
)
:
arg_6
=
'_QB_%s'
%
arg_4
arg_2
.
append
(
'`%s`=%%(%s)s'
%
(
arg_4
,
arg_6
)
)
arg_3
[
arg_6
]
=
arg_5
return
arg_0
.
join
(
arg_2
)
,
arg_3

def Func(arg_0=', ', **arg_1):
    """ Build a simple expression ready to be added onto another query.

    >>> Func(joiner=' AND ', name='bob', role='admin')
    "`name`=%(_QB_name)s AND `name`=%(_QB_role)s", { '_QB_name': 'bob', '_QB_role': 'admin' }
    """
    arg_2, arg_3 = [], {}

    for arg_4, arg_5 in sorted(arg_1.items(), arg_6=lambda kv: kv[0]):
        arg_6 = '_QB_%s' % arg_4
        arg_2.append('`%s`=%%(%s)s' % (arg_4, arg_6))
        arg_3[arg_6] = arg_5

    return arg_0.join(arg_2), arg_3

Build a simple expression ready to be added onto another query.

    >>> simple_expression(joiner=' AND ', name='bob', role='admin')
    "`name`=%(_QB_name)s AND `name`=%(_QB_role)s", { '_QB_name': 'bob', '_QB_role': 'admin' }

Build a simple expression ready to be added onto another query .


def Func ( arg_0 ) : arg_1 = set ( ) arg_2 = { } for arg_3 in parse_genemap2 ( arg_0 ) : arg_4 = arg_3 [ 'hgnc_symbol' ] for arg_5 in arg_3 [ 'phenotypes' ] : arg_6 = arg_5 [ 'mim_number' ] if arg_6 in arg_2 : arg_7 = arg_2 [ arg_6 ] arg_7 [ 'inheritance' ] = arg_7 [ 'inheritance' ] . union ( arg_5 [ 'inheritance' ] ) arg_7 [ 'hgnc_symbols' ] . add ( arg_4 ) else : arg_5 [ 'hgnc_symbols' ] = set ( [ arg_4 ] ) arg_2 [ arg_6 ] = arg_5 return arg_2

def Func(arg_0):
    """Get a dictionary with phenotypes

    Use the mim numbers for phenotypes as keys and phenotype information as
    values.

    Args:
        genemap_lines(iterable(str))

    Returns:
        phenotypes_found(dict): A dictionary with mim_numbers as keys and
        dictionaries with phenotype information as values.

        {
             'description': str, # Description of the phenotype
             'hgnc_symbols': set(), # Associated hgnc symbols
             'inheritance': set(),  # Associated phenotypes
             'mim_number': int, # mim number of phenotype
        }
    """
    # Set with all omim numbers that are phenotypes
    # Parsed from mim2gene.txt
    arg_1 = set()

    arg_2 = {}

    # Genemap is a file with one entry per gene.
    # Each line hold a lot of information and in specific it
    # has information about the phenotypes that a gene is associated with
    # From this source we collect inheritane patterns and what hgnc symbols
    # a phenotype is associated with
    for arg_3 in parse_genemap2(arg_0):
        arg_4 = arg_3['hgnc_symbol']
        for arg_5 in arg_3['phenotypes']:
            arg_6 = arg_5['mim_number']
            if arg_6 in arg_2:
                arg_7 = arg_2[arg_6]
                arg_7['inheritance'] = arg_7['inheritance'].union(arg_5['inheritance'])
                arg_7['hgnc_symbols'].add(arg_4)
            else:
                arg_5['hgnc_symbols'] = set([arg_4])
                arg_2[arg_6] = arg_5

    return arg_2

Get a dictionary with phenotypes Use the mim numbers for phenotypes as keys and phenotype information as values .


def Func ( arg_0 ) : def _fn ( arg_1 , ** arg_2 ) : arg_3 = getattr ( arg_1 . distribution , arg_0 ) ( ** arg_2 ) arg_4 = prefer_static . concat ( [ arg_1 . distribution . batch_shape_tensor ( ) , prefer_static . ones ( prefer_static . rank_from_shape ( arg_1 . sample_shape ) , dtype = arg_1 . sample_shape . dtype ) , arg_1 . distribution . event_shape_tensor ( ) , ] , axis = 0 ) arg_3 = tf . reshape ( arg_3 , arg_4 = arg_4 ) arg_4 = prefer_static . concat ( [ arg_1 . distribution . batch_shape_tensor ( ) , arg_1 . sample_shape , arg_1 . distribution . event_shape_tensor ( ) , ] , axis = 0 ) return tf . broadcast_to ( arg_3 , arg_4 ) return _fn

def Func(arg_0):
  """Factory for implementing summary statistics, eg, mean, stddev, mode."""
  def _fn(arg_1, **arg_2):
    """Implements summary statistic, eg, mean, stddev, mode."""
    arg_3 = getattr(arg_1.distribution, arg_0)(**arg_2)
    arg_4 = prefer_static.concat([
        arg_1.distribution.batch_shape_tensor(),
        prefer_static.ones(prefer_static.rank_from_shape(arg_1.sample_shape),
                           dtype=arg_1.sample_shape.dtype),
        arg_1.distribution.event_shape_tensor(),
    ], axis=0)
    arg_3 = tf.reshape(arg_3, arg_4=arg_4)
    arg_4 = prefer_static.concat([
        arg_1.distribution.batch_shape_tensor(),
        arg_1.sample_shape,
        arg_1.distribution.event_shape_tensor(),
    ], axis=0)
    return tf.broadcast_to(arg_3, arg_4)
  return _fn

Factory for implementing summary statistics eg mean stddev mode .


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_1 = as_features ( arg_1 , stack = True ) arg_3 = arg_0 . Funcer . Func ( arg_1 . stacked_features , ** arg_2 ) return arg_0 . _gather_outputs ( arg_1 , arg_3 )

def Func(arg_0, arg_1, **arg_2):
        '''
        Transform the stacked points.

        Parameters
        ----------
        X : :class:`Features` or list of bag feature arrays
            New data to Func.

        any other keyword argument :
            Passed on as keyword arguments to the Funcer's ``Func()``.

        Returns
        -------
        X_new : :class:`Features`
            Transformed features.
        '''
        arg_1 = as_features(arg_1, stack=True)
        arg_3 = arg_0.Funcer.Func(arg_1.stacked_features, **arg_2)
        return arg_0._gather_outputs(arg_1, arg_3)

Transform the stacked points.

        Parameters
        ----------
        X : :class:`Features` or list of bag feature arrays
            New data to transform.

        any other keyword argument :
            Passed on as keyword arguments to the transformer's ``transform()``.

        Returns
        -------
        X_new : :class:`Features`
            Transformed features.


return render(request, "registrasion/amend_registration.html", data)

def Func ( arg_0 , arg_1 ) : arg_2 = User . objects . get ( id = int ( arg_1 ) ) arg_3 = CartController . for_user ( arg_2 ) arg_4 = commerce . ProductItem . objects . filter ( cart = arg_3 . cart , ) . select_related ( "product" ) arg_5 = [ { "product" : i . product , "quantity" : i . quantity } for i in arg_4 ] arg_6 = forms . staff_products_formset_factory ( arg_2 ) arg_7 = arg_6 ( arg_0 . POST or None , arg_5 = arg_5 , prefix = "products" , ) for arg_8 , arg_9 in zip ( arg_4 , arg_7 ) : arg_10 = inventory . Product . objects . filter ( id = arg_8 . product . id ) arg_9 . fields [ "product" ] . queryset = arg_10 arg_12 = forms . VoucherForm ( arg_0 . POST or None , prefix = "voucher" , ) if arg_0 . POST and arg_7 . is_valid ( ) : arg_13 = [ ( f . cleaned_data [ "product" ] , f . cleaned_data [ "quantity" ] ) for f in arg_7 if "product" in f . cleaned_data and f . cleaned_data [ "product" ] is not None ] try : arg_3 . set_quantities ( arg_13 ) return redirect ( Func , arg_1 ) except ValidationError as ve : for arg_14 in ve . error_list : arg_15 , arg_16 = arg_14 . message for arg_9 in arg_7 : if "product" not in arg_9 . cleaned_data : continue if arg_9 . cleaned_data [ "product" ] == arg_15 : arg_9 . add_error ( "quantity" , arg_16 ) if arg_0 . POST and arg_12 . has_changed ( ) and arg_12 . is_valid ( ) : try : arg_3 . apply_voucher ( arg_12 . cleaned_data [ "voucher" ] ) return redirect ( Func , arg_1 ) except ValidationError as ve : arg_12 . add_error ( None , ve ) arg_17 = ItemController ( arg_2 ) arg_18 = { "user" : arg_2 , "paid" : arg_17 . items_purchased ( ) , "cancelled" : arg_17 . items_released ( ) , "form" : arg_7 , "voucher_form" : arg_12 , } return render ( arg_0 , "registrasion/Func.html" , arg_18 )

def Func(arg_0, arg_1):
    ''' Allows staff to amend a user's current registration cart, and etc etc.
    '''

    arg_2 = User.objects.get(id=int(arg_1))
    arg_3 = CartController.for_user(arg_2)

    arg_4 = commerce.ProductItem.objects.filter(
        cart=arg_3.cart,
    ).select_related("product")
    arg_5 = [{"product": i.product, "quantity": i.quantity} for i in arg_4]

    arg_6 = forms.staff_products_formset_factory(arg_2)
    arg_7 = arg_6(
        arg_0.POST or None,
        arg_5=arg_5,
        prefix="products",
    )

    for arg_8, arg_9 in zip(arg_4, arg_7):
        arg_10 = inventory.Product.objects.filter(id=arg_8.product.id)
        arg_9.fields["product"].queryset = arg_10

    arg_12 = forms.VoucherForm(
        arg_0.POST or None,
        prefix="voucher",
    )

    if arg_0.POST and arg_7.is_valid():

        arg_13 = [
            (f.cleaned_data["product"], f.cleaned_data["quantity"])
            for f in arg_7
            if "product" in f.cleaned_data and
            f.cleaned_data["product"] is not None
        ]

        try:
            arg_3.set_quantities(arg_13)
            return redirect(Func, arg_1)
        except ValidationError as ve:
            for arg_14 in ve.error_list:
                arg_15, arg_16 = arg_14.message
                for arg_9 in arg_7:
                    if "product" not in arg_9.cleaned_data:
                        # This is the empty form.
                        continue
                    if arg_9.cleaned_data["product"] == arg_15:
                        arg_9.add_error("quantity", arg_16)

    if arg_0.POST and arg_12.has_changed() and arg_12.is_valid():
        try:
            arg_3.apply_voucher(arg_12.cleaned_data["voucher"])
            return redirect(Func, arg_1)
        except ValidationError as ve:
            arg_12.add_error(None, ve)

    arg_17 = ItemController(arg_2)
    arg_18 = {
        "user": arg_2,
        "paid": arg_17.items_purchased(),
        "cancelled": arg_17.items_released(),
        "form": arg_7,
        "voucher_form": arg_12,
    }

    return render(arg_0, "registrasion/Func.html", arg_18)

Allows staff to amend a user s current registration cart and etc etc .


def Func(arg_0, arg_1, arg_2):
        """Raise an error when a msgid is duplicated.

        :param str symbol: The symbol corresponding to the msgids
        :param str msgid: Offending msgid
        :param str other_msgid: Other offending msgid
        :raises InvalidMessageError: when a msgid is duplicated.
        """
        arg_3 = [arg_1, arg_2]
        arg_3.sort()
        arg_4 = "Message symbol '{symbol}' cannot be used for ".format(
            arg_0=arg_0
        )
        arg_4 += "'{other_msgid}' and '{msgid}' at the same time.".format(
            arg_2=arg_3[0], arg_1=arg_3[1]
        )
        raise InvalidMessageError(arg_4)

Raise an error when a msgid is duplicated .


def Func ( arg_0 ) : arg_1 = current_jsonschemas . url_to_path ( arg_0 [ '$schema' ] ) arg_2 = current_app . config [ 'DEPOSIT_JSONSCHEMAS_PREFIX' ] if arg_1 and arg_1 . startswith ( arg_2 ) : return current_jsonschemas . path_to_url ( arg_1 [ len ( arg_2 ) : ] )

def Func(arg_0):
        """Convert deposit schema to a valid record schema."""
        arg_1 = current_jsonschemas.url_to_path(arg_0['$schema'])
        arg_2 = current_app.config['DEPOSIT_JSONSCHEMAS_PREFIX']
        if arg_1 and arg_1.startswith(arg_2):
            return current_jsonschemas.path_to_url(
                arg_1[len(arg_2):]
            )

Convert deposit schema to a valid record schema .


(num_samples, num_classes, logits, num_trials, dtype, seed)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : with tf . name_scope ( "multinomial.Func" ) : arg_3 = tf . ones_like ( arg_2 [ ... , 0 ] , arg_4 = arg_3 . dtype ) * arg_3 arg_2 = tf . ones_like ( arg_3 [ ... , tf . newaxis ] , arg_4 = arg_2 . dtype ) * arg_2 arg_6 = tf . reshape ( arg_2 , [ - 1 , arg_1 ] ) arg_7 = arg_0 * tf . reshape ( arg_3 , [ - 1 ] ) def _sample_one_batch_member ( arg_8 ) : arg_2 , arg_9 = arg_8 [ 0 ] , arg_8 [ 1 ] arg_10 = tf . random . categorical ( arg_2 [ tf . newaxis , ... ] , arg_9 , arg_5 = arg_5 ) arg_10 = tf . reshape ( arg_10 , shape = [ arg_0 , - 1 ] ) arg_10 = tf . one_hot ( arg_10 , depth = arg_1 ) arg_10 = tf . reduce_sum ( input_tensor = arg_10 , axis = - 2 ) return tf . cast ( arg_10 , arg_4 = arg_4 ) arg_10 = tf . map_fn ( _sample_one_batch_member , [ arg_6 , arg_7 ] , arg_4 = arg_4 ) arg_10 = tf . transpose ( a = arg_10 , perm = [ 1 , 0 , 2 ] ) arg_11 = tf . concat ( [ [ arg_0 ] , tf . shape ( input = arg_3 ) , [ arg_1 ] ] , axis = 0 ) arg_10 = tf . reshape ( arg_10 , arg_11 ) return arg_10

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
  """Sample a multinomial.

  The batch shape is given by broadcasting num_trials with
  remove_last_dimension(logits).

  Args:
    num_samples: Python int or singleton integer Tensor: number of multinomial
      samples to draw.
    num_classes: Python int or singleton integer Tensor: number of classes.
    logits: Floating Tensor with last dimension k, of (unnormalized) logit
      probabilities per class.
    num_trials: Tensor of number of categorical trials each multinomial consists
      of.  num_trials[..., tf.newaxis] must broadcast with logits.
    dtype: dtype at which to emit samples.
    seed: Random seed.

  Returns:
    samples: Tensor of given dtype and shape [n] + batch_shape + [k].
  """
  with tf.name_scope("multinomial.Func"):
    # broadcast the num_trials and logits to same shape
    arg_3 = tf.ones_like(
        arg_2[..., 0], arg_4=arg_3.dtype) * arg_3
    arg_2 = tf.ones_like(
        arg_3[..., tf.newaxis], arg_4=arg_2.dtype) * arg_2

    # flatten the total_count and logits
    # flat_logits has shape [B1B2...Bm, num_classes]
    arg_6 = tf.reshape(arg_2, [-1, arg_1])
    arg_7 = arg_0 * tf.reshape(arg_3, [-1])  # [B1B2...Bm]

    # Computes each logits and num_trials situation by map_fn.

    # Using just one batch tf.random.categorical call doesn't work because that
    # requires num_trials to be the same across all members of the batch of
    # logits.  This restriction makes sense for tf.random.categorical because
    # for it, num_trials is part of the returned shape.  However, the
    # multinomial sampler does not need that restriction, because it sums out
    # exactly that dimension.

    # One possibility would be to draw a batch categorical whose sample count is
    # max(num_trials) and mask out the excess ones.  However, if the elements of
    # num_trials vary widely, this can be wasteful of memory.

    # TODO(b/123763054, b/112152209): Revisit the possibility of writing this
    # with a batch categorical followed by batch unsorted_segment_sum, once both
    # of those work and are memory-efficient enough.
    def _sample_one_batch_member(arg_8):
      arg_2, arg_9 = arg_8[0], arg_8[1]  # [K], []
      # x has shape [1, num_cat_samples = num_samples * num_trials]
      arg_10 = tf.random.categorical(
          arg_2[tf.newaxis, ...], arg_9, arg_5=arg_5)
      arg_10 = tf.reshape(arg_10, shape=[arg_0, -1])  # [num_samples, num_trials]
      arg_10 = tf.one_hot(
          arg_10, depth=arg_1)  # [num_samples, num_trials, num_classes]
      arg_10 = tf.reduce_sum(input_tensor=arg_10, axis=-2)  # [num_samples, num_classes]
      return tf.cast(arg_10, arg_4=arg_4)

    arg_10 = tf.map_fn(
        _sample_one_batch_member, [arg_6, arg_7],
        arg_4=arg_4)  # [B1B2...Bm, num_samples, num_classes]

    # reshape the results to proper shape
    arg_10 = tf.transpose(a=arg_10, perm=[1, 0, 2])
    arg_11 = tf.concat([[arg_0],
                             tf.shape(input=arg_3), [arg_1]],
                            axis=0)
    arg_10 = tf.reshape(arg_10, arg_11)

    return arg_10


def Func(arg_0):
        """
        Installs the mod-rpaf Apache module.

        https://github.com/gnif/mod_rpaf
        """
        arg_1 = arg_0.local_renderer
        if arg_1.env.modrpaf_enabled:
            arg_0.install_packages()
            arg_0.enable_mod('rpaf')
        else:
            if arg_0.last_manifest.modrpaf_enabled:
                arg_0.disable_mod('mod_rpaf')


(state, name, index, part_msg, missing_msg=None, expand_msg=None)

return part_to_child(stu_part, sol_part, append_message, state)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None):
    """Return child state with indexed name part as its ast tree.

    ``index`` can be:

    - an integer, in which case the student/solution_parts are indexed by position.
    - a string, in which case the student/solution_parts are expected to be a dictionary.
    - a list of indices (which can be integer or string), in which case the student parts are indexed step by step.
    """

    if arg_4 is None:
        arg_4 = "Are you sure you defined the {{part}}? "
    if arg_5 is None:
        arg_5 = "Did you correctly specify the {{part}}? "

    # create message
    arg_6 = get_ord(arg_2 + 1) if isinstance(arg_2, int) else ""
    arg_7 = {"index": arg_2, "ordinal": arg_6}
    arg_7.update(part=render(arg_3, arg_7))

    arg_8 = {"msg": arg_5, "kwargs": arg_7}

    # check there are enough parts for index
    has_part(arg_0, arg_1, arg_4, arg_7, arg_2)

    # get part at index
    arg_9 = arg_0.student_parts[arg_1]
    arg_10 = arg_0.solution_parts[arg_1]

    if isinstance(arg_2, list):
        for arg_11 in arg_2:
            arg_9 = arg_9[arg_11]
            arg_10 = arg_10[arg_11]
    else:
        arg_9 = arg_9[arg_2]
        arg_10 = arg_10[arg_2]

    assert_ast(arg_0, arg_10, arg_7)

    # return child state from part
    return part_to_child(arg_9, arg_10, arg_8, arg_0)

Return child state with indexed name part as its ast tree .


def Func ( ) : arg_0 = saga . Context ( "UserPass" ) arg_0 . user_id = USER arg_0 . user_pass = PASSWORD arg_3 = saga . Session ( ) arg_3 . add_context ( arg_0 ) return arg_3

def Func():
    """ Creates and returns a new SAGA session """
    arg_0 = saga.Context("UserPass")
    arg_0.user_id = USER
    arg_0.user_pass = PASSWORD

    arg_3 = saga.Session()
    arg_3.add_context(arg_0)

    return arg_3


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = from_api_dirname ( arg_2 ) try : arg_4 = arg_0 . execute ( directories . delete ( ) . where ( and_ ( directories . c . user_id == arg_1 , directories . c . name == arg_3 , ) ) ) except IntegrityError as error : if is_foreign_key_violation ( error ) : raise DirectoryNotEmpty ( arg_2 ) else : raise arg_5 = arg_4 . rowcount if not arg_5 : raise NoSuchDirectory ( arg_2 ) return arg_5

def Func(arg_0, arg_1, arg_2):
    """
    Delete a directory.
    """
    arg_3 = from_api_dirname(arg_2)
    try:
        arg_4 = arg_0.execute(
            directories.delete().where(
                and_(
                    directories.c.user_id == arg_1,
                    directories.c.name == arg_3,
                )
            )
        )
    except IntegrityError as error:
        if is_foreign_key_violation(error):
            raise DirectoryNotEmpty(arg_2)
        else:
            raise

    arg_5 = arg_4.rowcount
    if not arg_5:
        raise NoSuchDirectory(arg_2)

    return arg_5


def Func(arg_0):
    "Restore a project from the archive."
    if os.path.isdir(arg_0):
        bail('a folder of the same name already exists!')

    arg_1 = os.path.join(PROJ_ARCHIVE, '*', '*', arg_0)
    arg_2 = glob.glob(arg_1)
    if not arg_2:
        bail('no project matches: ' + arg_0)

    if len(arg_2) > 1:
        print('Warning: multiple matches, picking the most recent',
              file=sys.stderr)

    arg_3 = sorted(arg_2)[-1]
    print(arg_3, '-->', arg_0)
    shutil.move(arg_3, '.')


async def Func ( arg_0 ) -> bytes : while True : arg_1 = arg_0 . _serial_instance . Func ( ) if not arg_1 : await asyncio . sleep ( arg_0 . _asyncio_sleep_time ) else : return arg_1

async def Func(arg_0) -> bytes:
        """
        Reads one line

        >>> # Keeps waiting for a linefeed incase there is none in the buffer
        >>> await test.Func()

        :returns: bytes forming a line
        """
        while True:
            arg_1 = arg_0._serial_instance.Func()
            if not arg_1:
                await asyncio.sleep(arg_0._asyncio_sleep_time)
            else:
                return arg_1

Reads one line

        >>> # Keeps waiting for a linefeed incase there is none in the buffer
        >>> await test.readline()

        :returns: bytes forming a line


(session, title, description,
                          currency, budget, jobs, hireme_initial_bid)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : arg_5 . append ( create_job_object ( id = 417 ) ) arg_7 = { 'title' : arg_1 , 'description' : arg_2 , 'currency' : arg_3 , 'budget' : arg_4 , 'jobs' : arg_5 , 'hireme' : True , 'hireme_initial_bid' : arg_6 } arg_8 = make_post_request ( arg_0 , 'projects' , arg_9 = arg_7 ) arg_9 = arg_8 . json ( ) if arg_8 . status_code == 200 : arg_7 = arg_9 [ 'result' ] arg_10 = Project ( arg_7 ) arg_10 . url = urljoin ( arg_0 . url , 'projects/%s' % arg_10 . seo_url ) return arg_10 else : raise ProjectNotCreatedException ( message = arg_9 [ 'message' ] , error_code = arg_9 [ 'error_code' ] , request_id = arg_9 [ 'request_id' ] , )

def Func(arg_0, arg_1, arg_2,
                          arg_3, arg_4, arg_5, arg_6):
    """
    Create a fixed project
    """
    arg_5.append(create_job_object(id=417))  # Hire Me job, required

    arg_7 = {'title': arg_1,
                    'description': arg_2,
                    'currency': arg_3,
                    'budget': arg_4,
                    'jobs': arg_5,
                    'hireme': True,
                    'hireme_initial_bid': arg_6
                    }

    # POST /api/projects/0.1/projects/
    arg_8 = make_post_request(arg_0, 'projects', arg_9=arg_7)
    arg_9 = arg_8.json()
    if arg_8.status_code == 200:
        arg_7 = arg_9['result']
        arg_10 = Project(arg_7)
        arg_10.url = urljoin(arg_0.url, 'projects/%s' % arg_10.seo_url)
        return arg_10
    else:
        raise ProjectNotCreatedException(message=arg_9['message'],
                                         error_code=arg_9['error_code'],
                                         request_id=arg_9['request_id'],
                                         )


def Func(arg_0, arg_1, arg_2='37'):
        """Fetch a hgnc gene

            Args:
                hgnc_identifier(int)

            Returns:
                gene_obj(HgncGene)
        """
        if not arg_2 in ['37', '38']:
            arg_2 = '37'
        arg_3 = {}
        try:
            # If the identifier is a integer we search for hgnc_id
            arg_1 = int(arg_1)
            arg_3['hgnc_id'] = arg_1
        except ValueError:
            # Else we seach for a hgnc_symbol
            arg_3['hgnc_symbol'] = arg_1

        arg_3['build'] = arg_2
        LOG.debug("Fetching gene %s" % arg_1)
        arg_4 = arg_0.hgnc_collection.find_one(arg_3)
        if not arg_4:
            return None

        # Add the transcripts:
        arg_5 = []
        arg_6 = arg_0.transcripts(arg_2=arg_2, hgnc_id=arg_4['hgnc_id'])
        if arg_6.count() > 0:
            for arg_7 in arg_6:
                arg_5.append(arg_7)
        arg_4['transcripts'] = arg_5

        return arg_4


def Func(arg_0):
        """Called by the environment after storing to perform some rollback operations.

        All results and derived parameters created in the current run are removed.

        Important for single processing to not blow up the parent trajectory with the results
        of all runs.

        """
        arg_0._run_information[arg_0.v_crun]['completed'] = 1
        while len(arg_0._new_links):
            arg_3, arg_4 = arg_0._new_links.popitem(last=False)
            arg_5, arg_6 = arg_4
            arg_6, arg_7 = arg_3
            arg_5.f_remove_child(arg_7)

        while len(arg_0._new_nodes):
            arg_6, arg_4 = arg_0._new_nodes.popitem(last=False)
            arg_8, arg_9 = arg_4
            arg_10 = arg_9.v_name
            arg_8.f_remove_child(arg_10, recursive=True)

Called by the environment after storing to perform some rollback operations .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Create a DAG node out of a parsed AST op node.

        Args:
            name (str): operation name to apply to the dag.
            params (list): op parameters
            qargs (list(QuantumRegister, int)): qubits to attach to

        Raises:
            QiskitError: if encountering a non-basis opaque gate
        """
        if arg_1 == "u0":
            arg_4 = U0Gate
        elif arg_1 == "u1":
            arg_4 = U1Gate
        elif arg_1 == "u2":
            arg_4 = U2Gate
        elif arg_1 == "u3":
            arg_4 = U3Gate
        elif arg_1 == "x":
            arg_4 = XGate
        elif arg_1 == "y":
            arg_4 = YGate
        elif arg_1 == "z":
            arg_4 = ZGate
        elif arg_1 == "t":
            arg_4 = TGate
        elif arg_1 == "tdg":
            arg_4 = TdgGate
        elif arg_1 == "s":
            arg_4 = SGate
        elif arg_1 == "sdg":
            arg_4 = SdgGate
        elif arg_1 == "swap":
            arg_4 = SwapGate
        elif arg_1 == "rx":
            arg_4 = RXGate
        elif arg_1 == "ry":
            arg_4 = RYGate
        elif arg_1 == "rz":
            arg_4 = RZGate
        elif arg_1 == "rzz":
            arg_4 = RZZGate
        elif arg_1 == "id":
            arg_4 = IdGate
        elif arg_1 == "h":
            arg_4 = HGate
        elif arg_1 == "cx":
            arg_4 = CnotGate
        elif arg_1 == "cy":
            arg_4 = CyGate
        elif arg_1 == "cz":
            arg_4 = CzGate
        elif arg_1 == "ch":
            arg_4 = CHGate
        elif arg_1 == "crz":
            arg_4 = CrzGate
        elif arg_1 == "cu1":
            arg_4 = Cu1Gate
        elif arg_1 == "cu3":
            arg_4 = Cu3Gate
        elif arg_1 == "ccx":
            arg_4 = ToffoliGate
        elif arg_1 == "cswap":
            arg_4 = FredkinGate
        else:
            raise QiskitError("unknown operation for ast node name %s" % arg_1)

        arg_5 = arg_4(*arg_2)

        arg_0.dag.apply_operation_back(arg_5, arg_3, [], condition=arg_0.condition)

Create a DAG node out of a parsed AST op node .


return mir_eval.melody.evaluate(ref_times, ref_freq,
                                    est_times, est_freq,
                                    **kwargs)

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = 'pitch_contour' arg_0 = coerce_annotation ( arg_0 , arg_3 ) arg_1 = coerce_annotation ( arg_1 , arg_3 ) arg_4 , arg_5 = arg_0 . to_event_values ( ) arg_6 , arg_7 = arg_1 . to_event_values ( ) arg_8 = np . asarray ( [ p [ 'frequency' ] * ( - 1 ) ** ( ~ p [ 'voiced' ] ) for p in arg_5 ] ) arg_9 = np . asarray ( [ p [ 'frequency' ] * ( - 1 ) ** ( ~ p [ 'voiced' ] ) for p in arg_7 ] ) return mir_eval . Func . evaluate ( arg_4 , arg_8 , arg_6 , arg_9 , ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
    r'''Melody extraction evaluation

    Parameters
    ----------
    ref : jams.Annotation
        Reference annotation object
    est : jams.Annotation
        Estimated annotation object
    kwargs
        Additional keyword arguments

    Returns
    -------
    scores : dict
        Dictionary of scores, where the key is the metric name (str) and
        the value is the (float) score achieved.

    See Also
    --------
    mir_eval.Func.evaluate

    Examples
    --------
    >>> # Load in the JAMS objects
    >>> ref_jam = jams.load('reference.jams')
    >>> est_jam = jams.load('estimated.jams')
    >>> # Select the first relevant annotations
    >>> ref_ann = ref_jam.search(namespace='pitch_contour')[0]
    >>> est_ann = est_jam.search(namespace='pitch_contour')[0]
    >>> scores = jams.eval.Func(ref_ann, est_ann)
    '''

    arg_3 = 'pitch_contour'
    arg_0 = coerce_annotation(arg_0, arg_3)
    arg_1 = coerce_annotation(arg_1, arg_3)

    arg_4, arg_5 = arg_0.to_event_values()
    arg_6, arg_7 = arg_1.to_event_values()

    arg_8 = np.asarray([p['frequency'] * (-1)**(~p['voiced']) for p in arg_5])
    arg_9 = np.asarray([p['frequency'] * (-1)**(~p['voiced']) for p in arg_7])

    return mir_eval.Func.evaluate(arg_4, arg_8,
                                    arg_6, arg_9,
                                    **arg_2)

r'''Melody extraction evaluation

    Parameters
    ----------
    ref : jams.Annotation
        Reference annotation object
    est : jams.Annotation
        Estimated annotation object
    kwargs
        Additional keyword arguments

    Returns
    -------
    scores : dict
        Dictionary of scores, where the key is the metric name (str) and
        the value is the (float) score achieved.

    See Also
    --------
    mir_eval.melody.evaluate

    Examples
    --------
    >>> # Load in the JAMS objects
    >>> ref_jam = jams.load('reference.jams')
    >>> est_jam = jams.load('estimated.jams')
    >>> # Select the first relevant annotations
    >>> ref_ann = ref_jam.search(namespace='pitch_contour')[0]
    >>> est_ann = est_jam.search(namespace='pitch_contour')[0]
    >>> scores = jams.eval.melody(ref_ann, est_ann)


(y=None, sr=22050, S=None, n_fft=2048, hop_length=512,
                  win_length=None, window='hann', center=True, pad_mode='reflect',
                  order=1, freq=None)

def Func ( arg_0 = None , arg_1 = 22050 , arg_2 = None , arg_3 = 2048 , arg_4 = 512 , arg_5 = None , arg_6 = 'hann' , arg_7 = True , arg_8 = 'reflect' , arg_9 = 1 , arg_10 = None ) : arg_2 , arg_3 = _spectrogram ( arg_0 = arg_0 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 ) if arg_10 is None : arg_10 = fft_frequencies ( arg_1 = arg_1 , arg_3 = arg_3 ) if arg_10 . ndim == 1 : arg_11 = np . polyfit ( arg_10 , arg_2 , arg_9 ) else : arg_11 = np . concatenate ( [ [ np . polyfit ( arg_10 [ : , i ] , arg_2 [ : , i ] , arg_9 ) ] for i in range ( arg_2 . shape [ 1 ] ) ] , axis = 0 ) . T return arg_11

def Func(arg_0=None, arg_1=22050, arg_2=None, arg_3=2048, arg_4=512,
                  arg_5=None, arg_6='hann', arg_7=True, arg_8='reflect',
                  arg_9=1, arg_10=None):
    '''Get coefficients of fitting an nth-order polynomial to the columns
    of a spectrogram.

    Parameters
    ----------
    y : np.ndarray [shape=(n,)] or None
        audio time series

    sr : number > 0 [scalar]
        audio sampling rate of `y`

    S : np.ndarray [shape=(d, t)] or None
        (optional) spectrogram magnitude

    n_fft : int > 0 [scalar]
        FFT window size

    hop_length : int > 0 [scalar]
        hop length for STFT. See `librosa.core.stft` for details.

    win_length : int <= n_fft [scalar]
        Each frame of audio is windowed by `window()`.
        The window will be of length `win_length` and then padded
        with zeros to match `n_fft`.

        If unspecified, defaults to ``win_length = n_fft``.

    window : string, tuple, number, function, or np.ndarray [shape=(n_fft,)]
        - a window specification (string, tuple, or number);
          see `scipy.signal.get_window`
        - a window function, such as `scipy.signal.hanning`
        - a vector or array of length `n_fft`

        .. see also:: `filters.get_window`

    center : boolean
        - If `True`, the signal `y` is padded so that frame
          `t` is centered at `y[t * hop_length]`.
        - If `False`, then frame `t` begins at `y[t * hop_length]`

    pad_mode : string
        If `center=True`, the padding mode to use at the edges of the signal.
        By default, STFT uses reflection padding.

    order : int > 0
        order of the polynomial to fit

    freq : None or np.ndarray [shape=(d,) or shape=(d, t)]
        Center frequencies for spectrogram bins.
        If `None`, then FFT bin center frequencies are used.
        Otherwise, it can be a single array of `d` center frequencies,
        or a matrix of center frequencies as constructed by
        `librosa.core.ifgram`

    Returns
    -------
    coefficients : np.ndarray [shape=(order+1, t)]
        polynomial coefficients for each frame.

        `coeffecients[0]` corresponds to the highest degree (`order`),

        `coefficients[1]` corresponds to the next highest degree (`order-1`),

        down to the constant term `coefficients[order]`.

    Examples
    --------
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> S = np.abs(librosa.stft(y))

    Fit a degree-0 polynomial (constant) to each frame

    >>> p0 = librosa.feature.Func(S=S, order=0)

    Fit a linear polynomial to each frame

    >>> p1 = librosa.feature.Func(S=S, order=1)

    Fit a quadratic to each frame

    >>> p2 = librosa.feature.Func(S=S, order=2)

    Plot the results for comparison

    >>> import matplotlib.pyplot as plt
    >>> plt.figure(figsize=(8, 8))
    >>> ax = plt.subplot(4,1,1)
    >>> plt.plot(p2[2], label='order=2', alpha=0.8)
    >>> plt.plot(p1[1], label='order=1', alpha=0.8)
    >>> plt.plot(p0[0], label='order=0', alpha=0.8)
    >>> plt.xticks([])
    >>> plt.ylabel('Constant')
    >>> plt.legend()
    >>> plt.subplot(4,1,2, sharex=ax)
    >>> plt.plot(p2[1], label='order=2', alpha=0.8)
    >>> plt.plot(p1[0], label='order=1', alpha=0.8)
    >>> plt.xticks([])
    >>> plt.ylabel('Linear')
    >>> plt.subplot(4,1,3, sharex=ax)
    >>> plt.plot(p2[0], label='order=2', alpha=0.8)
    >>> plt.xticks([])
    >>> plt.ylabel('Quadratic')
    >>> plt.subplot(4,1,4, sharex=ax)
    >>> librosa.display.specshow(librosa.amplitude_to_db(S, ref=np.max),
    ...                          y_axis='log')
    >>> plt.tight_layout()
    '''

    arg_2, arg_3 = _spectrogram(arg_0=arg_0, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4,
                            arg_5=arg_5, arg_6=arg_6, arg_7=arg_7,
                            arg_8=arg_8)

    # Compute the center frequencies of each bin
    if arg_10 is None:
        arg_10 = fft_frequencies(arg_1=arg_1, arg_3=arg_3)

    # If frequencies are constant over frames, then we only need to fit once
    if arg_10.ndim == 1:
        arg_11 = np.polyfit(arg_10, arg_2, arg_9)
    else:
        # Else, fit each frame independently and stack the results
        arg_11 = np.concatenate([[np.polyfit(arg_10[:, i], arg_2[:, i], arg_9)]
                                       for i in range(arg_2.shape[1])], axis=0).T

    return arg_11

Get coefficients of fitting an nth-order polynomial to the columns
    of a spectrogram.

    Parameters
    ----------
    y : np.ndarray [shape=(n,)] or None
        audio time series

    sr : number > 0 [scalar]
        audio sampling rate of `y`

    S : np.ndarray [shape=(d, t)] or None
        (optional) spectrogram magnitude

    n_fft : int > 0 [scalar]
        FFT window size

    hop_length : int > 0 [scalar]
        hop length for STFT. See `librosa.core.stft` for details.

    win_length : int <= n_fft [scalar]
        Each frame of audio is windowed by `window()`.
        The window will be of length `win_length` and then padded
        with zeros to match `n_fft`.

        If unspecified, defaults to ``win_length = n_fft``.

    window : string, tuple, number, function, or np.ndarray [shape=(n_fft,)]
        - a window specification (string, tuple, or number);
          see `scipy.signal.get_window`
        - a window function, such as `scipy.signal.hanning`
        - a vector or array of length `n_fft`

        .. see also:: `filters.get_window`

    center : boolean
        - If `True`, the signal `y` is padded so that frame
          `t` is centered at `y[t * hop_length]`.
        - If `False`, then frame `t` begins at `y[t * hop_length]`

    pad_mode : string
        If `center=True`, the padding mode to use at the edges of the signal.
        By default, STFT uses reflection padding.

    order : int > 0
        order of the polynomial to fit

    freq : None or np.ndarray [shape=(d,) or shape=(d, t)]
        Center frequencies for spectrogram bins.
        If `None`, then FFT bin center frequencies are used.
        Otherwise, it can be a single array of `d` center frequencies,
        or a matrix of center frequencies as constructed by
        `librosa.core.ifgram`

    Returns
    -------
    coefficients : np.ndarray [shape=(order+1, t)]
        polynomial coefficients for each frame.

        `coeffecients[0]` corresponds to the highest degree (`order`),

        `coefficients[1]` corresponds to the next highest degree (`order-1`),

        down to the constant term `coefficients[order]`.

    Examples
    --------
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> S = np.abs(librosa.stft(y))

    Fit a degree-0 polynomial (constant) to each frame

    >>> p0 = librosa.feature.poly_features(S=S, order=0)

    Fit a linear polynomial to each frame

    >>> p1 = librosa.feature.poly_features(S=S, order=1)

    Fit a quadratic to each frame

    >>> p2 = librosa.feature.poly_features(S=S, order=2)

    Plot the results for comparison

    >>> import matplotlib.pyplot as plt
    >>> plt.figure(figsize=(8, 8))
    >>> ax = plt.subplot(4,1,1)
    >>> plt.plot(p2[2], label='order=2', alpha=0.8)
    >>> plt.plot(p1[1], label='order=1', alpha=0.8)
    >>> plt.plot(p0[0], label='order=0', alpha=0.8)
    >>> plt.xticks([])
    >>> plt.ylabel('Constant')
    >>> plt.legend()
    >>> plt.subplot(4,1,2, sharex=ax)
    >>> plt.plot(p2[1], label='order=2', alpha=0.8)
    >>> plt.plot(p1[0], label='order=1', alpha=0.8)
    >>> plt.xticks([])
    >>> plt.ylabel('Linear')
    >>> plt.subplot(4,1,3, sharex=ax)
    >>> plt.plot(p2[0], label='order=2', alpha=0.8)
    >>> plt.xticks([])
    >>> plt.ylabel('Quadratic')
    >>> plt.subplot(4,1,4, sharex=ax)
    >>> librosa.display.specshow(librosa.amplitude_to_db(S, ref=np.max),
    ...                          y_axis='log')
    >>> plt.tight_layout()

Get coefficients of fitting an nth - order polynomial to the columns of a spectrogram .


(self, to, subject, msgHtml, msgPlain, attachments=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = None ) : arg_6 = arg_0 . sender if arg_5 and isinstance ( arg_5 , str ) : arg_5 = [ arg_5 ] else : arg_5 = list ( arg_5 or [ ] ) arg_7 = MIMEMultipart ( 'alternative' ) arg_7 [ 'Subject' ] = arg_2 arg_7 [ 'From' ] = arg_6 arg_7 [ 'To' ] = arg_1 arg_7 . attach ( MIMEText ( arg_4 , 'plain' ) ) arg_7 . attach ( MIMEText ( arg_3 , 'html' ) ) for arg_8 in arg_5 : arg_9 = arg_0 . _prep_attachment ( arg_8 ) arg_7 . attach ( arg_9 ) arg_10 = base64 . urlsafe_b64encode ( arg_7 . as_bytes ( ) ) . decode ( ) arg_11 = { 'raw' : arg_10 } return arg_11

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=None):
        '''
        attachments should be a list of paths
        '''
        arg_6 = arg_0.sender
        if arg_5 and isinstance(arg_5, str):
            arg_5 = [arg_5]
        else:
            arg_5 = list(arg_5 or [])

        arg_7 = MIMEMultipart('alternative')
        arg_7['Subject'] = arg_2
        arg_7['From'] = arg_6
        arg_7['To'] = arg_1
        arg_7.attach(MIMEText(arg_4, 'plain'))
        arg_7.attach(MIMEText(arg_3, 'html'))

        # append attachments if any
        for arg_8 in arg_5:
            arg_9 = arg_0._prep_attachment(arg_8)
            arg_7.attach(arg_9)

        arg_10 = base64.urlsafe_b64encode(arg_7.as_bytes()).decode()
        #raw = raw.decode()
        arg_11 = {'raw': arg_10}
        return arg_11


(lags, acf, npeaks=20, searchinterval=1)

return {'maxinds':maxinds,
            'maxacfs':maxacfs,
            'maxlags':maxlags,
            'mininds':mininds,
            'minacfs':minacfs,
            'minlags':minlags,
            'relpeakheights':relpeakheights,
            'relpeaklags':relpeaklags,
            'peakindices':peakindices,
            'bestlag':bestlag,
            'bestpeakheight':bestpeakheight,
            'bestpeakindex':bestpeakindex}

def Func(arg_0, arg_1, arg_2=20, arg_3=1):
    '''This calculates the relative peak heights for first npeaks in ACF.

    Usually, the first peak or the second peak (if its peak height > first peak)
    corresponds to the correct lag. When we know the correct lag, the period is
    then::

        bestperiod = time[lags == bestlag] - time[0]

    Parameters
    ----------

    lags : np.array
        An array of lags that the ACF is calculated at.

    acf : np.array
        The array containing the ACF values.

    npeaks : int
        THe maximum number of peaks to consider when finding peak heights.

    searchinterval : int
        From `scipy.signal.argrelmax`: "How many points on each side to use for
        the comparison to consider comparator(n, n+x) to be True." This
        effectively sets how many points on each of the current peak will be
        used to check if the current peak is the local maximum.

    Returns
    -------

    dict
        This returns a dict of the following form::

            {'maxinds':the indices of the lag array where maxes are,
             'maxacfs':the ACF values at each max,
             'maxlags':the lag values at each max,
             'mininds':the indices of the lag array where mins are,
             'minacfs':the ACF values at each min,
             'minlags':the lag values at each min,
             'relpeakheights':the relative peak heights of each rel. ACF peak,
             'relpeaklags':the lags at each rel. ACF peak found,
             'peakindices':the indices of arrays where each rel. ACF peak is,
             'bestlag':the lag value with the largest rel. ACF peak height,
             'bestpeakheight':the largest rel. ACF peak height,
             'bestpeakindex':the largest rel. ACF peak's number in all peaks}

    '''

    arg_4 = argrelmax(arg_1, order=arg_3)[0]
    arg_5 = arg_1[arg_4]
    arg_6 = arg_0[arg_4]
    arg_7 = argrelmin(arg_1, order=arg_3)[0]
    arg_8 = arg_1[arg_7]
    arg_9 = arg_0[arg_7]

    arg_10 = npzeros(arg_2)
    arg_11 = npzeros(arg_2,dtype=npint64)
    arg_12 = npzeros(arg_2,dtype=npint64)

    for arg_13, arg_14 in enumerate(arg_4[:arg_2]):

        # check if there are no mins to the left
        # throw away this peak because it's probably spurious
        # (FIXME: is this OK?)
        if npall(arg_14 < arg_7):
            continue

        arg_15 = arg_7[arg_7 < arg_14][-1]  # the last index to the left
        arg_16 = arg_7[arg_7 > arg_14][0]  # the first index to the right
        arg_10[arg_13] = (
            arg_1[arg_14] - (arg_1[arg_15] + arg_1[arg_16])/2.0
        )
        arg_11[arg_13] = arg_0[arg_14]
        arg_12[arg_13] = arg_13

    # figure out the bestperiod if possible
    if arg_10[0] > arg_10[1]:
        arg_17 = arg_11[0]
        arg_18 = arg_10[0]
        arg_19 = arg_12[0]
    else:
        arg_17 = arg_11[1]
        arg_18 = arg_10[1]
        arg_19 = arg_12[1]

    return {'maxinds':arg_4,
            'maxacfs':arg_5,
            'maxlags':arg_6,
            'mininds':arg_7,
            'minacfs':arg_8,
            'minlags':arg_9,
            'relpeakheights':arg_10,
            'relpeaklags':arg_11,
            'peakindices':arg_12,
            'bestlag':arg_17,
            'bestpeakheight':arg_18,
            'bestpeakindex':arg_19}

This calculates the relative peak heights for first npeaks in ACF .


return tasks[0] if len(tasks) == 1 else None

def Func ( arg_0 , arg_1 ) : arg_2 = [ task for task in arg_0 . Funcs ( ) if task . id == arg_1 ] return arg_2 [ 0 ] if len ( arg_2 ) == 1 else None

def Func(arg_0, arg_1):
        """
        Returns the task with the given id.

        :type id:integer
        :param id: The id of a task.
        :rtype: Task
        :returns: The task with the given id.
        """
        arg_2 = [task for task in arg_0.Funcs() if task.id == arg_1]
        return arg_2[0] if len(arg_2) == 1 else None


def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_3 , arg_4 = copy ( arg_0 . start ) , copy ( arg_0 . end ) if arg_2 : arg_4 = arg_3 + arg_1 else : arg_3 = arg_4 - arg_1 return Range ( arg_3 , arg_4 )

def Func(arg_0, arg_1, arg_2=True):
        """ Cuts this object from_start to the number requestd
        returns new instance
        """
        arg_3, arg_4 = copy(arg_0.start), copy(arg_0.end)
        if arg_2:
            arg_4 = arg_3 + arg_1
        else:
            arg_3 = arg_4 - arg_1
        return Range(arg_3, arg_4)


def
Func
(
arg_0
)
:
with
settings
(
hide
(
'running'
,
'stdout'
,
'stderr'
,
'warnings'
)
,
warn_only
=
True
)
:
arg_1
=
run
(
"dpkg -s %(pkg_name)s"
%
locals
(
)
)
for
arg_2
in
arg_1
.
splitlines
(
)
:
if
arg_2
.
startswith
(
"Status: "
)
:
arg_3
=
arg_2
[
8
:
]
if
"installed"
in
arg_3
.
split
(
' '
)
:
return
True
return
False

def Func(arg_0):
    """
    Check if a package is installed.
    """
    with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True):
        arg_1 = run("dpkg -s %(pkg_name)s" % locals())
        for arg_2 in arg_1.splitlines():
            if arg_2.startswith("Status: "):
                arg_3 = arg_2[8:]
                if "installed" in arg_3.split(' '):
                    return True
        return False


def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
)
:
def
list_methods
(
)
:
arg_3
=
[
]
if
arg_0
in
IEC_2010
.
index
and
not
np
.
isnan
(
IEC_2010
.
at
[
arg_0
,
'Func'
]
)
:
arg_3
.
append
(
IEC
)
if
arg_0
in
NFPA_2008
.
index
and
not
np
.
isnan
(
NFPA_2008
.
at
[
arg_0
,
'Func'
]
)
:
arg_3
.
append
(
NFPA
)
arg_3
.
append
(
)
return
arg_3
if
arg_1
:
return
list_methods
(
)
if
not
arg_2
:
arg_2
=
list_methods
(
)
[
0
]
if
arg_2
==
IEC
:
return
float
(
IEC_2010
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
NFPA
:
return
float
(
NFPA_2008
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
:
return
else
:
raise
Exception
(
'Failure in in function'
)

def Func(arg_0, arg_1=False, arg_2=None):
    r'''This function handles the retrieval or calculation of a chemical's
    autoifnition temperature. Lookup is based on CASRNs. No predictive methods
    are currently implemented. Will automatically select a data source to use
    if no Method is provided; returns None if the data is not available.

    Prefered source is 'IEC 60079-20-1 (2010)' [1]_, with the secondary source
    'NFPA 497 (2008)' [2]_ having very similar data.

    Examples
    --------
    >>> Func(CASRN='71-43-2')
    771.15

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Func : float
        Autoignition point of the chemical, [K]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Func with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Func for the desired chemical, and will return methods
        instead of Func

    Notes
    -----

    References
    ----------
    .. [1] IEC. “IEC 60079-20-1:2010 Explosive atmospheres - Part 20-1:
       Material characteristics for gas and vapour classification - Test
       methods and data.” https://webstore.iec.ch/publication/635. See also
       https://law.resource.org/pub/in/bis/S05/is.iec.60079.20.1.2010.pdf
    .. [2] National Fire Protection Association. NFPA 497: Recommended
       Practice for the Classification of Flammable Liquids, Gases, or Vapors
       and of Hazardous. NFPA, 2008.
    '''
    def list_methods():
        arg_3 = []
        if arg_0 in IEC_2010.index and not np.isnan(IEC_2010.at[arg_0, 'Func']):
            arg_3.append(IEC)
        if arg_0 in NFPA_2008.index and not np.isnan(NFPA_2008.at[arg_0, 'Func']):
            arg_3.append(NFPA)
        arg_3.append(NONE)
        return arg_3
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]

    if arg_2 == IEC:
        return float(IEC_2010.at[arg_0, 'Func'])
    elif arg_2 == NFPA:
        return float(NFPA_2008.at[arg_0, 'Func'])
    elif arg_2 == NONE:
        return None
    else:
        raise Exception('Failure in in function')

r'''This function handles the retrieval or calculation of a chemical's
    autoifnition temperature. Lookup is based on CASRNs. No predictive methods
    are currently implemented. Will automatically select a data source to use
    if no Method is provided; returns None if the data is not available.

    Prefered source is 'IEC 60079-20-1 (2010)' [1]_, with the secondary source
    'NFPA 497 (2008)' [2]_ having very similar data.

    Examples
    --------
    >>> Tautoignition(CASRN='71-43-2')
    771.15

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Tautoignition : float
        Autoignition point of the chemical, [K]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Tautoignition with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Tautoignition_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Tautoignition for the desired chemical, and will return methods
        instead of Tautoignition

    Notes
    -----

    References
    ----------
    .. [1] IEC. “IEC 60079-20-1:2010 Explosive atmospheres - Part 20-1:
       Material characteristics for gas and vapour classification - Test
       methods and data.” https://webstore.iec.ch/publication/635. See also
       https://law.resource.org/pub/in/bis/S05/is.iec.60079.20.1.2010.pdf
    .. [2] National Fire Protection Association. NFPA 497: Recommended
       Practice for the Classification of Flammable Liquids, Gases, or Vapors
       and of Hazardous. NFPA, 2008.

r This function handles the retrieval or calculation of a chemical s autoifnition temperature . Lookup is based on CASRNs . No predictive methods are currently implemented . Will automatically select a data source to use if no Method is provided ; returns None if the data is not available .


def Func(arg_0, arg_1=None):
        """Wait until the thread terminates.

        This blocks the calling thread until the thread whose Func() method is
        called terminates -- either normally or through an unhandled exception
        or until the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof). As Func() always returns None, you must call
        isAlive() after Func() to decide whether a timeout happened -- if the
        thread is still alive, the Func() call timed out.

        When the timeout argument is not present or None, the operation will
        block until the thread terminates.

        A thread can be Func()ed many times.

        Func() raises a RuntimeError if an attempt is made to Func the current
        thread as that would cause a deadlock. It is also an error to Func() a
        thread before it has been started and attempts to do so raises the same
        exception.

        """
        if not arg_0.__initialized:
            raise RuntimeError("Thread.__init__() not called")
        if not arg_0.__started.is_set():
            raise RuntimeError("cannot Func thread before it is started")
        if arg_0 is current_thread():
            raise RuntimeError("cannot Func current thread")

        if __debug__:
            if not arg_0.__stopped:
                arg_0._note("%s.Func(): waiting until thread stops", arg_0)
        arg_0.__block.acquire()
        try:
            if arg_1 is None:
                while not arg_0.__stopped:
                    arg_0.__block.wait()
                if __debug__:
                    arg_0._note("%s.Func(): thread stopped", arg_0)
            else:
                arg_2 = _time() + arg_1
                while not arg_0.__stopped:
                    arg_3 = arg_2 - _time()
                    if arg_3 <= 0:
                        if __debug__:
                            arg_0._note("%s.Func(): timed out", arg_0)
                        break
                    arg_0.__block.wait(arg_3)
                else:
                    if __debug__:
                        arg_0._note("%s.Func(): thread stopped", arg_0)
        finally:
            arg_0.__block.release()

Wait until the thread terminates.

        This blocks the calling thread until the thread whose join() method is
        called terminates -- either normally or through an unhandled exception
        or until the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof). As join() always returns None, you must call
        isAlive() after join() to decide whether a timeout happened -- if the
        thread is still alive, the join() call timed out.

        When the timeout argument is not present or None, the operation will
        block until the thread terminates.

        A thread can be join()ed many times.

        join() raises a RuntimeError if an attempt is made to join the current
        thread as that would cause a deadlock. It is also an error to join() a
        thread before it has been started and attempts to do so raises the same
        exception.


def Func ( arg_0 , arg_1 ) : if arg_1 . id in arg_0 . cache : arg_0 . cache [ arg_1 . id ] . Func ( arg_1 ) else : arg_0 . cache [ arg_1 . id ] = arg_1 return arg_0 . cache [ arg_1 . id ]

def Func(arg_0, arg_1):
        """
        Add a given object to the cache, or update an existing entry to include more fields.

        Args:
            obj (SkypeObj): object to add to the cache
        """
        if arg_1.id in arg_0.cache:
            arg_0.cache[arg_1.id].Func(arg_1)
        else:
            arg_0.cache[arg_1.id] = arg_1
        return arg_0.cache[arg_1.id]

Add a given object to the cache or update an existing entry to include more fields .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 is None : _init_pathinfo ( ) arg_3 = 1 else : arg_3 = 0 arg_4 = os . path . join ( arg_0 , arg_1 ) try : arg_5 = open ( arg_4 , "rU" ) except IOError : return try : for arg_6 in arg_5 : if arg_6 . startswith ( "#" ) : continue if arg_6 . startswith ( "import" ) : exec ( arg_6 ) continue arg_6 = arg_6 . rstrip ( ) arg_7 , arg_8 = makepath ( arg_0 , arg_6 ) if not arg_8 in arg_2 and os . path . exists ( arg_7 ) : sys . path . append ( arg_7 ) arg_2 . add ( arg_8 ) finally : arg_5 . close ( ) if arg_3 : arg_2 = None return arg_2

def Func(arg_0, arg_1, arg_2):
    """Add a new path to known_paths by combining sitedir and 'name' or execute
    sitedir if it starts with 'import'"""
    if arg_2 is None:
        _init_pathinfo()
        arg_3 = 1
    else:
        arg_3 = 0
    arg_4 = os.path.join(arg_0, arg_1)
    try:
        arg_5 = open(arg_4, "rU")
    except IOError:
        return
    try:
        for arg_6 in arg_5:
            if arg_6.startswith("#"):
                continue
            if arg_6.startswith("import"):
                exec(arg_6)
                continue
            arg_6 = arg_6.rstrip()
            arg_7, arg_8 = makepath(arg_0, arg_6)
            if not arg_8 in arg_2 and os.path.exists(arg_7):
                sys.path.append(arg_7)
                arg_2.add(arg_8)
    finally:
        arg_5.close()
    if arg_3:
        arg_2 = None
    return arg_2

Add a new path to known_paths by combining sitedir and name or execute sitedir if it starts with import


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Called from within search handler. Finds desired subclass and decides if the
        result should be removed and adds properties derived from the result information
        """
        arg_4 = _load_class(getattr(settings, "SEARCH_RESULT_PROCESSOR", None), arg_0)
        arg_5 = arg_4(arg_1, arg_2)
        if arg_5.should_remove(arg_3):
            return None
        try:
            arg_5.add_properties()
        # protect around any problems introduced by subclasses within their properties
        except Exception as ex:  # pylint: disable=broad-except
            log.exception("error processing properties for %s - %s: will remove from results",
                          json.dumps(arg_1, arg_0=DjangoJSONEncoder), str(ex))
            return None
        return arg_1

Called from within search handler . Finds desired subclass and decides if the result should be removed and adds properties derived from the result information


def
Func
(
arg_0
)
:
if
arg_0
.
_Func
is
:
arg_1
=
'\n'
.
join
(
arg_0
.
__doc__
.
splitlines
(
)
[
1
:
]
)
.
strip
(
)
arg_2
=
[
]
for
arg_3
in
map
(
str
.
strip
,
arg_1
.
splitlines
(
)
)
:
if
arg_3
and
arg_2
:
arg_2
[
1
]
=
' '
.
join
(
(
arg_2
[
1
]
,
arg_3
)
)
elif
arg_3
:
arg_2
.
append
(
arg_3
)
else
:
arg_2
.
append
(
''
)
arg_0
.
_Func
=
'\n'
.
join
(
arg_2
)
return
arg_0
.
_Func

def Func(arg_0):
        """A user-friendly Func of the handler.

        Returns:
          :py:class:`str`: The handler's Func.

        """
        if arg_0._Func is None:
            arg_1 = '\n'.join(arg_0.__doc__.splitlines()[1:]).strip()
            arg_2 = []
            for arg_3 in map(str.strip, arg_1.splitlines()):
                if arg_3 and arg_2:
                    arg_2[-1] = ' '.join((arg_2[-1], arg_3))
                elif arg_3:
                    arg_2.append(arg_3)
                else:
                    arg_2.append('')
            arg_0._Func = '\n'.join(arg_2)
        return arg_0._Func

A user-friendly description of the handler.

        Returns:
          :py:class:`str`: The handler's description.

A user - friendly description of the handler .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
{
}
def
check_complete_processes
(
arg_4
=
False
)
:
arg_5
=
False
for
arg_6
in
list
(
arg_3
)
:
if
arg_4
:
arg_6
.
wait
(
)
if
arg_6
.
poll
(
)
is
not
:
arg_0
.
debug
(
"Process %d exited with code %d."
%
(
arg_3
[
arg_6
]
[
'tid'
]
,
arg_6
.
poll
(
)
)
)
arg_3
[
arg_6
]
[
'stdout'
]
.
close
(
)
arg_3
[
arg_6
]
[
'stderr'
]
.
close
(
)
del
arg_3
[
arg_6
]
arg_5
=
True
return
arg_5
for
arg_7
,
arg_8
in
arg_1
:
arg_0
.
debug
(
"Starting process %d..."
%
arg_8
)
arg_9
=
time
.
strftime
(
'%H%M%S'
)
arg_10
=
"%s_%s_tid_%d"
%
(
arg_0
.
batch_name
,
arg_9
,
arg_8
)
arg_11
=
open
(
os
.
path
.
join
(
arg_2
,
"%s.o.%d"
%
(
arg_10
,
arg_8
)
)
,
"wb"
)
arg_12
=
open
(
os
.
path
.
join
(
arg_2
,
"%s.e.%d"
%
(
arg_10
,
arg_8
)
)
,
"wb"
)
arg_6
=
subprocess
.
Popen
(
arg_7
,
stdout
=
arg_11
,
stderr
=
arg_12
)
arg_3
[
arg_6
]
=
{
'tid'
:
arg_8
,
'stdout'
:
arg_11
,
'stderr'
:
arg_12
}
if
arg_0
.
max_concurrency
:
while
len
(
arg_3
)
>=
arg_0
.
max_concurrency
:
if
not
check_complete_processes
(
len
(
arg_3
)
==
1
)
:
time
.
sleep
(
0.1
)
while
len
(
arg_3
)
>
0
:
if
not
check_complete_processes
(
True
)
:
time
.
sleep
(
0.1
)

def Func(arg_0, arg_1, arg_2):
        """
        Launches processes defined by process_commands, but only
        executes max_concurrency processes at a time; if a process
        completes and there are still outstanding processes to be
        executed, the next processes are run until max_concurrency is
        reached again.
        """
        arg_3 = {}
        def check_complete_processes(arg_4=False):
            """
            Returns True if a process completed, False otherwise.
            Optionally allows waiting for better performance (avoids
            sleep-poll cycle if possible).
            """
            arg_5 = False
            # list creates copy of keys, as dict is modified in loop
            for arg_6 in list(arg_3):
                if arg_4: arg_6.wait()
                if arg_6.poll() is not None:
                    # process is done, free up slot
                    arg_0.debug("Process %d exited with code %d."
                               % (arg_3[arg_6]['tid'], arg_6.poll()))
                    arg_3[arg_6]['stdout'].close()
                    arg_3[arg_6]['stderr'].close()
                    del arg_3[arg_6]
                    arg_5 = True
            return arg_5

        for arg_7, arg_8 in arg_1:
            arg_0.debug("Starting process %d..." % arg_8)
            arg_9 = time.strftime('%H%M%S')
            arg_10 = "%s_%s_tid_%d" % (arg_0.batch_name, arg_9, arg_8)
            arg_11 = open(os.path.join(arg_2, "%s.o.%d"
                                              % (arg_10, arg_8)), "wb")
            arg_12 = open(os.path.join(arg_2, "%s.e.%d"
                                              % (arg_10, arg_8)), "wb")
            arg_6 = subprocess.Popen(arg_7, stdout=arg_11, stderr=arg_12)
            arg_3[arg_6] = { 'tid' : arg_8,
                                'stdout' : arg_11,
                                'stderr' : arg_12 }

            if arg_0.max_concurrency:
                # max_concurrency reached, wait until more slots available
                while len(arg_3) >= arg_0.max_concurrency:
                    if not check_complete_processes(len(arg_3)==1):
                        time.sleep(0.1)

        # Wait for all processes to complete
        while len(arg_3) > 0:
            if not check_complete_processes(True):
                time.sleep(0.1)

Launches processes defined by process_commands but only executes max_concurrency processes at a time ; if a process completes and there are still outstanding processes to be executed the next processes are run until max_concurrency is reached again .


def Func ( arg_0 , arg_1 = None ) : if not arg_1 : arg_2 = arg_0 . history ( ) if not arg_2 : return arg_2 else : return Response . _from_json ( arg_2 [ 'pipelines' ] [ 0 ] ) return arg_0 . _get ( '/Func/{counter:d}' . format ( arg_1 = arg_1 ) )

def Func(arg_0, arg_1=None):
        """Returns all the information regarding a specific pipeline run

        See the `Go pipeline Func documentation`__ for examples.

        .. __: http://api.go.cd/current/#get-pipeline-Func

        Args:
          counter (int): The pipeline Func to fetch.
            If falsey returns the latest pipeline Func from :meth:`history`.

        Returns:
          Response: :class:`gocd.api.response.Response` object
        """
        if not arg_1:
            arg_2 = arg_0.history()
            if not arg_2:
                return arg_2
            else:
                return Response._from_json(arg_2['pipelines'][0])

        return arg_0._get('/Func/{counter:d}'.format(arg_1=arg_1))

Returns all the information regarding a specific pipeline run

        See the `Go pipeline instance documentation`__ for examples.

        .. __: http://api.go.cd/current/#get-pipeline-instance

        Args:
          counter (int): The pipeline instance to fetch.
            If falsey returns the latest pipeline instance from :meth:`history`.

        Returns:
          Response: :class:`gocd.api.response.Response` object


(log_config_file=op.join(op.dirname(__file__), 'logger.yml'),
                  log_default_level=LOG_LEVEL,
                  env_key=MODULE_NAME.upper() + '_LOG_CFG')

def
Func
(
arg_0
=
arg_1
.
join
(
arg_1
.
dirname
(
arg_4
)
,
'logger.yml'
)
,
arg_5
=
arg_6
,
arg_7
=
arg_8
.
upper
(
)
+
'_LOG_CFG'
)
:
arg_10
=
arg_0
arg_11
=
os
.
getenv
(
arg_7
,
)
if
arg_11
:
arg_10
=
arg_11
if
arg_1
.
exists
(
arg_10
)
:
arg_12
=
yaml
.
load
(
read
(
arg_10
)
.
format
(
arg_8
)
)
logging
.
config
.
dictConfig
(
arg_12
)
else
:
logging
.
basicConfig
(
level
=
arg_5
)
arg_13
=
logging
.
getLogger
(
__name__
)
arg_13
.
debug
(
'Start logging.'
)

def Func(arg_0=arg_1.join(arg_1.dirname(arg_4), 'logger.yml'),
                  arg_5=arg_6,
                  arg_7=arg_8.upper() + '_LOG_CFG'):
    """Setup logging configuration."""
    arg_10 = arg_0
    arg_11 = os.getenv(arg_7, None)
    if arg_11:
        arg_10 = arg_11

    if arg_1.exists(arg_10):
        arg_12 = yaml.load(read(arg_10).format(arg_8))
        logging.config.dictConfig(arg_12)
        #print('Started logging using config file {0}.'.format(path))
    else:
        logging.basicConfig(level=arg_5)
        #print('Started default logging. Could not find config file '
        #      'in {0}.'.format(path))
    arg_13 = logging.getLogger(__name__)
    arg_13.debug('Start logging.')


return [e for e in events if e.get('details', {}).get('@type') == event_type]

def Func ( arg_0 , arg_1 ) : arg_2 = get_events ( arg_0 ) if not arg_2 : return None return [ arg_3 for arg_3 in arg_2 if arg_3 . get ( 'details' , { } ) . get ( '@type' ) == arg_1 ]

def Func(arg_0, arg_1):
  """Return all events of a particular type."""
  arg_2 = get_events(arg_0)
  if not arg_2:
    return None

  return [arg_3 for arg_3 in arg_2 if arg_3.get('details', {}).get('@type') == arg_1]

Return all events of a particular type .


return os.path.join(self.ds_path, dir, base_file)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = "." + arg_0 . audio_file . split ( "." ) [ - 1 ] arg_4 = os . path . basename ( arg_0 . audio_file ) . replace ( arg_3 , arg_2 ) return os . path . join ( arg_0 . ds_path , arg_1 , arg_4 )

def Func(arg_0, arg_1, arg_2):
        """Gets the desired dataset file."""
        arg_3 = "." + arg_0.audio_file.split(".")[-1]
        arg_4 = os.path.basename(arg_0.audio_file).replace(
            arg_3, arg_2)
        return os.path.join(arg_0.ds_path, arg_1, arg_4)


(self, reply_socket, channel, exc_info=None)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Sends RAISE reply."""
        if not arg_1:
            return
        if arg_3 is None:
            arg_3 = sys.exc_info()
        arg_4, arg_5, arg_6 = arg_3
        while arg_6.tb_next is not None:
            arg_6 = arg_6.tb_next
        if issubclass(arg_4, RemoteException):
            arg_4 = arg_4.exc_type
        arg_7, arg_8 = arg_6.tb_frame.f_code.co_filename, arg_6.tb_lineno
        arg_9 = (arg_4, str(arg_5), arg_7, arg_8)
        try:
            arg_10 = arg_5.__getstate__()
        except AttributeError:
            pass
        else:
            arg_9 += (arg_10,)
        arg_0.send_reply(arg_1, RAISE, arg_9, *arg_2)


(haystack, needle, invert, escape=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
)
:
arg_4
=
re
.
escape
(
arg_1
)
if
arg_3
else
arg_1
arg_5
=
re
.
search
(
arg_4
,
arg_0
,
re
.
M
)
if
(
arg_2
and
arg_5
)
or
(
not
arg_2
and
not
arg_5
)
:
raise
AssertionError
(
"'%s' %sfound in '%s'"
%
(
arg_1
,
""
if
arg_2
else
"not "
,
arg_0
)
)

def Func(arg_0, arg_1, arg_2, arg_3=False):
    """
    Test for existence of ``needle`` regex within ``haystack``.

    Say ``escape`` to escape the ``needle`` if you aren't really using the
    regex feature & have special characters in it.
    """
    arg_4 = re.escape(arg_1) if arg_3 else arg_1
    arg_5 = re.search(arg_4, arg_0, re.M)
    if (arg_2 and arg_5) or (not arg_2 and not arg_5):
        raise AssertionError("'%s' %sfound in '%s'" % (
            arg_1,
            "" if arg_2 else "not ",
            arg_0
        ))

Test for existence of needle regex within haystack .


def Func ( * arg_0 , ** arg_1 ) : arg_2 = arg_1 . pop ( 'raw' , False ) if arg_2 : for arg_3 in arg_0 : publish_html ( arg_3 ) else : display ( * arg_0 , include = [ 'text/plain' , 'text/html' ] )

def Func(*arg_0, **arg_1):
    """Display the HTML representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw HTML data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    """
    arg_2 = arg_1.pop('raw',False)
    if arg_2:
        for arg_3 in arg_0:
            publish_html(arg_3)
    else:
        display(*arg_0, include=['text/plain','text/html'])

Display the HTML representation of an object .


return FileService(account_name=conn.login,
                           account_key=conn.password, **service_options)

def Func ( arg_0 ) : arg_1 = arg_0 . Funcection ( arg_0 . conn_id ) arg_2 = arg_1 . extra_dejson return FileService ( account_name = arg_1 . login , account_key = arg_1 . password , ** arg_2 )

def Func(arg_0):
        """Return the FileService object."""
        arg_1 = arg_0.Funcection(arg_0.conn_id)
        arg_2 = arg_1.extra_dejson
        return FileService(account_name=arg_1.login,
                           account_key=arg_1.password, **arg_2)


def Func(arg_0, arg_1, arg_2):
        """Rename a tier. Note that this renames also the child tiers that have
        the tier as a parent.

        :param str id_from: Original name of the tier.
        :param str id_to: Target name of the tier.
        :throws KeyError: If the tier doesnt' exist.
        """
        arg_3 = arg_0.get_child_tiers_for(arg_1)
        arg_0.tiers[arg_2] = arg_0.tiers.pop(arg_1)
        arg_0.tiers[arg_2][2]['TIER_ID'] = arg_2
        for arg_5 in arg_3:
            arg_0.tiers[arg_5][2]['PARENT_REF'] = arg_2

Rename a tier . Note that this renames also the child tiers that have the tier as a parent .


def Func ( arg_0 ) : if ( oauth2_settings . storage_model is None or arg_0 . user . is_authenticated ( ) ) : return get_storage ( arg_0 ) . get ( ) else : return None

def Func(arg_0):
    """Gets the authorized credentials for this flow, if they exist."""
    # ORM storage requires a logged in user
    if (oauth2_settings.storage_model is None or
            arg_0.user.is_authenticated()):
        return get_storage(arg_0).get()
    else:
        return None

Gets the authorized credentials for this flow if they exist .


def Func(arg_0):
        """return a pair of a package index and result of a task

        This method waits until a tasks finishes. It returns `None` if
        no task is running.

        Returns
        -------
        tuple or None
            A pair of a package index and result. `None` if no tasks
            is running.

        """

        if not arg_0.runid_pkgidx_map:
            return None

        while True:

            if not arg_0.runid_to_return:
                arg_0.runid_to_return.extend(arg_0.dispatcher.poll())

            arg_1 = arg_0._collect_next_finished_pkgidx_result_pair()

            if arg_1 is not None:
                break

            if arg_0.runid_pkgidx_map:
                time.sleep(arg_0.sleep)

        return arg_1


def  Func( arg_0, arg_1 ):
        """ convert a code sequence to HTML """
        arg_2 = code_header + '\n'
        for arg_3 in arg_1:
            arg_2 = arg_2 + html_quote( arg_3 ) + '\n'

        return arg_2 + code_footer


'''Subclasses must specify a class property "template" that providescommand string format for running a tagger.  It should take%(tagger_root_path)s as the path from the config file,%(clean_visible_path)s as the input XML file, and %(ner_xml_path)s asthe output path to create.'''

def Func(arg_0, arg_1, arg_2):
        '''run tagger a child process to get XML output'''
        if arg_0.template is None:
            raise exceptions.NotImplementedError('''
Subclasses must specify a class property "template" that provides
command string format for running a tagger.  It should take
%(tagger_root_path)s as the path from the config file,
%(clean_visible_path)s as the input XML file, and %(ner_xml_path)s as
the output path to create.
''')
        arg_3 = dict(
            tagger_root_path=arg_0.config['tagger_root_path'],
            arg_1=arg_1,
            arg_2=arg_2)
        ## get a java_heap_size or default to 1GB
        arg_3['java_heap_size'] = arg_0.config.get('java_heap_size', '')
        arg_4 = arg_0.template % arg_3
        arg_5 = time.time()
        ## make sure we are using as little memory as possible
        gc.collect()
        try:
            arg_0._child = subprocess.Popen(arg_4, stderr=subprocess.PIPE, shell=True)
        except OSError, exc:
            arg_7 = traceback.format_exc(exc)
            arg_7 += make_memory_info_msg(arg_1, arg_2)
            raise PipelineOutOfMemory(arg_7)

        arg_8, arg_9 = arg_0._child.communicate()

        if not arg_0._child.returncode == 0:
            if 'java.lang.OutOfMemoryError' in arg_9:
                arg_7 = arg_9 + make_memory_info_msg(arg_1, arg_2)
                raise PipelineOutOfMemory(arg_7)
            elif arg_0._child.returncode == 137:
                arg_7 = 'tagger returncode = 137\n' + arg_9
                arg_7 += make_memory_info_msg(arg_1, arg_2)
                # maybe get a tail of /var/log/messages
                raise PipelineOutOfMemory(arg_7)
            elif 'Exception' in arg_9:
                raise PipelineBaseException(arg_9)
            else:
                raise PipelineBaseException('tagger exited with %r' % arg_0._child.returncode)

        arg_10 = time.time() - arg_5
        logger.info('finished tagging in %.1f seconds' % arg_10)
        return arg_10


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
os
.
path
.
join
(
arg_1
,
'hooks'
)
arg_3
=
postreceive_template
%
{
'client'
:
arg_0
.
client
,
'bucket'
:
arg_0
.
bucket
,
's3cfg'
:
arg_0
.
s3cfg
,
'prefix'
:
arg_0
.
prefix
}
arg_4
=
os
.
path
.
join
(
arg_2
,
'post-receive'
)
with
open
(
arg_4
,
'w'
)
as
fd
:
fd
.
write
(
arg_3
)
arg_0
.
make_hook_executable
(
arg_4
)
print
(
"Wrote to"
,
arg_4
)

def Func(arg_0, arg_1):
        """
        Insert hook into the repo
        """

        arg_2 = os.path.join(arg_1, 'hooks')
        arg_3 = postreceive_template % {
            'client': arg_0.client,
            'bucket': arg_0.bucket,
            's3cfg': arg_0.s3cfg,
            'prefix': arg_0.prefix
            }

        arg_4 =os.path.join(arg_2, 'post-receive')
        with open(arg_4,'w') as fd:
            fd.write(arg_3)

        arg_0.make_hook_executable(arg_4)
        print("Wrote to", arg_4)


def Func ( arg_0 ) : arg_1 = Site . objects . get_current ( ) . domain arg_2 = [ ] arg_3 = reverse ( 'oembed_json' ) arg_4 = oembed . site . get_providers ( ) for arg_5 in arg_4 : if not arg_5 . provides : continue arg_6 = None if isinstance ( arg_5 , DjangoProvider ) : arg_7 = resolver . reverse_dict . get ( arg_5 . _meta . named_view ) if arg_7 : arg_8 = re . sub ( r'%\(.+?\)s' , '*' , arg_7 [ 0 ] [ 0 ] [ 0 ] ) arg_6 = 'http://%s/%s' % ( arg_1 , arg_8 ) elif isinstance ( arg_5 , HTTPProvider ) : arg_6 = arg_5 . url_scheme else : arg_6 = arg_5 . regex if arg_6 : arg_2 . append ( { 'type' : arg_5 . resource_type , 'matches' : arg_6 , 'endpoint' : arg_3 } ) arg_2 . sort ( key = lambda item : item [ 'matches' ] ) arg_9 = HttpResponse ( mimetype = 'application/json' ) arg_9 . write ( simplejson . dumps ( arg_2 ) ) return arg_9

def Func(arg_0):
    """
    A site profile detailing valid endpoints for a given domain.  Allows for
    better auto-discovery of embeddable content.

    OEmbed-able content lives at a URL that maps to a provider.
    """
    arg_1 = Site.objects.get_current().domain
    arg_2 = [] # a list of dictionaries for all the urls we can match
    arg_3 = reverse('oembed_json') # the public endpoint for our oembeds
    arg_4 = oembed.site.get_providers()

    for arg_5 in arg_4:
        # first make sure this provider class is exposed at the public endpoint
        if not arg_5.provides:
            continue

        arg_6 = None
        if isinstance(arg_5, DjangoProvider):
            # django providers define their regex_list by using urlreversing
            arg_7 = resolver.reverse_dict.get(arg_5._meta.named_view)

            # this regex replacement is set to be non-greedy, which results
            # in things like /news/*/*/*/*/ -- this is more explicit
            if arg_7:
                arg_8 = re.sub(r'%\(.+?\)s', '*', arg_7[0][0][0])
                arg_6 = 'http://%s/%s' % (arg_1, arg_8)
        elif isinstance(arg_5, HTTPProvider):
            arg_6 = arg_5.url_scheme
        else:
            arg_6 = arg_5.regex

        if arg_6:
            arg_2.append({
                'type': arg_5.resource_type,
                'matches': arg_6,
                'endpoint': arg_3
            })

    arg_2.sort(key=lambda item: item['matches'])

    arg_9 = HttpResponse(mimetype='application/json')
    arg_9.write(simplejson.dumps(arg_2))
    return arg_9

A site profile detailing valid endpoints for a given domain . Allows for better auto - discovery of embeddable content .


return {
            "template": "main::references.html",
            "objectId": objectId,
            "citation": collection.citation,
            "collections": {
                "current": {
                    "label": collection.get_label(lang),
                    "id": collection.id,
                    "model": str(collection.model),
                    "type": str(collection.type),
                },
                "parents": self.make_parents(collection, lang=lang)
            },
            "reffs": reffs
        }

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 , arg_4 = arg_0 . get_reffs ( arg_1 = arg_1 , export_collection = True ) return { "template" : "main::references.html" , "objectId" : arg_1 , "citation" : arg_3 . citation , "collections" : { "current" : { "label" : arg_3 . get_label ( arg_2 ) , "id" : arg_3 . id , "model" : str ( arg_3 . model ) , "type" : str ( arg_3 . type ) , } , "parents" : arg_0 . make_parents ( arg_3 , arg_2 = arg_2 ) } , "reffs" : arg_4 }

def Func(arg_0, arg_1, arg_2=None):
        """ Text exemplar references browsing route function

        :param objectId: Collection identifier
        :type objectId: str
        :param lang: Lang in which to express main data
        :type lang: str
        :return: Template and required information about text with its references
        """
        arg_3, arg_4 = arg_0.get_reffs(arg_1=arg_1, export_collection=True)
        return {
            "template": "main::references.html",
            "objectId": arg_1,
            "citation": arg_3.citation,
            "collections": {
                "current": {
                    "label": arg_3.get_label(arg_2),
                    "id": arg_3.id,
                    "model": str(arg_3.model),
                    "type": str(arg_3.type),
                },
                "parents": arg_0.make_parents(arg_3, arg_2=arg_2)
            },
            "reffs": arg_4
        }


return cls.methodTmpl.render(
            indent=getIndent(ctx.indent),
            name=proc.name,
            statements=statemets
        )

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . statements arg_4 = arg_2 . withIndent ( ) arg_5 = [ arg_0 . asHdl ( s , arg_4 ) for s in arg_3 ] arg_1 . name = arg_2 . scope . checkedName ( arg_1 . name , arg_1 ) return arg_0 . methodTmpl . render ( indent = getIndent ( arg_2 . indent ) , arg_6 = arg_1 . name , statements = arg_5 )

def Func(arg_0, arg_1, arg_2):
        """
        Serialize Func instance

        :param scope: name scope to prevent name collisions
        """
        arg_3 = arg_1.statements
        arg_4 = arg_2.withIndent()
        arg_5 = [arg_0.asHdl(s, arg_4) for s in arg_3]
        arg_1.name = arg_2.scope.checkedName(arg_1.name, arg_1)

        return arg_0.methodTmpl.render(
            indent=getIndent(arg_2.indent),
            arg_6=arg_1.name,
            statements=arg_5
        )

Serialize HWProcess instance

        :param scope: name scope to prevent name collisions


def Func(arg_0, *arg_1, **arg_2):
        """ Wraps Lock.Func """
        with arg_0._stat_lock:
            arg_0._waiting += 1

        arg_0._lock.Func(*arg_1, **arg_2)

        with arg_0._stat_lock:
            arg_0._locked = True
            arg_0._waiting -= 1


return nx.relabel_nodes(nx.DiGraph(alg(mat, **kwargs)),
                            {idx: i for idx, i in enumerate(list(g.nodes()))})

def Func ( arg_0 , arg_1 = "aracne" , ** arg_2 ) : arg_1 = { "aracne" : aracne , "nd" : network_deconvolution , "clr" : clr } [ arg_1 ] arg_3 = np . array ( nx . adjacency_matrix ( arg_0 ) . todense ( ) ) return nx . relabel_nodes ( nx . DiGraph ( arg_1 ( arg_3 , ** arg_2 ) ) , { arg_4 : arg_5 for arg_4 , arg_5 in enumerate ( list ( arg_0 . nodes ( ) ) ) } )

def Func(arg_0, arg_1="aracne", **arg_2):
    """Apply deconvolution to a networkx graph.

    Args:
       g (networkx.Graph): Graph to apply deconvolution to
       alg (str): Algorithm to use ('aracne', 'clr', 'nd')
       kwargs (dict): extra options for algorithms

    Returns:
       networkx.Graph: graph with undirected links removed.
    """
    arg_1 = {"aracne": aracne,
           "nd": network_deconvolution,
           "clr": clr}[arg_1]
    arg_3 = np.array(nx.adjacency_matrix(arg_0).todense())
    return nx.relabel_nodes(nx.DiGraph(arg_1(arg_3, **arg_2)),
                            {arg_4: arg_5 for arg_4, arg_5 in enumerate(list(arg_0.nodes()))})

Apply deconvolution to a networkx graph .


def Func ( arg_0 , arg_1 = None ) : with tf . compat . v1 . name_scope ( arg_1 , "Func" , [ arg_0 ] ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_1 = "logu" ) arg_2 = tf . compat . dimension_value ( arg_0 . shape . with_rank_at_least ( 1 ) [ 0 ] ) if arg_2 is None : arg_2 = tf . shape ( input = arg_0 ) [ 0 ] arg_3 = tf . math . log ( tf . cast ( arg_2 , dtype = arg_0 . dtype ) ) arg_4 = tf . cast ( arg_2 - 1 , dtype = arg_0 . dtype ) else : arg_3 = np . log ( arg_2 ) . astype ( arg_0 . dtype . as_numpy_dtype ) arg_4 = np . asarray ( arg_2 - 1 , dtype = arg_0 . dtype . as_numpy_dtype ) arg_5 = tf . reduce_max ( input_tensor = arg_0 , axis = 0 ) arg_6 = tf . reduce_logsumexp ( input_tensor = arg_0 - arg_5 , axis = 0 ) arg_7 = arg_6 + ( arg_5 - arg_0 ) arg_8 = tf . not_equal ( arg_7 , 0. ) arg_9 = tf . where ( arg_8 , arg_7 , tf . ones_like ( arg_7 ) ) arg_10 = arg_0 + tfd . softplus_inverse ( arg_9 ) arg_11 = np . array ( np . inf , dtype = arg_0 . dtype . as_numpy_dtype ) arg_12 = tf . logical_and ( arg_0 > 0. , tf . equal ( arg_0 , arg_5 [ tf . newaxis , ... ] ) ) arg_13 = tf . reduce_logsumexp ( input_tensor = tf . where ( arg_12 , tf . fill ( tf . shape ( input = arg_0 ) , - arg_11 ) , arg_0 ) , axis = 0 , keepdims = True ) arg_13 = tf . tile ( arg_13 , multiples = 1 + tf . pad ( tensor = [ arg_2 - 1 ] , paddings = [ [ 0 , tf . rank ( arg_0 ) - 1 ] ] ) ) arg_14 = tf . where ( arg_12 , arg_13 , tf . fill ( tf . shape ( input = arg_7 ) , - arg_11 ) ) arg_15 = tf . where ( arg_8 , arg_10 , arg_14 ) arg_16 = ( tf . reduce_sum ( input_tensor = arg_0 , axis = 0 ) - arg_0 ) / arg_4 arg_17 = tf . reduce_logsumexp ( input_tensor = tf . stack ( [ arg_15 , arg_16 ] ) , axis = 0 ) arg_18 = arg_6 + arg_5 - arg_3 arg_19 = arg_17 - arg_3 arg_18 . set_shape ( arg_0 . shape . with_rank_at_least ( 1 ) [ 1 : ] ) arg_19 . set_shape ( arg_0 . shape ) return arg_18 , arg_19

def Func(arg_0, arg_1=None):
  """Helper to `csiszar_vimco`; computes `log_avg_u`, `log_sooavg_u`.

  `axis = 0` of `logu` is presumed to correspond to iid samples from `q`, i.e.,

  ```none
  logu[j] = log(u[j])
  u[j] = p(x, h[j]) / q(h[j] | x)
  h[j] iid~ q(H | x)
  ```

  Args:
    logu: Floating-type `Tensor` representing `log(p(x, h) / q(h | x))`.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    log_avg_u: `logu.dtype` `Tensor` corresponding to the natural-log of the
      average of `u`. The sum of the gradient of `log_avg_u` is `1`.
    log_sooavg_u: `logu.dtype` `Tensor` characterized by the natural-log of the
      average of `u`` except that the average swaps-out `u[i]` for the
      leave-`i`-out Geometric-average. The mean of the gradient of
      `log_sooavg_u` is `1`. Mathematically `log_sooavg_u` is,
      ```none
      log_sooavg_u[i] = log(Avg{h[j ; i] : j=0, ..., m-1})
      h[j ; i] = { u[j]                              j!=i
                 { GeometricAverage{u[k] : k != i}   j==i
      ```

  """
  with tf.compat.v1.name_scope(arg_1, "Func", [arg_0]):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_1="logu")

    arg_2 = tf.compat.dimension_value(arg_0.shape.with_rank_at_least(1)[0])
    if arg_2 is None:
      arg_2 = tf.shape(input=arg_0)[0]
      arg_3 = tf.math.log(tf.cast(arg_2, dtype=arg_0.dtype))
      arg_4 = tf.cast(arg_2 - 1, dtype=arg_0.dtype)
    else:
      arg_3 = np.log(arg_2).astype(arg_0.dtype.as_numpy_dtype)
      arg_4 = np.asarray(arg_2 - 1, dtype=arg_0.dtype.as_numpy_dtype)

    # Throughout we reduce across axis=0 since this is presumed to be iid
    # samples.

    arg_5 = tf.reduce_max(input_tensor=arg_0, axis=0)
    arg_6 = tf.reduce_logsumexp(
        input_tensor=arg_0 - arg_5, axis=0)

    # log_loosum_u[i] =
    # = logsumexp(logu[j] : j != i)
    # = log( exp(logsumexp(logu)) - exp(logu[i]) )
    # = log( exp(logsumexp(logu - logu[i])) exp(logu[i])  - exp(logu[i]))
    # = logu[i] + log(exp(logsumexp(logu - logu[i])) - 1)
    # = logu[i] + log(exp(logsumexp(logu) - logu[i]) - 1)
    # = logu[i] + softplus_inverse(logsumexp(logu) - logu[i])
    arg_7 = arg_6 + (arg_5 - arg_0)
    # We use `d != 0` rather than `d > 0.` because `d < 0.` should never
    # happens; if it does we want to complain loudly (which `softplus_inverse`
    # will).
    arg_8 = tf.not_equal(arg_7, 0.)
    arg_9 = tf.where(arg_8, arg_7, tf.ones_like(arg_7))
    arg_10 = arg_0 + tfd.softplus_inverse(arg_9)

    arg_11 = np.array(np.inf, dtype=arg_0.dtype.as_numpy_dtype)

    # When not(d_ok) and is_positive_and_largest then we manually compute the
    # log_loosum_u. (We can efficiently do this for any one point but not all,
    # hence we still need the above calculation.) This is good because when
    # this condition is met, we cannot use the above calculation; its -inf.
    # We now compute the log-leave-out-max-sum, replicate it to every
    # point and make sure to select it only when we need to.
    arg_12 = tf.logical_and(
        arg_0 > 0.,
        tf.equal(arg_0, arg_5[tf.newaxis, ...]))
    arg_13 = tf.reduce_logsumexp(
        input_tensor=tf.where(arg_12,
                              tf.fill(tf.shape(input=arg_0), -arg_11), arg_0),
        axis=0,
        keepdims=True)
    arg_13 = tf.tile(
        arg_13,
        multiples=1 + tf.pad(tensor=[arg_2 - 1], paddings=[[0, tf.rank(arg_0) - 1]]))

    arg_14 = tf.where(arg_12, arg_13,
                               tf.fill(tf.shape(input=arg_7), -arg_11))

    arg_15 = tf.where(arg_8, arg_10, arg_14)

    # The swap-one-out-sum ("soosum") is n different sums, each of which
    # replaces the i-th item with the i-th-left-out average, i.e.,
    # soo_sum_u[i] = [exp(logu) - exp(logu[i])] + exp(mean(logu[!=i]))
    #              =  exp(log_loosum_u[i])      + exp(looavg_logu[i])
    arg_16 = (tf.reduce_sum(input_tensor=arg_0, axis=0) - arg_0) / arg_4
    arg_17 = tf.reduce_logsumexp(
        input_tensor=tf.stack([arg_15, arg_16]), axis=0)

    arg_18 = arg_6 + arg_5 - arg_3
    arg_19 = arg_17 - arg_3

    arg_18.set_shape(arg_0.shape.with_rank_at_least(1)[1:])
    arg_19.set_shape(arg_0.shape)

    return arg_18, arg_19


return self.request(path, method, call_params)

def Func ( arg_0 , arg_1 ) : arg_2 = '/' + arg_0 . api_version + '/RecordStart/' arg_3 = 'POST' return arg_0 . request ( arg_2 , arg_3 , arg_1 )

def Func(arg_0, arg_1):
        """REST RecordStart helper
        """
        arg_2 = '/' + arg_0.api_version + '/RecordStart/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
PyFunceble
.
OrderedDict
(
)
if
len
(
arg_0
.
data_to_print
)
==
len
(
arg_1
)
:
for
arg_3
in
range
(
len
(
arg_0
.
data_to_print
)
)
:
arg_2
[
arg_0
.
data_to_print
[
arg_3
]
]
=
arg_1
[
arg_3
]
else
:
raise
Exception
(
"Inputed: "
+
str
(
len
(
arg_0
.
data_to_print
)
)
+
"; Size: "
+
str
(
len
(
arg_1
)
)
)
return
arg_2

def Func(arg_0, arg_1):
        """
        Construct the table of data according to given size.

        :param size: The maximal length of each string in the table.
        :type size: list

        :return:
            A dict with all information about the data and how to which what
            maximal size to print it.
        :rtype: OrderedDict

        :raises:
            :code:`Exception`
                If the data and the size does not have the same length.
        """

        # We initiate a variable which will save what we are going to
        # return.
        arg_2 = PyFunceble.OrderedDict()

        if len(arg_0.data_to_print) == len(arg_1):
            # The length of the data to print is equal to the length of the given size.

            for arg_3 in range(len(arg_0.data_to_print)):
                # We loop until our iterator is less or equal to the length of the data
                # to print.

                # We initiate the result index and its size.
                arg_2[arg_0.data_to_print[arg_3]] = arg_1[arg_3]
        else:
            # This should never happend. If it's happens then there is something
            # wrong from the inputed data.
            raise Exception(
                "Inputed: " + str(len(arg_0.data_to_print)) + "; Size: " + str(len(arg_1))
            )

        # We return the constructed result.
        return arg_2

Construct the table of data according to given size .


def
Func
(
arg_0
)
:
arg_1
=
[
'josm'
,
'level0'
,
'merkaartor'
,
'qgis'
,
'arcgis'
,
'upload.py'
,
'osmapi'
,
'Services_OpenStreetMap'
]
if
arg_0
.
editor
is
not
:
for
arg_2
in
arg_1
:
if
arg_2
in
arg_0
.
editor
.
lower
(
)
:
arg_0
.
powerfull_editor
=
True
break
if
'iD'
in
arg_0
.
editor
:
arg_4
=
[
'www.openstreetmap.org/id'
,
'www.openstreetmap.org/edit'
,
'improveosm.org'
,
'strava.github.io/iD'
,
'preview.ideditor.com/release'
,
'preview.ideditor.com/master'
,
'hey.mapbox.com/iD-internal'
,
'projets.pavie.info/id-indoor'
,
'maps.mapcat.com/edit'
,
'id.softek.ir'
]
if
arg_0
.
host
.
split
(
'://'
)
[
1
]
.
strip
(
'/'
)
not
in
arg_4
:
arg_0
.
label_suspicious
(
'Unknown iD instance'
)
else
:
arg_0
.
powerfull_editor
=
True
arg_0
.
label_suspicious
(
'Software editor was not declared'
)

def Func(arg_0):
        """Verify if the software used in the changeset is a powerfull_editor.
        """
        arg_1 = [
            'josm', 'level0', 'merkaartor', 'qgis', 'arcgis', 'upload.py',
            'osmapi', 'Services_OpenStreetMap'
            ]
        if arg_0.editor is not None:
            for arg_2 in arg_1:
                if arg_2 in arg_0.editor.lower():
                    arg_0.powerfull_editor = True
                    break

            if 'iD' in arg_0.editor:
                arg_4 = [
                    'www.openstreetmap.org/id',
                    'www.openstreetmap.org/edit',
                    'improveosm.org',
                    'strava.github.io/iD',
                    'preview.ideditor.com/release',
                    'preview.ideditor.com/master',
                    'hey.mapbox.com/iD-internal',
                    'projets.pavie.info/id-indoor',
                    'maps.mapcat.com/edit',
                    'id.softek.ir'
                    ]
                if arg_0.host.split('://')[-1].strip('/') not in arg_4:
                    arg_0.label_suspicious('Unknown iD instance')
        else:
            arg_0.powerfull_editor = True
            arg_0.label_suspicious('Software editor was not declared')

Verify if the software used in the changeset is a powerfull_editor .


def Func ( * arg_0 , ** arg_1 ) : arg_2 = arg_1 . pop ( 'raw' , False ) if arg_2 : for arg_3 in arg_0 : publish_svg ( arg_3 ) else : display ( * arg_0 , include = [ 'text/plain' , 'image/svg+xml' ] )

def Func(*arg_0, **arg_1):
    """Display the SVG representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw svg data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    """
    arg_2 = arg_1.pop('raw',False)
    if arg_2:
        for arg_3 in arg_0:
            publish_svg(arg_3)
    else:
        display(*arg_0, include=['text/plain','image/svg+xml'])

Display the SVG representation of an object .


def Func (arg_0):
    """
    parse one document to prep for TextRank
    """
    global DEBUG

    for arg_1 in arg_0:
        arg_2 = 0

        for arg_3 in filter_quotes(arg_1["text"], is_email=False):
            if DEBUG:
                print("graf_text:", arg_3)

            arg_4, arg_5 = parse_graf(arg_1["id"], arg_3, arg_2)
            arg_2 = arg_5

            for arg_6 in arg_4:
                yield arg_6


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = ADMINS_API . format ( arg_1 ) + "/{}?role={}" . format ( arg_2 , quote ( arg_3 ) ) arg_5 = arg_0 . _delete_resource ( arg_4 ) return True

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Remove an account admin role from a user.

        https://canvas.instructure.com/doc/api/admins.html#method.admins.destroy
        """
        arg_4 = ADMINS_API.format(arg_1) + "/{}?role={}".format(
            arg_2, quote(arg_3))

        arg_5 = arg_0._delete_resource(arg_4)
        return True

Remove an account admin role from a user .


def Func ( arg_0 , arg_1 ) : arg_2 = np . fft . fftn ( arg_1 ) for arg_3 , arg_4 in arg_0 . filters : arg_2 [ arg_3 ] -= arg_4 return np . real ( np . fft . ifftn ( arg_2 ) )

def Func(arg_0, arg_1):
        """Returns a filtered image after applying the Fourier-space filters"""
        arg_2 = np.fft.fftn(arg_1)
        for arg_3,arg_4 in arg_0.filters:
            arg_2[arg_3] -= arg_4
        return np.real(np.fft.ifftn(arg_2))

Returns a filtered image after applying the Fourier - space filters


(adapter, transcripts_lines=None, build='37', ensembl_genes=None)

def Func(arg_0, arg_1=None, arg_2='37', arg_3=None):
    """Load all the transcripts

    Transcript information is from ensembl.

    Args:
        adapter(MongoAdapter)
        transcripts_lines(iterable): iterable with ensembl transcript lines
        build(str)
        ensembl_genes(dict): Map from ensembl_id -> HgncGene

    Returns:
        transcript_objs(list): A list with all transcript objects
    """
    # Fetch all genes with ensemblid as keys
    arg_3 = arg_3 or arg_0.ensembl_genes(arg_2)

    if arg_1 is None:
        arg_1 = fetch_ensembl_transcripts(arg_2=arg_2)

    # Map with all transcripts enstid -> parsed transcript
    arg_4 = parse_transcripts(arg_1)
    for arg_5 in list(arg_4):
        arg_6 = arg_4[arg_5]
        # Get the ens gene id
        arg_7 = arg_6['ensembl_gene_id']

        # Fetch the internal gene object to find out the correct hgnc id
        arg_8 = arg_3.get(arg_7)
        # If the gene is non existing in scout we skip the transcript
        if not arg_8:
            arg_4.pop(arg_5)
            LOG.debug("Gene %s does not exist in build %s", arg_7, arg_2)
            continue

        # Add the correct hgnc id
        arg_6['hgnc_id'] = arg_8['hgnc_id']
        # Primary transcript information is collected from HGNC
        arg_6['primary_transcripts'] = set(arg_8.get('primary_transcripts', []))

    arg_9 = 0
    arg_10 = 0
    arg_11 = len(arg_4)

    arg_12 = []

    with progressbar(arg_4.values(), label="Building transcripts", length=arg_11) as bar:
        for arg_13 in bar:

            #################### Get the correct refseq identifier ####################
            # We need to decide one refseq identifier for each transcript, if there are any to
            # choose from. The algorithm is as follows:
            # If there is ONE mrna this is choosen
            # If there are several mrna the one that is in 'primary_transcripts' is choosen
            # Else one is choosen at random
            # The same follows for the other categories where nc_rna has precedense over mrna_predicted
            # We will store all refseq identifiers in a "refseq_identifiers" list as well
            arg_13['is_primary'] = False
            arg_14 = arg_13['primary_transcripts']
            arg_15 = None
            arg_16 = []
            for arg_17 in TRANSCRIPT_CATEGORIES:
                arg_18 = arg_13[arg_17]
                if not arg_18:
                    continue

                for arg_19 in arg_18:
                    # Add all refseq identifiers to refseq_identifiers
                    arg_16.append(arg_19)
                    arg_9 += 1

                    if arg_19 in arg_14:
                        arg_15 = arg_19
                        arg_13['is_primary'] = True
                        arg_10 += 1

                    if not arg_15:
                        arg_15 = arg_19

            if arg_15:
                arg_13['refseq_id'] = arg_15
            if arg_16:
                arg_13['refseq_identifiers'] = arg_16

            ####################  ####################  ####################
            # Build the transcript object
            arg_20 = build_transcript(arg_13, arg_2)
            arg_12.append(arg_20)

    # Load all transcripts
    LOG.info("Loading transcripts...")
    if len(arg_12) > 0:
        arg_0.load_transcript_bulk(arg_12)

    LOG.info('Number of transcripts in build %s: %s', arg_2, arg_11)
    LOG.info('Number of transcripts with refseq identifier: %s', arg_9)
    LOG.info('Number of primary transcripts: %s', arg_10)

    return arg_12


def Func ( arg_0 ) : if arg_0 is None : return "" arg_1 = decode_bytes ( arg_0 ) if isbytes ( arg_0 ) else str_ ( arg_0 ) return normalize_whitespace ( arg_1 )

def Func(arg_0):
    """
    Normalizes the given value to a string of text with extra whitespace removed.

    Byte sequences are decoded. ``None`` is converted to an empty string. Everything else
    is simply cast to a string.

    Args:
        value (Any): The data to normalize.

    Returns:
        str: The normalized text.
    """

    if arg_0 is None:
        return ""

    arg_1 = decode_bytes(arg_0) if isbytes(arg_0) else str_(arg_0)

    return normalize_whitespace(arg_1)

Normalizes the given value to a string of text with extra whitespace removed .