def Func(arg_0, arg_1):
        """Register an io-handler with the glib main loop."""
        if arg_0.check_events():
            return
        if arg_1 in arg_0._unprepared_handlers:
            arg_2 = arg_0._unprepared_handlers[arg_1]
            arg_3 = arg_0._prepare_io_handler(arg_1)
        else:
            arg_2 = None
            arg_3 = True
        arg_4 = arg_1.fileno()
        if arg_2 is not None and arg_4 != arg_2:
            arg_5 = arg_0._io_sources.pop(arg_1, None)
            if arg_5 is not None:
                glib.source_remove(arg_5)
        if not arg_3:
            arg_0._unprepared_handlers[arg_1] = arg_4
        if arg_4 is None:
            logger.debug(" {0!r}.fileno() is None, not polling"
                                                    .format(arg_1))
            return
        arg_7 = 0
        if arg_1.is_readable():
            logger.debug(" {0!r} readable".format(arg_1))
            arg_7 |= glib.IO_IN | glib.IO_ERR
        if arg_1.is_writable():
            logger.debug(" {0!r} writable".format(arg_1))
            arg_7 |= glib.IO_OUT | glib.IO_HUP | glib.IO_ERR
        if arg_7:
            logger.debug(" registering {0!r} handler fileno {1} for"
                            " events {2}".format(arg_1, arg_4, arg_7))
            glib.io_add_watch(arg_4, arg_7, arg_0._io_callback, arg_1)

Register an io - handler with the glib main loop .


def
Func
(
arg_0
,
arg_1
)
:
logger
.
debug
(
'Fetching DOE CODE JSON: %s'
,
arg_0
)
if
arg_1
is
:
raise
ValueError
(
'DOE CODE API Key value is missing!'
)
arg_2
=
requests
.
get
(
arg_0
,
headers
=
{
"Authorization"
:
"Basic "
+
arg_1
}
)
arg_3
=
arg_2
.
json
(
)
for
arg_4
in
arg_3
[
'records'
]
:
yield
arg_4

def Func(arg_0, arg_1):
    """
    Yields DOE CODE records from a DOE CODE .json URL response
    Converts a DOE CODE API .json URL response into DOE CODE projects
    """

    logger.debug('Fetching DOE CODE JSON: %s', arg_0)

    if arg_1 is None:
        raise ValueError('DOE CODE API Key value is missing!')

    arg_2 = requests.get(arg_0, headers={"Authorization": "Basic " + arg_1})
    arg_3 = arg_2.json()

    for arg_4 in arg_3['records']:
        yield arg_4

Yields DOE CODE records from a DOE CODE . json URL response Converts a DOE CODE API . json URL response into DOE CODE projects


(self, grad, do_correct_damping=True, subblock=None)

def Func(arg_0, arg_1, arg_2=True, arg_3=None):
        """
        Calculates LM updates, with or without the acceleration correction.

        Parameters
        ----------
            grad : numpy.ndarray
                The gradient of the model cost.
            do_correct_damping : Bool, optional
                If `self.use_accel`, then set to True to correct damping
                if the acceleration correction is too big. Default is True
                Does nothing is `self.use_accel` is False
            subblock : slice, numpy.ndarray, or None, optional
                Set to a slice or a valide numpy.ndarray to use only a
                certain subset of the parameters. Default is None, i.e.
                use all the parameters.

        Returns
        -------
            delta : numpy.ndarray
                The Levenberg-Marquadt step, relative to the old
                parameters. Size is always self.param_vals.size.
        """
        if arg_3 is not None:
            if (arg_3.sum() == 0) or (arg_3.size == 0):
                CLOG.fatal('Empty subblock in Func')
                raise ValueError('Empty sub-block')
            arg_4 = arg_0.J[arg_3]
            arg_5 = np.dot(arg_4, arg_4.T)
            arg_6 = arg_0._calc_damped_jtj(arg_5, arg_3=arg_3)
            arg_1 = arg_1[arg_3]  #select the subblock of the grad
        else:
            arg_6 = arg_0._calc_damped_jtj(arg_0.JTJ, arg_3=arg_3)

        arg_7 = arg_0._calc_lm_step(arg_6, arg_1, arg_3=arg_3)

        if arg_0.use_accel:
            arg_8 = arg_0.calc_accel_correction(arg_6, arg_7)
            arg_9 = np.sqrt(np.sum(arg_7**2))
            arg_10 = np.sqrt(np.sum(arg_8**2))
            CLOG.debug('|correction| / |LM step|\t%e' % (arg_10/arg_9))
            if arg_10/arg_9 < arg_0.max_accel_correction:
                arg_7 += arg_8
            elif arg_2:
                CLOG.debug('Untrustworthy step! Increasing damping...')
                arg_0.increase_damping()
                arg_6 = arg_0._calc_damped_jtj(arg_0.JTJ, arg_3=arg_3)
                arg_7 = arg_0._calc_lm_step(arg_6, arg_1, arg_3=arg_3)

        if np.any(np.isnan(arg_7)):
            CLOG.fatal('Calculated steps have nans!?')
            raise FloatingPointError('Calculated steps have nans!?')
        return arg_7

Calculates LM updates with or without the acceleration correction .


def Func(arg_0, arg_1=None):
        """Delete the exons collection"""
        if arg_1:
            LOG.info("Dropping the exons collection, build %s", arg_1)
            arg_0.exon_collection.delete_many({'build': arg_1})
        else:
            LOG.info("Dropping the exons collection")
            arg_0.exon_collection.drop()


def Func ( arg_0 ) : arg_1 = [ arg_0 . package_name ] for arg_2 , arg_3 , arg_4 in os . walk ( arg_0 . root_path ) : arg_5 = arg_0 . _path2uri ( os . path . join ( arg_0 . root_path , arg_2 ) ) for arg_6 in arg_3 [ : ] : arg_7 = '.' . join ( ( arg_5 , arg_6 ) ) if ( arg_0 . _uri2path ( arg_7 ) and arg_0 . _survives_exclude ( arg_7 , 'package' ) ) : arg_1 . append ( arg_7 ) else : arg_3 . remove ( arg_6 ) for arg_8 in arg_4 : arg_9 = arg_8 [ : - 3 ] arg_10 = '.' . join ( ( arg_5 , arg_9 ) ) if ( arg_0 . _uri2path ( arg_10 ) and arg_0 . _survives_exclude ( arg_10 , 'module' ) ) : arg_1 . append ( arg_10 ) return sorted ( arg_1 )

def Func(arg_0):
        ''' Return module sequence discovered from ``self.package_name``

        Parameters
        ----------
        None

        Returns
        -------
        mods : sequence
            Sequence of module names within ``self.package_name``

        Examples
        --------
        >>> dw = ApiDocWriter('sphinx')
        >>> mods = dw.Func()
        >>> 'sphinx.util' in mods
        True
        >>> dw.package_skip_patterns.append('\.util$')
        >>> 'sphinx.util' in dw.Func()
        False
        >>>
        '''
        arg_1 = [arg_0.package_name]
        # raw directory parsing
        for arg_2, arg_3, arg_4 in os.walk(arg_0.root_path):
            # Check directory names for packages
            arg_5 = arg_0._path2uri(os.path.join(arg_0.root_path,
                                                   arg_2))
            for arg_6 in arg_3[:]: # copy list - we modify inplace
                arg_7 = '.'.join((arg_5, arg_6))
                if (arg_0._uri2path(arg_7) and
                    arg_0._survives_exclude(arg_7, 'package')):
                    arg_1.append(arg_7)
                else:
                    arg_3.remove(arg_6)
            # Check filenames for modules
            for arg_8 in arg_4:
                arg_9 = arg_8[:-3]
                arg_10 = '.'.join((arg_5, arg_9))
                if (arg_0._uri2path(arg_10) and
                    arg_0._survives_exclude(arg_10, 'module')):
                    arg_1.append(arg_10)
        return sorted(arg_1)

Return module sequence discovered from ``self.package_name``

        Parameters
        ----------
        None

        Returns
        -------
        mods : sequence
            Sequence of module names within ``self.package_name``

        Examples
        --------
        >>> dw = ApiDocWriter('sphinx')
        >>> mods = dw.discover_modules()
        >>> 'sphinx.util' in mods
        True
        >>> dw.package_skip_patterns.append('\.util$')
        >>> 'sphinx.util' in dw.discover_modules()
        False
        >>>

Return module sequence discovered from self . package_name


def Func ( arg_0 ) : if 'http' not in arg_0 . lower ( ) : arg_0 = 'http://{}' . format ( arg_0 ) return urllib . parse . urlparse ( arg_0 ) . hostname

def Func(arg_0):
    """ Returns domain name portion of a URL """
    if 'http' not in arg_0.lower():
        arg_0 = 'http://{}'.format(arg_0)
    return urllib.parse.urlparse(arg_0).hostname


(self, stream, container="div", encoding=None,
                      parseMeta=False, useChardet=True)

def Func ( arg_0 , arg_1 , arg_2 = "div" , arg_3 = None , arg_4 = False , arg_5 = True ) : arg_0 . _parse ( arg_1 , True , arg_2 = arg_2 , arg_3 = arg_3 ) return arg_0 . tree . getFragment ( )

def Func(arg_0, arg_1, arg_2="div", arg_3=None,
                      arg_4=False, arg_5=True):
        """Parse a HTML fragment into a well-formed tree fragment

        container - name of the element we're setting the innerHTML property
        if set to None, default to 'div'

        stream - a filelike object or string containing the HTML to be parsed

        The optional encoding parameter must be a string that indicates
        the encoding.  If specified, that encoding will be used,
        regardless of any BOM or later declaration (such as in a meta
        element)
        """
        arg_0._parse(arg_1, True, arg_2=arg_2, arg_3=arg_3)
        return arg_0.tree.getFragment()

Parse a HTML fragment into a well - formed tree fragment


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Update various internal variables from a model update from oldmodel to
        newmodel for the tile `tile`
        """
        arg_0._loglikelihood -= arg_0._calc_loglikelihood(arg_1, arg_3=arg_3)
        arg_0._loglikelihood += arg_0._calc_loglikelihood(arg_2, arg_3=arg_3)
        arg_0._residuals[arg_3.slicer] = arg_0._data[arg_3.slicer] - arg_2

Update various internal variables from a model update from oldmodel to newmodel for the tile tile


def Func(arg_0, arg_1):
    """
    Update disease terms in mongo database.
    """
    arg_2 = arg_0.obj['adapter']

    # Fetch the omim information
    arg_1 = arg_1 or arg_0.obj.get('omim_api_key')
    if not arg_1:
        LOG.warning("Please provide a omim api key to load the omim gene panel")
        arg_0.abort()

    try:
        arg_3 = fetch_mim_files(arg_1, genemap2=True)
    except Exception as err:
        LOG.warning(err)
        arg_0.abort()

    LOG.info("Dropping DiseaseTerms")
    arg_2.disease_term_collection.drop()
    LOG.debug("DiseaseTerms dropped")

    load_disease_terms(
        arg_2=arg_2,
        genemap_lines=arg_3['genemap2'],
    )

    LOG.info("Successfully loaded all disease terms")

Update disease terms in mongo database .


basic support for evaluate at server, at least to run some unittest, do not expect this to work from strings

(self, expression, i1=None, i2=None, out=None, selection=None, delay=False)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None, arg_5=None, arg_6=False):
        arg_1 = _ensure_strings_from_expressions(arg_1)
        """basic support for Func at server, at least to run some unittest, do not expect this to work from strings"""
        arg_7 = arg_0.server._call_dataset("Func", arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_5=arg_5, arg_6=arg_6)
        # TODO: we ignore out
        return arg_7

basic support for evaluate at server at least to run some unittest do not expect this to work from strings


return self._perform_post(
            self._get_storage_service_path(
                service_name) + '/keys?action=regenerate',
            _XmlSerializer.regenerate_keys_to_xml(
                key_type),
            StorageService)

def Func(arg_0, arg_1, arg_2):
        '''
        Regenerates the primary or secondary access key for the specified
        storage account.

        service_name:
            Name of the storage service account.
        key_type:
            Specifies which key to regenerate. Valid values are:
            Primary, Secondary
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('key_type', arg_2)
        return arg_0._perform_post(
            arg_0._get_storage_service_path(
                arg_1) + '/keys?action=regenerate',
            _XmlSerializer.regenerate_keys_to_xml(
                arg_2),
            StorageService)

Regenerates the primary or secondary access key for the specified storage account .


return self.request(id, json=job, method="post").json()

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . request ( arg_1 , json = arg_2 , method = "post" ) . json ( )

def Func(arg_0, arg_1, arg_2):
        """ Registers a new job or updates an existing job

           https://www.nomadproject.io/docs/http/job.html

            arguments:
              - id
            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        return arg_0.request(arg_1, json=arg_2, method="post").json()


