def Func ( arg_0 : arg_1 ) -> str : if '' in arg_0 : if len ( arg_0 ) == 1 : return '' arg_2 = True del arg_0 [ '' ] else : arg_2 = False arg_3 = _defaultdict ( list ) for arg_4 , arg_5 in arg_0 . items ( ) : arg_6 = Func ( arg_5 ) arg_3 [ arg_6 ] . append ( arg_4 ) arg_7 = [ ] for arg_6 , arg_8 in arg_3 . items ( ) : if len ( arg_8 ) == 1 : arg_7 . append ( arg_8 [ 0 ] + arg_6 ) else : arg_8 . sort ( reverse = True ) arg_7 . append ( '[' + '' . join ( arg_8 ) + ']' + arg_6 ) if len ( arg_7 ) == 1 : arg_9 = arg_7 [ 0 ] if arg_2 : if len ( arg_9 ) == 1 : arg_9 += '?+' else : arg_9 = '(?:' + arg_9 + ')?+' else : arg_7 . sort ( reverse = True ) arg_9 = '(?>' + '|' . join ( arg_7 ) + ')' if arg_2 : arg_9 += '?+' return arg_9

def Func(arg_0: arg_1) -> str:
    """Convert a trie to a regex pattern."""
    if '' in arg_0:
        if len(arg_0) == 1:
            return ''
        arg_2 = True
        del arg_0['']
    else:
        arg_2 = False

    arg_3 = _defaultdict(list)

    for arg_4, arg_5 in arg_0.items():
        arg_6 = Func(arg_5)
        arg_3[arg_6].append(arg_4)

    arg_7 = []
    for arg_6, arg_8 in arg_3.items():
        if len(arg_8) == 1:
            arg_7.append(arg_8[0] + arg_6)
        else:
            arg_8.sort(reverse=True)
            arg_7.append('[' + ''.join(arg_8) + ']' + arg_6)

    if len(arg_7) == 1:
        arg_9 = arg_7[0]
        if arg_2:
            if len(arg_9) == 1:
                arg_9 += '?+'
            else:  # more than one character in alts[0]
                arg_9 = '(?:' + arg_9 + ')?+'
    else:
        arg_7.sort(reverse=True)
        arg_9 = '(?>' + '|'.join(arg_7) + ')'
        if arg_2:
            arg_9 += '?+'
    return arg_9


(literal: Sequence[Input], *literals: Sequence[Sequence[Input]])

def Func ( arg_0 : arg_1 [ arg_2 ] , * arg_3 : arg_1 [ arg_1 [ arg_2 ] ] ) -> Parser : if len ( arg_3 ) > 0 : return AlternativeParser ( options . handle_Funceral ( arg_0 ) , * map ( options . handle_Funceral , arg_3 ) ) else : return options . handle_Funceral ( arg_0 )

def Func(arg_0: arg_1[arg_2], *arg_3: arg_1[arg_1[arg_2]]) -> Parser:
    """Match a Funceral sequence.

    In the `TextParsers`` context, this matches the Funceral string
    provided. In the ``GeneralParsers`` context, this matches a sequence of
    input.

    If multiple Funcerals are provided, they are treated as alternatives. e.g.
    ``Func('+', '-')`` is the same as ``Func('+') | Func('-')``.

    Args:
        Funceral: A Funceral to match
        *Funcerals: Alternative Funcerals to match

    Returns:
        A ``LiteralParser`` in the ``GeneralContext``, a ``LiteralStringParser``
        in the ``TextParsers`` context, and an ``AlternativeParser`` if multiple
        arguments are provided.
    """
    if len(arg_3) > 0:
        return AlternativeParser(options.handle_Funceral(arg_0), *map(options.handle_Funceral, arg_3))
    else:
        return options.handle_Funceral(arg_0)