def Func ( arg_0 , arg_1 ) : arg_2 = baseId ( arg_1 ) if arg_2 in arg_0 . players : return arg_0 . players [ arg_2 ] else : arg_3 = '{0}{1}.json' . format ( card_info_url , arg_2 ) return requests . get ( arg_3 , timeout = arg_0 . timeout ) . json ( )

def Func(arg_0, arg_1):
        """Return card info.

        :params resource_id: Resource id.
        """
        # TODO: add referer to headers (futweb)
        arg_2 = baseId(arg_1)
        if arg_2 in arg_0.players:
            return arg_0.players[arg_2]
        else:  # not a player?
            arg_3 = '{0}{1}.json'.format(card_info_url, arg_2)
            return requests.get(arg_3, timeout=arg_0.timeout).json()


def Func(arg_0, arg_1):
        """
        Delete the specified InactivityAlert

        :param tag_id: The tag ID to Func
        :type tag_id: str

        :raises: This will raise a
            :class:`ServerException <logentries_api.exceptions.ServerException>`
            if there is an error from Logentries
        """
        arg_2 = 'https://logentries.com/rest/{account_id}/api/tags/{tag_id}'

        arg_0._api_Func(
            url=arg_2.format(
                account_id=arg_0.account_id,
                arg_1=arg_1
            )
        )

Delete the specified InactivityAlert

        :param tag_id: The tag ID to delete
        :type tag_id: str

        :raises: This will raise a
            :class:`ServerException <logentries_api.exceptions.ServerException>`
            if there is an error from Logentries


def Func ( arg_0 ) : if not arg_0 . available ( ) : return arg_0 . _create_pfile ( ) arg_0 . prof = hotshot . Profile ( arg_0 . pfile )

def Func(arg_0):
        """Create profile stats file and load profiler.
        """
        if not arg_0.available():
            return
        arg_0._create_pfile()
        arg_0.prof = hotshot.Profile(arg_0.pfile)

Create profile stats file and load profiler .


(self, model=None,
                          make_dependent_reactions_nonfunctional=True)

def Func(arg_0, arg_1=None,
                          arg_2=True):
        """Removes the association

        Parameters
        ----------
        model : cobra model
           The model to remove the gene from
        make_dependent_reactions_nonfunctional : bool
           If True then replace the gene with 'False' in the gene
           association, else replace the gene with 'True'

        .. deprecated :: 0.4
            Use cobra.manipulation.delete_model_genes to simulate knockouts
            and cobra.manipulation.remove_genes to remove genes from
            the model.

        """
        warn("Use cobra.manipulation.remove_genes instead")
        if arg_1 is not None:
            if arg_1 != arg_0._model:
                raise Exception("%s is a member of %s, not %s" %
                                (repr(arg_0), repr(arg_0._model), repr(arg_1)))
        if arg_0._model is None:
            raise Exception('%s is not in a model' % repr(arg_0))

        if arg_2:
            arg_3 = 'False'
        else:
            arg_3 = 'True'
        arg_4 = re.compile('(^|(?<=( |\()))%s(?=( |\)|$))' %
                                 re.escape(arg_0.id))

        # remove reference to the gene in all groups
        arg_5 = arg_0._model.get_associated_groups(arg_0)
        for arg_6 in arg_5:
            arg_6.remove_members(arg_0)

        arg_0._model.genes.remove(arg_0)
        arg_0._model = None

        for arg_8 in list(arg_0._reaction):
            arg_8._gene_reaction_rule = arg_4.sub(
                arg_3, arg_8.gene_reaction_rule)
            arg_8._genes.remove(arg_0)
            # Now, deactivate the reaction if its gene association evaluates
            # to False
            arg_10 = arg_8.gene_reaction_rule
            for arg_11 in arg_8._genes:
                arg_12 = re.compile('(^|(?<=( |\()))%s(?=( |\)|$))' %
                                           re.escape(arg_11.id))
                arg_10 = arg_12.sub(
                    'True',
                    arg_10)

            if not eval(arg_10):
                arg_8.lower_bound = 0
                arg_8.upper_bound = 0
        arg_0._reaction.clear()


def Func ( arg_0 ) : if arg_0 . _ready or arg_0 . _selfIsReadonlyNode or time . time ( ) < arg_0 . _lastBindAttemptTime + arg_0 . _syncObj . conf . bindRetryTime : return arg_0 . _lastBindAttemptTime = time . time ( ) try : arg_0 . _server . bind ( ) except Exception as e : arg_0 . _bindAttempts += 1 if arg_0 . _syncObj . conf . maxBindRetries and arg_0 . _bindAttempts >= arg_0 . _syncObj . conf . maxBindRetries : arg_0 . _bindOverEvent . set ( ) raise TransportNotReadyError else : arg_0 . _ready = True arg_0 . _bindOverEvent . set ( )

def Func(arg_0):
        """
        Bind the server unless it is already bound, this is a read-only node, or the last attempt was too recently.

        :raises TransportNotReadyError if the bind attempt fails
        """

        if arg_0._ready or arg_0._selfIsReadonlyNode or time.time() < arg_0._lastBindAttemptTime + arg_0._syncObj.conf.bindRetryTime:
            return
        arg_0._lastBindAttemptTime = time.time()
        try:
            arg_0._server.bind()
        except Exception as e:
            arg_0._bindAttempts += 1
            if arg_0._syncObj.conf.maxBindRetries and arg_0._bindAttempts >= arg_0._syncObj.conf.maxBindRetries:
                arg_0._bindOverEvent.set()
                raise TransportNotReadyError
        else:
            arg_0._ready = True
            arg_0._bindOverEvent.set()

Bind the server unless it is already bound this is a read - only node or the last attempt was too recently .


async def Func ( arg_0 , arg_1 : arg_2 ) -> User : arg_3 = await arg_0 . http . user ( to_id ( arg_1 ) ) return User ( arg_0 , arg_3 )

async def Func(arg_0, arg_1: arg_2) -> User:
        """Retrive an user with a spotify ID.

        Parameters
        ----------
        spotify_id : str
            The ID to search for.

        Returns
        -------
        user : User
            The user from the ID
        """
        arg_3 = await arg_0.http.user(to_id(arg_1))
        return User(arg_0, arg_3)


(returns, factor_returns=None, return_stats=True,
                         **kwargs)

def Func(arg_0, arg_1=None, arg_2=True,
                         **arg_3):
    """Calculates various bootstrapped performance metrics of a strategy.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    factor_returns : pd.Series, optional
        Daily noncumulative returns of the benchmark factor to which betas are
        computed. Usually a benchmark such as market returns.
         - This is in the same style as returns.
         - If None, do not compute alpha, beta, and information ratio.
    return_stats : boolean (optional)
        If True, returns a DataFrame of mean, median, 5 and 95 percentiles
        for each perf metric.
        If False, returns a DataFrame with the bootstrap samples for
        each perf metric.

    Returns
    -------
    pd.DataFrame
        if return_stats is True:
        - Distributional statistics of bootstrapped sampling
        distribution of performance metrics.
        if return_stats is False:
        - Bootstrap samples for each performance metric.
    """

    arg_4 = OrderedDict()

    for arg_5 in SIMPLE_STAT_FUNCS:
        arg_6 = STAT_FUNC_NAMES[arg_5.__name__]
        arg_4[arg_6] = calc_bootstrap(arg_5,
                                                     arg_0)

    if arg_1 is not None:
        for arg_5 in FACTOR_STAT_FUNCS:
            arg_6 = STAT_FUNC_NAMES[arg_5.__name__]
            arg_4[arg_6] = calc_bootstrap(
                arg_5,
                arg_0,
                arg_1=arg_1)

    arg_4 = pd.DataFrame(arg_4)

    if arg_2:
        arg_7 = arg_4.apply(calc_distribution_stats)
        return arg_7.T[['mean', 'median', '5%', '95%']]
    else:
        return arg_4

Calculates various bootstrapped performance metrics of a strategy .


return self._stat(axis, func=minimum, keepdims=keepdims)

def Func ( arg_0 , arg_1 = None , arg_2 = False ) : from numpy import Funcimum return arg_0 . _stat ( arg_1 , func = Funcimum , arg_2 = arg_2 )

def Func(arg_0, arg_1=None, arg_2=False):
        """
        Return the Funcimum of the array over the given axis.

        Parameters
        ----------
        axis : tuple or int, optional, default=None
            Axis to compute statistic over, if None
            will compute over all axes

        keepdims : boolean, optional, default=False
            Keep axis remaining after operation with size 1.
        """
        from numpy import Funcimum
        return arg_0._stat(arg_1, func=Funcimum, arg_2=arg_2)

Return the minimum of the array over the given axis.

        Parameters
        ----------
        axis : tuple or int, optional, default=None
            Axis to compute statistic over, if None
            will compute over all axes

        keepdims : boolean, optional, default=False
            Keep axis remaining after operation with size 1.

Return the minimum of the array over the given axis .


(jam_in, audio_file,
                   validate=True,
                   strict=True,
                   fmt='auto',
                   **kwargs)

return jam_pack(jam, _audio=dict(y=y, sr=sr))

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = True , arg_4 = 'auto' , ** arg_5 ) : if isinstance ( arg_0 , jams . JAMS ) : arg_6 = arg_0 else : arg_6 = jams . load ( arg_0 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 ) arg_7 , arg_8 = librosa . load ( arg_1 , ** arg_5 ) if arg_6 . file_metadata . duration is None : arg_6 . file_metadata . duration = librosa . get_duration ( arg_7 = arg_7 , arg_8 = arg_8 ) return jam_pack ( arg_6 , _audio = dict ( arg_7 = arg_7 , arg_8 = arg_8 ) )

def Func(arg_0, arg_1,
                   arg_2=True,
                   arg_3=True,
                   arg_4='auto',
                   **arg_5):
    '''Load a jam and pack it with audio.

    Parameters
    ----------
    jam_in : str, file descriptor, or jams.JAMS
        JAMS filename, open file-descriptor, or object to load.
        See ``jams.load`` for acceptable formats.

    audio_file : str
        Audio filename to load

    validate : bool
    strict : bool
    fmt : str
        Parameters to `jams.load`

    kwargs : additional keyword arguments
        See `librosa.load`

    Returns
    -------
    jam : jams.JAMS
        A jams object with audio data in the top-level sandbox

    Notes
    -----
    This operation can modify the `file_metadata.duration` field of `jam_in`:
    If it is not currently set, it will be populated with the duration of the
    audio file.

    See Also
    --------
    jams.load
    librosa.core.load
    '''

    if isinstance(arg_0, jams.JAMS):
        arg_6 = arg_0
    else:
        arg_6 = jams.load(arg_0, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)

    arg_7, arg_8 = librosa.load(arg_1, **arg_5)

    if arg_6.file_metadata.duration is None:
        arg_6.file_metadata.duration = librosa.get_duration(arg_7=arg_7, arg_8=arg_8)

    return jam_pack(arg_6, _audio=dict(arg_7=arg_7, arg_8=arg_8))


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . __dict__ . copy ( ) arg_0 . _set_exc_info ( arg_2 ) arg_3 = 'default' if arg_2 . get ( 'event_name' ) : arg_3 = arg_2 . pop ( 'event_name' ) arg_4 = 'INFO' if arg_2 . get ( 'log_level' ) : arg_4 = arg_2 . pop ( 'log_level' ) [ arg_2 . pop ( arg_5 ) for arg_5 in arg_2 . keys ( ) if arg_5 not in arg_0 . fields ] arg_6 = arg_0 . defaults . copy ( ) arg_7 = arg_0 . fields . copy ( ) arg_7 . update ( arg_2 ) arg_8 = { } for arg_5 , arg_9 in arg_7 . iteritems ( ) : if arg_9 is not None : arg_8 [ arg_5 ] = arg_9 arg_6 . update ( { 'event_timestamp' : arg_0 . _get_now ( ) , 'event_name' : arg_3 , 'log_level' : arg_4 , 'fields' : arg_8 } ) return json . dumps ( arg_6 , default = arg_0 . json_default )

def Func(arg_0, arg_1):
        """Funcs a logging.Record into a standard json log entry

        :param record: record to be Functed
        :type record: logging.Record
        :return: the Functed json string
        :rtype: string
        """

        arg_2 = arg_1.__dict__.copy()
        arg_0._set_exc_info(arg_2)

        arg_3 = 'default'
        if arg_2.get('event_name'):
            arg_3 = arg_2.pop('event_name')

        arg_4 = 'INFO'
        if arg_2.get('log_level'):
            arg_4 = arg_2.pop('log_level')

        [arg_2.pop(arg_5) for arg_5 in arg_2.keys()
         if arg_5 not in arg_0.fields]

        arg_6 = arg_0.defaults.copy()
        arg_7 = arg_0.fields.copy()
        arg_7.update(arg_2)
        arg_8 = {}
        for arg_5, arg_9 in arg_7.iteritems():
            if arg_9 is not None:
                arg_8[arg_5] = arg_9

        arg_6.update({
            'event_timestamp': arg_0._get_now(),
            'event_name': arg_3,
            'log_level': arg_4,
            'fields': arg_8})

        return json.dumps(arg_6, default=arg_0.json_default)

formats a logging.Record into a standard json log entry

        :param record: record to be formatted
        :type record: logging.Record
        :return: the formatted json string
        :rtype: string

formats a logging . Record into a standard json log entry


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
[
]
def
_walk_dir
(
arg_1
,
arg_3
)
:
arg_4
=
{
'type'
:
'dir'
,
'exists'
:
os
.
path
.
isdir
(
os
.
path
.
join
(
arg_0
.
__path
,
arg_1
)
)
,
'pyrepdirinfo'
:
os
.
path
.
isfile
(
os
.
path
.
join
(
arg_0
.
__path
,
arg_1
,
arg_0
.
__dirInfo
)
)
,
}
arg_2
.
append
(
{
arg_1
:
arg_4
}
)
for
arg_5
in
sorted
(
[
f
for
f
in
arg_3
if
isinstance
(
f
,
basestring
)
]
)
:
arg_6
=
os
.
path
.
join
(
arg_1
,
arg_5
)
arg_7
=
os
.
path
.
join
(
arg_0
.
__path
,
arg_6
)
arg_8
=
{
'type'
:
'file'
,
'exists'
:
os
.
path
.
isfile
(
arg_7
)
,
'pyrepfileinfo'
:
os
.
path
.
isfile
(
os
.
path
.
join
(
arg_0
.
__path
,
arg_1
,
arg_0
.
__fileInfo
%
arg_5
)
)
,
}
arg_2
.
append
(
{
arg_6
:
arg_8
}
)
for
arg_9
in
sorted
(
[
d
for
d
in
arg_3
if
isinstance
(
d
,
dict
)
]
,
key
=
lambda
k
:
list
(
k
)
[
0
]
)
:
arg_10
=
list
(
arg_9
)
[
0
]
_walk_dir
(
arg_1
=
os
.
path
.
join
(
arg_1
,
arg_10
)
,
arg_3
=
arg_9
[
arg_10
]
)
if
arg_1
is
:
_walk_dir
(
arg_1
=
''
,
arg_3
=
arg_0
.
__repo
[
'walk_repo'
]
)
else
:
assert
isinstance
(
arg_1
,
basestring
)
,
"relaPath must be None or a str"
arg_1
=
arg_0
.
to_repo_relative_path
(
path
=
arg_1
,
split
=
False
)
arg_11
=
arg_1
.
split
(
os
.
sep
)
arg_3
=
arg_0
.
__repo
[
'walk_repo'
]
while
len
(
arg_11
)
:
arg_10
=
arg_11
.
pop
(
0
)
arg_12
=
[
d
for
d
in
arg_3
if
isinstance
(
d
,
dict
)
]
if
not
len
(
arg_12
)
:
arg_3
=
break
arg_13
=
[
d
for
d
in
arg_12
if
arg_10
in
d
]
if
not
len
(
arg_13
)
:
arg_3
=
break
arg_3
=
arg_13
[
0
]
[
arg_10
]
if
arg_3
is
not
:
_walk_dir
(
arg_1
=
arg_1
,
arg_3
=
arg_3
)
return
arg_2

def Func(arg_0, arg_1=None):
        """
        Get a list representation of repository state along with useful
        information. List state is ordered relativeley to directories level

        :Parameters:
            #. relaPath (None, str): relative directory path from where to
               start. If None all repository representation is returned.

        :Returns:
            #. state (list): List representation of the repository.
               List items are all dictionaries. Every dictionary has a single
               key which is the file or the directory name and the value is a
               dictionary of information including:

                   * 'type': the type of the tracked whether it's file, dir, or objectdir
                   * 'exists': whether file or directory actually exists on disk
                   * 'pyrepfileinfo': In case of a file or an objectdir whether .%s_pyrepfileinfo exists
                   * 'pyrepdirinfo': In case of a directory whether .pyrepdirinfo exists
        """
        arg_2 = []
        def _walk_dir(arg_1, arg_3):
            arg_4 = {'type':'dir',
                       'exists':os.path.isdir(os.path.join(arg_0.__path,arg_1)),
                       'pyrepdirinfo':os.path.isfile(os.path.join(arg_0.__path,arg_1,arg_0.__dirInfo)),
                      }
            arg_2.append({arg_1:arg_4})
            # loop files and dirobjects
            for arg_5 in sorted([f for f in arg_3 if isinstance(f, basestring)]):
                arg_6 = os.path.join(arg_1,arg_5)
                arg_7 = os.path.join(arg_0.__path,arg_6)
                #if os.path.isdir(realFilePath) and df.startswith('.') and df.endswith(self.__objectDir[3:]):
                #    fileDict = {'type':'objectdir',
                #                'exists':True,
                #                'pyrepfileinfo':os.path.isfile(os.path.join(self.__path,relaPath,self.__fileInfo%fname)),
                #               }
                #else:
                #    fileDict = {'type':'file',
                #                'exists':os.path.isfile(realFilePath),
                #                'pyrepfileinfo':os.path.isfile(os.path.join(self.__path,relaPath,self.__fileInfo%fname)),
                #               }
                arg_8 = {'type':'file',
                            'exists':os.path.isfile(arg_7),
                            'pyrepfileinfo':os.path.isfile(os.path.join(arg_0.__path,arg_1,arg_0.__fileInfo%arg_5)),
                           }
                arg_2.append({arg_6:arg_8})
            # loop directories
            #for ddict in sorted([d for d in dirList if isinstance(d, dict) and len(d)], key=lambda k: list(k)[0]):
            for arg_9 in sorted([d for d in arg_3 if isinstance(d, dict)], key=lambda k: list(k)[0]):
                arg_10 = list(arg_9)[0]
                _walk_dir(arg_1=os.path.join(arg_1,arg_10), arg_3=arg_9[arg_10])
        # call recursive _walk_dir
        if arg_1 is None:
            _walk_dir(arg_1='', arg_3=arg_0.__repo['walk_repo'])
        else:
            assert isinstance(arg_1, basestring), "relaPath must be None or a str"
            arg_1 = arg_0.to_repo_relative_path(path=arg_1, split=False)
            arg_11    = arg_1.split(os.sep)
            arg_3  = arg_0.__repo['walk_repo']
            while len(arg_11):
                arg_10 = arg_11.pop(0)
                arg_12   = [d for d in arg_3 if isinstance(d, dict)]
                if not len(arg_12):
                    arg_3 = None
                    break
                arg_13 = [d for d in arg_12 if arg_10 in d]
                if not len(arg_13):
                    arg_3 = None
                    break
                arg_3 = arg_13[0][arg_10]
            if arg_3 is not None:
                _walk_dir(arg_1=arg_1, arg_3=arg_3)
        # return state list
        return arg_2

Get a list representation of repository state along with useful information . List state is ordered relativeley to directories level


def Func(arg_0, arg_1, arg_2=False):
        """Remove a list of metabolites from the the object.

        The change is reverted upon exit when using the model as a context.

        Parameters
        ----------
        metabolite_list : list
            A list with `cobra.Metabolite` objects as elements.

        destructive : bool
            If False then the metabolite is removed from all
            associated reactions.  If True then all associated
            reactions are removed from the Model.

        """
        if not hasattr(arg_1, '__iter__'):
            arg_1 = [arg_1]
        # Make sure metabolites exist in model
        arg_1 = [arg_3 for arg_3 in arg_1
                           if arg_3.id in arg_0.metabolites]
        for arg_3 in arg_1:
            arg_3._model = None

            # remove reference to the metabolite in all groups
            arg_5 = arg_0.get_associated_groups(arg_3)
            for arg_6 in arg_5:
                arg_6.remove_members(arg_3)

            if not arg_2:
                for arg_7 in list(arg_3._reaction):
                    arg_8 = arg_7._metabolites[arg_3]
                    arg_7.subtract_metabolites({arg_3: arg_8})

            else:
                for arg_3 in list(arg_3._reaction):
                    arg_3.remove_from_model()

        arg_0.metabolites -= arg_1

        arg_9 = [arg_0.solver.constraints[m.id] for m in arg_1]
        arg_0.remove_cons_vars(arg_9)

        arg_10 = get_context(arg_0)
        if arg_10:
            arg_10(partial(arg_0.metabolites.__iadd__, arg_1))
            for arg_3 in arg_1:
                arg_10(partial(setattr, arg_3, '_model', arg_0))

Remove a list of metabolites from the the object .


def Func(arg_0, arg_1=True):
    """ Returns next available data record from the file.

    :returns: a data row (a list or tuple) if available; None, if no more
              records in the table (End of Stream - EOS); empty sequence (list
              or tuple) when timing out while waiting for the next record.
    """
    assert arg_0._file is not None
    assert arg_0._mode == arg_0._FILE_READ_MODE

    # Read the line
    try:
      arg_2 = arg_0._reader.next()

    except StopIteration:
      if arg_0.rewindAtEOF:
        if arg_0._recordCount == 0:
          raise Exception("The source configured to reset at EOF but "
                          "'%s' appears to be empty" % arg_0._filename)
        arg_0.rewind()
        arg_2 = arg_0._reader.next()

      else:
        return None

    # Keep score of how many records were read
    arg_0._recordCount += 1

    # Split the line to text fields and convert each text field to a Python
    # object if value is missing (empty string) encode appropriately for
    # upstream consumers in the case of numeric types, this means replacing
    # missing data with a sentinel value for string type, we can leave the empty
    # string in place
    arg_3 = []
    for arg_4, arg_5 in enumerate(arg_2):
      #print "DEBUG: Evaluating field @ index %s: %r" % (i, f)
      #sys.stdout.flush()
      if arg_5 in arg_0._missingValues:
        arg_3.append(SENTINEL_VALUE_FOR_MISSING_DATA)
      else:
        # either there is valid data, or the field is string type,
        # in which case the adapter does the right thing by default
        arg_3.append(arg_0._adapters[arg_4](arg_5))

    return arg_3

Returns next available data record from the file .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . canvas if arg_1 is not None : arg_3 . remove ( arg_1 ) if arg_2 is not None : arg_3 . add ( arg_2 )

def Func(arg_0, arg_1, arg_2):
        """ Handles the component being changed.
        """
        arg_3 = arg_0.canvas
        if arg_1 is not None:
            arg_3.remove(arg_1)
        if arg_2 is not None:
            arg_3.add(arg_2)


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . index : arg_3 = arg_0 . loc [ arg_2 ] if len ( arg_3 ) == 0 : continue for arg_4 in arg_3 : arg_4 = map_transaction ( arg_4 ) arg_1 . append ( arg_4 ) arg_5 = pd . DataFrame ( sorted ( arg_1 , key = lambda x : x [ 'dt' ] ) ) arg_5 [ 'txn_dollars' ] = - arg_5 [ 'amount' ] * arg_5 [ 'price' ] arg_5 . index = list ( map ( pd . Timestamp , arg_5 . dt . values ) ) return arg_5

def Func(arg_0):
    """
    Formats a transaction DataFrame.

    Parameters
    ----------
    transactions : pd.DataFrame
        Contains improperly formatted transactional data.

    Returns
    -------
    df : pd.DataFrame
        Daily transaction volume and dollar ammount.
         - See full explanation in tears.create_full_tear_sheet.
    """

    arg_1 = []
    for arg_2 in arg_0.index:
        arg_3 = arg_0.loc[arg_2]
        if len(arg_3) == 0:
            continue

        for arg_4 in arg_3:
            arg_4 = map_transaction(arg_4)
            arg_1.append(arg_4)
    arg_5 = pd.DataFrame(sorted(arg_1, key=lambda x: x['dt']))
    arg_5['txn_dollars'] = -arg_5['amount'] * arg_5['price']

    arg_5.index = list(map(pd.Timestamp, arg_5.dt.values))
    return arg_5