Match a literal sequence.

    In the `TextParsers`` context, this matches the literal string
    provided. In the ``GeneralParsers`` context, this matches a sequence of
    input.

    If multiple literals are provided, they are treated as alternatives. e.g.
    ``lit('+', '-')`` is the same as ``lit('+') | lit('-')``.

    Args:
        literal: A literal to match
        *literals: Alternative literals to match

    Returns:
        A ``LiteralParser`` in the ``GeneralContext``, a ``LiteralStringParser``
        in the ``TextParsers`` context, and an ``AlternativeParser`` if multiple
        arguments are provided.


def Func ( arg_0 , arg_1 , arg_2 ) : with TemporaryDirectory ( ) as temp_dir_name : arg_3 = os . path . join ( temp_dir_name , 'model.ckpt' ) tf . train . Saver ( ) . save ( arg_0 , arg_3 ) Func_from_checkpoint ( arg_3 , arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
    """Freeze and shrink the graph based on a session and the output node names."""
    with TemporaryDirectory() as temp_dir_name:
        arg_3 = os.path.join(temp_dir_name, 'model.ckpt')
        tf.train.Saver().save(arg_0, arg_3)

        Func_from_checkpoint(arg_3, arg_1, arg_2)

Freeze and shrink the graph based on a session and the output node names .


def Func ( arg_0 , arg_1 ) : arg_2 = list ( arg_0 . graph . triples ( ( None , arg_0 . spdx_namespace . licenseId , arg_1 . identifier ) ) ) if len ( arg_2 ) != 0 : return arg_2 [ 0 ] [ 0 ] else : arg_3 = BNode ( ) arg_4 = ( arg_3 , RDF . type , arg_0 . spdx_namespace . ExtractedLicensingInfo ) arg_0 . graph . add ( arg_4 ) arg_5 = ( arg_3 , arg_0 . spdx_namespace . licenseId , Literal ( arg_1 . identifier ) ) arg_0 . graph . add ( arg_5 ) arg_6 = ( arg_3 , arg_0 . spdx_namespace . extractedText , Literal ( arg_1 . text ) ) arg_0 . graph . add ( arg_6 ) if arg_1 . full_name is not None : arg_7 = ( arg_3 , arg_0 . spdx_namespace . licenseName , arg_0 . to_special_value ( arg_1 . full_name ) ) arg_0 . graph . add ( arg_7 ) for arg_8 in arg_1 . cross_ref : arg_9 = ( arg_3 , RDFS . seeAlso , URIRef ( arg_8 ) ) arg_0 . graph . add ( arg_9 ) if arg_1 . comment is not None : arg_10 = ( arg_3 , RDFS . comment , Literal ( arg_1 . comment ) ) arg_0 . graph . add ( arg_10 ) return arg_3

def Func(arg_0, arg_1):
        """
        Handle extracted license.
        Return the license node.
        """
        arg_2 = list(arg_0.graph.triples((None, arg_0.spdx_namespace.licenseId, arg_1.identifier)))
        if len(arg_2) != 0:
            return arg_2[0][0]  # return subject in first triple
        else:
            arg_3 = BNode()
            arg_4 = (arg_3, RDF.type, arg_0.spdx_namespace.ExtractedLicensingInfo)
            arg_0.graph.add(arg_4)
            arg_5 = (arg_3, arg_0.spdx_namespace.licenseId, Literal(arg_1.identifier))
            arg_0.graph.add(arg_5)
            arg_6 = (arg_3, arg_0.spdx_namespace.extractedText, Literal(arg_1.text))
            arg_0.graph.add(arg_6)
            if arg_1.full_name is not None:
                arg_7 = (arg_3, arg_0.spdx_namespace.licenseName, arg_0.to_special_value(arg_1.full_name))
                arg_0.graph.add(arg_7)
            for arg_8 in arg_1.cross_ref:
                arg_9 = (arg_3, RDFS.seeAlso, URIRef(arg_8))
                arg_0.graph.add(arg_9)
            if arg_1.comment is not None:
                arg_10 = (arg_3, RDFS.comment, Literal(arg_1.comment))
                arg_0.graph.add(arg_10)
            return arg_3

Handle extracted license . Return the license node .


def Func ( arg_0 , * arg_1 ) : arg_2 = urijoin ( arg_0 . RBUG , arg_1 [ 0 ] , arg_0 . RCOMMENT ) arg_3 = { arg_0 . PIDS : arg_1 } arg_4 = arg_0 . call ( arg_2 , arg_3 ) return arg_4

def Func(arg_0, *arg_1):
        """Get the Func of the given bugs.

        :param bug_ids: list of bug identifiers
        """
        # Hack. The first value must be a valid bug id
        arg_2 = urijoin(arg_0.RBUG, arg_1[0], arg_0.RCOMMENT)

        arg_3 = {
            arg_0.PIDS: arg_1
        }

        arg_4 = arg_0.call(arg_2, arg_3)

        return arg_4

Get the comments of the given bugs.

        :param bug_ids: list of bug identifiers


return credentials.with_subject(self.delegate_to) \
            if self.delegate_to else credentials

def Func(arg_0):
        """
        Returns the Credentials object for Google API
        """
        arg_1 = arg_0._get_field('key_path', False)
        arg_2 = arg_0._get_field('keyfile_dict', False)
        arg_3 = arg_0._get_field('scope', None)
        if arg_3:
            arg_4 = [s.strip() for s in arg_3.split(',')]
        else:
            arg_4 = _DEFAULT_SCOPES

        if not arg_1 and not arg_2:
            arg_0.log.info('Getting connection using `google.auth.default()` '
                          'since no key file is defined for hook.')
            arg_5, arg_6 = google.auth.default(arg_4=arg_4)
        elif arg_1:
            # Get credentials from a JSON file.
            if arg_1.endswith('.json'):
                arg_0.log.debug('Getting connection using JSON key file %s' % arg_1)
                arg_5 = (
                    google.oauth2.service_account.Credentials.from_service_account_file(
                        arg_1, arg_4=arg_4)
                )
            elif arg_1.endswith('.p12'):
                raise AirflowException('Legacy P12 key file are not supported, '
                                       'use a JSON key file.')
            else:
                raise AirflowException('Unrecognised extension for key file.')
        else:
            # Get credentials from JSON data provided in the UI.
            try:
                arg_2 = json.loads(arg_2)

                # Depending on how the JSON was formatted, it may contain
                # escaped newlines. Convert those to actual newlines.
                arg_2['private_key'] = arg_2['private_key'].replace(
                    '\\n', '\n')

                arg_5 = (
                    google.oauth2.service_account.Credentials.from_service_account_info(
                        arg_2, arg_4=arg_4)
                )
            except json.decoder.JSONDecodeError:
                raise AirflowException('Invalid key JSON.')

        return arg_5.with_subject(arg_0.delegate_to) \
            if arg_0.delegate_to else arg_5


def Func(arg_0, arg_1, arg_2=False):
        """
        Decrement the stack pointer and write `value` to the stack.

        :param int value: The value to write
        :param force: whether to ignore memory permissions
        :return: New stack pointer
        """
        arg_0.STACK -= arg_0.address_bit_size // 8
        arg_0.write_int(arg_0.STACK, arg_1, arg_2=arg_2)
        return arg_0.STACK

Decrement the stack pointer and write value to the stack .


def Func(arg_0, arg_1, arg_2):
        '''
        Giving the MinHash and size of the Func set, retrieve
        keys that references sets with containment with respect to
        the Func set greater than the threshold.

        Args:
            minhash (datasketch.MinHash): The MinHash of the Func set.
            size (int): The size (number of unique items) of the Func set.

        Returns:
            `iterator` of keys.
        '''
        for arg_3, arg_4 in enumerate(arg_0.indexes):
            arg_5 = arg_0.uppers[arg_3]
            if arg_5 is None:
                continue
            arg_6, arg_7 = arg_0._get_optimal_param(arg_5, arg_2)
            for arg_8 in arg_4[arg_7]._Func_b(arg_1, arg_6):
                yield arg_8

Giving the MinHash and size of the query set, retrieve
        keys that references sets with containment with respect to
        the query set greater than the threshold.

        Args:
            minhash (datasketch.MinHash): The MinHash of the query set.
            size (int): The size (number of unique items) of the query set.

        Returns:
            `iterator` of keys.

Giving the MinHash and size of the query set retrieve keys that references sets with containment with respect to the query set greater than the threshold .


def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Add the given lxml representation of the BPMN file to the parser's set.

        :param svg: Optionally, provide the text data for the SVG of the BPMN
          file
        :param filename: Optionally, provide the source filename.
        """
        arg_4 = xpath_eval(arg_1)

        arg_5 = arg_4('.//bpmn:process')
        for arg_6 in arg_5:
            arg_7 = arg_0.PROCESS_PARSER_CLASS(
                arg_0, arg_6, arg_2, arg_3=arg_3, doc_xpath=arg_4)
            if arg_7.get_id() in arg_0.process_parsers:
                raise ValidationException(
                    'Duplicate process ID', node=arg_6, arg_3=arg_3)
            if arg_7.get_name() in arg_0.process_parsers_by_name:
                raise ValidationException(
                    'Duplicate process name', node=arg_6, arg_3=arg_3)
            arg_0.process_parsers[arg_7.get_id()] = arg_7
            arg_0.process_parsers_by_name[
                arg_7.get_name()] = arg_7

Add the given lxml representation of the BPMN file to the parser s set .


def Func(arg_0, arg_1):
    """Return the distances between the input pattern and all other
    stored patterns.

    :param inputPattern: pattern to check distance with

    :returns: (distances, categories) numpy arrays of the same length.
        - overlaps: an integer overlap amount for each category
        - categories: category index for each element of distances
    """
    arg_2 = arg_0._Func(arg_1)
    return (arg_2, arg_0._categoryList)

Return the distances between the input pattern and all other stored patterns .


Return a vector with the occupancy of each grid point for
    given array of points

def Func ( arg_0 , arg_1 , arg_2 = 0.01 ) : arg_3 = ( ( arg_0 [ : , None , : ] - arg_1 [ None , : , : ] ) ** 2 ) . sum ( axis = 2 ) arg_4 = ( arg_3 < arg_2 ) . sum ( axis = 1 ) return arg_4

def Func(arg_0, arg_1, arg_2=0.01):
    """Return a vector with the Func of each grid point for
    given array of points"""
    arg_3 = ((arg_0[:,None,:] - arg_1[None,:,:])**2).sum(axis=2)
    arg_4 = (arg_3 < arg_2).sum(axis=1)
    return arg_4


def Func(arg_0, arg_1=3):
    r"""Cauchy tapering window

    :param int N: window length
    :param float alpha: parameter of the poisson window

    .. math:: w(n) = \frac{1}{1+\left(\frac{\alpha*n}{N/2}\right)**2}

    .. plot::
        :width: 80%
        :include-source:

        from spectrum import window_visu
        window_visu(64, 'cauchy', alpha=3)
        window_visu(64, 'cauchy', alpha=4)
        window_visu(64, 'cauchy', alpha=5)

    .. seealso:: :func:`window_poisson`, :func:`window_hann`
    """
    arg_2 = linspace(-arg_0/2., (arg_0)/2., arg_0)
    arg_3 = 1./(1.+ (arg_1*arg_2/(arg_0/2.))**2)
    return arg_3


(lclist,
                     binsizesec,
                     maxobjects=None,
                     outdir=None,
                     lcformat='hat-sql',
                     lcformatdir=None,
                     timecols=None,
                     magcols=None,
                     errcols=None,
                     minbinelems=7,
                     nworkers=NCPUS,
                     maxworkertasks=1000)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = 'hat-sql' , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = None , arg_9 = 7 , arg_10 = arg_11 , arg_12 = 1000 ) : if arg_3 and not os . path . exists ( arg_3 ) : os . mkdir ( arg_3 ) if arg_2 is not None : arg_0 = arg_0 [ : arg_2 ] arg_13 = [ ( x , arg_1 , { 'outdir' : arg_3 , 'lcformat' : arg_4 , 'lcformatdir' : arg_5 , 'timecols' : arg_6 , 'magcols' : arg_7 , 'errcols' : arg_8 , 'minbinelems' : arg_9 } ) for x in arg_0 ] arg_14 = mp . Pool ( arg_10 , maxtasksperchild = arg_12 ) arg_15 = arg_14 . map ( timebinlc_worker , arg_13 ) arg_14 . close ( ) arg_14 . join ( ) arg_16 = { os . path . basename ( x ) : y for ( x , y ) in zip ( arg_0 , arg_15 ) } return arg_16

def Func(arg_0,
                     arg_1,
                     arg_2=None,
                     arg_3=None,
                     arg_4='hat-sql',
                     arg_5=None,
                     arg_6=None,
                     arg_7=None,
                     arg_8=None,
                     arg_9=7,
                     arg_10=arg_11,
                     arg_12=1000):
    '''This time-bins all the LCs in the list using the specified bin size.

    Parameters
    ----------

    lclist : list of str
        The input LCs to process.

    binsizesec : float
        The time bin size to use in seconds.

    maxobjects : int or None
        If provided, LC processing will stop at `lclist[maxobjects]`.

    outdir : str or None
        The directory where output LCs will be written. If None, will write to
        the same directory as the input LCs.

    lcformat : str
        This is the `formatkey` associated with your light curve format, which
        you previously passed in to the `lcproc.register_lcformat`
        function. This will be used to look up how to find and read the light
        curve file.

    lcformatdir : str or None
        If this is provided, gives the path to a directory when you've stored
        your lcformat description JSONs, other than the usual directories lcproc
        knows to search for them in. Use this along with `lcformat` to specify
        an LC format JSON file that's not currently registered with lcproc.

    timecols,magcols,errcols : lists of str
        The keys in the lcdict produced by your light curve reader function that
        correspond to the times, mags/fluxes, and associated measurement errors
        that will be used as inputs to the binning process. If these are None,
        the default values for `timecols`, `magcols`, and `errcols` for your
        light curve format will be used here.

    minbinelems : int
        The minimum number of time-bin elements required to accept a time-bin as
        valid for the output binned light curve.

    nworkers : int
        Number of parallel workers to launch.

    maxworkertasks : int
        The maximum number of tasks a parallel worker will complete before being
        replaced to guard against memory leaks.

    Returns
    -------

    dict
        The returned dict contains keys = input LCs, vals = output LCs.

    '''

    if arg_3 and not os.path.exists(arg_3):
        os.mkdir(arg_3)

    if arg_2 is not None:
        arg_0 = arg_0[:arg_2]

    arg_13 = [(x, arg_1, {'outdir':arg_3,
                              'lcformat':arg_4,
                              'lcformatdir':arg_5,
                              'timecols':arg_6,
                              'magcols':arg_7,
                              'errcols':arg_8,
                              'minbinelems':arg_9}) for x in arg_0]

    arg_14 = mp.Pool(arg_10, maxtasksperchild=arg_12)
    arg_15 = arg_14.map(timebinlc_worker, arg_13)
    arg_14.close()
    arg_14.join()

    arg_16 = {os.path.basename(x):y for (x,y) in zip(arg_0, arg_15)}

    return arg_16

This time - bins all the LCs in the list using the specified bin size .


def Func ( arg_0 ) : arg_1 = { arg_0 . name : { 'timestamp' : arg_0 . time , } , } if arg_0 . data is not None : arg_1 [ arg_0 . name ] [ 'data' ] = arg_0 . data return arg_1

def Func(arg_0):
        """
        Get the event description.

        Returns a dictionary describing the event.
        """
        arg_1 = {
            arg_0.name: {
                'timestamp': arg_0.time,
            },
        }

        if arg_0.data is not None:
            arg_1[arg_0.name]['data'] = arg_0.data

        return arg_1


(self, seq_pair, multiplicity, t, return_log=False)

return logP if return_log else np.exp(logP)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = False ) : if arg_3 < 0 : arg_5 = - ttconf . BIG_NUMBER else : arg_6 = arg_0 . expQt ( arg_3 ) arg_7 = ( arg_6 == 0 ) arg_8 = arg_9 . log ( arg_6 + ttconf . TINY_NUMBER * ( arg_7 ) ) arg_8 [ arg_9 . isnan ( arg_8 ) | arg_9 . isinf ( arg_8 ) | arg_7 ] = - ttconf . BIG_NUMBER arg_5 = arg_9 . sum ( arg_8 [ arg_1 [ : , 1 ] , arg_1 [ : , 0 ] ] * arg_2 ) return arg_5 if arg_4 else arg_9 . exp ( arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=False):
        '''
        Calculate the probability of observing a sequence pair at a distance t,
        for compressed sequences

        Parameters
        ----------

          seq_pair : numpy array
            :code:`np.array([(0,1), (2,2), ()..])` as indicies of
            pairs of aligned positions. (e.g. 'A'==0, 'C'==1 etc).
            This only lists all occuring parent-child state pairs, order is irrelevant

          multiplicity : numpy array
            The number of times a parent-child state pair is observed.
            This allows compression of the sequence representation

          t : float
            Length of the branch separating parent and child

          return_log : bool
            Whether or not to exponentiate the result

        '''
        if arg_3<0:
            arg_5 = -ttconf.BIG_NUMBER
        else:
            arg_6 = arg_0.expQt(arg_3)
            arg_7=(arg_6==0)
            arg_8 = arg_9.log(arg_6 + ttconf.TINY_NUMBER*(arg_7))
            arg_8[arg_9.isnan(arg_8) | arg_9.isinf(arg_8) | arg_7] = -ttconf.BIG_NUMBER
            arg_5 = arg_9.sum(arg_8[arg_1[:,1], arg_1[:,0]]*arg_2)

        return arg_5 if arg_4 else arg_9.exp(arg_5)

Calculate the probability of observing a sequence pair at a distance t for compressed sequences


def Func(arg_0, arg_1, arg_2):
        """
        Insert object before index.

        :param int index: index to Func in
        :param string value: path to Func
        """
        arg_0._list.Func(arg_1, arg_2)
        arg_0._sync()

Insert object before index.

        :param int index: index to insert in
        :param string value: path to insert


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . next_question if arg_2 is None : return try : arg_3 = arg_2 . prompter ( arg_0 . get_prompt ( arg_2 , arg_1 ) , * arg_2 . prompter_args , ** arg_2 . prompter_kwargs ) except QuestionnaireGoBack as e : arg_4 = e . args [ 0 ] if e . args else 1 if arg_4 == 0 : arg_0 . Func ( ) return arg_0 . go_back ( arg_4 ) else : if arg_2 . _validate : arg_1 = arg_2 . _validate ( arg_3 ) if arg_1 : arg_0 . Func ( arg_1 ) return if arg_2 . _transform : arg_3 = arg_2 . _transform ( arg_3 ) arg_0 . answers [ arg_2 . key ] = arg_3 return arg_3

def Func(arg_0, arg_1=None):
        """Asks the next question in the questionnaire and returns the answer,
        unless user goes back.
        """
        arg_2 = arg_0.next_question
        if arg_2 is None:
            return

        try:
            arg_3 = arg_2.prompter(arg_0.get_prompt(arg_2, arg_1), *arg_2.prompter_args, **arg_2.prompter_kwargs)
        except QuestionnaireGoBack as e:
            arg_4 = e.args[0] if e.args else 1
            if arg_4 == 0:
                arg_0.Func()  # user can redo current question even if `can_go_back` is `False`
                return
            arg_0.go_back(arg_4)
        else:
            if arg_2._validate:
                arg_1 = arg_2._validate(arg_3)
                if arg_1:
                    arg_0.Func(arg_1)
                    return
            if arg_2._transform:
                arg_3 = arg_2._transform(arg_3)
            arg_0.answers[arg_2.key] = arg_3
            return arg_3

Asks the next question in the questionnaire and returns the answer unless user goes back .


(self, f_start=None, f_stop=None,t_start=None, t_stop=None)

def Func(arg_0, arg_1=None, arg_2=None,arg_3=None, arg_4=None):
        """ Reads data selection if small enough.
        """

        arg_0.container.Func(arg_1=arg_1, arg_2=arg_2,arg_3=arg_3, arg_4=arg_4)

        arg_0.__load_data()


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . rpc . get_key_references ( [ str ( arg_1 ) ] ) [ 0 ] for arg_3 in arg_2 : yield arg_3

def Func(arg_0, arg_1):
        """ Obtain all accounts associated with a public key
        """
        arg_2 = arg_0.rpc.get_key_references([str(arg_1)])[0]
        for arg_3 in arg_2:
            yield arg_3


return (padded_array_2d[pad_size_0 // 2:self.mask.shape[0] - pad_size_0 // 2,
                pad_size_1 // 2:self.mask.shape[1] - pad_size_1 // 2])

def Func(arg_0, arg_1):
        """ Map a padded 1D array of values to its original 2D array, trimming all edge values.

        Parameters
        -----------
        padded_array_1d : ndarray
            A 1D array of values which were computed using the *PaddedRegularGrid*.
        """
        arg_2 = arg_0.map_to_2d_keep_padded(arg_1)
        arg_3 = arg_0.mask.shape[0] - arg_0.image_shape[0]
        arg_4 = arg_0.mask.shape[1] - arg_0.image_shape[1]
        return (arg_2[arg_3 // 2:arg_0.mask.shape[0] - arg_3 // 2,
                arg_4 // 2:arg_0.mask.shape[1] - arg_4 // 2])

Map a padded 1D array of values to its original 2D array trimming all edge values .


def Func ( arg_0 ) : arg_0 . status = 'pending' arg_0 . thing . action_notify ( arg_0 ) arg_0 . perform_action ( ) arg_0 . finish ( )

def Func(arg_0):
        """Start performing the action."""
        arg_0.status = 'pending'
        arg_0.thing.action_notify(arg_0)
        arg_0.perform_action()
        arg_0.finish()


def Func ( arg_0 ) : try : arg_1 = ParseFloat ( arg_0 . token ) except ValueError as e : raise arg_0 . _ParseError ( str ( e ) ) arg_0 . NextToken ( ) return arg_1

def Func(arg_0):
    """Consumes an floating point number.

    Returns:
      The number parsed.

    Raises:
      ParseError: If a floating point number couldn't be consumed.
    """
    try:
      arg_1 = ParseFloat(arg_0.token)
    except ValueError as e:
      raise arg_0._ParseError(str(e))
    arg_0.NextToken()
    return arg_1


def Func(arg_0, arg_1):
        """
        Generates features based on an iput p_set
        p_set - PredictorSet
        """
        if arg_0._initialized!=True:
            arg_2 = "Dictionaries have not been initialized."
            log.exception(arg_2)
            raise util_functions.InputError(arg_1, arg_2)

        arg_3 = []
        for arg_4 in xrange(0,len(arg_1._essay_sets)):
            arg_3.append(arg_0._extractors[arg_4].Func(arg_1._essay_sets[arg_4]))

        arg_5 = numpy.concatenate(arg_3, axis=1)
        arg_6 = numpy.array(arg_1._numeric_features)

        print arg_5.shape
        print arg_6.shape

        arg_7 = numpy.concatenate((arg_5, arg_6), axis=1)

        return arg_7.copy()


def Func(arg_0, arg_1):
        """
        Read from written process output.

        Parameters
        ----------
        output_tile : BufferedTile or tile index tuple
            Member of the output tile pyramid (not necessarily the process
            pyramid, if output has a different metatiling setting)

        Returns
        -------
        data : NumPy array or features
            process output
        """
        if arg_0.config.mode not in ["Funconly", "continue", "overwrite"]:
            raise ValueError("process mode must be Funconly, continue or overwrite")
        if isinstance(arg_1, tuple):
            arg_1 = arg_0.config.output_pyramid.tile(*arg_1)
        elif isinstance(arg_1, BufferedTile):
            pass
        else:
            raise TypeError("output_tile must be tuple or BufferedTile")

        return arg_0.config.output.Func(arg_1)


return {
            "header"     : header,
            "ciphertext" : ciphertext
        }

def Func(arg_0, arg_1, arg_2 = None):
        """
        Encrypt a message using this double ratchet session.

        :param message: A bytes-like object encoding the message to encrypt.
        :param ad: A bytes-like object encoding the associated data to use for message
            authentication. Pass None to use the associated data set during construction.
        :returns: A dictionary containing the message header and ciphertext. The header is
            required to synchronize the double ratchet of the receiving party. Send it
            along with the ciphertext.

        The returned dictionary consists of two keys: "header", which includes an instance
        of the Header class and "ciphertext", which includes the encrypted message encoded
        as a bytes-like object.

        :raises NotInitializedException: If this double ratchet session is not yet
            initialized with the other parties public key, thus not ready to encrypt a
            message to that party.
        """

        if arg_2 == None:
            arg_2 = arg_0.__ad

        # Prepare the header for this message
        arg_3 = Header(
            arg_0.pub,
            arg_0.__skr.sending_chain_length,
            arg_0.__skr.previous_sending_chain_length
        )

        # Encrypt the message
        arg_4 = arg_0.__aead.encrypt(
            arg_1,
            arg_0.__skr.nextEncryptionKey(),
            arg_0._makeAD(arg_3, arg_2)
        )

        return {
            "header"     : arg_3,
            "ciphertext" : arg_4
        }

Encrypt a message using this double ratchet session .


async def Func ( arg_0 , arg_1 , * arg_2 ) -> str : arg_2 = [ str ( track ) for track in arg_2 ] await arg_0 . http . replace_playlist_tracks ( arg_0 . id , str ( arg_1 ) , arg_2 = ',' . join ( arg_2 ) )

async def Func(arg_0, arg_1, *arg_2) -> str:
        """Replace all the tracks in a playlist, overwriting its existing tracks.
        This powerful request can be useful for replacing tracks, re-ordering existing tracks, or clearing the playlist.

        Parameters
        ----------
        playlist : Union[str, PLaylist]
            The playlist to modify
        tracks : Sequence[Union[str, Track]]
            Tracks to place in the playlist
        """
        arg_2 = [str(track) for track in arg_2]
        await arg_0.http.replace_playlist_tracks(arg_0.id, str(arg_1), arg_2=','.join(arg_2))

Replace all the tracks in a playlist overwriting its existing tracks . This powerful request can be useful for replacing tracks re - ordering existing tracks or clearing the playlist .


(hostname, username, idfile, is_get,
                       local_path, remote_path)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
if
arg_0
.
strip
(
)
==
''
or
arg_0
is
:
raise
ValueError
(
'Empty hostname'
)
arg_6
=
[
_get_path
(
'scp'
)
,
'-o'
,
'StrictHostKeyChecking=no'
,
'-o'
,
'ConnectTimeout=5'
,
'-o'
,
'UserKnownHostsFile={}'
.
format
(
_KNOWN_HOSTS_FILE
)
]
if
arg_2
is
not
:
arg_6
.
extend
(
[
'-i'
,
arg_2
]
)
if
arg_1
is
not
:
arg_0
=
'%s@%s'
%
(
arg_1
,
arg_0
)
arg_5
=
'{}:{}'
.
format
(
arg_0
,
arg_5
)
if
arg_3
:
arg_6
.
extend
(
[
arg_5
,
arg_4
]
)
else
:
arg_6
.
extend
(
[
arg_4
,
arg_5
]
)
return
' '
.
join
(
arg_6
)

def Func(arg_0, arg_1, arg_2, arg_3,
                       arg_4, arg_5):
    """
    Uses hostname and other info to construct an SCP command.

    :param hostname: The hostname of the remote machine.
    :type hostname: ``str``
    :param username: The username to use on the remote machine.
    :type username: ``str``
    :param idfile: A path to the identity file to use.
    :type idfile: ``str``
    :param is_get: If true, we are getting a file rather than putting a file.
    :type is_get: ``bool``
    :param local_path: The path on the local file system.
    :type local_path: ``str``
    :param remote_path: The path on the remote file system.
    :type remote_path: ``str``
    """
    if arg_0.strip() == '' or arg_0 is None:
        raise ValueError('Empty hostname')
    arg_6 = [_get_path('scp'),
               '-o', 'StrictHostKeyChecking=no',
               '-o', 'ConnectTimeout=5',
               '-o', 'UserKnownHostsFile={}'.format(_KNOWN_HOSTS_FILE)]
    if arg_2 is not None:
        arg_6.extend(['-i', arg_2])
    if arg_1 is not None:
        arg_0 = '%s@%s' % (arg_1, arg_0)
    arg_5 = '{}:{}'.format(arg_0, arg_5)
    if arg_3:
        arg_6.extend([arg_5, arg_4])
    else:
        arg_6.extend([arg_4, arg_5])
    return ' '.join(arg_6)

Uses hostname and other info to construct an SCP command .


return [p[data_index] for p in dataset['data']]

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = getattr ( arg_0 , '%s_data_index' % arg_1 ) return [ arg_4 [ arg_3 ] for arg_4 in arg_2 [ 'data' ] ]

def Func(arg_0, arg_1, arg_2):
		"""
		Return all the values for a single axis of the data.
		"""
		arg_3 = getattr(arg_0, '%s_data_index' % arg_1)
		return [arg_4[arg_3] for arg_4 in arg_2['data']]

Return all the values for a single axis of the data .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 [ : arg_1 . index ( '\n' ) ] . strip ( ) arg_4 = words ( arg_1 ) arg_5 = len ( arg_0 . documents ) arg_0 . documents . append ( Document ( arg_3 , arg_2 , len ( arg_4 ) ) ) for arg_6 in arg_4 : if arg_6 not in arg_0 . stopwords : arg_0 . index [ arg_6 ] [ arg_5 ] += 1

def Func(arg_0, arg_1, arg_2):
        "Index the text of a document."
        ## For now, use first line for title
        arg_3 = arg_1[:arg_1.index('\n')].strip()
        arg_4 = words(arg_1)
        arg_5 = len(arg_0.documents)
        arg_0.documents.append(Document(arg_3, arg_2, len(arg_4)))
        for arg_6 in arg_4:
            if arg_6 not in arg_0.stopwords:
                arg_0.index[arg_6][arg_5] += 1


return self.request(path, method, call_params)

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

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


def
Func
(
arg_0
)
:
arg_0
.
all_tasks_done
.
acquire
(
)
try
:
arg_1
=
arg_0
.
unfinished_tasks
1
if
arg_1
<=
0
:
if
arg_1
<
0
:
raise
ValueError
(
'Func() called too many times'
)
arg_0
.
all_tasks_done
.
notify_all
(
)
arg_0
.
unfinished_tasks
=
arg_1
finally
:
arg_0
.
all_tasks_done
.
release
(
)

def Func(arg_0):
        """Indicate that a formerly enqueued task is complete.

        Used by Queue consumer threads.  For each get() used to fetch a task,
        a subsequent call to Func() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items
        have been processed (meaning that a Func() call was received
        for every item that had been put() into the queue).

        Raises a ValueError if called more times than there were items
        placed in the queue.
        """
        arg_0.all_tasks_done.acquire()
        try:
            arg_1 = arg_0.unfinished_tasks - 1
            if arg_1 <= 0:
                if arg_1 < 0:
                    raise ValueError('Func() called too many times')
                arg_0.all_tasks_done.notify_all()
            arg_0.unfinished_tasks = arg_1
        finally:
            arg_0.all_tasks_done.release()

Indicate that a formerly enqueued task is complete.

        Used by Queue consumer threads.  For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items
        have been processed (meaning that a task_done() call was received
        for every item that had been put() into the queue).

        Raises a ValueError if called more times than there were items
        placed in the queue.

Indicate that a formerly enqueued task is complete .


def
Func
(
arg_0
,
arg_1
=
62000
)
:
from
http
.
Funcr
import
HTTPServer
,
CGIHTTPRequestHandler
os
.
chdir
(
arg_0
.
log_folder
)
arg_2
=
HTTPServer
(
(
''
,
arg_1
)
,
CGIHTTPRequestHandler
)
print
(
"Starting LanguageBoard on port: "
+
str
(
arg_2
.
Funcr_port
)
)
webbrowser
.
open
(
'http://0.0.0.0:{}'
.
format
(
arg_1
)
)
arg_2
.
Func_forever
(
)

def Func(arg_0, arg_1=62000):
        """ Start LanguageBoard web application

        Parameters
        ----------
        port: int
            port to Func web application
        """

        from http.Funcr import HTTPServer, CGIHTTPRequestHandler
        os.chdir(arg_0.log_folder)

        arg_2 = HTTPServer(('', arg_1), CGIHTTPRequestHandler)
        print("Starting LanguageBoard on port: " + str(arg_2.Funcr_port))
        webbrowser.open('http://0.0.0.0:{}'.format(arg_1))
        arg_2.Func_forever()

Start LanguageBoard web application

        Parameters
        ----------
        port: int
            port to serve web application


(self, text, position, color=(255, 255, 255),
                size=12, antialias=False, center=False)

def Func(arg_0, arg_1, arg_2, arg_3=(255, 255, 255),
                arg_4=12, arg_5=False, arg_6=False):
        """Write text at x, y top left corner position.

        By default the x and y coordinates represent the top left hand corner
        of the text. The text can be centered vertically and horizontally by
        using setting the ``center`` option to ``True``.

        :param text: text to write
        :param position: (row, col) tuple
        :param color: RGB tuple
        :param size: font size
        :param antialias: whether or not the text should be antialiased
        :param center: whether or not the text should be centered on the
                       input coordinate
        """
        def antialias_value(arg_7, arg_8):
            return int(round(arg_7 * arg_8))

        def antialias_rgb(arg_3, arg_8):
            return tuple([antialias_value(arg_9, arg_8) for arg_9 in arg_3])

        def set_color(arg_10, arg_11, arg_3):
            try:
                arg_0[arg_11, arg_10] = arg_3
            except IndexError:
                pass

        arg_12, arg_13 = arg_2
        arg_14 = PIL.ImageFont.truetype(DEFAULT_FONT_PATH, arg_4=arg_4)
        arg_15 = arg_14.getmask(arg_1)
        arg_16, arg_17 = arg_15.size
        if arg_6:
            arg_13 = arg_13 - (arg_16 // 2)
            arg_12 = arg_12 - (arg_17 // 2)
        for arg_18 in range(arg_17):
            for arg_19 in range(arg_16):
                arg_8 = arg_15[arg_18 * arg_16 + arg_19] / 255.
                if arg_5:
                    if arg_8 != 0:
                        arg_20 = antialias_rgb(arg_3, arg_8)
                        set_color(arg_13 + arg_19, arg_12+arg_18, arg_20)
                else:
                    if arg_8 > .5:
                        set_color(arg_13 + arg_19, arg_12 + arg_18, arg_3)

Write text at x y top left corner position .


return q_intersection_mag / sqrt(q_src_mag * q_tar_mag)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 2 ) : if arg_1 == arg_2 : return 1.0 if not arg_1 or not arg_2 : return 0.0 arg_4 , arg_5 = arg_0 . _get_qgrams ( arg_1 , arg_2 , arg_3 ) arg_6 = sum ( arg_4 . values ( ) ) arg_7 = sum ( arg_5 . values ( ) ) arg_8 = sum ( ( arg_4 & arg_5 ) . values ( ) ) return arg_8 / sqrt ( arg_6 * arg_7 )

def Func(arg_0, arg_1, arg_2, arg_3=2):
        r"""Return the cosine Funcilarity of two strings.

        Parameters
        ----------
        src : str
            Source string (or QGrams/Counter objects) for comparison
        tar : str
            Target string (or QGrams/Counter objects) for comparison
        qval : int
            The length of each q-gram; 0 for non-q-gram version

        Returns
        -------
        float
            Cosine Funcilarity

        Examples
        --------
        >>> cmp = Cosine()
        >>> cmp.Func('cat', 'hat')
        0.5
        >>> cmp.Func('Niall', 'Neil')
        0.3651483716701107
        >>> cmp.Func('aluminum', 'Catalan')
        0.11785113019775793
        >>> cmp.Func('ATCG', 'TAGC')
        0.0

        """
        if arg_1 == arg_2:
            return 1.0
        if not arg_1 or not arg_2:
            return 0.0

        arg_4, arg_5 = arg_0._get_qgrams(arg_1, arg_2, arg_3)
        arg_6 = sum(arg_4.values())
        arg_7 = sum(arg_5.values())
        arg_8 = sum((arg_4 & arg_5).values())

        return arg_8 / sqrt(arg_6 * arg_7)

r"""Return the cosine similarity of two strings.

        Parameters
        ----------
        src : str
            Source string (or QGrams/Counter objects) for comparison
        tar : str
            Target string (or QGrams/Counter objects) for comparison
        qval : int
            The length of each q-gram; 0 for non-q-gram version

        Returns
        -------
        float
            Cosine similarity

        Examples
        --------
        >>> cmp = Cosine()
        >>> cmp.sim('cat', 'hat')
        0.5
        >>> cmp.sim('Niall', 'Neil')
        0.3651483716701107
        >>> cmp.sim('aluminum', 'Catalan')
        0.11785113019775793
        >>> cmp.sim('ATCG', 'TAGC')
        0.0

r Return the cosine similarity of two strings .


def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = os . path . abspath ( os . path . expanduser ( "~/.ledgerrc" ) ) if "LEDGER_FILE" in os . environ : return os . path . abspath ( os . path . expanduser ( os . environ [ "LEDGER_FILE" ] ) ) elif os . path . exists ( arg_0 ) : arg_1 = open ( arg_0 ) for arg_2 in arg_1 . readlines ( ) : arg_3 = re . match ( r"--file\s+([^\s]+).*" , arg_2 ) if arg_3 is not None : return os . path . abspath ( os . path . expanduser ( arg_3 . group ( 1 ) ) ) else : return None

def Func(arg_0=None):
    """Returns main ledger file path or raise exception if it cannot be \
found."""
    if arg_0 is None:
        arg_0 = os.path.abspath(os.path.expanduser("~/.ledgerrc"))
    if "LEDGER_FILE" in os.environ:
        return os.path.abspath(os.path.expanduser(os.environ["LEDGER_FILE"]))
    elif os.path.exists(arg_0):
        # hacky
        arg_1 = open(arg_0)
        for arg_2 in arg_1.readlines():
            arg_3 = re.match(r"--file\s+([^\s]+).*", arg_2)
            if arg_3 is not None:
                return os.path.abspath(os.path.expanduser(arg_3.group(1)))
    else:
        return None

Returns main ledger file path or raise exception if it cannot be \ found .


def Func ( arg_0 , arg_1 ) : arg_0 . file . seek ( arg_1 * K - K ) return arg_0 . file . read ( K )

def Func(arg_0, arg_1):
        """Return record `n` as 1,024 bytes; records are indexed from 1."""
        arg_0.file.seek(arg_1 * K - K)
        return arg_0.file.read(K)

Return record n as 1 024 bytes ; records are indexed from 1 .


def Func(arg_0, arg_1, arg_2=False):
        """Evaluate a URL as a possible download, and maybe retrieve it"""
        if arg_1 in arg_0.scanned_urls and not arg_2:
            return
        arg_0.scanned_urls[arg_1] = True
        if not URL_SCHEME(arg_1):
            arg_0.process_filename(arg_1)
            return
        else:
            arg_4 = list(distros_for_url(arg_1))
            if arg_4:
                if not arg_0.url_ok(arg_1):
                    return
                arg_0.debug("Found link: %s", arg_1)

        if arg_4 or not arg_2 or arg_1 in arg_0.fetched_urls:
            list(map(arg_0.add, arg_4))
            return  # don't need the actual page

        if not arg_0.url_ok(arg_1):
            arg_0.fetched_urls[arg_1] = True
            return

        arg_0.info("Reading %s", arg_1)
        arg_0.fetched_urls[arg_1] = True   # prevent multiple fetch attempts
        arg_6 = arg_0.open_url(arg_1, "Download error on %s: %%s -- Some packages may not be found!" % arg_1)
        if arg_6 is None: return
        arg_0.fetched_urls[arg_6.url] = True
        if 'html' not in arg_6.headers.get('content-type', '').lower():
            arg_6.close()   # not html, we can't process it
            return

        arg_7 = arg_6.url     # handle redirects
        arg_8 = arg_6.read()
        if not isinstance(arg_8, str): # We are in Python 3 and got bytes. We want str.
            if isinstance(arg_6, HTTPError):
                # Errors have no charset, assume latin1:
                arg_9 = 'latin-1'
            else:
                arg_9 = arg_6.headers.get_param('charset') or 'latin-1'
            arg_8 = arg_8.decode(arg_9, "ignore")
        arg_6.close()
        for arg_10 in HREF.finditer(arg_8):
            arg_11 = urljoin(arg_7, htmldecode(arg_10.group(1)))
            arg_0.Func(arg_11)
        if arg_1.startswith(arg_0.index_url) and getattr(arg_6,'code',None)!=404:
            arg_8 = arg_0.process_index(arg_1, arg_8)

Evaluate a URL as a possible download and maybe retrieve it


return '\n'.join([header, columns] + rows + [''])

def
Func
(
arg_0
)
:
arg_1
=
'ver:%s'
%
dump_str
(
str
(
arg_0
.
_version
)
,
version
=
arg_0
.
_version
)
if
bool
(
arg_0
.
metadata
)
:
arg_1
+=
' '
+
dump_meta
(
arg_0
.
metadata
,
version
=
arg_0
.
_version
)
arg_2
=
dump_columns
(
arg_0
.
column
,
version
=
arg_0
.
_version
)
arg_3
=
dump_rows
(
arg_0
)
return
'\n'
.
join
(
[
arg_1
,
arg_2
]
+
arg_3
+
[
''
]
)

def Func(arg_0):
    """
    Dump a single grid to its ZINC representation.
    """
    arg_1 = 'ver:%s' % dump_str(str(arg_0._version), version=arg_0._version)
    if bool(arg_0.metadata):
        arg_1 += ' ' + dump_meta(arg_0.metadata, version=arg_0._version)
    arg_2 = dump_columns(arg_0.column, version=arg_0._version)
    arg_3 = dump_rows(arg_0)
    return '\n'.join([arg_1, arg_2] + arg_3 + [''])

Dump a single grid to its ZINC representation .


def Func(arg_0, arg_1, arg_2):
    """
    Grows the histogram to have rows rows and cols columns.
    Must not have been initialized before, or already have the same
    number of columns.
    If rows is smaller than the current number of rows,
    does not shrink.
    Also updates the sizes of the row and column sums.

    :param rows: Integer number of rows.
    :param cols: Integer number of columns.
    """
    if not arg_0.hist_:
      arg_0.hist_ = SparseMatrix(arg_1, arg_2)
      arg_0.rowSums_ = numpy.zeros(arg_1, dtype=dtype)
      arg_0.colSums_ = numpy.zeros(arg_2, dtype=dtype)
      arg_0.hack_ = None
    else:
      arg_7 = arg_0.hist_.nRows()
      arg_8 = arg_0.hist_.nCols()
      arg_9 = max(arg_7, arg_1)
      arg_10 = max(arg_8, arg_2)
      if (arg_7 < arg_9) or (arg_8 < arg_10):
        arg_0.hist_.resize(arg_9, arg_10)
        if arg_7 < arg_9:
          arg_11 = arg_0.rowSums_
          arg_0.rowSums_ = numpy.zeros(arg_9, dtype=dtype)
          arg_0.rowSums_[0:arg_12(arg_11)] = arg_11
          arg_0.hack_ = None
        if arg_8 < arg_10:
          arg_11 = arg_0.colSums_
          arg_0.colSums_ = numpy.zeros(arg_10, dtype=dtype)
          arg_0.colSums_[0:arg_12(arg_11)] = arg_11
          arg_0.hack_ = None

Grows the histogram to have rows rows and cols columns . Must not have been initialized before or already have the same number of columns . If rows is smaller than the current number of rows does not shrink . Also updates the sizes of the row and column sums .


def Func ( arg_0 , arg_1 ) : arg_1 . delete ( ) PersistentIdentifier . query . filter_by ( object_type = 'rec' , object_uuid = arg_1 . id , ) . update ( { PersistentIdentifier . status : PIDStatus . DELETED } ) arg_0 . delete_buckets ( arg_1 ) db . session . commit ( )

def Func(arg_0, arg_1):
        """Delete a record and it's persistent identifiers."""
        arg_1.delete()
        PersistentIdentifier.query.filter_by(
            object_type='rec', object_uuid=arg_1.id,
        ).update({PersistentIdentifier.status: PIDStatus.DELETED})
        arg_0.delete_buckets(arg_1)
        db.session.commit()

Delete a record and it s persistent identifiers .


def Func ( arg_0 , arg_1 ) : arg_2 = object . __new__ ( arg_0 ) arg_2 . _iteration = arg_1 . iteration arg_2 . _historicalScores = collections . deque ( maxlen = arg_1 . historicWindowSize ) for arg_5 , arg_6 in enumerate ( arg_1 . historicalScores ) : arg_2 . _historicalScores . append ( ( arg_5 , arg_6 . value , arg_6 . anomalyScore ) ) if arg_1 . distribution . name : arg_2 . _distribution = dict ( ) arg_2 . _distribution [ 'distribution' ] = dict ( ) arg_2 . _distribution [ 'distribution' ] [ "name" ] = arg_1 . distribution . name arg_2 . _distribution [ 'distribution' ] [ "mean" ] = arg_1 . distribution . mean arg_2 . _distribution [ 'distribution' ] [ "variance" ] = arg_1 . distribution . variance arg_2 . _distribution [ 'distribution' ] [ "stdev" ] = arg_1 . distribution . stdev arg_2 . _distribution [ "movingAverage" ] = { } arg_2 . _distribution [ "movingAverage" ] [ "windowSize" ] = arg_1 . distribution . movingAverage . windowSize arg_2 . _distribution [ "movingAverage" ] [ "historicalValues" ] = [ ] for arg_8 in arg_1 . distribution . movingAverage . historicalValues : arg_2 . _distribution [ "movingAverage" ] [ "historicalValues" ] . append ( arg_8 ) arg_2 . _distribution [ "movingAverage" ] [ "total" ] = arg_1 . distribution . movingAverage . total arg_2 . _distribution [ "historicalLikelihoods" ] = [ ] for arg_9 in arg_1 . distribution . historicalLikelihoods : arg_2 . _distribution [ "historicalLikelihoods" ] . append ( arg_9 ) else : arg_2 . _distribution = None arg_2 . _probationaryPeriod = arg_1 . probationaryPeriod arg_2 . _learningPeriod = arg_1 . learningPeriod arg_2 . _reestimationPeriod = arg_1 . reestimationPeriod return arg_2

def Func(arg_0, arg_1):
    """ capnp deserialization method for the anomaly likelihood object

    :param proto: (Object) capnp proto object specified in
                          nupic.regions.anomaly_likelihood.capnp

    :returns: (Object) the deserialized AnomalyLikelihood object
    """
    # pylint: disable=W0212
    arg_2 = object.__new__(arg_0)
    arg_2._iteration = arg_1.iteration

    arg_2._historicalScores = collections.deque(
      maxlen=arg_1.historicWindowSize)
    for arg_5, arg_6 in enumerate(arg_1.historicalScores):
      arg_2._historicalScores.append((arg_5, arg_6.value,
                                                  arg_6.anomalyScore))
    if arg_1.distribution.name: # is "" when there is no distribution.
      arg_2._distribution = dict()
      arg_2._distribution['distribution'] = dict()
      arg_2._distribution['distribution']["name"] = arg_1.distribution.name
      arg_2._distribution['distribution']["mean"] = arg_1.distribution.mean
      arg_2._distribution['distribution']["variance"] = arg_1.distribution.variance
      arg_2._distribution['distribution']["stdev"] = arg_1.distribution.stdev

      arg_2._distribution["movingAverage"] = {}
      arg_2._distribution["movingAverage"]["windowSize"] = arg_1.distribution.movingAverage.windowSize
      arg_2._distribution["movingAverage"]["historicalValues"] = []
      for arg_8 in arg_1.distribution.movingAverage.historicalValues:
        arg_2._distribution["movingAverage"]["historicalValues"].append(arg_8)
      arg_2._distribution["movingAverage"]["total"] = arg_1.distribution.movingAverage.total

      arg_2._distribution["historicalLikelihoods"] = []
      for arg_9 in arg_1.distribution.historicalLikelihoods:
        arg_2._distribution["historicalLikelihoods"].append(arg_9)
    else:
      arg_2._distribution = None

    arg_2._probationaryPeriod = arg_1.probationaryPeriod
    arg_2._learningPeriod = arg_1.learningPeriod
    arg_2._reestimationPeriod = arg_1.reestimationPeriod
    # pylint: enable=W0212

    return arg_2


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Gets the cell with the smallest number of segments.
    Break ties randomly.

    :param random: (Object)
    Random number generator. Gets mutated.

    :param cells: (list)
    Indices of cells.

    :param connections: (Object)
    Connections instance for the TM.

    :returns: (int) Cell index.
    """
    arg_4 = []
    arg_5 = float("inf")
    for arg_6 in arg_2:
      arg_7 = arg_3.numSegments(arg_6)

      if arg_7 < arg_5:
        arg_5 = arg_7
        arg_4 = []

      if arg_7 == arg_5:
        arg_4.append(arg_6)

    arg_8 = arg_1.getUInt32(len(arg_4))
    return arg_4[arg_8]

Gets the cell with the smallest number of segments . Break ties randomly .


(self, logger, config, incremental=False)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : arg_4 = arg_2 . get ( 'level' , None ) if arg_4 is not None : arg_1 . setLevel ( _checkLevel ( arg_4 ) ) if not arg_3 : for arg_5 in arg_1 . handlers [ : ] : arg_1 . removeHandler ( arg_5 ) arg_6 = arg_2 . get ( 'handlers' , None ) if arg_6 : arg_0 . add_handlers ( arg_1 , arg_6 ) arg_7 = arg_2 . get ( 'filters' , None ) if arg_7 : arg_0 . add_filters ( arg_1 , arg_7 )

def Func(arg_0, arg_1, arg_2, arg_3=False):
        """
        Perform configuration which is common to root and non-root loggers.
        """
        arg_4 = arg_2.get('level', None)
        if arg_4 is not None:
            arg_1.setLevel(_checkLevel(arg_4))
        if not arg_3:
            # Remove any existing handlers
            for arg_5 in arg_1.handlers[:]:
                arg_1.removeHandler(arg_5)
            arg_6 = arg_2.get('handlers', None)
            if arg_6:
                arg_0.add_handlers(arg_1, arg_6)
            arg_7 = arg_2.get('filters', None)
            if arg_7:
                arg_0.add_filters(arg_1, arg_7)

Perform configuration which is common to root and non - root loggers .


def Func ( arg_0 ) : if hasattr ( arg_0 , '_sfdr' ) and arg_0 . _sfdr : arg_0 . _spatialPoolerOutput = numpy . zeros ( arg_0 . columnCount , dtype = GetNTAReal ( ) ) else : arg_0 . _spatialPoolerOutput = None arg_0 . _fpLogSPInput = None arg_0 . _fpLogSP = None arg_0 . _fpLogSPDense = None arg_0 . logPathInput = "" arg_0 . logPathOutput = "" arg_0 . logPathOutputDense = ""

def Func(arg_0):
    """
    Initialize all ephemerals used by derived classes.
    """

    if hasattr(arg_0, '_sfdr') and arg_0._sfdr:
      arg_0._spatialPoolerOutput = numpy.zeros(arg_0.columnCount,
                                               dtype=GetNTAReal())
    else:
      arg_0._spatialPoolerOutput = None  # Will be filled in initInNetwork

    # Direct logging support (faster than node watch)
    arg_0._fpLogSPInput = None
    arg_0._fpLogSP = None
    arg_0._fpLogSPDense = None
    arg_0.logPathInput = ""
    arg_0.logPathOutput = ""
    arg_0.logPathOutputDense = ""

Initialize all ephemerals used by derived classes .


def
Func
(
arg_0
)
:
logger
.
debug
(
"======================"
)
logger
.
debug
(
"Setting configurations"
)
logger
.
debug
(
"======================"
)
arg_1
=
""
arg_2
=
""
arg_3
=
""
arg_4
=
""
if
arg_0
.
merge_params
:
arg_3
+=
arg_0
.
_get_merged_params_string
(
)
arg_5
=
arg_0
.
_get_merged_params_help
(
)
else
:
arg_3
+=
arg_0
.
_get_params_string
(
)
arg_5
=
arg_0
.
_get_params_help
(
)
for
arg_6
in
arg_0
.
processes
:
if
not
arg_6
.
directives
:
continue
logger
.
debug
(
"[{}] Adding directives: {}"
.
format
(
arg_6
.
template
,
arg_6
.
directives
)
)
arg_1
+=
arg_0
.
_get_resources_string
(
arg_6
.
directives
,
arg_6
.
pid
)
arg_2
+=
arg_0
.
_get_container_string
(
arg_6
.
directives
,
arg_6
.
pid
)
arg_4
=
arg_0
.
_get_manifest_string
(
)
arg_0
.
resources
=
arg_0
.
_render_config
(
"resources.config"
,
{
"process_info"
:
arg_1
}
)
arg_0
.
containers
=
arg_0
.
_render_config
(
"containers.config"
,
{
"container_info"
:
arg_2
}
)
arg_0
.
params
=
arg_0
.
_render_config
(
"params.config"
,
{
"params_info"
:
arg_3
}
)
arg_0
.
manifest
=
arg_0
.
_render_config
(
"manifest.config"
,
{
"manifest_info"
:
arg_4
}
)
arg_0
.
help
=
arg_0
.
_render_config
(
"Helper.groovy"
,
{
"nf_file"
:
basename
(
arg_0
.
nf_file
)
,
"help_list"
:
arg_5
,
"version"
:
__version__
,
"pipeline_name"
:
" "
.
join
(
[
x
.
upper
(
)
for
x
in
arg_0
.
pipeline_name
]
)
}
)
arg_0
.
user_config
=
arg_0
.
_render_config
(
"user.config"
,
{
}
)

def Func(arg_0):
        """This method will iterate over all process in the pipeline and
        populate the nextflow configuration files with the directives
        of each process in the pipeline.
        """

        logger.debug("======================")
        logger.debug("Setting configurations")
        logger.debug("======================")

        arg_1 = ""
        arg_2 = ""
        arg_3 = ""
        arg_4 = ""

        if arg_0.merge_params:
            arg_3 += arg_0._get_merged_params_string()
            arg_5 = arg_0._get_merged_params_help()
        else:
            arg_3 += arg_0._get_params_string()
            arg_5 = arg_0._get_params_help()

        for arg_6 in arg_0.processes:

            # Skip processes with the directives attribute populated
            if not arg_6.directives:
                continue

            logger.debug("[{}] Adding directives: {}".format(
                arg_6.template, arg_6.directives))
            arg_1 += arg_0._get_resources_string(arg_6.directives, arg_6.pid)
            arg_2 += arg_0._get_container_string(arg_6.directives, arg_6.pid)

        arg_4 = arg_0._get_manifest_string()

        arg_0.resources = arg_0._render_config("resources.config", {
            "process_info": arg_1
        })
        arg_0.containers = arg_0._render_config("containers.config", {
            "container_info": arg_2
        })
        arg_0.params = arg_0._render_config("params.config", {
            "params_info": arg_3
        })
        arg_0.manifest = arg_0._render_config("manifest.config", {
            "manifest_info": arg_4
        })
        arg_0.help = arg_0._render_config("Helper.groovy", {
            "nf_file": basename(arg_0.nf_file),
            "help_list": arg_5,
            "version": __version__,
            "pipeline_name": " ".join([x.upper() for x in arg_0.pipeline_name])
        })
        arg_0.user_config = arg_0._render_config("user.config", {})

This method will iterate over all process in the pipeline and populate the nextflow configuration files with the directives of each process in the pipeline .


def Func(arg_0, arg_1, arg_2):
        """Fix the value of a variable and remove it from the constraint.

        Args:
            v (variable):
                Variable in the constraint to be set to a constant value.

            val (int):
                Value assigned to the variable. Values must match the :class:`.Vartype` of the
                constraint.

        Examples:
            This example creates a constraint that :math:`a \\ne b` on binary variables,
            fixes variable a to 0, and tests two candidate solutions.

            >>> import dwavebinarycsp
            >>> const = dwavebinarycsp.Constraint.from_func(operator.ne,
            ...             ['a', 'b'], dwavebinarycsp.BINARY)
            >>> const.Func('a', 0)
            >>> const.check({'b': 1})
            True
            >>> const.check({'b': 0})
            False

        """
        arg_3 = arg_0.variables
        try:
            arg_4 = arg_3.index(arg_1)
        except ValueError:
            raise ValueError("given variable {} is not part of the constraint".format(arg_1))

        if arg_2 not in arg_0.vartype.value:
            raise ValueError("expected value to be in {}, received {} instead".format(arg_0.vartype.value, arg_2))

        arg_5 = frozenset(config[:arg_4] + config[arg_4 + 1:]  # exclude the fixed var
                                   for config in arg_0.configurations
                                   if config[arg_4] == arg_2)

        if not arg_5:
            raise UnsatError("fixing {} to {} makes this constraint unsatisfiable".format(arg_1, arg_2))

        arg_3 = arg_3[:arg_4] + arg_3[arg_4 + 1:]

        arg_0.configurations = arg_5
        arg_0.variables = arg_3

        def arg_7(*arg_6): return arg_6 in arg_5
        arg_0.func = arg_7

        arg_0.name = '{} ({} fixed to {})'.format(arg_0.name, arg_1, arg_2)

Fix the value of a variable and remove it from the constraint.

        Args:
            v (variable):
                Variable in the constraint to be set to a constant value.

            val (int):
                Value assigned to the variable. Values must match the :class:`.Vartype` of the
                constraint.

        Examples:
            This example creates a constraint that :math:`a \\ne b` on binary variables,
            fixes variable a to 0, and tests two candidate solutions.

            >>> import dwavebinarycsp
            >>> const = dwavebinarycsp.Constraint.from_func(operator.ne,
            ...             ['a', 'b'], dwavebinarycsp.BINARY)
            >>> const.fix_variable('a', 0)
            >>> const.check({'b': 1})
            True
            >>> const.check({'b': 0})
            False

Fix the value of a variable and remove it from the constraint .


def
Func
(
arg_0
)
:
arg_0
.
logger
.
debug
(
'PostgresGreenlet Func'
)
arg_0
.
start
(
)
arg_0
.
_stop_event
.
wait
(
)
gevent
.
joinall
(
arg_0
.
threads
+
[
DDPLauncher
.
pgworker
]
)
arg_0
.
threads
=
[
]

def Func(arg_0):
        """Run DDP greenlets."""
        arg_0.logger.debug('PostgresGreenlet Func')
        arg_0.start()
        arg_0._stop_event.wait()
        # wait for all threads to stop.
        gevent.joinall(arg_0.threads + [DDPLauncher.pgworker])
        arg_0.threads = []


def Func(arg_0, arg_1, arg_2=True, arg_3=3):
        """
        Load repository from a directory path and update the current instance.
        First, new repository still will be loaded. If failed, then old
        style repository load will be tried.

        :Parameters:
            #. path (string): The path of the directory from where to load
               the repository from. If '.' or an empty string is passed,
               the current working directory will be used.
            #. verbose (boolean): Whether to be verbose about abnormalities
            #. ntrials (int): After aquiring all locks, ntrials is the maximum
               number of trials allowed before failing.
               In rare cases, when multiple processes
               are accessing the same repository components, different processes
               can alter repository components between successive lock releases
               of some other process. Bigger number of trials lowers the
               likelyhood of failure due to multiple processes same time
               alteration.

        :Returns:
             #. repository (pyrep.Repository): returns self repository with loaded data.
        """
        assert isinstance(arg_3, int), "ntrials must be integer"
        assert arg_3>0, "ntrials must be >0"
        arg_4 = None
        for arg_5 in range(arg_3):
            try:
                arg_0.__Func(arg_1=arg_1, arg_2=True)
            except Exception as err1:
                try:
                    from .OldRepository import Repository
                    arg_6 = Repository(arg_1)
                except Exception as err2:
                    #traceback.print_exc()
                    arg_7 = "Unable to load repository using neiher new style (%s) nor old style (%s)"%(err1, err2)
                    if arg_0.DEBUG_PRINT_FAILED_TRIALS: print("Trial %i failed in Repository.%s (%s). Set Repository.DEBUG_PRINT_FAILED_TRIALS to False to mute"%(arg_5, inspect.stack()[1][3], str(arg_7)))
                else:
                    arg_7 = None
                    arg_4  = arg_6
                    break
            else:
                arg_7 = None
                arg_4  = arg_0
                break
        # check and return
        assert arg_7 is None, arg_7
        return arg_4

Load repository from a directory path and update the current instance . First new repository still will be loaded . If failed then old style repository load will be tried .


def Func(arg_0, arg_1):
        """Process a single DDP message."""
        arg_2 = arg_1.get('id', None)
        try:
            arg_3 = arg_1.pop('msg')
        except KeyError:
            arg_0.reply(
                'error', reason='Bad request',
                offendingMessage=arg_1,
            )
            return
        try:
            # dispatch message
            arg_0.dispatch(arg_3, arg_1)
        except Exception as err:  # pylint: disable=broad-except
            # This should be the only protocol exception handler
            arg_4 = {
                'msg': {'method': 'result'}.get(arg_3, 'error'),
            }
            if arg_2 is not None:
                arg_4['id'] = arg_2
            if isinstance(err, MeteorError):
                arg_5 = err.as_dict()
            else:
                arg_5 = {
                    'error': 500,
                    'reason': 'Internal server error',
                }
            if arg_4['msg'] == 'error':
                arg_4.update(arg_5)
            else:
                arg_4['error'] = arg_5
            if not isinstance(err, MeteorError):
                # not a client error, should always be logged.
                arg_6, arg_7 = safe_call(
                    arg_0.logger.error, '%r %r', arg_3, arg_1, exc_info=1,
                )
                if arg_6 is not None:
                    # something went wrong while logging the error, revert to
                    # writing a stack trace to stderr.
                    traceback.print_exc(file=sys.stderr)
                    sys.stderr.write(
                        'Additionally, while handling the above error the '
                        'following error was encountered:\n'
                    )
                    sys.stderr.write(arg_6)
            elif settings.DEBUG:
                print('ERROR: %s' % err)
                dprint('msg', arg_3)
                dprint('data', arg_1)
                arg_5.setdefault('details', traceback.format_exc())
                # print stack trace for client errors when DEBUG is True.
                print(arg_5['details'])
            arg_0.reply(**arg_4)
            if arg_2 and arg_3 == 'method':
                arg_0.reply('updated', methods=[arg_2])


def
Func
(
arg_0
,
arg_1
=
2
)
:
if
not
isinstance
(
arg_1
,
int
)
or
arg_1
<
1
:
raise
ValueError
(
'factor must be a positive integer.'
)
arg_2
=
[
'Func'
,
'{}'
.
format
(
arg_1
)
]
arg_0
.
effects
.
extend
(
arg_2
)
arg_0
.
effects_log
.
append
(
'Func'
)
return
arg_0

def Func(arg_0, arg_1=2):
        '''Downsample the signal by an integer factor. Only the first out of
        each factor samples is retained, the others are discarded.

        No decimation filter is applied. If the input is not a properly
        bandlimited baseband signal, aliasing will occur. This may be desirable
        e.g., for frequency translation.

        For a general resampling effect with anti-aliasing, see rate.

        Parameters
        ----------
        factor : int, default=2
            Downsampling factor.

        See Also
        --------
        rate, upsample

        '''
        if not isinstance(arg_1, int) or arg_1 < 1:
            raise ValueError('factor must be a positive integer.')

        arg_2 = ['Func', '{}'.format(arg_1)]

        arg_0.effects.extend(arg_2)
        arg_0.effects_log.append('Func')
        return arg_0

Downsample the signal by an integer factor . Only the first out of each factor samples is retained the others are discarded .


def Func ( arg_0 ) : for arg_1 in arg_0 : if isinstance ( arg_1 , pyflakes . messages . UnusedVariable ) : yield arg_1 . lineno

def Func(arg_0):
    """Yield line numbers of unused variables."""
    for arg_1 in arg_0:
        if isinstance(arg_1, pyflakes.messages.UnusedVariable):
            yield arg_1.lineno

Yield line numbers of unused variables .


def Func(arg_0, arg_1, arg_2=None, **arg_3):
        """Subscribe to the passed pair's OHLC data channel.

        :param pair: str, Symbol pair to request data for
        :param timeframe: str, {1m, 5m, 15m, 30m, 1h, 3h, 6h, 12h,
                                1D, 7D, 14D, 1M}
        :param kwargs:
        :return:
        """

        arg_4 = ['1m', '5m', '15m', '30m', '1h', '3h', '6h', '12h', '1D',
                     '7D', '14D', '1M']
        if arg_2:
            if arg_2 not in arg_4:
                raise ValueError("timeframe must be any of %s" % arg_4)
        else:
            arg_2 = '1m'
        arg_5 = ('candles', arg_1, arg_2)
        arg_1 = 't' + arg_1 if not arg_1.startswith('t') else arg_1
        arg_6 = 'trade:' + arg_2 + ':' + arg_1
        arg_0._subscribe('candles', arg_5, arg_6=arg_6, **arg_3)

Subscribe to the passed pair s OHLC data channel .


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = arg_0 . db . Func ( ) except Exception as e : arg_4 = error . wrap_exception ( ) else : arg_4 = dict ( status = 'ok' , history = arg_3 ) arg_0 . session . send ( arg_0 . query , "history_reply" , arg_4 = arg_4 , parent = arg_2 , ident = arg_1 )

def Func(arg_0, arg_1, arg_2):
        """Get a list of all msg_ids in our DB records"""
        try:
            arg_3 = arg_0.db.Func()
        except Exception as e:
            arg_4 = error.wrap_exception()
        else:
            arg_4 = dict(status='ok', history=arg_3)

        arg_0.session.send(arg_0.query, "history_reply", arg_4=arg_4,
                                            parent=arg_2, ident=arg_1)


def Func ( arg_0 , arg_1 , arg_2 = arg_3 ) : if arg_0 . HasParam ( arg_1 ) : return arg_0 . Func ( arg_1 ) else : if arg_2 == arg_3 : raise KeyError else : return arg_2

def Func(arg_0, arg_1, arg_2=arg_3):
    """ Convenience function for accessing tag parameters"""
    if arg_0.HasParam(arg_1):
        return arg_0.Func(arg_1)
    else:
        if arg_2 == arg_3:
            raise KeyError
        else:
            return arg_2


def Func ( arg_0 , arg_1 ) : arg_2 = os . path . join ( arg_0 . dirs . refmapping , arg_1 . name + "-mapped-sorted.bam" ) arg_3 = os . path . join ( arg_0 . dirs . refmapping , arg_1 . name + "-unmapped.bam" ) arg_4 = [ ipyrad . bins . samtools , "flagstat" , arg_3 ] arg_5 = sps . Popen ( arg_4 , stderr = sps . STDOUT , stdout = sps . PIPE ) arg_6 = arg_5 . communicate ( ) [ 0 ] arg_7 = [ ipyrad . bins . samtools , "flagstat" , arg_2 ] arg_8 = sps . Popen ( arg_7 , stderr = sps . STDOUT , stdout = sps . PIPE ) arg_9 = arg_8 . communicate ( ) [ 0 ] if "pair" in arg_0 . paramsdict [ "datatype" ] : arg_1 . stats [ "refseq_unmapped_reads" ] = int ( arg_6 . split ( ) [ 0 ] ) / 2 arg_1 . stats [ "refseq_mapped_reads" ] = int ( arg_9 . split ( ) [ 0 ] ) / 2 else : arg_1 . stats [ "refseq_unmapped_reads" ] = int ( arg_6 . split ( ) [ 0 ] ) arg_1 . stats [ "refseq_mapped_reads" ] = int ( arg_9 . split ( ) [ 0 ] ) sample_cleanup ( arg_0 , arg_1 )

def Func(arg_0, arg_1):
    """
    Get the number of mapped and unmapped reads for a sample
    and update sample.stats
    """
    ## shorter names
    arg_2 = os.path.join(arg_0.dirs.refmapping, arg_1.name+"-mapped-sorted.bam")
    arg_3 = os.path.join(arg_0.dirs.refmapping, arg_1.name+"-unmapped.bam")

    ## get from unmapped
    arg_4 = [ipyrad.bins.samtools, "flagstat", arg_3]
    arg_5 = sps.Popen(arg_4, stderr=sps.STDOUT, stdout=sps.PIPE)
    arg_6 = arg_5.communicate()[0]

    ## get from mapped
    arg_7 = [ipyrad.bins.samtools, "flagstat", arg_2]
    arg_8 = sps.Popen(arg_7, stderr=sps.STDOUT, stdout=sps.PIPE)
    arg_9 = arg_8.communicate()[0]

    ## store results
    ## If PE, samtools reports the _actual_ number of reads mapped, both
    ## R1 and R2, so here if PE divide the results by 2 to stay consistent
    ## with how we've been reporting R1 and R2 as one "read pair"
    if "pair" in arg_0.paramsdict["datatype"]:
        arg_1.stats["refseq_unmapped_reads"] = int(arg_6.split()[0]) / 2
        arg_1.stats["refseq_mapped_reads"] = int(arg_9.split()[0]) / 2
    else:
        arg_1.stats["refseq_unmapped_reads"] = int(arg_6.split()[0])
        arg_1.stats["refseq_mapped_reads"] = int(arg_9.split()[0])

    sample_cleanup(arg_0, arg_1)

Get the number of mapped and unmapped reads for a sample and update sample . stats


return self.known.get(pk) or self.wknown.get(pk)

def Func ( arg_0 , arg_1 ) : arg_0 . _init ( ) return arg_0 . known . Func ( arg_1 ) or arg_0 . wknown . Func ( arg_1 )

def Func(arg_0, arg_1):
        '''
        Fetches an entity from the session based on primary key.
        '''
        arg_0._init()
        return arg_0.known.Func(arg_1) or arg_0.wknown.Func(arg_1)

Fetches an entity from the session based on primary key .


def
Func
(
arg_0
)
:
if
os
.
path
.
exists
(
arg_0
)
:
logger
.
debug
(
"Found pipeline file: {}"
.
format
(
arg_0
)
)
with
open
(
arg_0
)
as
fh
:
arg_0
=
""
.
join
(
[
x
.
strip
(
)
for
x
in
fh
.
readlines
(
)
]
)
logger
.
info
(
colored_print
(
"Resulting pipeline string:\n"
)
)
logger
.
info
(
colored_print
(
arg_0
+
"\n"
)
)
insanity_checks
(
arg_0
)
logger
.
debug
(
"Parsing pipeline string: {}"
.
format
(
arg_0
)
)
arg_1
=
[
]
arg_2
=
1
arg_3
,
arg_4
=
add_unique_identifiers
(
arg_0
)
arg_5
=
arg_3
.
count
(
FORK_TOKEN
)
logger
.
debug
(
"Found {} fork(s)"
.
format
(
arg_5
)
)
if
not
arg_5
:
logger
.
debug
(
"Detected linear pipeline string : {}"
.
format
(
arg_0
)
)
arg_6
=
[
"__init__"
]
+
arg_3
.
split
(
)
arg_1
.
extend
(
linear_connection
(
arg_6
,
arg_2
)
)
arg_1
=
remove_unique_identifiers
(
arg_4
,
arg_1
)
return
arg_1
for
arg_7
in
range
(
arg_5
)
:
logger
.
debug
(
"Processing fork {} in lane {}"
.
format
(
arg_7
,
arg_2
)
)
arg_8
=
arg_3
.
split
(
FORK_TOKEN
,
arg_7
+
1
)
arg_9
=
arg_8
[
2
]
.
split
(
LANE_TOKEN
)
[
1
]
.
split
(
)
logger
.
debug
(
"Previous processes string: {}"
.
format
(
arg_8
[
2
]
)
)
logger
.
debug
(
"Previous processes list: {}"
.
format
(
arg_9
)
)
arg_10
=
get_lanes
(
arg_8
[
1
]
)
logger
.
debug
(
"Next lanes object: {}"
.
format
(
arg_10
)
)
arg_11
=
[
x
[
0
]
for
x
in
arg_10
]
logger
.
debug
(
"The fork sinks into the processes: {}"
.
format
(
arg_11
)
)
if
arg_7
==
0
:
if
not
arg_9
:
arg_9
=
[
"__init__"
]
arg_2
=
0
else
:
arg_9
=
[
"__init__"
]
+
arg_9
arg_1
.
extend
(
linear_connection
(
arg_9
,
arg_2
)
)
arg_12
=
arg_9
[
1
]
logger
.
debug
(
"Fork source is set to: {}"
.
format
(
arg_12
)
)
arg_13
=
get_source_lane
(
arg_9
,
arg_1
)
logger
.
debug
(
"Fork lane is set to: {}"
.
format
(
arg_13
)
)
arg_1
.
extend
(
fork_connection
(
arg_12
,
arg_11
,
arg_13
,
arg_2
)
)
arg_1
.
extend
(
linear_lane_connection
(
arg_10
,
arg_2
)
)
arg_2
+=
len
(
arg_11
)
arg_1
=
remove_unique_identifiers
(
arg_4
,
arg_1
)
return
arg_1

def Func(arg_0):
    """Parses a pipeline string into a list of dictionaries with the connections
     between processes

    Parameters
    ----------
    pipeline_str : str
        String with the definition of the pipeline, e.g.::
            'processA processB processC(ProcessD | ProcessE)'

    Returns
    -------
    pipeline_links : list

    """

    if os.path.exists(arg_0):
        logger.debug("Found pipeline file: {}".format(arg_0))
        with open(arg_0) as fh:
            arg_0 = "".join([x.strip() for x in fh.readlines()])

    logger.info(colored_print("Resulting pipeline string:\n"))
    logger.info(colored_print(arg_0 + "\n"))

    # Perform pipeline insanity checks
    insanity_checks(arg_0)

    logger.debug("Parsing pipeline string: {}".format(arg_0))

    arg_1 = []
    arg_2 = 1

    # Add unique identifiers to each process to allow a correct connection
    # between forks with same processes
    arg_3, arg_4 = add_unique_identifiers(
        arg_0)

    # Get number of forks in the pipeline
    arg_5 = arg_3.count(FORK_TOKEN)
    logger.debug("Found {} fork(s)".format(arg_5))

    # If there are no forks, connect the pipeline as purely linear
    if not arg_5:
        logger.debug("Detected linear pipeline string : {}".format(
            arg_0))
        arg_6 = ["__init__"] + arg_3.split()
        arg_1.extend(linear_connection(arg_6, arg_2))
        # Removes unique identifiers used for correctly assign fork parents with
        #  a possible same process name
        arg_1 = remove_unique_identifiers(arg_4,
                                                   arg_1)
        return arg_1

    for arg_7 in range(arg_5):

        logger.debug("Processing fork {} in lane {}".format(arg_7, arg_2))
        # Split the pipeline at each fork start position. fields[-1] will
        # hold the process after the fork. fields[-2] will hold the processes
        # before the fork.
        arg_8 = arg_3.split(FORK_TOKEN, arg_7 + 1)

        # Get the processes before the fork. This may be empty when the
        # fork is at the beginning of the pipeline.
        arg_9 = arg_8[-2].split(LANE_TOKEN)[-1].split()
        logger.debug("Previous processes string: {}".format(arg_8[-2]))
        logger.debug("Previous processes list: {}".format(arg_9))
        # Get lanes after the fork
        arg_10 = get_lanes(arg_8[-1])
        logger.debug("Next lanes object: {}".format(arg_10))
        # Get the immediate targets of the fork
        arg_11 = [x[0] for x in arg_10]
        logger.debug("The fork sinks into the processes: {}".format(arg_11))

        # The first fork is a special case, where the processes before AND
        # after the fork (until the start of another fork) are added to
        # the ``pipeline_links`` variable. Otherwise, only the processes
        # after the fork will be added
        if arg_7 == 0:
            # If there are no previous process, the fork is at the beginning
            # of the pipeline string. In this case, inject the special
            # "init" process.
            if not arg_9:
                arg_9 = ["__init__"]
                arg_2 = 0
            else:
                arg_9 = ["__init__"] + arg_9

            # Add the linear modules before the fork
            arg_1.extend(
                linear_connection(arg_9, arg_2))

        arg_12 = arg_9[-1]
        logger.debug("Fork source is set to: {}".format(arg_12))
        arg_13 = get_source_lane(arg_9, arg_1)
        logger.debug("Fork lane is set to: {}".format(arg_13))
        # Add the forking modules
        arg_1.extend(
            fork_connection(arg_12, arg_11, arg_13, arg_2))
        # Add the linear connections in the subsequent lanes
        arg_1.extend(
            linear_lane_connection(arg_10, arg_2))

        arg_2 += len(arg_11)

    arg_1 = remove_unique_identifiers(arg_4,
                                               arg_1)
    return arg_1


def Func(arg_0, arg_1):
        """Create a new sender link."""
        arg_2 = arg_0._pn_session.sender(arg_1)
        return arg_0.request_sender(arg_2)


def Func ( arg_0 ) : if arg_0 . stacked : return arg_0 . _boundaries = bounds = np . r_ [ 0 , np . cumsum ( arg_0 . n_pts ) ] arg_0 . stacked_features = arg_4 = np . vstack ( arg_0 . features ) arg_0 . features = np . array ( [ arg_4 [ bounds [ i - 1 ] : bounds [ i ] ] for i in xrange ( 1 , len ( bounds ) ) ] , dtype = object ) arg_0 . stacked = True

def Func(arg_0):
        "If unstacked, convert to stacked. If stacked, do nothing."
        if arg_0.stacked:
            return

        arg_0._boundaries = bounds = np.r_[0, np.cumsum(arg_0.n_pts)]
        arg_0.stacked_features = arg_4 = np.vstack(arg_0.features)
        arg_0.features = np.array(
            [arg_4[bounds[i-1]:bounds[i]] for i in xrange(1, len(bounds))],
            dtype=object)
        arg_0.stacked = True

If unstacked convert to stacked . If stacked do nothing .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : with tf . compat . v1 . name_scope ( arg_2 , 'Func' , [ arg_0 , arg_1 ] ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_2 = 'x' ) if arg_1 is None : if arg_0 . dtype . base_dtype == tf . string : arg_1 = '' else : arg_1 = arg_0 . dtype . as_numpy_dtype ( 0 ) arg_1 = tf . cast ( arg_1 , arg_0 . dtype , arg_2 = 'ignore_value' ) arg_3 = tf . where ( tf . not_equal ( arg_0 , arg_1 ) , arg_2 = 'indices' ) return tf . SparseTensor ( arg_3 = arg_3 , values = tf . gather_nd ( arg_0 , arg_3 , arg_2 = 'values' ) , dense_shape = tf . shape ( input = arg_0 , out_type = tf . int64 , arg_2 = 'dense_shape' ) )

def Func(arg_0, arg_1=None, arg_2=None):
  """Converts dense `Tensor` to `SparseTensor`, dropping `ignore_value` cells.

  Args:
    x: A `Tensor`.
    ignore_value: Entries in `x` equal to this value will be
      absent from the return `SparseTensor`. If `None`, default value of
      `x` dtype will be used (e.g. '' for `str`, 0 for `int`).
    name: Python `str` prefix for ops created by this function.

  Returns:
    sparse_x: A `tf.SparseTensor` with the same shape as `x`.

  Raises:
    ValueError: when `x`'s rank is `None`.
  """
  # Copied (with modifications) from:
  # tensorflow/contrib/layers/python/ops/sparse_ops.py.
  with tf.compat.v1.name_scope(arg_2, 'Func', [arg_0, arg_1]):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_2='x')
    if arg_1 is None:
      if arg_0.dtype.base_dtype == tf.string:
        # Exception due to TF strings are converted to numpy objects by default.
        arg_1 = ''
      else:
        arg_1 = arg_0.dtype.as_numpy_dtype(0)
      arg_1 = tf.cast(arg_1, arg_0.dtype, arg_2='ignore_value')
    arg_3 = tf.where(tf.not_equal(arg_0, arg_1), arg_2='indices')
    return tf.SparseTensor(
        arg_3=arg_3,
        values=tf.gather_nd(arg_0, arg_3, arg_2='values'),
        dense_shape=tf.shape(input=arg_0, out_type=tf.int64, arg_2='dense_shape'))

Converts dense Tensor to SparseTensor dropping ignore_value cells .


def Func(arg_0):
    ''' get the command to start the topology health manager processes '''
    arg_1 = 'org.apache.heron.healthmgr.HealthManager'

    arg_2 = [os.path.join(arg_0.heron_java_home, 'bin/java'),
                     # We could not rely on the default -Xmx setting, which could be very big,
                     # for instance, the default -Xmx in Twitter mesos machine is around 18GB
                     '-Xmx1024M',
                     '-XX:+PrintCommandLineFlags',
                     '-verbosegc',
                     '-XX:+PrintGCDetails',
                     '-XX:+PrintGCTimeStamps',
                     '-XX:+PrintGCDateStamps',
                     '-XX:+PrintGCCause',
                     '-XX:+UseGCLogFileRotation',
                     '-XX:NumberOfGCLogFiles=5',
                     '-XX:GCLogFileSize=100M',
                     '-XX:+PrintPromotionFailure',
                     '-XX:+PrintTenuringDistribution',
                     '-XX:+PrintHeapAtGC',
                     '-XX:+HeapDumpOnOutOfMemoryError',
                     '-XX:+UseConcMarkSweepGC',
                     '-XX:+PrintCommandLineFlags',
                     '-Xloggc:log-files/gc.healthmgr.log',
                     '-Djava.net.preferIPv4Stack=true',
                     '-cp', arg_0.health_manager_classpath,
                     arg_1,
                     "--cluster", arg_0.cluster,
                     "--role", arg_0.role,
                     "--environment", arg_0.environment,
                     "--topology_name", arg_0.topology_name,
                     "--metricsmgr_port", arg_0.metrics_manager_port]

    return Command(arg_2, arg_0.shell_env)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
if
arg_1
in
(
'__builtin__'
,
'__builtins__'
)
:
raise
ValueError
(
"Refusing to delete %s"
%
arg_1
)
arg_3
=
arg_0
.
all_ns_refs
if
arg_2
:
for
arg_4
in
arg_3
:
try
:
del
arg_4
[
arg_1
]
except
KeyError
:
pass
else
:
try
:
arg_5
=
arg_0
.
user_ns
[
arg_1
]
except
KeyError
:
raise
NameError
(
"name '%s' is not defined"
%
arg_1
)
arg_3
.
append
(
arg_0
.
history_manager
.
output_hist
)
for
arg_4
in
arg_3
:
arg_6
=
[
n
for
n
,
o
in
arg_4
.
iteritems
(
)
if
o
is
arg_5
]
for
arg_7
in
arg_6
:
del
arg_4
[
arg_7
]
for
arg_7
in
(
'_'
,
'__'
,
'___'
)
:
if
getattr
(
arg_0
.
displayhook
,
arg_7
)
is
arg_5
:
setattr
(
arg_0
.
displayhook
,
arg_7
,
)

def Func(arg_0, arg_1, arg_2=False):
        """Delete a variable from the various namespaces, so that, as
        far as possible, we're not keeping any hidden references to it.

        Parameters
        ----------
        varname : str
            The name of the variable to delete.
        by_name : bool
            If True, delete variables with the given name in each
            namespace. If False (default), find the variable in the user
            namespace, and delete references to it.
        """
        if arg_1 in ('__builtin__', '__builtins__'):
            raise ValueError("Refusing to delete %s" % arg_1)

        arg_3 = arg_0.all_ns_refs

        if arg_2:                    # Delete by name
            for arg_4 in arg_3:
                try:
                    del arg_4[arg_1]
                except KeyError:
                    pass
        else:                         # Delete by object
            try:
                arg_5 = arg_0.user_ns[arg_1]
            except KeyError:
                raise NameError("name '%s' is not defined" % arg_1)
            # Also check in output history
            arg_3.append(arg_0.history_manager.output_hist)
            for arg_4 in arg_3:
                arg_6 = [n for n, o in arg_4.iteritems() if o is arg_5]
                for arg_7 in arg_6:
                    del arg_4[arg_7]

            # displayhook keeps extra references, but not in a dictionary
            for arg_7 in ('_', '__', '___'):
                if getattr(arg_0.displayhook, arg_7) is arg_5:
                    setattr(arg_0.displayhook, arg_7, None)

Delete a variable from the various namespaces so that as far as possible we re not keeping any hidden references to it .


def
Func
(
arg_0
,
arg_1
)
:
if
not
is_uri
(
arg_1
)
:
raise
ValueError
(
'%s is not a valid URI.'
%
arg_1
)
arg_2
=
[
arg_3
for
arg_3
in
arg_0
.
concept_scheme_uri_map
.
keys
(
)
if
arg_1
.
startswith
(
arg_3
)
]
for
arg_3
in
arg_2
:
arg_4
=
arg_0
.
get_provider
(
arg_3
)
.
Func
(
arg_1
)
if
arg_4
:
return
arg_4
for
arg_5
in
arg_0
.
providers
.
values
(
)
:
arg_4
=
arg_5
.
Func
(
arg_1
)
if
arg_4
:
return
arg_4
return
False

def Func(arg_0, arg_1):
        '''Get a concept or collection by its uri.

        Returns a single concept or collection if one exists with this uri.
        Returns False otherwise.

        :param string uri: The uri to find a concept or collection for.
        :raises ValueError: The uri is invalid.
        :rtype: :class:`skosprovider.skos.Concept` or
            :class:`skosprovider.skos.Collection`
        '''
        if not is_uri(arg_1):
            raise ValueError('%s is not a valid URI.' % arg_1)
        # Check if there's a provider that's more likely to have the URI
        arg_2 = [arg_3 for arg_3 in arg_0.concept_scheme_uri_map.keys() if arg_1.startswith(arg_3)]
        for arg_3 in arg_2:
            arg_4 = arg_0.get_provider(arg_3).Func(arg_1)
            if arg_4:
                return arg_4
        # Check all providers
        for arg_5 in arg_0.providers.values():
            arg_4 = arg_5.Func(arg_1)
            if arg_4:
                return arg_4
        return False

Get a concept or collection by its uri .


return categories_available - categories_held

def Func ( arg_0 ) : arg_1 = user_for_context ( arg_0 ) arg_2 = set ( CategoryController . available_categories ( arg_1 ) ) arg_3 = ItemController ( arg_1 ) . items_pending_or_purchased ( ) arg_4 = set ( ) for arg_5 , arg_6 in arg_3 : arg_4 . add ( arg_5 . category ) return arg_2 - arg_4

def Func(arg_0):
    ''' Adds the categories that the user does not currently have. '''
    arg_1 = user_for_context(arg_0)
    arg_2 = set(CategoryController.available_categories(arg_1))
    arg_3 = ItemController(arg_1).items_pending_or_purchased()

    arg_4 = set()

    for arg_5, arg_6 in arg_3:
        arg_4.add(arg_5.category)

    return arg_2 - arg_4

Adds the categories that the user does not currently have .


def Func(arg_0, arg_1):
    """This function will check whether a PID is currently running"""
    try:
        # A Kill of 0 is to check if the PID is active. It won't kill the process
        os.kill(arg_0, 0)
        if arg_1 > 1:
            print("Script has a PIDFILE where the process is still running")
        return True
    except OSError:
        if arg_1 > 1:
            print("Script does not appear to be running")
        return False


def Func(arg_0, *arg_1):
        """Retrieve Func.

        :params phids: list of Func identifiers
        """
        arg_2 = {
            arg_0.PHIDS: arg_1
        }

        arg_3 = arg_0._call(arg_0.PHAB_USERS, arg_2)

        return arg_3

Retrieve users.

        :params phids: list of users identifiers


def Func ( arg_0 ) : arg_1 = arg_0 . cleaned_data [ 'channel_worker_username' ] . strip ( ) try : User . objects . get ( username = arg_1 ) except User . DoesNotExist : raise ValidationError ( ValidationMessages . INVALID_CHANNEL_WORKER . format ( arg_1 = arg_1 ) ) return arg_1

def Func(arg_0):
        """
        Clean enterprise channel worker user form field

        Returns:
            str: the cleaned value of channel user username for transmitting courses metadata.
        """
        arg_1 = arg_0.cleaned_data['channel_worker_username'].strip()

        try:
            User.objects.get(username=arg_1)
        except User.DoesNotExist:
            raise ValidationError(
                ValidationMessages.INVALID_CHANNEL_WORKER.format(
                    arg_1=arg_1
                )
            )

        return arg_1


(self, x, y, max_distance=1e-4,
                                     raise_if_too_far_away=True)

def Func(arg_0, arg_1, arg_2, arg_3=1e-4,
                                     arg_4=True):
        """
        Set the first point of the exterior to the given point based on its coordinates.

        If multiple points are found, the closest one will be picked.
        If no matching points are found, an exception is raised.

        Note: This method does *not* work in-place.

        Parameters
        ----------
        x : number
            X-coordinate of the point.

        y : number
            Y-coordinate of the point.

        max_distance : None or number, optional
            Maximum distance past which possible matches are ignored.
            If ``None`` the distance limit is deactivated.

        raise_if_too_far_away : bool, optional
            Whether to raise an exception if the closest found point is too
            far away (``True``) or simply return an unchanged copy if this
            object (``False``).

        Returns
        -------
        imgaug.Polygon
            Copy of this polygon with the new point order.

        """
        if len(arg_0.exterior) == 0:
            raise Exception("Cannot reorder polygon points, because it contains no points.")

        arg_5, arg_6 = arg_0.find_closest_point_index(arg_1=arg_1, arg_2=arg_2, return_distance=True)
        if arg_3 is not None and arg_6 > arg_3:
            if not arg_4:
                return arg_0.deepcopy()

            arg_7 = arg_0.exterior[arg_5, :]
            raise Exception(
                "Closest found point (%.9f, %.9f) exceeds max_distance of %.9f exceeded" % (
                    arg_7[0], arg_7[1], arg_6)
            )
        return arg_0.change_first_point_by_index(arg_5)

Set the first point of the exterior to the given point based on its coordinates .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
)
:
arg_1
=
pass_white
(
arg_0
,
arg_1
)
arg_3
=
arg_1
if
not
arg_3
<
len
(
arg_0
)
:
if
arg_2
:
raise
SyntaxError
(
'Missing identifier!'
)
return
if
arg_0
[
arg_3
]
not
in
IDENTIFIER_START
:
if
arg_2
:
raise
SyntaxError
(
'Invalid identifier start: "%s"'
%
arg_0
[
arg_3
]
)
return
arg_3
+=
1
while
arg_3
<
len
(
arg_0
)
and
arg_0
[
arg_3
]
in
IDENTIFIER_PART
:
arg_3
+=
1
if
not
is_valid_lval
(
arg_0
[
arg_1
:
arg_3
]
)
:
if
arg_2
:
raise
SyntaxError
(
'Invalid identifier name: "%s"'
%
arg_0
[
arg_1
:
arg_3
]
)
return
return
arg_0
[
arg_1
:
arg_3
]
,
arg_3

def Func(arg_0, arg_1, arg_2=True):
    """passes white space from start and returns first identifier,
       if identifier invalid and throw raises SyntaxError otherwise returns None"""
    arg_1 = pass_white(arg_0, arg_1)
    arg_3 = arg_1
    if not arg_3 < len(arg_0):
        if arg_2:
            raise SyntaxError('Missing identifier!')
        return None
    if arg_0[arg_3] not in IDENTIFIER_START:
        if arg_2:
            raise SyntaxError('Invalid identifier start: "%s"' % arg_0[arg_3])
        return None
    arg_3 += 1
    while arg_3 < len(arg_0) and arg_0[arg_3] in IDENTIFIER_PART:
        arg_3 += 1
    if not is_valid_lval(arg_0[arg_1:arg_3]):
        if arg_2:
            raise SyntaxError(
                'Invalid identifier name: "%s"' % arg_0[arg_1:arg_3])
        return None
    return arg_0[arg_1:arg_3], arg_3

passes white space from start and returns first identifier if identifier invalid and throw raises SyntaxError otherwise returns None


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if isinstance ( arg_1 , int ) : arg_4 = str ( arg_1 ) elif isinstance ( arg_1 , basestring ) : arg_4 = arg_1 else : arg_4 = arg_1 . number arg_5 = arg_0 . _issue_data_key ( arg_2 ) arg_6 = arg_0 . _issue_data_key ( arg_3 ) arg_7 = arg_0 . data . get ( arg_5 , { } ) arg_8 = arg_0 . data . get ( arg_6 , { } ) arg_9 = arg_7 . pop ( arg_4 , None ) if arg_9 : arg_8 [ arg_4 ] = arg_9 arg_0 . data [ arg_6 ] = arg_8 arg_0 . data [ arg_5 ] = arg_7

def Func(arg_0, arg_1, arg_2, arg_3):
        """Moves an issue_data from one namespace to another."""

        if isinstance(arg_1, int):
            arg_4 = str(arg_1)
        elif isinstance(arg_1, basestring):
            arg_4 = arg_1
        else:
            arg_4 = arg_1.number

        arg_5 = arg_0._issue_data_key(arg_2)
        arg_6 = arg_0._issue_data_key(arg_3)
        arg_7 = arg_0.data.get(arg_5,
            {})
        arg_8 = arg_0.data.get(arg_6,
            {})

        arg_9 = arg_7.pop(arg_4, None)
        if arg_9:
            arg_8[arg_4] = arg_9

        arg_0.data[arg_6] = arg_8
        arg_0.data[arg_5] = arg_7

Moves an issue_data from one namespace to another .


def Func(arg_0, arg_1):
        """Parse an assembly fasta file.

        This is a Fasta parsing method that populates the
        :py:attr:`~Assembly.contigs` attribute with data for each contig in the
        assembly.

        The insertion of data on the self.contigs is done by the
        :py:meth:`Assembly._populate_contigs` method, which also calculates
        GC content and proportions.

        Parameters
        ----------
        assembly_file : str
            Path to the assembly fasta file.

        """

        # Temporary storage of sequence data
        arg_2 = []
        # Id counter for contig that will serve as key in self.contigs
        arg_3 = 0
        # Initialize kmer coverage and header
        arg_4, arg_5 = None, None

        with open(arg_1) as fh:

            logger.debug("Starting iteration of assembly file: {}".format(
                arg_1))
            for arg_6 in fh:
                # Skip empty lines
                if not arg_6.strip():
                    continue
                else:
                    # Remove whitespace surrounding line for further processing
                    arg_6 = arg_6.strip()

                if arg_6.startswith(">"):
                    # If a sequence has already been populated, save the
                    # previous contig information
                    if arg_2:
                        # Use join() to convert string list into the full
                        # contig string. This is generally much more efficient
                        # than successively concatenating strings.
                        arg_7 = "".join(arg_2)

                        logger.debug("Populating contig with contig_id '{}', "
                                     "header '{}' and cov '{}'".format(
                                        arg_3, arg_5, arg_4))
                        arg_0._populate_contigs(arg_3, arg_5, arg_4, arg_7)

                        # Reset temporary sequence storage
                        arg_2 = []
                        arg_3 += 1

                    arg_5 = arg_6[1:]
                    arg_4 = arg_0._parse_coverage(arg_6)

                else:
                    arg_2.append(arg_6)

            # Populate last contig entry
            logger.debug("Populating contig with contig_id '{}', "
                         "header '{}' and cov '{}'".format(
                            arg_3, arg_5, arg_4))
            arg_7 = "".join(arg_2)
            arg_0._populate_contigs(arg_3, arg_5, arg_4, arg_7)


(ctx, app_id, sentence_file,
           json_flag, sentence, doc_time, request_id)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
arg_1
=
clean_app_id
(
arg_1
)
arg_4
=
clean_sentence
(
arg_4
,
arg_2
)
arg_7
=
GoolabsAPI
(
arg_1
)
arg_8
=
arg_7
.
Func
(
arg_4
=
arg_4
,
arg_5
=
arg_5
,
arg_6
=
arg_6
,
)
if
arg_3
:
click
.
echo
(
format_json
(
arg_7
.
response
.
json
(
)
)
)
return
for
arg_9
in
arg_8
[
'datetime_list'
]
:
click
.
echo
(
u'{0}: {1}'
.
format
(
text
(
arg_9
[
0
]
)
,
arg_9
[
1
]
)
)

def Func(arg_0, arg_1, arg_2,
           arg_3, arg_4, arg_5, arg_6):
    # type: (Context, unicode, Optional[IO], bool, unicode, unicode, unicode) -> None  # NOQA
    """Extract expression expressing date and time and normalize its value """

    arg_1 = clean_app_id(arg_1)
    arg_4 = clean_sentence(arg_4, arg_2)

    arg_7 = GoolabsAPI(arg_1)
    arg_8 = arg_7.Func(
        arg_4=arg_4,
        arg_5=arg_5,
        arg_6=arg_6,
    )

    if arg_3:
        click.echo(format_json(arg_7.response.json()))
        return

    for arg_9 in arg_8['datetime_list']:
        click.echo(u'{0}: {1}'.format(text(arg_9[0]), arg_9[1]))


return [
            self.format_metric_string(m_name, getattr(metric, key), m_type)
            for key in keys
        ]

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Serialize and send available measures of a metric."""

        return [
            arg_0.format_metric_string(arg_2, getattr(arg_1, arg_5), arg_4)
            for arg_5 in arg_3
        ]

Serialize and send available measures of a metric .


def Func ( arg_0 , arg_1 ) : from airflow . models . dagrun import DagRun arg_2 = arg_1 . query ( DagRun ) . filter ( DagRun . dag_id == arg_0 . dag_id , DagRun . execution_date == arg_0 . execution_date ) . first ( ) return arg_2

def Func(arg_0, arg_1):
        """
        Returns the DagRun for this TaskInstance

        :param session:
        :return: DagRun
        """
        from airflow.models.dagrun import DagRun  # Avoid circular import
        arg_2 = arg_1.query(DagRun).filter(
            DagRun.dag_id == arg_0.dag_id,
            DagRun.execution_date == arg_0.execution_date
        ).first()

        return arg_2