return (
            self.get_keys(
                start=index,
                count=1,
                step=1,
                iterations=iterations,
            )[0]
        )

def Func ( arg_0 , arg_1 , arg_2 ) : return ( arg_0 . Funcs ( start = arg_1 , count = 1 , step = 1 , arg_2 = arg_2 , ) [ 0 ] )

def Func(arg_0, arg_1, arg_2):
        # type: (int, int) -> PrivateKey
        """
        Generates a single key.

        :param index:
            The key index.

        :param iterations:
            Number of transform iterations to apply to the key, also
            known as security level.
            Must be >= 1.

            Increasing this value makes key generation slower, but more
            resistant to brute-forcing.
        """
        return (
            arg_0.Funcs(
                start=arg_1,
                count=1,
                step=1,
                arg_2=arg_2,
            )[0]
        )


async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . SendChatMessageResponse ( ) await arg_0 . _pb_request ( 'conversations/sendchatmessage' , arg_1 , arg_2 ) return arg_2

async def Func(arg_0, arg_1):
        """Send a chat message to a conversation."""
        arg_2 = hangouts_pb2.SendChatMessageResponse()
        await arg_0._pb_request('conversations/sendchatmessage',
                               arg_1, arg_2)
        return arg_2


def Func(arg_0, arg_1, arg_2=2, arg_3={}):
        ''' Execute asynchronousely without waiting for exitcode

        Args:
            - cmd (string): Commandline string to be executed on the remote side
            - walltime (int): timeout to exec_command

        KWargs:
            - envs (dict): A dictionary of env variables

        Returns:
            - None, stdout (readable stream), stderr (readable stream)

        Raises:
            - ChannelExecFailed (reason)
        '''

        # Execute the command
        arg_4, arg_5, arg_6 = arg_0.ssh_client.exec_command(
            arg_0.prepend_envs(arg_1, arg_3), bufsize=-1, timeout=arg_2
        )
        return None, arg_5, arg_6


def Func(arg_0, arg_1=1000, arg_2='VERT'):
    """ Create a new layer populated with a point sampling of the current mesh,
        at most one sample for each element of the mesh is created.

    Samples are taking in a uniform way, one for each element
    (vertex/edge/face); all the elements have the same probabilty of being
    choosen.

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        sample_num (int): The desired number of elements that must be chosen.
            Being a subsampling of the original elements if this number should
            not be larger than the number of elements of the original mesh.
        element (enum in ['VERT', 'EDGE', 'FACE']): Choose what mesh element
            will be used for the subsampling. At most one point sample will
            be added for each one of the chosen elements

    Layer stack:
        Creates new layer 'Sampled Mesh'. Current layer is changed to the new
            layer.

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    if arg_2.lower() == 'vert':
        arg_3 = 0
    elif arg_2.lower() == 'edge':
        arg_3 = 1
    elif arg_2.lower() == 'face':
        arg_3 = 2
    arg_4 = ''.join([
        '  <filter name="Mesh Element Subsampling">\n',
        '    <Param name="Sampling" ',
        'value="{:d}" '.format(arg_3),
        'description="Element to sample:" ',
        'enum_val0="Vertex" ',
        'enum_val1="Edge" ',
        'enum_val2="Face" ',
        'enum_cardinality="3" ',
        'type="RichEnum" ',
        '/>\n',
        '    <Param name="SampleNum" ',
        'value="{:d}" '.format(arg_1),
        'description="Number of samples" ',
        'type="RichInt" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(arg_0, arg_4)
    if isinstance(arg_0, FilterScript):
        arg_0.add_layer('Sampled Mesh')
    return None

Create a new layer populated with a point sampling of the current mesh at most one sample for each element of the mesh is created .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Copy code running in current environment to memory"""

        arg_0._allocate(arg_1, arg_3)
        arg_4 = 3             # cost to copy one 32 byte word
        arg_5 = arg_0.safe_mul(arg_4, Operators.UDIV(arg_0.safe_add(arg_3, 31), 32))
        arg_0._consume(arg_5)

        if issymbolic(arg_3):
            arg_6 = solver.max(arg_0.constraints, arg_3)
        else:
            arg_6 = arg_3

        for arg_7 in range(arg_6):
            if issymbolic(arg_7 < arg_3):
                arg_8 = Operators.ITEBV(8, arg_7 < arg_3, 0, arg_0._load(arg_1 + arg_7, 1))  # Fixme. unnecessary memory read
            else:
                if arg_7 < arg_3:
                    arg_8 = 0
                else:
                    arg_8 = arg_0._load(arg_1 + arg_7, 1)

            if issymbolic(arg_2):
                arg_9 = Operators.ITEBV(8, arg_2 + arg_7 >= len(arg_0.bytecode), arg_8, arg_0.bytecode[arg_2 + arg_7])
            else:
                if arg_2 + arg_7 >= len(arg_0.bytecode):
                    arg_9 = arg_8
                else:
                    arg_9 = arg_0.bytecode[arg_2 + arg_7]
            arg_0._store(arg_1 + arg_7, arg_9)
        arg_0._publish('did_evm_read_code', arg_2, arg_3)


(estimator, parameters, cv, X, y=None, scoring=None,
                            iid=True, n_jobs=1, verbose=1,
                            pre_dispatch='2*n_jobs')

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None,
                            arg_6=True, arg_7=1, arg_8=1,
                            arg_9='2*n_jobs'):
    """Fit and score an estimator with cross-validation

    This function is basically a copy of sklearn's
    model_selection._BaseSearchCV._fit(), which is the core of the GridSearchCV
    fit() method. Unfortunately, that class does _not_ return the training
    set scores, which we want to save in the database, and because of the
    way it's written, you can't change it by subclassing or monkeypatching.

    This function uses some undocumented internal sklearn APIs (non-public).
    It was written against sklearn version 0.16.1. Prior Versions are likely
    to fail due to changes in the design of cross_validation module.

    Returns
    -------
    out : dict, with keys 'mean_test_score' 'test_scores', 'train_scores'
        The scores on the training and test sets, as well as the mean test set
        score.
    """

    arg_10 = check_scoring(arg_0, arg_5=arg_5)
    arg_11 = num_samples(arg_3)
    arg_3, arg_4 = check_arrays(arg_3, arg_4, allow_lists=True, sparse_format='csr',
                        allow_nans=True)
    if arg_4 is not None:
        if len(arg_4) != arg_11:
            raise ValueError('Target variable (y) has a different number '
                             'of samples (%i) than data (X: %i samples)'
                             % (len(arg_4), arg_11))
    arg_2 = check_cv(arg_2=arg_2, arg_4=arg_4, classifier=is_classifier(arg_0))

    arg_12 = Parallel(
        arg_7=arg_7, arg_8=arg_8, arg_9=arg_9
    )(
        delayed(_fit_and_score)(clone(arg_0), arg_3, arg_4, arg_10,
                                train, test, arg_8, arg_1,
                                fit_params=None)
        for train, test in arg_2.split(arg_3, arg_4))

    assert len(arg_12) == arg_2.n_splits

    arg_13, arg_14 = [], []
    arg_15, arg_16 = [], []
    for arg_17, arg_18, arg_19, arg_20, arg_21 in arg_12:
        arg_13.append(arg_19)
        arg_14.append(arg_17)
        arg_16.append(arg_18)
        arg_15.append(arg_20)

    arg_13, arg_14 = map(list, check_arrays(arg_13,
                                                       arg_14,
                                                       warn_nans=True,
                                                       replace_nans=True))

    if arg_6:
        if arg_8 > 0 and is_msmbuilder_estimator(arg_0):
            print('[CV] Using MSMBuilder API n_samples averaging')
            print('[CV]   n_train_samples: %s' % str(arg_15))
            print('[CV]   n_test_samples: %s' % str(arg_16))
        arg_22 = np.average(arg_14, weights=arg_16)
        arg_23 = np.average(arg_13, weights=arg_15)
    else:
        arg_22 = np.average(arg_14)
        arg_23 = np.average(arg_13)

    arg_24 = {
        'mean_test_score': arg_22, 'test_scores': arg_14,
        'mean_train_score': arg_23, 'train_scores': arg_13,
        'n_test_samples': arg_16, 'n_train_samples': arg_15}
    return arg_24

Fit and score an estimator with cross - validation


def Func(arg_0):
        """Find and parse config file, storing all variables in ``self._config``."""
        arg_0._config_loaded = True
        arg_2 = []
        for arg_3 in arg_0._candidate_log_files():
            if os.path.isfile(arg_3):
                arg_0._logger.info("Reading config file %s" % arg_3)
                arg_4 = re.compile(r"^\[(\w+)\]$")
                arg_5 = re.compile(r"^(\w+:)?([\w.]+)\s*=(.*)$")
                with io.open(arg_3, "rt", encoding="utf-8") as config_file:
                    arg_6 = None
                    for arg_7, arg_8 in enumerate(config_file):
                        arg_8 = arg_8.strip()
                        if arg_8 == "" or arg_8.startswith("#"): continue
                        arg_9 = arg_4.match(arg_8)
                        if arg_9:
                            arg_6 = arg_9.group(1)
                            continue
                        arg_10 = arg_5.match(arg_8)
                        if arg_10:
                            arg_11 = arg_10.group(1)
                            arg_12 = arg_10.group(2)
                            arg_13 = arg_10.group(3).strip()
                            if arg_11 and arg_11.lower() != "py:": continue
                            if arg_6:
                                arg_12 = arg_6 + "." + arg_12
                            if arg_12 in H2OConfigReader._allowed_config_keys:
                                arg_2.append((arg_12, arg_13))
                            else:
                                arg_0._logger.error("Key %s is not a valid config key" % arg_12)
                            continue
                        arg_0._logger.error("Syntax error in config file line %d: %s" % (arg_7, arg_8))
                arg_0._config = dict(arg_2)
                return

Find and parse config file storing all variables in self . _config .


def
Func
(
arg_0
)
:
if
not
arg_0
or
arg_0
==
"\r\n"
:
return
if
arg_0
[
0
]
in
" \t"
:
return
arg_0
[
1
:
]
.
rstrip
(
)
arg_1
,
arg_2
=
arg_0
.
split
(
":"
,
1
)
return
(
arg_1
.
strip
(
)
,
arg_2
.
strip
(
)
)

def Func(arg_0):
    """Parse a header line.

    Args:
        line: A header line as a string.

    Returns:
        None if end of headers is found. A string giving the continuation line
        if a continuation is found. A tuple of name, value when a header line is
        found.

    Raises:
        ValueError: If the line cannot be parsed as a header.
    """
    if not arg_0 or arg_0 == "\r\n":
        return None
    if arg_0[0] in " \t":
        return arg_0[1:].rstrip()
    arg_1, arg_2 = arg_0.split(":", 1)
    return (arg_1.strip(), arg_2.strip())


def
Func
(
arg_0
=
)
:
if
arg_0
is
:
return
time
.
time
(
)
else
:
arg_1
=
time
.
time
(
)
arg_0
if
arg_1
<
1
:
return
"%.02f ms"
%
(
arg_1
*
1000.0
)
elif
arg_1
<
60
:
return
"%.02f s"
%
(
arg_1
)
else
:
return
"%.02f min"
%
(
arg_1
/
60.0
)

def Func(arg_0=None):
    """simple timer. returns a time object, or a string."""
    if arg_0 is None:
        return time.time()
    else:
        arg_1=time.time()-arg_0
        if arg_1<1:
            return "%.02f ms"%(arg_1*1000.0)
        elif arg_1<60:
            return "%.02f s"%(arg_1)
        else:
            return "%.02f min"%(arg_1/60.0)

simple timer . returns a time object or a string .


def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
0
)
:
arg_3
=
[
w
for
w
in
arg_0
.
wells
if
attribute
(
w
,
'u'
)
==
arg_2
and
attribute
(
w
,
'v'
)
==
arg_1
]
if
len
(
arg_3
)
==
1
:
arg_3
=
arg_3
[
0
]
arg_4
=
os
.
path
.
join
(
arg_3
,
'TileConfiguration.registered.txt'
)
with
open
(
arg_4
)
as
f
:
arg_5
=
[
x
.
strip
(
)
for
l
in
f
.
readlines
(
)
if
l
[
0
:
7
]
==
'image--'
for
x
in
l
.
split
(
';'
)
]
arg_6
=
(
ast
.
literal_eval
(
x
)
for
x
in
arg_5
[
2
:
:
3
]
)
arg_6
=
sum
(
arg_6
,
(
)
)
arg_7
=
tuple
(
attributes
(
x
)
for
x
in
arg_5
[
0
:
:
3
]
)
return
arg_6
[
0
:
:
2
]
,
arg_6
[
1
:
:
2
]
,
arg_7
else
:
print
(
'leicaexperiment Func'
'({}, {}) Well not found'
.
format
(
arg_1
,
arg_2
)
)

def Func(arg_0, arg_1=0, arg_2=0):
        """Get a list of stitch coordinates for the given well.

        Parameters
        ----------
        well_row : int
            Y well coordinate. Same as --V in files.
        well_column : int
            X well coordinate. Same as --U in files.

        Returns
        -------
        (xs, ys, attr) : tuples with float and collections.OrderedDict
            Tuple of x's, y's and attributes.
        """
        arg_3 = [w for w in arg_0.wells
                    if attribute(w, 'u') == arg_2 and
                       attribute(w, 'v') == arg_1]

        if len(arg_3) == 1:
            arg_3 = arg_3[0]
            arg_4 = os.path.join(arg_3, 'TileConfiguration.registered.txt')

            with open(arg_4) as f:
                arg_5 = [x.strip()
                            for l in f.readlines()
                                if l[0:7] == 'image--'
                                    for x in l.split(';')] # flat list
                arg_6 = (ast.literal_eval(x) for x in arg_5[2::3])
                # flatten
                arg_6 = sum(arg_6, ())
                arg_7 = tuple(attributes(x) for x in arg_5[0::3])
            return arg_6[0::2], arg_6[1::2], arg_7

        else:
            print('leicaexperiment Func'
                  '({}, {}) Well not found'.format(arg_1, arg_2))

Get a list of stitch coordinates for the given well .


def Func ( arg_0 , arg_1 = 1 , arg_2 = 60 ) : arg_3 = time . time ( ) arg_4 = 0 while ( arg_0 . status != "complete" and ( arg_2 <= 0 or arg_4 < arg_2 ) ) : time . sleep ( arg_1 ) arg_0 . refresh ( ) arg_4 = time . time ( ) - arg_3

def Func(arg_0, arg_1=1, arg_2=60):
        """It will poll the URL to grab the latest status resource in a given
        timeout and time interval.

        Args:
            poll_interval (int): how often to poll the status service.
            timeout (int): how long to poll the URL until giving up. Use <= 0
                to wait forever

        """
        arg_3 = time.time()
        arg_4 = 0
        while (arg_0.status != "complete" and
                (arg_2 <= 0 or arg_4 < arg_2)):
            time.sleep(arg_1)
            arg_0.refresh()
            arg_4 = time.time() - arg_3

It will poll the URL to grab the latest status resource in a given timeout and time interval .


(self, thresholds=None, train=False, valid=False, xval=False)

return {model.model_id: model.F1(thresholds, train, valid, xval) for model in
                self.models}

def Func ( arg_0 , arg_1 = None , arg_2 = False , arg_3 = False , arg_4 = False ) : return { arg_5 . model_id : arg_5 . Func ( arg_1 , arg_2 , arg_3 , arg_4 ) for arg_5 in arg_0 . models }

def Func(arg_0, arg_1=None, arg_2=False, arg_3=False, arg_4=False):
        """
        Get the Func values for a set of thresholds for the models explored.

        If all are False (default), then return the training metric value.
        If more than one options is set to True, then return a dictionary of metrics where
        the keys are "train", "valid", and "xval".

        :param List thresholds: If None, then the thresholds in this set of metrics will be used.
        :param bool train: If True, return the Func value for the training data.
        :param bool valid: If True, return the Func value for the validation data.
        :param bool xval: If True, return the Func value for each of the cross-validated splits.
        :returns: Dictionary of model keys to Func values
        """
        return {arg_5.model_id: arg_5.Func(arg_1, arg_2, arg_3, arg_4) for arg_5 in
                arg_0.models}

Get the F1 values for a set of thresholds for the models explored.

        If all are False (default), then return the training metric value.
        If more than one options is set to True, then return a dictionary of metrics where
        the keys are "train", "valid", and "xval".

        :param List thresholds: If None, then the thresholds in this set of metrics will be used.
        :param bool train: If True, return the F1 value for the training data.
        :param bool valid: If True, return the F1 value for the validation data.
        :param bool xval: If True, return the F1 value for each of the cross-validated splits.
        :returns: Dictionary of model keys to F1 values

Get the F1 values for a set of thresholds for the models explored .


return [x for x in self._resources if x not in seen and not seen.add(x)]

def Func ( arg_0 ) : arg_1 = set ( ) return [ arg_2 for arg_2 in arg_0 . _Func if arg_2 not in arg_1 and not arg_1 . add ( arg_2 ) ]

def Func(arg_0):
        """
        Returns list of unique `FragmentResource`s by order of first appearance.
        """
        arg_1 = set()
        # seen.add always returns None, so 'not seen.add(x)' is always True,
        # but will only be called if the value is not already in seen (because
        # 'and' short-circuits)
        return [arg_2 for arg_2 in arg_0._Func if arg_2 not in arg_1 and not arg_1.add(arg_2)]

Returns list of unique FragmentResource s by order of first appearance .


def Func ( arg_0 ) : arg_1 = [ LOCAL_ODS , GDOCS_TRANS_CSV , GDOCS_META_CSV , LOCAL_TRANS_CSV , LOCAL_META_CSV ] for arg_2 in arg_1 : arg_3 = os . path . join ( arg_0 . temp_path , arg_2 ) if os . path . exists ( arg_3 ) : os . remove ( arg_3 )

def Func(arg_0):
        """
        Clear temp directory from created csv and ods files during
        communicator operations.
        """
        arg_1 = [LOCAL_ODS, GDOCS_TRANS_CSV, GDOCS_META_CSV,
                      LOCAL_TRANS_CSV, LOCAL_META_CSV]
        for arg_2 in arg_1:
            arg_3 = os.path.join(arg_0.temp_path, arg_2)
            if os.path.exists(arg_3):
                os.remove(arg_3)

Clear temp directory from created csv and ods files during communicator operations .


(dirname='em', mdp=config.templates['em.mdp'],
                    struct='solvate/ionized.gro', top='top/system.top',
                    output='em.pdb', deffnm="em",
                    mdrunner=None, mdrun_args=None,
                    **kwargs)

return {'struct': final_struct,
            'top': topology,
            'mainselection': mainselection,
            }

def Func(arg_0='em', arg_1=arg_2.templates['em.mdp'],
                    arg_4='solvate/ionized.gro', arg_5='top/system.top',
                    arg_6='em.pdb', arg_7="em",
                    arg_8=None, arg_9=None,
                    **arg_10):
    """Energy minimize the system.

    This sets up the system (creates run input files) and also runs
    ``mdrun_d``. Thus it can take a while.

    Additional itp files should be in the same directory as the top file.

    Many of the keyword arguments below already have sensible values.

    :Keywords:
       *dirname*
          set up under directory dirname [em]
       *struct*
          input structure (gro, pdb, ...) [solvate/ionized.gro]
       *output*
          output structure (will be put under dirname) [em.pdb]
       *deffnm*
          default name for mdrun-related files [em]
       *top*
          topology file [top/system.top]
       *mdp*
          mdp file (or use the template) [templates/em.mdp]
       *includes*
          additional directories to search for itp files
       *mdrunner*
          :class:`gromacs.run.MDrunner` instance; by default we
          just try :func:`gromacs.mdrun_d` and :func:`gromacs.mdrun` but a
          MDrunner instance gives the user the ability to run mpi jobs
          etc. [None]
       *mdrun_args*
          arguments for *mdrunner* (as a dict), e.g. ``{'nt': 2}``;
          empty by default

          .. versionaddedd:: 0.7.0

       *kwargs*
          remaining key/value pairs that should be changed in the
          template mdp file, eg ``nstxtcout=250, nstfout=250``.

    .. note:: If :func:`~gromacs.mdrun_d` is not found, the function
              falls back to :func:`~gromacs.mdrun` instead.
    """

    arg_11 = realpath(arg_4)
    arg_12 = realpath(arg_5)
    arg_13 = arg_2.get_template(arg_1)
    arg_7 = arg_7.strip()

    arg_9 = {} if arg_9 is None else arg_9

    # write the processed topology to the default output
    arg_10.setdefault('pp', 'processed.top')

    # filter some kwargs that might come through when feeding output
    # from previous stages such as solvate(); necessary because *all*
    # **kwargs must be *either* substitutions in the mdp file *or* valid
    # command line parameters for ``grompp``.
    arg_10.pop('ndx', None)
    # mainselection is not used but only passed through; right now we
    # set it to the default that is being used in all argument lists
    # but that is not pretty. TODO.
    arg_14 = arg_10.pop('mainselection', '"Protein"')
    # only interesting when passed from solvate()
    arg_15 = arg_10.pop('qtot', 0)

    # mdp is now the *output* MDP that will be generated from mdp_template
    arg_1 = arg_7+'.mdp'
    arg_16 = arg_7+'.tpr'

    logger.info("[{dirname!s}] Energy minimization of struct={struct!r}, top={top!r}, mdp={mdp!r} ...".format(**vars()))

    cbook.add_mdp_includes(arg_12, arg_10)

    if arg_15 != 0:
        # At the moment this is purely user-reported and really only here because
        # it might get fed into the function when using the keyword-expansion pipeline
        # usage paradigm.
        arg_17 = "Total charge was reported as qtot = {qtot:g} <> 0; probably a problem.".format(**vars())
        logger.warn(arg_17)
        warnings.warn(arg_17, category=BadParameterWarning)

    with in_dir(arg_0):
        arg_18 = cbook.edit_mdp(arg_13, new_mdp=arg_1, **arg_10)
        check_mdpargs(arg_18)
        gromacs.grompp(f=arg_1, o=arg_16, c=arg_11, r=arg_11, p=arg_12, **arg_18)
        arg_9.update(v=True, stepout=10, arg_7=arg_7, c=arg_6)
        if arg_8 is None:
            arg_19 = run.get_double_or_single_prec_mdrun()
            arg_19(**arg_9)
        else:
            if type(arg_8) is type:
                # class
                # user wants full control and provides simulation.MDrunner **class**
                # NO CHECKING --- in principle user can supply any callback they like
                arg_19 = arg_8(**arg_9)
                arg_19.run()
            else:
                # anything with a run() method that takes mdrun arguments...
                try:
                    arg_8.run(mdrunargs=arg_9)
                except AttributeError:
                    logger.error("mdrunner: Provide a gromacs.run.MDrunner class or instance or a callback with a run() method")
                    raise TypeError("mdrunner: Provide a gromacs.run.MDrunner class or instance or a callback with a run() method")

        # em.gro --> gives 'Bad box in file em.gro' warning --- why??
        # --> use em.pdb instead.
        if not os.path.exists(arg_6):
            arg_20 = "Energy minimized system NOT produced."
            logger.error(arg_20)
            raise GromacsError(arg_20)
        arg_21 = realpath(arg_6)

    logger.info("[{dirname!s}] energy minimized structure {final_struct!r}".format(**vars()))
    return {'struct': arg_21,
            'top': arg_12,
            'mainselection': arg_14,
            }


def Func(arg_0, arg_1):
        """Resolves current tree item of 'tree_alias' tree matching current
        request path against URL of given tree item.

        :param str|unicode tree_alias:
        :rtype: TreeItemBase
        """
        arg_2 = arg_0._current_items.get(arg_1, _UNSET)

        if arg_2 is not _UNSET:

            if arg_2 is not None:
                arg_2.is_current = True  # Could be reset by .get_sitetree()

            return arg_2

        arg_2 = None

        if arg_0.current_app_is_admin():
            arg_0._current_items[arg_1] = arg_2
            return None

        # urlquote is an attempt to support non-ascii in url.
        arg_5 = arg_0.current_request.path
        if isinstance(arg_5, str):
            arg_5 = arg_5.encode('UTF-8')
        if arg_5:
            arg_5 = urlquote(arg_5)

        for arg_6, arg_7 in arg_0._items_urls.items():
            # Iterate each as this dict may contains "current" items for various trees.
            if arg_7 != arg_5:
                continue

            arg_6.is_current = True
            if arg_6.tree.alias == arg_1:
                arg_2 = arg_6

        if arg_2 is not None:
            arg_0._current_items[arg_1] = arg_2

        return arg_2

Resolves current tree item of tree_alias tree matching current request path against URL of given tree item .


return str(header) if PY2 else bytes(header)

def Func ( arg_0 ) : arg_1 = bytearray ( 2 ) arg_1 [ 0 ] = 0xE0 arg_0 . Funcd = arg_1 return str ( arg_1 ) if PY2 else bytes ( arg_1 )

def Func(arg_0):
        '''
        Encode and store a DISCONNECT control packet.
        '''
        arg_1    = bytearray(2)
        arg_1[0] = 0xE0
        arg_0.Funcd = arg_1
        return str(arg_1) if PY2 else bytes(arg_1)

Encode and store a DISCONNECT control packet .


def Func ( arg_0 , arg_1 : arg_2 ) -> 'Timeslot' : return Timeslot ( arg_0 . interval . Func ( arg_1 ) , arg_0 . channel )

def Func(arg_0, arg_1: arg_2) -> 'Timeslot':
        """Return a new Timeslot Funced by `time`.

        Args:
            time: time to be Funced
        """
        return Timeslot(arg_0.interval.Func(arg_1), arg_0.channel)

Return a new Timeslot shifted by `time`.

        Args:
            time: time to be shifted


def Func ( arg_0 ) : arg_1 = OPJ ( arg_0 . workdir , arg_0 . name + "-K-*-rep-*_f" ) arg_2 = glob . glob ( arg_1 ) return arg_2

def Func(arg_0):
        """ returns a list of files that have finished structure """
        arg_1 = OPJ(arg_0.workdir, arg_0.name+"-K-*-rep-*_f")
        arg_2 = glob.glob(arg_1)
        return arg_2


(self, where, expression, size=None, force=False)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=False):
        """
        Writes int to memory

        :param int where: address to write to
        :param expr: value to write
        :type expr: int or BitVec
        :param size: bit size of `expr`
        :param force: whether to ignore memory permissions
        """
        if arg_3 is None:
            arg_3 = arg_0.address_bit_size
        assert arg_3 in SANE_SIZES
        arg_0._publish('will_write_memory', arg_1, arg_2, arg_3)

        arg_5 = [Operators.CHR(Operators.EXTRACT(arg_2, offset, 8)) for offset in range(0, arg_3, 8)]
        arg_0._memory.write(arg_1, arg_5, arg_4)

        arg_0._publish('did_write_memory', arg_1, arg_2, arg_3)


return re.compile('|'.join(fnmatch.translate(x) for x in globs))

def Func ( arg_0 , arg_1 = False ) : if not arg_0 : return re . compile ( '^$' ) elif arg_1 : arg_0 = [ arg_2 + '*' for arg_2 in arg_0 ] return re . compile ( '|' . join ( fnmatch . translate ( arg_2 ) for arg_2 in arg_0 ) )

def Func(arg_0, arg_1=False):
    """Generate a single "A or B or C" regex from a list of shell globs.

    :param globs: Patterns to be processed by :mod:`fnmatch`.
    :type globs: iterable of :class:`~__builtins__.str`

    :param prefix: If ``True``, then :meth:`~re.RegexObject.match` will
        perform prefix matching rather than exact string matching.
    :type prefix: :class:`~__builtins__.bool`

    :rtype: :class:`re.RegexObject`
    """
    if not arg_0:
        # An empty globs list should only match empty strings
        return re.compile('^$')
    elif arg_1:
        arg_0 = [arg_2 + '*' for arg_2 in arg_0]
    return re.compile('|'.join(fnmatch.translate(arg_2) for arg_2 in arg_0))

Generate a single A or B or C regex from a list of shell globs .


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the Credential struct to a stream.

        Args:
            output_stream (stream): A data stream in which to encode object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if either the credential type or value are not
                defined.
        """
        arg_6 = BytearrayStream()

        if arg_0._credential_type:
            arg_0._credential_type.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise ValueError(
                "Credential struct missing the credential type."
            )

        if arg_0._credential_value:
            arg_0._credential_value.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise ValueError(
                "Credential struct missing the credential value."
            )

        arg_0.length = arg_6.length()
        super(Credential, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_1.Func(arg_6.buffer)

Write the data encoding the Credential struct to a stream.

        Args:
            output_stream (stream): A data stream in which to encode object
                data, supporting a write method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if either the credential type or value are not
                defined.

Write the data encoding the Credential struct to a stream .


def Func ( arg_0 , arg_1 ) : arg_2 = False for arg_3 in arg_0 : if isinstance ( arg_3 , Cells ) : arg_2 = True break if arg_2 : arg_0 = tuple ( arg_3 . value if isinstance ( arg_3 , Cells ) else arg_3 for arg_3 in arg_0 ) if arg_1 is not None : for arg_4 , arg_3 in arg_1 . items ( ) : if isinstance ( arg_3 , Cells ) : arg_1 [ arg_4 ] = arg_3 . value return arg_0 , arg_1

def Func(arg_0, arg_1):
    """If args and kwargs contains Cells, Convert them to their values."""

    arg_2 = False
    for arg_3 in arg_0:
        if isinstance(arg_3, Cells):
            arg_2 = True
            break

    if arg_2:
        arg_0 = tuple(
            arg_3.value if isinstance(arg_3, Cells) else arg_3 for arg_3 in arg_0
        )

    if arg_1 is not None:
        for arg_4, arg_3 in arg_1.items():
            if isinstance(arg_3, Cells):
                arg_1[arg_4] = arg_3.value

    return arg_0, arg_1

If args and kwargs contains Cells Convert them to their values .


def Func(arg_0):
        """Verify there is a process object, and that it is still running.
        Raise NoGdbProcessError if either of the above are not true."""
        if not arg_0.gdb_process:
            raise NoGdbProcessError("gdb process is not attached")

        elif arg_0.gdb_process.poll() is not None:
            raise NoGdbProcessError(
                "gdb process has already finished with return code: %s"
                % str(arg_0.gdb_process.poll())
            )

Verify there is a process object and that it is still running . Raise NoGdbProcessError if either of the above are not true .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : for arg_4 in arg_0 . throttles . values ( ) : getattr ( arg_4 , arg_1 ) . Func ( arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Update timeout for all throttles

        :param name: name of throttle to Func to ("read" or "write")
        :type name: :py:class:`str`

        :param data: bytes of data for count
        :type data: :py:class:`bytes`

        :param start: start of read/write time from
            :py:meth:`asyncio.BaseEventLoop.time`
        :type start: :py:class:`float`
        """
        for arg_4 in arg_0.throttles.values():
            getattr(arg_4, arg_1).Func(arg_2, arg_3)

Update timeout for all throttles

        :param name: name of throttle to append to ("read" or "write")
        :type name: :py:class:`str`

        :param data: bytes of data for count
        :type data: :py:class:`bytes`

        :param start: start of read/write time from
            :py:meth:`asyncio.BaseEventLoop.time`
        :type start: :py:class:`float`


def Func(arg_0, arg_1, arg_2):
        """Add a format function for a given type.

        Parameters
        -----------
        typ : class
            The class of the object that will be formatted using `func`.
        func : callable
            The callable that will be called to compute the format data. The
            call signature of this function is simple, it must take the
            object to be formatted and return the raw data for the given
            format. Subclasses may use a different call signature for the
            `func` argument.
        """
        arg_3 = arg_0.type_printers.get(arg_1, None)
        if arg_2 is not None:
            # To support easy restoration of old printers, we need to ignore
            # Nones.
            arg_0.type_printers[arg_1] = arg_2
        return arg_3

Add a format function for a given type .


return [
            WikiLink(_lststr, _type_to_spans, span, 'WikiLink')
            for span in self._subspans('WikiLink')]

def Func ( arg_0 ) -> List [ 'WikiLink' ] : arg_1 = arg_0 . _lststr arg_2 = arg_0 . _type_to_spans return [ WikiLink ( arg_1 , arg_2 , arg_3 , 'WikiLink' ) for arg_3 in arg_0 . _subspans ( 'WikiLink' ) ]

def Func(arg_0) -> List['WikiLink']:
        """Return a list of wikilink objects."""
        arg_1 = arg_0._lststr
        arg_2 = arg_0._type_to_spans
        return [
            WikiLink(arg_1, arg_2, arg_3, 'WikiLink')
            for arg_3 in arg_0._subspans('WikiLink')]


def Func ( arg_0 , arg_1 = True ) : arg_2 = arg_0 . get ( 'argspec' ) if arg_2 is None : arg_3 = None else : try : arg_4 = arg_2 [ 'args' ] [ 0 ] == 'self' except ( KeyError , IndexError ) : pass else : if arg_4 : arg_2 [ 'args' ] = arg_2 [ 'args' ] [ 1 : ] arg_3 = arg_0 [ 'name' ] + format_argspec ( arg_2 ) arg_5 = arg_0 . get ( 'call_docstring' ) if arg_5 is None : arg_5 = arg_0 . get ( 'init_docstring' ) if arg_5 is None : arg_5 = arg_0 . get ( 'docstring' , '' ) return arg_3 , arg_5

def Func(arg_0, arg_1=True):
    """Extract call tip data from an oinfo dict.

    Parameters
    ----------
    oinfo : dict

    format_call : bool, optional
      If True, the call line is formatted and returned as a string.  If not, a
      tuple of (name, argspec) is returned.

    Returns
    -------
    call_info : None, str or (str, dict) tuple.
      When format_call is True, the whole call information is formattted as a
      single string.  Otherwise, the object's name and its argspec dict are
      returned.  If no call information is available, None is returned.

    docstring : str or None
      The most relevant docstring for calling purposes is returned, if
      available.  The priority is: call docstring for callable instances, then
      constructor docstring for classes, then main object's docstring otherwise
      (regular functions).
    """
    # Get call definition
    arg_2 = arg_0.get('argspec')
    if arg_2 is None:
        arg_3 = None
    else:
        # Callable objects will have 'self' as their first argument, prune
        # it out if it's there for clarity (since users do *not* pass an
        # extra first argument explicitly).
        try:
            arg_4 = arg_2['args'][0] == 'self'
        except (KeyError, IndexError):
            pass
        else:
            if arg_4:
                arg_2['args'] = arg_2['args'][1:]

        arg_3 = arg_0['name']+format_argspec(arg_2)

    # Now get docstring.
    # The priority is: call docstring, constructor docstring, main one.
    arg_5 = arg_0.get('call_docstring')
    if arg_5 is None:
        arg_5 = arg_0.get('init_docstring')
    if arg_5 is None:
        arg_5 = arg_0.get('docstring','')

    return arg_3, arg_5

Extract call tip data from an oinfo dict .


def Func ( arg_0 , arg_1 , arg_2 = True ) : if isinstance ( arg_0 , string_types ) : arg_0 = [ arg_0 ] arg_3 = np . zeros ( ( arg_1 . n_vox_in_mask , len ( arg_0 ) ) ) for arg_4 , arg_5 in enumerate ( arg_0 ) : arg_3 [ : , arg_4 ] = arg_1 . mask ( arg_5 , arg_2 ) return arg_3

def Func(arg_0, arg_1, arg_2=True):
    """ Load multiple images from file into an ndarray.

    Args:
      filenames: A single filename or list of filenames pointing to valid
        images.
      masker: A Masker instance.
      nan_to_num: Optional boolean indicating whether to convert NaNs to zero.

    Returns:
      An m x n 2D numpy array, where m = number of voxels in mask and
      n = number of images passed.
    """
    if isinstance(arg_0, string_types):
        arg_0 = [arg_0]
    arg_3 = np.zeros((arg_1.n_vox_in_mask, len(arg_0)))
    for arg_4, arg_5 in enumerate(arg_0):
        arg_3[:, arg_4] = arg_1.mask(arg_5, arg_2)
    return arg_3

Load multiple images from file into an ndarray .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . in_memory : arg_0 . _memory_db [ arg_1 ] = arg_2 else : arg_4 = arg_0 . _read_file ( ) arg_4 [ arg_1 ] = arg_2 with open ( arg_0 . db_path , 'w' ) as f : f . write ( json . dumps ( arg_4 , ensure_ascii = False , indent = 2 ) )

def Func(arg_0, arg_1, arg_2):
        """ Set key value """
        if arg_0.in_memory:
            arg_0._memory_db[arg_1] = arg_2
        else:
            arg_4 = arg_0._read_file()
            arg_4[arg_1] = arg_2
            with open(arg_0.db_path, 'w') as f:
                f.write(json.dumps(arg_4, ensure_ascii=False, indent=2))


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_2 = dict ( arg_0 . kwds , ** arg_2 ) arg_3 = arg_0 . servers . get ( arg_1 ) if arg_3 : arg_3 . check_keywords ( arg_0 . constructor , arg_2 ) else : arg_3 = _CachedServer ( arg_0 . constructor , arg_1 , arg_2 ) arg_0 . servers [ arg_1 ] = arg_3 return arg_3

def Func(arg_0, arg_1, **arg_2):
        """
        Get a new or existing server for this key.

        :param int key: key for the server to use
        """
        arg_2 = dict(arg_0.kwds, **arg_2)
        arg_3 = arg_0.servers.get(arg_1)
        if arg_3:
            # Make sure it's the right server.
            arg_3.check_keywords(arg_0.constructor, arg_2)
        else:
            # Make a new server
            arg_3 = _CachedServer(arg_0.constructor, arg_1, arg_2)
            arg_0.servers[arg_1] = arg_3

        return arg_3

Get a new or existing server for this key .


def Func(arg_0):
        """return pairs of package indices and results of all tasks

        This method waits until all tasks finish.

        Returns
        -------
        list
            A list of pairs of package indices and results

        """

        arg_1 = [ ] # a list of (pkgid, result)
        while True:

            if arg_0.runid_pkgidx_map:
                arg_0.runid_to_return.extend(arg_0.dispatcher.poll())
                arg_1.extend(arg_0._collect_all_finished_pkgidx_result_pairs())

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

        arg_1 = sorted(arg_1, key=itemgetter(0))

        return arg_1


def Func ( arg_0 ) : arg_1 = PageWriter ( arg_0 . settings , index_title = arg_0 . title ) for arg_2 in arg_0 . albums . values ( ) : arg_3 = arg_2 . medias arg_4 = arg_3 [ 1 : ] + [ None ] arg_5 = [ None ] + arg_3 [ : - 1 ] arg_6 = zip ( arg_3 , arg_4 , arg_5 ) for arg_7 in arg_6 : arg_1 . write ( arg_2 , arg_7 )

def Func(arg_0):
    '''Generates and writes the media pages for all media in the gallery'''

    arg_1 = PageWriter(arg_0.settings, index_title=arg_0.title)

    for arg_2 in arg_0.albums.values():
        arg_3 = arg_2.medias
        arg_4 = arg_3[1:] + [None]
        arg_5 = [None] + arg_3[:-1]

        # The media group allows us to easily get next and previous links
        arg_6 = zip(arg_3, arg_4, arg_5)

        for arg_7 in arg_6:
            arg_1.write(arg_2, arg_7)


def Func ( arg_0 ) : arg_1 = [ np . ma . getmaskarray ( block ) for block in arg_0 if np . ma . isMaskedArray ( block ) ] arg_0 = [ block . data if np . ma . isMaskedArray ( block ) else block for block in arg_0 ] arg_2 = None if arg_1 : arg_2 = arg_1 [ 0 ] . copy ( ) for arg_3 in arg_1 [ 1 : ] : arg_2 |= arg_3 return arg_0 , arg_2

def Func(arg_0):
	'''Combines all masks from a list of arrays, and logically ors them into a single mask'''
	arg_1 = [np.ma.getmaskarray(block) for block in arg_0 if np.ma.isMaskedArray(block)]
	arg_0 = [block.data if np.ma.isMaskedArray(block) else block for block in arg_0]
	arg_2 = None
	if arg_1:
		arg_2 = arg_1[0].copy()
		for arg_3 in arg_1[1:]:
			arg_2 |= arg_3
	return arg_0, arg_2

Combines all masks from a list of arrays and logically ors them into a single mask


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = len ( arg_1 . client . history ) try : arg_5 = arg_0 ( arg_1 , * arg_2 , ** arg_3 ) finally : arg_6 = len ( arg_1 . client . history ) - arg_4 arg_7 = arg_1 . client . history [ - arg_6 : ] arg_1 . history . extend ( arg_7 ) map ( arg_1 . outstanding . add , arg_7 ) return arg_5

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """Keep our history and outstanding attributes up to date after a method call."""
    arg_4 = len(arg_1.client.history)
    try:
        arg_5 = arg_0(arg_1, *arg_2, **arg_3)
    finally:
        arg_6 = len(arg_1.client.history) - arg_4
        arg_7 = arg_1.client.history[-arg_6:]
        arg_1.history.extend(arg_7)
        map(arg_1.outstanding.add, arg_7)
    return arg_5

Keep our history and outstanding attributes up to date after a method call .


def Func ( arg_0 , arg_1 ) : arg_2 = fits . open ( arg_0 ) return np . flipud ( np . array ( arg_2 [ arg_1 ] . data ) )

def Func(arg_0, arg_1):
    """Read a 2D NumPy array to a .fits file.

    After loading the NumPy array, the array is flipped upside-down using np.flipud. This is so that the arrays \
    appear the same orientation as .fits files loaded in DS9.

    Parameters
    ----------
    file_path : str
        The full path of the file that is loaded, including the file name and '.fits' extension.
    hdu : int
        The HDU extension of the array that is loaded from the .fits file.

    Returns
    -------
    ndarray
        The NumPy array that is loaded from the .fits file.

    Examples
    --------
    array_2d = numpy_array_from_fits(file_path='/path/to/file/filename.fits', hdu=0)
    """
    arg_2 = fits.open(arg_0)
    return np.flipud(np.array(arg_2[arg_1].data))

Read a 2D NumPy array to a . fits file .


(self, startx, starty, points=20, outer=100, inner=50, draw=True, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3=20, arg_4=100, arg_5=50, arg_6=True, **arg_7):
        '''Draws a Func.
        '''
        # Taken from Nodebox.
        arg_0.beginpath(**arg_7)
        arg_0.moveto(arg_1, arg_2 + arg_4)

        for arg_8 in range(1, int(2 * arg_3)):
            arg_9 = arg_8 * pi / arg_3
            arg_10 = sin(arg_9)
            arg_11 = cos(arg_9)
            if arg_8 % 2:
                arg_12 = arg_5
            else:
                arg_12 = arg_4
            arg_10 = arg_1 + arg_12 * arg_10
            arg_11 = arg_2 + arg_12 * arg_11
            arg_0.lineto(arg_10, arg_11)

        return arg_0.endpath(arg_6)


(network, sensorRegionName,
                                  classifierRegionName)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . link ( arg_1 , arg_2 , "UniformLink" , "" , srcOutput = "bucketIdxOut" , destInput = "bucketIdxIn" ) arg_0 . link ( arg_1 , arg_2 , "UniformLink" , "" , srcOutput = "actValueOut" , destInput = "actValueIn" ) arg_0 . link ( arg_1 , arg_2 , "UniformLink" , "" , srcOutput = "categoryOut" , destInput = "categoryIn" )

def Func(arg_0, arg_1,
                                  arg_2):
  """Create required links from a sensor region to a classifier region."""
  arg_0.link(arg_1, arg_2, "UniformLink", "",
               srcOutput="bucketIdxOut", destInput="bucketIdxIn")
  arg_0.link(arg_1, arg_2, "UniformLink", "",
               srcOutput="actValueOut", destInput="actValueIn")
  arg_0.link(arg_1, arg_2, "UniformLink", "",
               srcOutput="categoryOut", destInput="categoryIn")

Create required links from a sensor region to a classifier region .


def Func(arg_0, arg_1='', arg_2=None):
        """ Reads one line of input from the user.

        Parameters
        ----------
        prompt : str, optional
            The prompt to print before reading the line.

        callback : callable, optional
            A callback to execute with the read line. If not specified, input is
            read *synchronously* and this method does not return until it has
            been read.

        Returns
        -------
        If a callback is specified, returns nothing. Otherwise, returns the
        input string with the trailing newline stripped.
        """
        if arg_0._reading:
            raise RuntimeError('Cannot read a line. Widget is already reading.')

        if not arg_2 and not arg_0.isVisible():
            # If the user cannot see the widget, this function cannot return.
            raise RuntimeError('Cannot synchronously read a line if the widget '
                               'is not visible!')

        arg_0._reading = True
        arg_0._show_prompt(arg_1, newline=False)

        if arg_2 is None:
            arg_0._reading_callback = None
            while arg_0._reading:
                QtCore.QCoreApplication.processEvents()
            return arg_0._get_input_buffer(force=True).rstrip('\n')

        else:
            arg_0._reading_callback = lambda: \
                arg_2(arg_0._get_input_buffer(force=True).rstrip('\n'))


def Func ( arg_0 , arg_1 , arg_2 ) : if 'code' in arg_1 and 'message' in arg_1 : arg_3 = arg_1 [ 'code' ] arg_4 = arg_1 [ 'message' ] if arg_3 == 'error:noloop' : raise YOURLSNoLoopError ( arg_4 , arg_2 = arg_2 ) elif arg_3 == 'error:nourl' : raise YOURLSNoURLError ( arg_4 , arg_2 = arg_2 ) elif 'message' in arg_1 : arg_4 = arg_1 [ 'message' ] raise YOURLSHTTPError ( arg_4 , arg_2 = arg_2 ) arg_5 = arg_0 . args [ 0 ] raise YOURLSHTTPError ( arg_5 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2):
    """Handle YOURLS API errors.

    requests' raise_for_status doesn't show the user the YOURLS json response,
    so we parse that here and raise nicer exceptions.
    """
    if 'code' in arg_1 and 'message' in arg_1:
        arg_3 = arg_1['code']
        arg_4 = arg_1['message']

        if arg_3 == 'error:noloop':
            raise YOURLSNoLoopError(arg_4, arg_2=arg_2)
        elif arg_3 == 'error:nourl':
            raise YOURLSNoURLError(arg_4, arg_2=arg_2)

    elif 'message' in arg_1:
        arg_4 = arg_1['message']
        raise YOURLSHTTPError(arg_4, arg_2=arg_2)

    arg_5 = arg_0.args[0]
    raise YOURLSHTTPError(arg_5, arg_2=arg_2)


def Func ( arg_0 , arg_1 ) : arg_2 = os . path . join ( arg_0 . path , arg_0 . package_relpath ( arg_1 ) ) return arg_2

def Func(arg_0, arg_1):
        """Returns the full path of the package

        This method returns the full path to the package. This method
        simply constructs the path based on the convention and doesn't
        check if the package actually exists.

        Parameters
        ----------
        package_index :
            a package index

        Returns
        -------
        str
            the full path to the package

        """

        arg_2 = os.path.join(arg_0.path, arg_0.package_relpath(arg_1))
        # e.g., '{path}/tpd_20161129_122841_HnpcmF/task_00009.p.gz'

        return arg_2


def Func(arg_0):
    """
    Split an API file path into directory and name.
    """
    arg_1 = arg_0.rsplit('/', 1)
    if len(arg_1) == 1:
        arg_2 = arg_1[0]
        arg_3 = '/'
    else:
        arg_2 = arg_1[1]
        arg_3 = arg_1[0] + '/'

    return from_api_dirname(arg_3), arg_2

Split an API file path into directory and name .


def
Func
(
arg_0
)
:
arg_1
=
Match
(
r'^( *)\S'
,
arg_0
)
if
arg_1
:
return
len
(
arg_1
.
group
(
1
)
)
else
:
return
0

def Func(arg_0):
  """Return the number of leading spaces in line.

  Args:
    line: A string to check.

  Returns:
    An integer count of leading spaces, possibly zero.
  """
  arg_1 = Match(r'^( *)\S', arg_0)
  if arg_1:
    return len(arg_1.group(1))
  else:
    return 0

Return the number of leading spaces in line .


def Func ( arg_0 ) : arg_1 = False try : arg_2 = arg_0 . drivers except AttributeError : return ( arg_0 , arg_1 ) if len ( arg_2 ) == 1 : arg_3 = list ( arg_0 . drivers ) [ 0 ] if isinstance ( arg_3 , Operator ) and arg_3 . operator == AllOps . NOT : arg_0 = arg_3 . operands [ 0 ] arg_1 = True return ( arg_0 , arg_1 )

def Func(arg_0):
    """
    if is negated return original cond and negated flag
    """
    arg_1 = False
    try:
        arg_2 = arg_0.drivers
    except AttributeError:
        return (arg_0, arg_1)

    if len(arg_2) == 1:
        arg_3 = list(arg_0.drivers)[0]
        if isinstance(arg_3, Operator) and arg_3.operator == AllOps.NOT:
            arg_0 = arg_3.operands[0]
            arg_1 = True

    return (arg_0, arg_1)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = BytesIO ( ) write_var_array ( arg_3 , arg_1 , arg_2 ) arg_4 = zlib . compress ( arg_3 . getvalue ( ) ) arg_3 . close ( ) arg_0 . write ( struct . pack ( 'b3xI' , etypes [ 'miCOMPRESSED' ] [ 'n' ] , len ( arg_4 ) ) ) arg_0 . write ( arg_4 )

def Func(arg_0, arg_1, arg_2):
    """Write compressed variable data to file"""
    arg_3 = BytesIO()

    write_var_array(arg_3, arg_1, arg_2)

    arg_4 = zlib.compress(arg_3.getvalue())
    arg_3.close()

    # write array data elements (size info)
    arg_0.write(struct.pack('b3xI', etypes['miCOMPRESSED']['n'], len(arg_4)))

    # write the compressed data
    arg_0.write(arg_4)


(self, webspace_name, website_name, geo_region, host_names,
                    plan='VirtualDedicatedPlan', compute_mode='Shared',
                    server_farm=None, site_mode=None)

return self._perform_post(
            self._get_sites_path(webspace_name),
            xml,
            Site)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                    arg_5='VirtualDedicatedPlan', arg_6='Shared',
                    arg_7=None, arg_8=None):
        '''
        Create a website.

        webspace_name:
            The name of the webspace.
        website_name:
            The name of the website.
        geo_region:
            The geographical region of the webspace that will be created.
        host_names:
            An array of fully qualified domain names for website. Only one
            hostname can be specified in the azurewebsites.net domain.
            The hostname should match the name of the website. Custom domains
            can only be specified for Shared or Standard websites.
        plan:
            This value must be 'VirtualDedicatedPlan'.
        compute_mode:
            This value should be 'Shared' for the Free or Paid Shared
            offerings, or 'Dedicated' for the Standard offering. The default
            value is 'Shared'. If you set it to 'Dedicated', you must specify
            a value for the server_farm parameter.
        server_farm:
            The name of the Server Farm associated with this website. This is
            a required value for Standard mode.
        site_mode:
            Can be None, 'Limited' or 'Basic'. This value is 'Limited' for the
            Free offering, and 'Basic' for the Paid Shared offering. Standard
            mode does not use the site_mode parameter; it uses the compute_mode
            parameter.
        '''
        arg_9 = _XmlSerializer.create_website_to_xml(arg_1, arg_2, arg_3, arg_5, arg_4, arg_6, arg_7, arg_8)
        return arg_0._perform_post(
            arg_0._get_sites_path(arg_1),
            arg_9,
            Site)


(self, templatePub, templatePriv,
                        mecha=MechanismRSAGENERATEKEYPAIR)

def Func(arg_0, arg_1, arg_2,
                        arg_3=arg_4):
        """
        generate a key pair

        :param templatePub: template for the public key
        :param templatePriv:  template for the private key
        :param mecha: mechanism to use
        :return: a tuple of handles (pub, priv)
        :rtype: tuple
        """
        arg_5 = arg_0._template2ckattrlist(arg_1)
        arg_6 = arg_0._template2ckattrlist(arg_2)
        arg_7 = PyKCS11.LowLevel.CK_OBJECT_HANDLE()
        arg_8 = PyKCS11.LowLevel.CK_OBJECT_HANDLE()
        arg_9 = arg_3.to_native()
        arg_10 = arg_0.lib.C_GenerateKeyPair(arg_0.session, arg_9, arg_5, arg_6,
                                        arg_7, arg_8)

        if arg_10 != CKR_OK:
            raise PyKCS11Error(arg_10)
        return arg_7, arg_8


return os.path.commonprefix([filename, directory]) == directory

def Func ( arg_0 , arg_1 ) : arg_0 = os . path . normcase ( os . path . abspath ( arg_0 ) ) arg_1 = os . path . normcase ( os . path . abspath ( arg_1 ) ) return os . path . commonprefix ( [ arg_0 , arg_1 ] ) == arg_1

def Func(arg_0, arg_1):
    """Test if a file is located within the given directory."""
    arg_0 = os.path.normcase(os.path.abspath(arg_0))
    arg_1 = os.path.normcase(os.path.abspath(arg_1))
    return os.path.commonprefix([arg_0, arg_1]) == arg_1

Test if a file is located within the given directory .


def Func(arg_0, arg_1, arg_2=None, **arg_3):
        """Creates a remote app and registers it."""
        arg_3 = arg_0._process_kwargs(
            arg_2=(arg_2 or arg_0.default_name), **arg_3)
        return arg_1.remote_app(**arg_3)


def Func ( arg_0 ) : super ( FileRecordStream , arg_0 ) . Func ( ) arg_0 . close ( ) arg_0 . _file = open ( arg_0 . _filename , arg_0 . _mode ) arg_0 . _reader = csv . reader ( arg_0 . _file , dialect = "excel" ) arg_0 . _reader . next ( ) arg_0 . _reader . next ( ) arg_0 . _reader . next ( ) arg_0 . _recordCount = 0

def Func(arg_0):
    """
    Put us back at the beginning of the file again.
    """

    # Superclass Func
    super(FileRecordStream, arg_0).Func()

    arg_0.close()
    arg_0._file = open(arg_0._filename, arg_0._mode)
    arg_0._reader = csv.reader(arg_0._file, dialect="excel")

    # Skip header rows
    arg_0._reader.next()
    arg_0._reader.next()
    arg_0._reader.next()

    # Reset record count, etc.
    arg_0._recordCount = 0

Put us back at the beginning of the file again .


return [val for vec in args_ for val in vec]

def Func ( * arg_0 ) : arg_1 = [ tf . get_static_value ( x ) for x in arg_0 ] if any ( arg_2 is None for arg_2 in arg_1 ) : return tf . concat ( arg_0 , axis = 0 ) return [ arg_3 for arg_2 in arg_1 for arg_3 in arg_2 ]

def Func(*arg_0):
  """Concatenates input vectors, statically if possible."""
  arg_1 = [tf.get_static_value(x) for x in arg_0]
  if any(arg_2 is None for arg_2 in arg_1):
    return tf.concat(arg_0, axis=0)
  return [arg_3 for arg_2 in arg_1 for arg_3 in arg_2]

Concatenates input vectors statically if possible .


def Func(arg_0, arg_1):
        """Checks to see if this module uses Python's built-in logging."""
        for arg_2, arg_3 in arg_1.names:
            if arg_2 in arg_0._logging_modules:
                arg_0._logging_names.add(arg_3 or arg_2)

Checks to see if this module uses Python s built - in logging .


async def Func(arg_0, arg_1):
        """Receive a StateUpdate and fan out to Conversations.

        Args:
            state_update: hangouts_pb2.StateUpdate instance
        """
        # The state update will include some type of notification:
        arg_2 = arg_1.WhichOneof('state_update')

        # If conversation fields have been updated, the state update will have
        # a conversation containing changed fields. Handle updating the
        # conversation from this delta:
        if arg_1.HasField('conversation'):
            try:
                await arg_0._handle_conversation_delta(
                    arg_1.conversation
                )
            except exceptions.NetworkError:
                logger.warning(
                    'Discarding %s for %s: Failed to fetch conversation',
                    arg_2.replace('_', ' '),
                    arg_1.conversation.conversation_id.id
                )
                return

        if arg_2 == 'typing_notification':
            await arg_0._handle_set_typing_notification(
                arg_1.typing_notification
            )
        elif arg_2 == 'watermark_notification':
            await arg_0._handle_watermark_notification(
                arg_1.watermark_notification
            )
        elif arg_2 == 'event_notification':
            await arg_0._on_event(
                arg_1.event_notification.event
            )

Receive a StateUpdate and fan out to Conversations .


def
Func
(
arg_0
)
:
@
wraps
(
arg_0
)
def
wrapped
(
*
arg_1
,
**
arg_2
)
:
try
:
return
arg_0
(
*
arg_1
,
**
arg_2
)
except
PathOutsideRoot
as
e
:
raise
HTTPError
(
404
,
"Path outside root: [%s]"
%
e
.
args
[
0
]
)
return
wrapped

def Func(arg_0):
    """
    Decorator for converting PathOutsideRoot errors to 404s.
    """
    @wraps(arg_0)
    def wrapped(*arg_1, **arg_2):
        try:
            return arg_0(*arg_1, **arg_2)
        except PathOutsideRoot as e:
            raise HTTPError(404, "Path outside root: [%s]" % e.args[0])
    return wrapped

Decorator for converting PathOutsideRoot errors to 404s .


def Func ( arg_0 , arg_1 ) : arg_2 = len ( arg_1 . data . data ) arg_3 = arg_1 . data . seq if arg_2 == 0 : arg_0 . _next_seq_id = arg_3 return False if arg_0 . _next_seq_id != - 1 and arg_3 != arg_0 . _next_seq_id : return False arg_0 . _next_seq_id = arg_3 + arg_2 with arg_0 . _lock_packets : arg_0 . _length += len ( arg_1 . data . data ) arg_0 . _remaining += len ( arg_1 . data . data ) arg_0 . _packets . append ( arg_1 ) return True

def Func(arg_0, arg_1):
        """ Func the packet into the queue """

        arg_2 = len(arg_1.data.data)
        arg_3 = arg_1.data.seq

        if arg_2 == 0:
            arg_0._next_seq_id = arg_3
            return False

        # have we seen this packet?
        if arg_0._next_seq_id != -1 and arg_3 != arg_0._next_seq_id:
            return False

        arg_0._next_seq_id = arg_3 + arg_2

        with arg_0._lock_packets:
            # Note: we only account for payload (i.e.: tcp data)
            arg_0._length += len(arg_1.data.data)
            arg_0._remaining += len(arg_1.data.data)

            arg_0._packets.append(arg_1)

        return True


def
Func
(
*
arg_0
,
**
arg_1
)
:
arg_2
=
arg_0
[
0
]
arg_3
=
arg_0
[
1
]
if
len
(
arg_0
)
==
2
and
'attribute'
in
arg_1
:
arg_4
=
arg_1
.
pop
(
'attribute'
)
if
arg_1
:
raise
FilterArgumentError
(
'Unexpected keyword argument %r'
%
next
(
iter
(
arg_1
)
)
)
arg_5
=
make_attrgetter
(
arg_2
.
environment
,
arg_4
)
else
:
try
:
arg_6
=
arg_0
[
2
]
arg_0
=
arg_0
[
3
:
]
except
LookupError
:
raise
FilterArgumentError
(
'map requires a filter argument'
)
arg_5
=
lambda
arg_7
:
arg_2
.
environment
.
call_filter
(
arg_6
,
arg_7
,
arg_0
,
arg_1
,
arg_2
=
arg_2
)
if
arg_3
:
for
arg_7
in
arg_3
:
yield
arg_5
(
arg_7
)

def Func(*arg_0, **arg_1):
    """Applies a filter on a sequence of objects or looks up an attribute.
    This is useful when dealing with lists of objects but you are really
    only interested in a certain value of it.

    The basic usage is mapping on an attribute.  Imagine you have a list
    of users but you are only interested in a list of usernames:

    .. sourcecode:: jinja

        Users on this page: {{ users|map(attribute='username')|join(', ') }}

    Alternatively you can let it invoke a filter by passing the name of the
    filter and the arguments afterwards.  A good example would be applying a
    text conversion filter on a sequence:

    .. sourcecode:: jinja

        Users on this page: {{ titles|map('lower')|join(', ') }}

    .. versionadded:: 2.7
    """
    arg_2 = arg_0[0]
    arg_3 = arg_0[1]

    if len(arg_0) == 2 and 'attribute' in arg_1:
        arg_4 = arg_1.pop('attribute')
        if arg_1:
            raise FilterArgumentError('Unexpected keyword argument %r' %
                next(iter(arg_1)))
        arg_5 = make_attrgetter(arg_2.environment, arg_4)
    else:
        try:
            arg_6 = arg_0[2]
            arg_0 = arg_0[3:]
        except LookupError:
            raise FilterArgumentError('map requires a filter argument')
        arg_5 = lambda arg_7: arg_2.environment.call_filter(
            arg_6, arg_7, arg_0, arg_1, arg_2=arg_2)

    if arg_3:
        for arg_7 in arg_3:
            yield arg_5(arg_7)

Applies a filter on a sequence of objects or looks up an attribute . This is useful when dealing with lists of objects but you are really only interested in a certain value of it .


def Func ( arg_0 , arg_1 ) : from invenio_migrator . tasks . communities import load_community loadcommon ( arg_0 , load_community , task_args = ( arg_1 , ) )

def Func(arg_0, arg_1):
    """Load communities."""
    from invenio_migrator.tasks.communities import load_community
    loadcommon(arg_0, load_community, task_args=(arg_1, ))