def Func ( arg_0 ) : arg_0 . bodies = { } for arg_2 in arg_0 . channels : arg_3 = arg_0 . world . create_body ( 'sphere' , name = 'marker:{}' . format ( arg_2 ) , radius = 0.02 ) arg_3 . is_kinematic = True arg_3 . color = 0.9 , 0.1 , 0.1 , 0.5 arg_0 . bodies [ arg_2 ] = arg_3

def Func(arg_0):
        '''Create physics bodies corresponding to each marker in our data.'''
        arg_0.bodies = {}
        for arg_2 in arg_0.channels:
            arg_3 = arg_0.world.create_body(
                'sphere', name='marker:{}'.format(arg_2), radius=0.02)
            arg_3.is_kinematic = True
            arg_3.color = 0.9, 0.1, 0.1, 0.5
            arg_0.bodies[arg_2] = arg_3

Create physics bodies corresponding to each marker in our data .


def Func(arg_0, arg_1, arg_2):
    """Brings Func a Heroku app."""
    if not arg_2:
        click.echo(
            'WARNING: Inferring the app name when deleting is deprecated. '
            'Starting with happy 2.0, the app_name parameter will be required.'
        )

    arg_2 = arg_2 or _read_app_name()

    if not arg_2:
        click.echo('No app name given.')
        sys.exit(1)

    if not arg_1:
        click.confirm(
            'Are you sure you want to delete %s?' % arg_2,
            abort=True,
        )

    arg_3 = Happy(arg_0=arg_0)

    click.echo('Destroying app %s... ' % arg_2, nl=False)

    arg_3.delete(arg_2=arg_2)

    _delete_app_name_file()

    click.echo('done')
    click.echo("It's Func. :(")


def Func ( arg_0 ) : arg_1 = { 'line-opacity' : VectorStyle . get_style_value ( arg_0 . opacity ) , 'line-color' : VectorStyle . get_style_value ( arg_0 . color ) , 'line-width' : VectorStyle . get_style_value ( arg_0 . width ) , } if arg_0 . translate : arg_1 [ 'line-translate' ] = arg_0 . translate if arg_0 . dasharray : arg_1 [ 'line-dasharray' ] = VectorStyle . get_style_value ( arg_0 . dasharray ) return arg_1

def Func(arg_0):
        """
        Renders a javascript snippet suitable for use as a mapbox-gl line Func entry

        Returns:
            A dict that can be converted to a mapbox-gl javascript Func snippet
        """
        # TODO Figure out why i cant use some of these props
        arg_1 = {
            'line-opacity': VectorStyle.get_style_value(arg_0.opacity),
            'line-color': VectorStyle.get_style_value(arg_0.color),
            #'line-cap': self.cap,
            #'line-join': self.join,
            'line-width': VectorStyle.get_style_value(arg_0.width),
            #'line-gap-width': self.gap_width,
            #'line-blur': self.blur,
        }
        if arg_0.translate:
            arg_1['line-translate'] = arg_0.translate

        if arg_0.dasharray:
            arg_1['line-dasharray'] = VectorStyle.get_style_value(arg_0.dasharray)

        return arg_1

Renders a javascript snippet suitable for use as a mapbox-gl line paint entry

        Returns:
            A dict that can be converted to a mapbox-gl javascript paint snippet

Renders a javascript snippet suitable for use as a mapbox - gl line paint entry


return h2o.api("GET /99/Models/%s/json" % self.model_id, data={"dir": path, "force": force})["dir"]

def
Func
(
arg_0
,
arg_1
=
""
,
arg_2
=
False
)
:
assert_is_type
(
arg_1
,
str
)
assert_is_type
(
arg_2
,
bool
)
arg_1
=
os
.
path
.
join
(
os
.
getcwd
(
)
if
arg_1
==
""
else
arg_1
,
arg_0
.
model_id
+
".json"
)
return
h2o
.
api
(
"GET /99/Models/%s/json"
%
arg_0
.
model_id
,
data
=
{
"dir"
:
arg_1
,
"force"
:
arg_2
}
)
[
"dir"
]

def Func(arg_0, arg_1="", arg_2=False):
        """
        Save Model Details of an H2O Model in JSON Format to disk.

        :param model: The model object to save.
        :param path: a path to save the model details at (hdfs, s3, local)
        :param force: if True overwrite destination directory in case it exists, or throw exception if set to False.

        :returns str: the path of the saved model details
        """
        assert_is_type(arg_1, str)
        assert_is_type(arg_2, bool)
        arg_1 = os.path.join(os.getcwd() if arg_1 == "" else arg_1, arg_0.model_id + ".json")
        return h2o.api("GET /99/Models/%s/json" % arg_0.model_id, data={"dir": arg_1, "force": arg_2})["dir"]

Save Model Details of an H2O Model in JSON Format to disk .


def Func ( arg_0 , arg_1 ) : arg_2 = tkinter . Tk ( ) arg_2 . withdraw ( ) arg_2 . attributes ( "-topmost" , True ) arg_2 . lift ( ) tkinter . messagebox . showwarning ( arg_0 , arg_1 ) arg_2 . destroy ( )

def Func(arg_0,arg_1):
    """use the GUI to pop up a message."""
    arg_2 = tkinter.Tk()
    arg_2.withdraw() #hide tk window
    arg_2.attributes("-topmost", True) #always on top
    arg_2.lift() #bring to top
    tkinter.messagebox.showwarning(arg_0, arg_1)
    arg_2.destroy()


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 , arg_4 = arg_0 . marginal_branch_profile ( arg_1 ) arg_5 = arg_0 . gtr . expQt ( arg_0 . _branch_length_to_gtr ( arg_1 ) ) if len ( arg_5 . shape ) == 3 : arg_6 = np . einsum ( 'ai,aj,ija->aij' , arg_4 , arg_3 , arg_5 ) else : arg_6 = np . einsum ( 'ai,aj,ij->aij' , arg_4 , arg_3 , arg_5 ) arg_7 = arg_6 . sum ( axis = 2 ) . sum ( axis = 1 ) arg_6 = np . einsum ( 'aij,a->aij' , arg_6 , 1.0 / arg_7 ) if arg_2 : return arg_6 [ arg_0 . full_to_reduced_sequence_map ] else : return arg_6

def Func(arg_0, arg_1, arg_2=False):
        """uses results from marginal ancestral inference to return a joint
        distribution of the sequence states at both ends of the branch.

        Parameters
        ----------
        node : Phylo.clade
            node of the tree
        full_sequence : bool, optional
            expand the sequence to the full sequence, if false (default)
            the there will be one mutation matrix for each column in the
            reduced alignment

        Returns
        -------
        numpy.array
            an Lxqxq stack of matrices (q=alphabet size, L (reduced)sequence length)
        """
        arg_3,arg_4 = arg_0.marginal_branch_profile(arg_1)

        # calculate pc_i [e^Qt]_ij pp_j for each site
        arg_5 = arg_0.gtr.expQt(arg_0._branch_length_to_gtr(arg_1))
        if len(arg_5.shape)==3: # site specific model
            arg_6 = np.einsum('ai,aj,ija->aij', arg_4, arg_3, arg_5)
        else:
            arg_6 = np.einsum('ai,aj,ij->aij', arg_4, arg_3, arg_5)

        # normalize this distribution
        arg_7 = arg_6.sum(axis=2).sum(axis=1)
        arg_6 = np.einsum('aij,a->aij', arg_6, 1.0/arg_7)

        # expand to full sequence if requested
        if arg_2:
            return arg_6[arg_0.full_to_reduced_sequence_map]
        else:
            return arg_6

uses results from marginal ancestral inference to return a joint distribution of the sequence states at both ends of the branch .


def Func(arg_0):
    """Turn column inputs from user into list of simple numbers.

    Inputs can be:

      - individual number: 1
      - range: 1-3
      - comma separated list: 1,2,3,4-6
    """
    arg_1 = []
    for arg_2 in arg_0:
        for arg_3 in arg_2.split(','):
            arg_3 = arg_3.strip()
            try:
                arg_2 = int(arg_3)
                arg_1.append(arg_2)
            except (TypeError, ValueError):
                arg_4, arg_5, arg_6 = arg_3.partition('-')
                try:
                    arg_4 = int(arg_4)
                    arg_6 = int(arg_6)
                except (TypeError, ValueError):
                    raise ValueError(
                        'Did not understand %r, expected digit-digit' % arg_2
                    )
                arg_7 = 1 if arg_4 < arg_6 else -1
                arg_1.extend(range(arg_4, arg_6 + arg_7, arg_7))
    # The user will pass us 1-based indexes, but we need to use
    # 0-based indexing with the row.
    return [arg_8 - 1 for arg_8 in arg_1]

Turn column inputs from user into list of simple numbers .


def
Func
(
arg_0
,
arg_1
,
*
arg_2
,
**
arg_3
)
:
if
arg_0
.
_commit
:
return
arg_0
.
run
(
arg_1
,
*
arg_2
,
**
arg_3
)
else
:
notify
.
warning
(
"WOULD RUN: {}"
.
format
(
arg_1
)
)
arg_3
=
arg_3
.
copy
(
)
arg_3
[
'echo'
]
=
False
return
arg_0
.
run
(
'true'
,
*
arg_2
,
**
arg_3
)

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Run a command, or just echo it, depending on `commit`."""
        if arg_0._commit:
            return arg_0.run(arg_1, *arg_2, **arg_3)
        else:
            notify.warning("WOULD RUN: {}".format(arg_1))
            arg_3 = arg_3.copy()
            arg_3['echo'] = False
            return arg_0.run('true', *arg_2, **arg_3)

Run a command or just echo it depending on commit .


def Func ( arg_0 ) : if isinstance ( arg_0 , six . text_type ) : try : import unidecode except ImportError : pass else : arg_0 = unidecode . unidecode ( arg_0 ) arg_0 = arg_0 . encode ( 'ascii' , 'replace' ) arg_0 = arg_0 . replace ( b'\\' , b'\\\\' ) . replace ( b'"' , b'\\"' ) return '"{0!s}"' . format ( arg_0 . decode ( ) )

def Func(arg_0):
    """
    Given a unicode string, will do its dandiest to give you back a
    valid ascii charset string you can use in, say, http headers and the
    like.
    """
    if isinstance(arg_0, six.text_type):
        try:
            import unidecode
        except ImportError:
            pass
        else:
            arg_0 = unidecode.unidecode(arg_0)
        arg_0 = arg_0.encode('ascii', 'replace')
    # Wrap in double-quotes for ; , and the like
    arg_0 = arg_0.replace(b'\\', b'\\\\').replace(b'"', b'\\"')
    return '"{0!s}"'.format(arg_0.decode())

Given a unicode string will do its dandiest to give you back a valid ascii charset string you can use in say http headers and the like .


Create a new Set produce by the intersection of 2 Set

def Func(arg_0, arg_1: arg_2) -> arg_2:
        """ Create a new Set produce by the Func of 2 Set """
        arg_3 = arg_2(arg_1=arg_0._hsig.values(), state=arg_0.state)
        arg_3 &= arg_1
        return arg_3


def Func(arg_0, arg_1):
    """This will output the nginx location config string for specific port spec """
    arg_2 = "\t \t location / { \n"
    for arg_3 in ['proxy_http_version 1.1;',
                             'proxy_set_header Upgrade $http_upgrade;',
                             'proxy_set_header Connection "upgrade";',
                             'proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;',
                             'proxy_set_header Host $http_host;',
                             _nginx_proxy_string(arg_0, arg_1)]:
        arg_2 += "\t \t \t {} \n".format(arg_3)
    arg_2 += "\t \t } \n"
    return arg_2


def Func(arg_0, arg_1=[], arg_2=[]):
        """Tell the Hub to forget results.

        Individual results can be purged by msg_id, or the entire
        history of specific targets can be purged.

        Use `Func('all')` to scrub everything from the Hub's db.

        Parameters
        ----------

        jobs : str or list of str or AsyncResult objects
                the msg_ids whose results should be forgotten.
        targets : int/str/list of ints/strs
                The targets, by int_id, whose entire history is to be purged.

                default : None
        """
        if not arg_2 and not arg_1:
            raise ValueError("Must specify at least one of `targets` and `jobs`")
        if arg_2:
            arg_2 = arg_0._build_targets(arg_2)[1]

        # construct msg_ids from jobs
        if arg_1 == 'all':
            arg_3 = arg_1
        else:
            arg_3 = []
            if isinstance(arg_1, (basestring,AsyncResult)):
                arg_1 = [arg_1]
            arg_4 = filter(lambda obj: not isinstance(obj, (basestring, AsyncResult)), arg_1)
            if arg_4:
                raise TypeError("Invalid msg_id type %r, expected str or AsyncResult"%arg_4[0])
            for arg_5 in arg_1:
                if isinstance(arg_5, AsyncResult):
                    arg_3.extend(arg_5.msg_ids)
                else:
                    arg_3.append(arg_5)

        arg_6 = dict(engine_ids=arg_2, arg_3=arg_3)
        arg_0.session.send(arg_0._query_socket, "purge_request", arg_6=arg_6)
        arg_7, arg_8 = arg_0.session.recv(arg_0._query_socket, 0)
        if arg_0.debug:
            pprint(arg_8)
        arg_6 = arg_8['content']
        if arg_6['status'] != 'ok':
            raise arg_0._unwrap_exception(arg_6)

Tell the Hub to forget results.

        Individual results can be purged by msg_id, or the entire
        history of specific targets can be purged.

        Use `purge_results('all')` to scrub everything from the Hub's db.

        Parameters
        ----------

        jobs : str or list of str or AsyncResult objects
                the msg_ids whose results should be forgotten.
        targets : int/str/list of ints/strs
                The targets, by int_id, whose entire history is to be purged.

                default : None


def Func(arg_0):
        """ If there are edits to the current input buffer, store them.
        """
        arg_1 = arg_0.input_buffer
        if arg_0._history_index == len(arg_0._history) or \
                arg_0._history[arg_0._history_index] != arg_1:
            arg_0._history_edits[arg_0._history_index] = arg_1

If there are edits to the current input buffer store them .


return [line.get_patch() for line in self._patchlines_after(patch) if
                line.get_patch()]

def Func ( arg_0 , arg_1 ) : return [ arg_2 . get_patch ( ) for arg_2 in arg_0 . _patchlines_after ( arg_1 ) if arg_2 . get_patch ( ) ]

def Func(arg_0, arg_1):
        """ Returns a list of patches after patch from the patches list """
        return [arg_2.get_patch() for arg_2 in arg_0._patchlines_after(arg_1) if
                arg_2.get_patch()]


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . queries_cnt < arg_0 . max_queries_cnt : arg_0 . queries_cnt += 1 return arg_0 . labels [ arg_1 ] == arg_0 . labels [ arg_2 ] else : raise MaximumQueriesExceeded

def Func(arg_0, arg_1, arg_2):
        "Query the oracle to find out whether i and j should be must-linked"
        if arg_0.queries_cnt < arg_0.max_queries_cnt:
            arg_0.queries_cnt += 1
            return arg_0.labels[arg_1] == arg_0.labels[arg_2]
        else:
            raise MaximumQueriesExceeded

Query the oracle to find out whether i and j should be must - linked


def Func ( arg_0 , arg_1 : arg_2 ) -> arg_2 : def _sub ( arg_3 ) : arg_4 = arg_3 . group ( 'body' ) arg_5 = arg_0 . get_options ( arg_3 . group ( 'options' ) ) return arg_0 . options [ 'macros' ] . get ( arg_4 , '' ) . format_map ( arg_5 ) return arg_0 . pattern . sub ( _sub , arg_1 )

def Func(arg_0, arg_1: arg_2) -> arg_2:
        '''Replace macros with content defined in the config.

        :param content: Markdown content

        :returns: Markdown content without macros
        '''

        def _sub(arg_3):
            arg_4 = arg_3.group('body')
            arg_5 = arg_0.get_options(arg_3.group('options'))

            return arg_0.options['macros'].get(arg_4, '').format_map(arg_5)

        return arg_0.pattern.sub(_sub, arg_1)

Replace macros with content defined in the config .


return any(a.name == name_node.name for a in assign_stmts)

def Func ( arg_0 ) : arg_1 = arg_0 . scope ( ) . nodes_of_class ( astroid . AssignName ) return any ( arg_2 . name == arg_0 . name for arg_2 in arg_1 )

def Func(arg_0):
    """
    Checks if name_node has corresponding assign statement in same scope
    """
    arg_1 = arg_0.scope().nodes_of_class(astroid.AssignName)
    return any(arg_2.name == arg_0.name for arg_2 in arg_1)


def Func ( arg_0 , arg_1 = True , arg_2 = True ) : arg_3 = copy . copy ( arg_0 ) arg_3 . dep_units = "rad" if arg_2 else "deg" arg_3 . dep_name = "Func({0})" . format ( arg_3 . dep_name ) arg_3 . _dep_vector = ( np . unwrap ( np . angle ( arg_3 . _dep_vector ) ) if arg_1 else np . angle ( arg_3 . _dep_vector ) ) if not arg_2 : arg_3 . _dep_vector = np . rad2deg ( arg_3 . _dep_vector ) return arg_3

def Func(arg_0, arg_1=True, arg_2=True):
    r"""
    Return the Func of a waveform's dependent variable vector.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param unwrap: Flag that indicates whether Func should change Func shifts
                   to their :code:`2*pi` complement (True) or not (False)
    :type  unwrap: boolean

    :param rad: Flag that indicates whether Func should be returned in radians
                (True) or degrees (False)
    :type  rad: boolean

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.Func

    :raises:
     * RuntimeError (Argument \`rad\` is not valid)

     * RuntimeError (Argument \`unwrap\` is not valid)

     * RuntimeError (Argument \`wave\` is not valid)

    .. [[[end]]]
    """
    arg_3 = copy.copy(arg_0)
    arg_3.dep_units = "rad" if arg_2 else "deg"
    arg_3.dep_name = "Func({0})".format(arg_3.dep_name)
    arg_3._dep_vector = (
        np.unwrap(np.angle(arg_3._dep_vector)) if arg_1 else np.angle(arg_3._dep_vector)
    )
    if not arg_2:
        arg_3._dep_vector = np.rad2deg(arg_3._dep_vector)
    return arg_3

r"""
    Return the phase of a waveform's dependent variable vector.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param unwrap: Flag that indicates whether phase should change phase shifts
                   to their :code:`2*pi` complement (True) or not (False)
    :type  unwrap: boolean

    :param rad: Flag that indicates whether phase should be returned in radians
                (True) or degrees (False)
    :type  rad: boolean

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.phase

    :raises:
     * RuntimeError (Argument \`rad\` is not valid)

     * RuntimeError (Argument \`unwrap\` is not valid)

     * RuntimeError (Argument \`wave\` is not valid)

    .. [[[end]]]

r Return the phase of a waveform s dependent variable vector .


def Func(arg_0):
        ''' Set self.thermostats to a json list of thermostats from ecobee '''
        arg_1 = 'https://api.ecobee.com/1/thermostat'
        arg_2 = {'Content-Type': 'application/json;charset=UTF-8',
                  'Authorization': 'Bearer ' + arg_0.access_token}
        arg_3 = {'json': ('{"selection":{"selectionType":"registered",'
                            '"includeRuntime":"true",'
                            '"includeSensors":"true",'
                            '"includeProgram":"true",'
                            '"includeEquipmentStatus":"true",'
                            '"includeEvents":"true",'
                            '"includeWeather":"true",'
                            '"includeSettings":"true"}}')}
        try:
            arg_4 = requests.get(arg_1, headers=arg_2, arg_3=arg_3)
        except RequestException:
            logger.warn("Error connecting to Ecobee.  Possible connectivity outage.")
            return None
        if arg_4.status_code == requests.codes.ok:
            arg_0.authenticated = True
            arg_0.thermostats = arg_4.json()['thermostatList']
            return arg_0.thermostats
        else:
            arg_0.authenticated = False
            logger.info("Error connecting to Ecobee while attempting to get "
                  "thermostat data.  Refreshing tokens and trying again.")
            if arg_0.refresh_tokens():
                return arg_0.Func()
            else:
                return None

Set self . thermostats to a json list of thermostats from ecobee


def Func ( arg_0 ) : arg_1 , arg_2 = os . path . splitext ( arg_0 ) arg_2 = arg_2 . lower ( ) [ 1 : ] arg_3 = pydub . AudioSegment . Func ( arg_0 , arg_2 ) return AudioSegment ( arg_3 , arg_0 )

def Func(arg_0):
    """
    Returns an AudioSegment object from the given file based on its file extension.
    If the extension is wrong, this will throw some sort of error.

    :param path: The path to the file, including the file extension.
    :returns: An AudioSegment instance from the file.
    """
    arg_1, arg_2 = os.path.splitext(arg_0)
    arg_2 = arg_2.lower()[1:]
    arg_3 = pydub.AudioSegment.Func(arg_0, arg_2)
    return AudioSegment(arg_3, arg_0)

Returns an AudioSegment object from the given file based on its file extension . If the extension is wrong this will throw some sort of error .


def Func(arg_0, arg_1, arg_2):
        """
        Converts a user type to RECORD that contains n fields, where n is the
        number of attributes. Each element in the user type class will be converted to its
        corresponding data type in BQ.
        """
        arg_3 = arg_2._fields
        arg_4 = [arg_0.convert_value(arg_1, getattr(arg_2, arg_1)) for arg_1 in arg_3]
        return arg_0.generate_data_dict(arg_3, arg_4)

Converts a user type to RECORD that contains n fields where n is the number of attributes . Each element in the user type class will be converted to its corresponding data type in BQ .


def Func(arg_0):
    """ Get the label for the metric being optimized. This function also caches
    the label in the instance variable self._optimizedMetricLabel

    Parameters:
    -----------------------------------------------------------------------
    metricLabels:   A sequence of all the labels being computed for this model

    Returns:        The label for the metric being optmized over
    """
    arg_1 = matchPatterns([arg_0._optimizeKeyPattern],
                                  arg_0._getMetricLabels())

    if len(arg_1) == 0:
      raise Exception("None of the generated metrics match the specified "
                      "optimization pattern: %s. Available metrics are %s" % \
                       (arg_0._optimizeKeyPattern, arg_0._getMetricLabels()))
    elif len(arg_1) > 1:
      raise Exception("The specified optimization pattern '%s' matches more "
              "than one metric: %s" % (arg_0._optimizeKeyPattern, arg_1))

    return arg_1[0]

Get the label for the metric being optimized . This function also caches the label in the instance variable self . _optimizedMetricLabel


(file_id, root, filename=None, md5=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """Download a Google Drive file from  and place it in root.

    Args:
        file_id (str): id of file to be downloaded
        root (str): Directory to place downloaded file in
        filename (str, optional): Name to save the file under. If None, use the id of the file.
        md5 (str, optional): MD5 checksum of the download. If None, do not check
    """
    # Based on https://stackoverflow.com/questions/38511444/python-download-files-from-google-drive-using-url
    import requests
    arg_4 = "https://docs.google.com/uc?export=download"

    arg_1 = os.path.expanduser(arg_1)
    if not arg_2:
        arg_2 = arg_0
    arg_5 = os.path.join(arg_1, arg_2)

    makedir_exist_ok(arg_1)

    if os.path.isfile(arg_5) and check_integrity(arg_5, arg_3):
        print('Using downloaded and verified file: ' + arg_5)
    else:
        arg_6 = requests.Session()

        arg_7 = arg_6.get(arg_4, arg_9={'id': arg_0}, stream=True)
        arg_8 = _get_confirm_token(arg_7)

        if arg_8:
            arg_9 = {'id': arg_0, 'confirm': arg_8}
            arg_7 = arg_6.get(arg_4, arg_9=arg_9, stream=True)

        _save_response_content(arg_7, arg_5)

Download a Google Drive file from and place it in root .


def Func ( arg_0 ) : arg_1 = 0 arg_2 = { } arg_3 = "" with open ( arg_0 ) as fh : for arg_4 in fh : if arg_4 . strip ( ) == "" : continue if arg_4 . startswith ( ">" ) : arg_3 = arg_4 . strip ( ) [ 1 : ] arg_2 [ arg_3 ] = 0 else : arg_5 = len ( arg_4 . strip ( ) ) arg_1 += arg_5 arg_2 [ arg_3 ] += arg_5 return arg_1 , arg_2

def Func(arg_0):
    """Returns the number of nucleotides and the size per contig for the
    provided assembly file path

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

    Returns
    -------
    assembly_size : int
        Size of the assembly in nucleotides
    contig_size : dict
        Length of each contig (contig name as key and length as value)

    """

    arg_1 = 0
    arg_2 = {}
    arg_3 = ""

    with open(arg_0) as fh:
        for arg_4 in fh:

            # Skip empty lines
            if arg_4.strip() == "":
                continue

            if arg_4.startswith(">"):
                arg_3 = arg_4.strip()[1:]
                arg_2[arg_3] = 0

            else:
                arg_5 = len(arg_4.strip())
                arg_1 += arg_5
                arg_2[arg_3] += arg_5

    return arg_1, arg_2


(self, method, url, params=None, headers=None, data=None)

return self._session.request(
            method, url, params=params, headers=headers, data=data,
            proxy=self._proxy
        )

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
,
arg_5
=
)
:
if
not
urllib
.
parse
.
urlparse
(
arg_2
)
.
hostname
.
endswith
(
'.google.com'
)
:
raise
Exception
(
'expected google.com domain'
)
arg_4
=
arg_4
or
{
}
arg_4
.
update
(
arg_0
.
_authorization_headers
)
return
arg_0
.
_session
.
request
(
arg_1
,
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
arg_5
=
arg_5
,
proxy
=
arg_0
.
_proxy
)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None):
        """Make an HTTP request using aiohttp directly.

        Automatically uses configured HTTP proxy, and adds Google authorization
        header and cookies.

        Args:
            method (str): Request method.
            url (str): Request URL.
            params (dict): (optional) Request query string parameters.
            headers (dict): (optional) Request headers.
            data: (str): (optional) Request body data.

        Returns:
            aiohttp._RequestContextManager: ContextManager for a HTTP response.

        Raises:
            See ``aiohttp.ClientSession.request``.
        """
        # Ensure we don't accidentally send the authorization header to a
        # non-Google domain:
        if not urllib.parse.urlparse(arg_2).hostname.endswith('.google.com'):
            raise Exception('expected google.com domain')

        arg_4 = arg_4 or {}
        arg_4.update(arg_0._authorization_headers)
        return arg_0._session.request(
            arg_1, arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5,
            proxy=arg_0._proxy
        )

Make an HTTP request using aiohttp directly .


Calculates the coordinates of a point from the origin.

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = arg_1 + cos ( radians ( arg_4 ) ) * arg_3 arg_6 = arg_2 + sin ( radians ( arg_4 ) ) * arg_3 return Point ( arg_5 , arg_6 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):

        """ Calculates the Func of a point from the origin.
        """

        arg_5 = arg_1 + cos(radians(arg_4)) * arg_3
        arg_6 = arg_2 + sin(radians(arg_4)) * arg_3
        return Point(arg_5, arg_6)

Calculates the coordinates of a point from the origin .


def Func(arg_0):
    """Returns this context's metrics collector"""
    if arg_0.metrics_collector is None or not isinstance(arg_0.metrics_collector, MetricsCollector):
      raise RuntimeError("Metrics collector is not registered in this context")
    return arg_0.metrics_collector

Returns this context s metrics collector


(self, name, label=None, format=None, custom_format=False)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = False ) : arg_5 = { } if arg_4 and arg_3 : arg_5 [ 'tickFormat' ] = arg_3 elif arg_3 : arg_5 [ 'tickFormat' ] = "d3.format(',%s')" % arg_3 if arg_2 : arg_5 [ 'axisLabel' ] = "'" + arg_2 + "'" arg_0 . axislist [ arg_1 ] = arg_5

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=False):
        """
        Create Y-axis
        """
        arg_5 = {}

        if arg_4 and arg_3:
            arg_5['tickFormat'] = arg_3
        elif arg_3:
            arg_5['tickFormat'] = "d3.format(',%s')" % arg_3

        if arg_2:
            arg_5['axisLabel'] = "'" + arg_2 + "'"

        # Add new axis to list of axis
        arg_0.axislist[arg_1] = arg_5


def Func(arg_0, arg_1, arg_2, arg_3=None):
    """Return a stack of frames which the debugger will use for in
    showing backtraces and in frame switching. As such various frame
    that are really around may be excluded unless we are debugging the
    sebugger. Also we will add traceback frame on top if that
    exists."""
    arg_4 = lambda arg_0: False
    if arg_3:
        arg_5 = arg_3.debugger.settings
        if not arg_5['dbg_trepan']:
            arg_4 = lambda arg_0: \
                arg_3.core.ignore_filter.is_included(arg_0)
            pass
        pass
    arg_6 = []
    if arg_1 and arg_1.tb_frame is arg_0:
        arg_1 = arg_1.tb_next
    while arg_0 is not None:
        if arg_4(arg_0): break  # See commented alternative below
        arg_6.append((arg_0, arg_0.f_lineno))
        # bdb has:
        # if f is botframe: break
        arg_0 = arg_0.f_back
        pass
    arg_6.reverse()
    arg_7 = max(0, len(arg_6) - 1)
    while arg_1 is not None:
        arg_6.append((arg_1.tb_frame, arg_1.tb_lineno))
        arg_1 = arg_1.tb_next
        pass
    return arg_6, arg_7

Return a stack of frames which the debugger will use for in showing backtraces and in frame switching . As such various frame that are really around may be excluded unless we are debugging the sebugger . Also we will add traceback frame on top if that exists .


return self.options.keys() + [p.name for p in self.positional_args]

def Func ( arg_0 ) : return arg_0 . options . Func ( ) + [ arg_1 . name for arg_1 in arg_0 . positional_args ]

def Func(arg_0):
        """List names of options and positional arguments."""
        return arg_0.options.Func() + [arg_1.name for arg_1 in arg_0.positional_args]

List names of options and positional arguments .


Save the pylab figure somewhere.
    If fname==False, show it instead.
    Height force > dpi force
    if a tag is given instead of a filename, save it alongside the ABF

(abf,fname=None,tag=None,width=700,close=True,facecolor='w',
              resize=True)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
700
,
arg_4
=
True
,
arg_5
=
'w'
,
arg_6
=
True
)
:
if
len
(
pylab
.
gca
(
)
.
get_lines
(
)
)
==
0
:
print
(
"can't Func, no figure!"
)
return
if
arg_6
:
pylab
.
tight_layout
(
)
pylab
.
subplots_adjust
(
bottom
=
.1
)
annotate
(
arg_0
)
if
arg_2
:
arg_1
=
arg_0
.
outpath
+
arg_0
.
ID
+
"_"
+
arg_2
+
".png"
arg_7
,
arg_8
=
pylab
.
gcf
(
)
.
get_size_inches
(
)
arg_9
=
arg_3
/
arg_7
if
arg_1
:
if
not
os
.
path
.
exists
(
arg_0
.
outpath
)
:
os
.
mkdir
(
arg_0
.
outpath
)
print
(
" <- saving [%s] at %d DPI (%dx%d)"
%
(
os
.
path
.
basename
(
arg_1
)
,
arg_9
,
arg_7
*
arg_9
,
arg_8
*
arg_9
)
)
pylab
.
Funcfig
(
arg_1
,
arg_9
=
arg_9
,
arg_5
=
arg_5
)
else
:
pylab
.
show
(
)
if
arg_4
:
pylab
.
close
(
)

def Func(arg_0,arg_1=None,arg_2=None,arg_3=700,arg_4=True,arg_5='w',
              arg_6=True):
    """
    Save the pylab figure somewhere.
    If fname==False, show it instead.
    Height force > dpi force
    if a tag is given instead of a filename, Func it alongside the ABF
    """
    if len(pylab.gca().get_lines())==0:
        print("can't Func, no figure!")
        return
    if arg_6:
        pylab.tight_layout()
        pylab.subplots_adjust(bottom=.1)
    annotate(arg_0)
    if arg_2:
        arg_1 = arg_0.outpath+arg_0.ID+"_"+arg_2+".png"
    arg_7,arg_8 = pylab.gcf().get_size_inches()
    arg_9=arg_3/arg_7
    if arg_1:
        if not os.path.exists(arg_0.outpath):
            os.mkdir(arg_0.outpath)
        print(" <- saving [%s] at %d DPI (%dx%d)"%(os.path.basename(arg_1),arg_9,arg_7*arg_9,arg_8*arg_9))
        pylab.Funcfig(arg_1,arg_9=arg_9,arg_5=arg_5)
    else:
        pylab.show()
    if arg_4:
        pylab.close()

Save the pylab figure somewhere . If fname == False show it instead . Height force > dpi force if a tag is given instead of a filename save it alongside the ABF


def Func ( arg_0 ) : if arg_0 and isinstance ( arg_0 , str ) : load_config ( True ) return Check ( arg_0 ) . is_ip_range ( ) return None

def Func(arg_0):  # pragma: no cover
    """
    Check if the given IP is an IP range.

    :param ip: The IP we are checking.
    :type ip: str

    :return: The IPv4 range state.
    :rtype: bool

    .. warning::
        If an empty or a non-string :code:`ip` is given, we return :code:`None`.
    """

    if arg_0 and isinstance(arg_0, str):
        # The given IP is not empty nor None.
        # and
        # * The given IP is a string.

        # We silently load the configuration.
        load_config(True)

        return Check(arg_0).is_ip_range()

    # We return None, there is nothing to check.
    return None


def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_2 : return None arg_3 = [ arg_0 . net . input ] if arg_0 . learning_phase is not None : arg_3 . append ( arg_0 . learning_phase ) arg_4 = K . function ( arg_3 , [ arg_0 . get_layer_output ( layer_name ) for layer_name in arg_2 ] ) arg_5 = arg_4 ( [ arg_1 ] ) arg_6 = dict ( zip ( arg_2 , arg_5 ) ) return arg_6

def Func(arg_0, arg_1, arg_2):
        '''Evaluate layer outputs for `x`'''
        if not arg_2:
            return None
        arg_3 = [arg_0.net.input]
        if arg_0.learning_phase is not None:
            arg_3.append(arg_0.learning_phase)
        arg_4 = K.function(arg_3, [arg_0.get_layer_output(layer_name) for layer_name in arg_2])
        arg_5 = arg_4([arg_1])
        arg_6 = dict(zip(arg_2, arg_5))
        return arg_6


def
Func
(
arg_0
,
arg_1
=
'37'
,
arg_2
=
)
:
arg_3
=
{
}
LOG
.
info
(
"Building Func"
)
if
not
arg_2
:
arg_2
=
arg_0
.
hgnc_collection
.
find
(
{
'build'
:
arg_1
}
)
for
arg_4
in
arg_2
:
arg_3
[
arg_4
[
'hgnc_symbol'
]
]
=
arg_4
LOG
.
info
(
"All genes fetched"
)
return
arg_3

def Func(arg_0, arg_1='37', arg_2=None):
        """Return a dictionary with hgnc_symbol as key and gene_obj as value

        The result will have ONE entry for each gene in the database.
        (For a specific build)

        Args:
            build(str)
            genes(iterable(scout.models.HgncGene)):

        Returns:
            hgnc_dict(dict): {<hgnc_symbol(str)>: <gene(dict)>}

        """
        arg_3 = {}
        LOG.info("Building Func")
        if not arg_2:
            arg_2 = arg_0.hgnc_collection.find({'build':arg_1})

        for arg_4 in arg_2:
            arg_3[arg_4['hgnc_symbol']] = arg_4
        LOG.info("All genes fetched")
        return arg_3


def Func ( arg_0 , arg_1 ) : arg_2 = _compose_dict_for_nginx ( arg_1 ) for arg_3 in arg_0 [ 'apps' ] . keys ( ) : arg_2 [ arg_3 ] = _composed_app_dict ( arg_3 , arg_0 , arg_1 ) for arg_4 in arg_0 [ 'services' ] . values ( ) : arg_2 [ arg_4 . name ] = _composed_service_dict ( arg_4 ) return arg_2

def Func(arg_0, arg_1):
    """ This function returns a dictionary representation of a docker-compose.yml file, based on assembled_specs from
    the spec_assembler, and port_specs from the port_spec compiler """
    arg_2 = _compose_dict_for_nginx(arg_1)
    for arg_3 in arg_0['apps'].keys():
        arg_2[arg_3] = _composed_app_dict(arg_3, arg_0, arg_1)
    for arg_4 in arg_0['services'].values():
        arg_2[arg_4.name] = _composed_service_dict(arg_4)
    return arg_2

This function returns a dictionary representation of a docker - compose . yml file based on assembled_specs from the spec_assembler and port_specs from the port_spec compiler


(self, effect_name: str, package_name: str = None)

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_2 = None ) -> Type [ 'Effect' ] : return arg_0 . _project . Func ( arg_1 , arg_3 = arg_3 )

def Func(arg_0, arg_1: arg_2, arg_3: arg_2 = None) -> Type['Effect']:
        """
        Get an effect class by the class name

        Args:
            effect_name (str): Name of the effect class

        Keyword Args:
            package_name (str): The package the effect belongs to. This is optional and only
                                needed when effect class names are not unique.

        Returns:
            :py:class:`Effect` class
        """
        return arg_0._project.Func(arg_1, arg_3=arg_3)


def Func ( arg_0 , * arg_1 ) : arg_2 = [ ] for arg_3 , arg_4 in arg_1 : if isinstance ( arg_3 , basestring ) : arg_3 = eid ( arg_3 ) if isinstance ( arg_4 , basestring ) : arg_4 += u'\U0010FFFF' arg_4 = eid ( arg_4 ) if arg_3 == ( ) and arg_4 == ( ) : arg_2 . append ( { 'match_all' : { } } ) elif arg_4 == ( ) : arg_2 . append ( { 'range' : { '_id' : { 'gte' : arg_3 } } } ) elif arg_3 == ( ) : arg_2 . append ( { 'range' : { '_id' : { 'lte' : arg_4 } } } ) else : arg_2 . append ( { 'range' : { '_id' : { 'gte' : arg_3 , 'lte' : arg_4 } } } ) if len ( arg_2 ) == 0 : return [ { 'match_all' : { } } ] else : return arg_2

def Func(arg_0, *arg_1):
        'Creates ES filters for key ranges used in scanning.'
        arg_2 = []
        for arg_3, arg_4 in arg_1:
            if isinstance(arg_3, basestring):
                arg_3 = eid(arg_3)
            if isinstance(arg_4, basestring):
                # Make the range inclusive.
                # We need a valid codepoint, so use the max.
                arg_4 += u'\U0010FFFF'
                arg_4 = eid(arg_4)

            if arg_3 == () and arg_4 == ():
                arg_2.append({'match_all': {}})
            elif arg_4 == ():
                arg_2.append({'range': {'_id': {'gte': arg_3}}})
            elif arg_3 == ():
                arg_2.append({'range': {'_id': {'lte': arg_4}}})
            else:
                arg_2.append({'range': {'_id': {'gte': arg_3, 'lte': arg_4}}})
        if len(arg_2) == 0:
            return [{'match_all': {}}]
        else:
            return arg_2

Creates ES filters for key ranges used in scanning .


(self, case_obj, variant_type='clinical', category='snv')

def Func(arg_0, arg_1, arg_2='clinical', arg_3='snv'):
        """Updates the manual rank for all variants in a case

        Add a variant rank based on the rank score
        Whenever variants are added or removed from a case we need to update the variant rank

        Args:
            case_obj(Case)
            variant_type(str)
        """
        # Get all variants sorted by rank score
        arg_4 = arg_0.variant_collection.find({
            'case_id': arg_1['_id'],
            'category': arg_3,
            'variant_type': arg_2,
        }).sort('rank_score', pymongo.DESCENDING)

        LOG.info("Updating variant_rank for all variants")

        arg_5 = []

        for arg_6, arg_7 in enumerate(arg_4):
            if len(arg_5) > 5000:
                try:
                    arg_0.variant_collection.bulk_write(arg_5, ordered=False)
                    arg_5 = []
                except BulkWriteError as err:
                    LOG.warning("Updating variant rank failed")
                    raise err

            arg_8 = pymongo.UpdateOne(
                {'_id': arg_7['_id']},
                {
                    '$set': {
                        'variant_rank': arg_6 + 1,
                    }
                })
            arg_5.append(arg_8)

        #Update the final bulk
        try:
            arg_0.variant_collection.bulk_write(arg_5, ordered=False)
        except BulkWriteError as err:
            LOG.warning("Updating variant rank failed")
            raise err

        LOG.info("Updating variant_rank done")


def Func ( arg_0 ) : arg_1 = 0 with open ( arg_0 ) as f : for arg_1 , arg_2 in enumerate ( f ) : pass return arg_1 + 1

def Func(arg_0):
    """Counts the number of lines in a file.

    Args:
        fname: string, name of the file.

    Returns:
        integer, the number of lines in the file.

    """
    arg_1 = 0
    with open(arg_0) as f:
        for arg_1, arg_2 in enumerate(f):
            pass
    return arg_1 + 1


def Func ( arg_0 ) : with arg_0 . engine . begin ( ) as db : purge_remote_checkpoints ( db , arg_0 . user_id )

def Func(arg_0):
        """
        Purge all database records for the current user.
        """
        with arg_0.engine.begin() as db:
            purge_remote_checkpoints(db, arg_0.user_id)

Purge all database records for the current user .


def Func ( arg_0 ) : arg_1 = arg_0 . img . split ( ) [ 3 ] arg_0 . img = arg_0 . img . convert ( "L" ) arg_0 . img = arg_0 . img . convert ( "RGBA" ) arg_0 . img . putalpha ( arg_1 )

def Func(arg_0):

        """Desaturates the layer, making it grayscale.

        Instantly removes all color information from the layer,
        while maintaing its alpha channel.

        """

        arg_1 = arg_0.img.split()[3]
        arg_0.img = arg_0.img.convert("L")
        arg_0.img = arg_0.img.convert("RGBA")
        arg_0.img.putalpha(arg_1)

Desaturates the layer making it grayscale . Instantly removes all color information from the layer while maintaing its alpha channel .


def Func(arg_0):
        """Parse a mbox file.

        This method parses a mbox file and returns an iterator of dictionaries.
        Each one of this contains an email message.

        :param filepath: path of the mbox to parse

        :returns : generator of messages; each message is stored in a
            dictionary of type `requests.structures.CaseInsensitiveDict`
        """
        arg_1 = _MBox(arg_0, create=False)

        for arg_2 in arg_1:
            arg_3 = message_to_dict(arg_2)
            yield arg_3


def Func(arg_0, arg_1=1):
        """ Starts over again at the new line. If number is specified,
            it will leave multiple lines."""
        if isinstance(arg_1, int):
            try:
                arg_0.page._Func(arg_0.font, arg_1, arg_0.double_spacing)
            except ValueError:
                arg_0.add_page()
        else:
            raise TypeError("Number of newlines must be an integer.")

Starts over again at the new line . If number is specified it will leave multiple lines .


def Func ( arg_0 ) : with open ( _PARAMS_PATH , "r" ) as f : arg_1 = yaml . safe_load ( f ) [ "modelParams" ] arg_2 = Network ( ) arg_2 . addRegion ( "sensor" , "py.RecordSensor" , '{}' ) arg_3 = arg_2 . regions [ "sensor" ] . getSelf ( ) arg_3 . encoder = createEncoder ( arg_1 [ "sensorParams" ] [ "encoders" ] ) arg_3 . dataSource = arg_0 arg_1 [ "spParams" ] [ "inputWidth" ] = arg_3 . encoder . getWidth ( ) arg_2 . addRegion ( "SP" , "py.SPRegion" , json . dumps ( arg_1 [ "spParams" ] ) ) arg_2 . addRegion ( "TM" , "py.TMRegion" , json . dumps ( arg_1 [ "tmParams" ] ) ) arg_5 = "py.%s" % arg_1 [ "clParams" ] . pop ( "regionName" ) arg_2 . addRegion ( "classifier" , arg_5 , json . dumps ( arg_1 [ "clParams" ] ) ) createSensorToClassifierLinks ( arg_2 , "sensor" , "classifier" ) createDataOutLink ( arg_2 , "sensor" , "SP" ) createFeedForwardLink ( arg_2 , "SP" , "TM" ) createFeedForwardLink ( arg_2 , "TM" , "classifier" ) createResetLink ( arg_2 , "sensor" , "SP" ) createResetLink ( arg_2 , "sensor" , "TM" ) arg_2 . initialize ( ) return arg_2

def Func(arg_0):
  """Create and initialize a network."""
  with open(_PARAMS_PATH, "r") as f:
    arg_1 = yaml.safe_load(f)["modelParams"]

  # Create a network that will hold the regions.
  arg_2 = Network()

  # Add a sensor region.
  arg_2.addRegion("sensor", "py.RecordSensor", '{}')

  # Set the encoder and data source of the sensor region.
  arg_3 = arg_2.regions["sensor"].getSelf()
  arg_3.encoder = createEncoder(arg_1["sensorParams"]["encoders"])
  arg_3.dataSource = arg_0

  # Make sure the SP input width matches the sensor region output width.
  arg_1["spParams"]["inputWidth"] = arg_3.encoder.getWidth()

  # Add SP and TM regions.
  arg_2.addRegion("SP", "py.SPRegion", json.dumps(arg_1["spParams"]))
  arg_2.addRegion("TM", "py.TMRegion", json.dumps(arg_1["tmParams"]))

  # Add a classifier region.
  arg_5 = "py.%s" % arg_1["clParams"].pop("regionName")
  arg_2.addRegion("classifier", arg_5, json.dumps(arg_1["clParams"]))

  # Add all links
  createSensorToClassifierLinks(arg_2, "sensor", "classifier")
  createDataOutLink(arg_2, "sensor", "SP")
  createFeedForwardLink(arg_2, "SP", "TM")
  createFeedForwardLink(arg_2, "TM", "classifier")
  # Reset links are optional, since the sensor region does not send resets.
  createResetLink(arg_2, "sensor", "SP")
  createResetLink(arg_2, "sensor", "TM")

  # Make sure all objects are initialized.
  arg_2.initialize()

  return arg_2


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_0
.
send_message
(
arg_1
.
channel
,
"Saving current state..."
)
arg_0
.
_bot
.
plugins
.
Func_state
(
)
arg_0
.
send_message
(
arg_1
.
channel
,
"Done."
)

def Func(arg_0, arg_1, arg_2):
        """Causes the bot to write its current state to backend."""
        arg_0.send_message(arg_1.channel, "Saving current state...")
        arg_0._bot.plugins.Func_state()
        arg_0.send_message(arg_1.channel, "Done.")

Causes the bot to write its current state to backend .


(self, instance_id, table_id, project_id=None)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Deletes the specified table in Cloud Bigtable.
        Raises google.api_core.exceptions.NotFound if the table does not exist.

        :type instance_id: str
        :param instance_id: The ID of the Cloud Bigtable instance.
        :type table_id: str
        :param table_id: The ID of the table in Cloud Bigtable.
        :type project_id: str
        :param project_id: Optional, Google Cloud Platform project ID where the
            BigTable exists. If set to None or missing,
            the default project_id from the GCP connection is used.
        """
        arg_4 = arg_0.get_instance(arg_1=arg_1, arg_3=arg_3).table(arg_2=arg_2)
        arg_4.delete()

Deletes the specified table in Cloud Bigtable . Raises google . api_core . exceptions . NotFound if the table does not exist .


(self, media_id, fields=None, schema=None)

return self._api_call("info", params, schema=schema)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_4 = { "media_id" : arg_1 } if arg_2 : arg_4 [ "fields" ] = "," . join ( arg_2 ) return arg_0 . _api_call ( "info" , arg_4 , arg_3 = arg_3 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
            Returns the data for a certain media item.

            :param media_id: id that identifies the media item to be accessed.
            :param fields: list of the media"s field to be returned. By default the
            API returns some fields, but others are not returned unless they are
            explicity asked for. I have no real documentation on the fields, but
            they all seem to start with the "media." prefix (e.g. media.name,
            media.stream_data).
            :param schema: validation schema to use
        """
        arg_4 = {"media_id": arg_1}

        if arg_2:
            arg_4["fields"] = ",".join(arg_2)

        return arg_0._api_call("info", arg_4, arg_3=arg_3)

Returns the data for a certain media item .


def Func ( arg_0 ) : arg_1 = np . array ( [ list ( i . split ( ) [ - 1 ] ) for i in arg_0 ] ) arg_2 = np . any ( arg_1 == "N" , axis = 0 ) arg_3 = arg_1 [ : , ~ arg_2 ] arg_4 = np . invert ( np . all ( arg_3 == arg_3 [ 0 , : ] , axis = 0 ) ) . sum ( ) return arg_3 . shape [ 1 ] , arg_4

def Func(arg_0):
    """
    count number of sites with cov=4, and number of variable sites.
    """
    arg_1 = np.array([list(i.split()[-1]) for i in arg_0])
    arg_2 = np.any(arg_1=="N", axis=0)
    arg_3 = arg_1[:, ~arg_2]
    arg_4 = np.invert(np.all(arg_3==arg_3[0, :], axis=0)).sum()
    return arg_3.shape[1], arg_4

count number of sites with cov = 4 and number of variable sites .


(
        self,
        name,
        subject,
        html,
        text='',
        timeout=None
    )

return self._api_request(
            self.TEMPLATES_ENDPOINT,
            self.HTTP_POST,
            payload=payload,
            timeout=timeout
        )

def Func(
        arg_0,
        arg_1,
        arg_2,
        arg_3,
        arg_4='',
        arg_5=None
    ):
        """ API call to create a template """
        arg_6 = {
            'name': arg_1,
            'subject': arg_2,
            'html': arg_3,
            'text': arg_4
        }

        return arg_0._api_request(
            arg_0.TEMPLATES_ENDPOINT,
            arg_0.HTTP_POST,
            arg_6=arg_6,
            arg_5=arg_5
        )


def Func(arg_0, arg_1: arg_2) -> arg_2:
        """Handles IntentRequest Alexa request.

        Args:
            request: Alexa request.
        Returns:
            response: "response" part of response dict conforming Alexa specification.
        """
        arg_3 = arg_0.config['intent_name']
        arg_4 = arg_0.config['slot_name']

        arg_5 = arg_1['request']['requestId']
        arg_6: arg_2 = arg_1['request']['intent']

        if arg_3 != arg_6['name']:
            log.error(f"Wrong intent name received: {request_intent['name']} in request {request_id}")
            return {'error': 'wrong intent name'}

        if arg_4 not in arg_6['slots'].keys():
            log.error(f'No slot named {slot_name} found in request {request_id}')
            return {'error': 'no slot found'}

        arg_7 = arg_6['slots'][arg_4]['value']
        arg_8 = arg_0._act(arg_7)

        if not arg_8:
            log.error(f'Some error during response generation for request {request_id}')
            return {'error': 'error during response generation'}

        arg_9: RichMessage = arg_8[0]
        arg_9: list = arg_9.alexa()

        if not arg_9:
            log.error(f'Some error during response generation for request {request_id}')
            return {'error': 'error during response generation'}

        arg_10 = arg_0._generate_response(arg_9[0], arg_1)

        return arg_10


def Func ( arg_0 , arg_1 ) : import xmlsec arg_2 = xmlsec . tree . find_node ( arg_0 , xmlsec . Node . SIGNATURE ) if arg_2 is None : return False arg_3 = xmlsec . SignatureContext ( ) arg_3 . register_id ( arg_0 ) for arg_4 in arg_0 . xpath ( "//*[local-name()='Assertion']" ) : arg_3 . register_id ( arg_4 ) arg_5 = None for arg_6 in [ xmlsec . KeyFormat . PEM , xmlsec . KeyFormat . CERT_PEM ] : arg_1 . seek ( 0 ) try : arg_5 = xmlsec . Key . from_memory ( arg_1 , arg_6 ) break except ValueError : pass arg_3 . key = arg_5 try : arg_3 . Func ( arg_2 ) return True except Exception : return False

def Func(arg_0, arg_1):
    """
    Verify the signaure of an XML document with the given certificate.
    Returns `True` if the document is signed with a valid signature.
    Returns `False` if the document is not signed or if the signature is
    invalid.

    :param lxml.etree._Element xml: The document to sign
    :param file stream: The private key to sign the document with

    :rtype: Boolean
    """
    # Import xmlsec here to delay initializing the C library in
    # case we don't need it.
    import xmlsec

    # Find the <Signature/> node.
    arg_2 = xmlsec.tree.find_node(arg_0, xmlsec.Node.SIGNATURE)
    if arg_2 is None:
        # No `signature` node found; we cannot Func
        return False

    # Create a digital signature context (no key manager is needed).
    arg_3 = xmlsec.SignatureContext()

    # Register <Response/> and <Assertion/>
    arg_3.register_id(arg_0)
    for arg_4 in arg_0.xpath("//*[local-name()='Assertion']"):
        arg_3.register_id(arg_4)

    # Load the public key.
    arg_5 = None
    for arg_6 in [
            xmlsec.KeyFormat.PEM,
            xmlsec.KeyFormat.CERT_PEM]:
        arg_1.seek(0)
        try:
            arg_5 = xmlsec.Key.from_memory(arg_1, arg_6)
            break
        except ValueError:
            # xmlsec now throws when it can't load the key
            pass

    # Set the key on the context.
    arg_3.key = arg_5

    # Verify the signature.
    try:
        arg_3.Func(arg_2)

        return True

    except Exception:
        return False

Verify the signaure of an XML document with the given certificate . Returns True if the document is signed with a valid signature . Returns False if the document is not signed or if the signature is invalid .


(self, batch_size, length, samples=1, fix_static=False,
               fix_dynamic=False)

def Func(arg_0, arg_1, arg_2, arg_3=1, arg_4=False,
               arg_5=False):
    """Generate new sequences.

    Args:
      batch_size: Number of sequences to Func.
      length: Number of timesteps to Func for each sequence.
      samples: Number of samples to draw from the latent distributions.
      fix_static: Boolean for whether or not to share the same random
        sample of the static latent variable `f` from its prior across
        all examples.
      fix_dynamic: Boolean for whether or not to share the same random
        sample of the dynamic latent variable `z_{1:T}` from its prior
        across all examples.

    Returns:
      A batched Independent distribution wrapping a set of Normal
      distributions over the pixels of the Funcd sequences, where
      the Independent distribution has event shape [height, width,
      channels], batch shape [samples, batch_size, timesteps], and
      sample shape [sample_shape, samples, batch_size, timesteps,
      height, width, channels].
    """
    arg_6, arg_7 = arg_0.sample_static_prior(arg_3, arg_1, arg_4)
    arg_8, arg_7 = arg_0.sample_dynamic_prior(arg_3, arg_1, arg_2,
                                                  arg_5)
    arg_9 = arg_0.decoder((arg_8, arg_6))
    return arg_9

Generate new sequences.

    Args:
      batch_size: Number of sequences to generate.
      length: Number of timesteps to generate for each sequence.
      samples: Number of samples to draw from the latent distributions.
      fix_static: Boolean for whether or not to share the same random
        sample of the static latent variable `f` from its prior across
        all examples.
      fix_dynamic: Boolean for whether or not to share the same random
        sample of the dynamic latent variable `z_{1:T}` from its prior
        across all examples.

    Returns:
      A batched Independent distribution wrapping a set of Normal
      distributions over the pixels of the generated sequences, where
      the Independent distribution has event shape [height, width,
      channels], batch shape [samples, batch_size, timesteps], and
      sample shape [sample_shape, samples, batch_size, timesteps,
      height, width, channels].


def Func(arg_0, arg_1):
    """ Function to find local minima.

    Parameters
    ----------
    x, y : array_like
        1D arrays of the independent (x) and dependent (y) variables.

    Returns
    -------
    array_like
        Array of points in x where y has a local minimum.
    """
    return arg_0[np.r_[False, arg_1[1:] < arg_1[:-1]] & np.r_[arg_1[:-1] < arg_1[1:], False]]


def Func ( arg_0 ) : assert not isinstance ( arg_0 , models . Field ) arg_1 = 'Encrypted' + arg_0 . __name__ if arg_0 not in arg_2 : arg_2 [ arg_0 ] = type ( arg_1 , ( EncryptedMixin , arg_0 ) , { 'base_class' : arg_0 , } ) return arg_2 [ arg_0 ]

def Func(arg_0):
    """
    A get or create method for encrypted fields, we cache the field in
    the module to avoid recreation. This also allows us to always return
    the same class reference for a field.

    :type base_class: models.Field[T]
    :rtype: models.Field[EncryptedMixin, T]
    """
    assert not isinstance(arg_0, models.Field)
    arg_1 = 'Encrypted' + arg_0.__name__
    if arg_0 not in arg_2:
        arg_2[arg_0] = type(arg_1,
                                       (EncryptedMixin, arg_0), {
                                           'base_class': arg_0,
                                       })
    return arg_2[arg_0]

A get or create method for encrypted fields we cache the field in the module to avoid recreation . This also allows us to always return the same class reference for a field .


def Func(arg_0):
        """
        Attempt to re-establish a connection using previously acquired tokens.

        If the Skype token is valid but the registration token is invalid, a new endpoint will be registered.

        Raises:
            .SkypeAuthException: if the token file cannot be used to authenticate
        """
        if not arg_0.tokenFile:
            raise SkypeAuthException("No token file specified")
        try:
            with open(arg_0.tokenFile, "r") as f:
                arg_1 = f.read().splitlines()
        except OSError:
            raise SkypeAuthException("Token file doesn't exist or not readable")
        try:
            arg_2, arg_3, arg_4, arg_5, arg_6, arg_7 = arg_1
            arg_4 = datetime.fromtimestamp(int(arg_4))
            arg_6 = datetime.fromtimestamp(int(arg_6))
        except ValueError:
            raise SkypeAuthException("Token file is malformed")
        if datetime.now() >= arg_4:
            raise SkypeAuthException("Token file has expired")
        arg_0.userId = arg_2
        arg_0.tokens["skype"] = arg_3
        arg_0.tokenExpiry["skype"] = arg_4
        if datetime.now() < arg_6:
            arg_0.tokens["reg"] = arg_5
            arg_0.tokenExpiry["reg"] = arg_6
            arg_0.msgsHost = arg_7
        else:
            arg_0.getRegToken()

Attempt to re - establish a connection using previously acquired tokens .


def Func(arg_0, arg_1):
        """
        Create a new list in your MailChimp account.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*,
            "contact": object*
            {
                "company": string*,
                "address1": string*,
                "city": string*,
                "state": string*,
                "zip": string*,
                "country": string*
            },
            "permission_reminder": string*,
            "campaign_defaults": object*
            {
                "from_name": string*,
                "from_email": string*,
                "subject": string*,
                "language": string*
            },
            "email_type_option": boolean
        }
        """
        if 'name' not in arg_1:
            raise KeyError('The list must have a name')
        if 'contact' not in arg_1:
            raise KeyError('The list must have a contact')
        if 'company' not in arg_1['contact']:
            raise KeyError('The list contact must have a company')
        if 'address1' not in arg_1['contact']:
            raise KeyError('The list contact must have a address1')
        if 'city' not in arg_1['contact']:
            raise KeyError('The list contact must have a city')
        if 'state' not in arg_1['contact']:
            raise KeyError('The list contact must have a state')
        if 'zip' not in arg_1['contact']:
            raise KeyError('The list contact must have a zip')
        if 'country' not in arg_1['contact']:
            raise KeyError('The list contact must have a country')
        if 'permission_reminder' not in arg_1:
            raise KeyError('The list must have a permission_reminder')
        if 'campaign_defaults' not in arg_1:
            raise KeyError('The list must have a campaign_defaults')
        if 'from_name' not in arg_1['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a from_name')
        if 'from_email' not in arg_1['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a from_email')
        check_email(arg_1['campaign_defaults']['from_email'])
        if 'subject' not in arg_1['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a subject')
        if 'language' not in arg_1['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a language')
        if 'email_type_option' not in arg_1:
            raise KeyError('The list must have an email_type_option')
        if arg_1['email_type_option'] not in [True, False]:
            raise TypeError('The list email_type_option must be True or False')
        arg_2 = arg_0._mc_client._post(url=arg_0._build_path(), arg_1=arg_1)
        if arg_2 is not None:
            arg_0.list_id = arg_2['id']
        else:
            arg_0.list_id = None
        return arg_2

Create a new list in your MailChimp account .


(prompt='Multi-line input\n' + \
        'Enter EOF on a blank line to end ' + \
        '(ctrl-D in *nix, ctrl-Z in windows)',
        maxlines = None, maxlength = None)

def
Func
(
arg_0
=
'Multi-line input\n'
+
'Enter EOF on a blank line to end '
+
'(ctrl-D in *nix, ctrl-Z in windows)'
,
arg_1
=
,
arg_2
=
)
:
arg_3
=
[
]
print
(
arg_0
)
arg_4
=
1
try
:
while
True
:
if
arg_1
:
if
arg_4
>
arg_1
:
break
else
:
if
arg_2
:
arg_3
.
append
(
string_input
(
''
)
[
:
arg_2
]
)
else
:
arg_3
.
append
(
string_input
(
''
)
)
arg_4
+=
1
else
:
if
arg_2
:
arg_3
.
append
(
string_input
(
''
)
[
:
arg_2
]
)
else
:
arg_3
.
append
(
string_input
(
''
)
)
except
EOFError
:
pass
finally
:
return
'\n'
.
join
(
arg_3
)

def Func(arg_0='Multi-line input\n' + \
        'Enter EOF on a blank line to end ' + \
        '(ctrl-D in *nix, ctrl-Z in windows)',
        arg_1 = None, arg_2 = None):
    """Get a multi-line string as input"""

    arg_3 = []
    print(arg_0)
    arg_4 = 1

    try:
        while True:

            if arg_1:

                if arg_4 > arg_1:
                    break

                else:
                    if arg_2:
                        arg_3.append(string_input('')[:arg_2])
                    else:
                        arg_3.append(string_input(''))
                    arg_4 += 1

            else:
                if arg_2:
                    arg_3.append(string_input('')[:arg_2])
                else:
                    arg_3.append(string_input(''))

    except EOFError:
        pass
    finally:
        return '\n'.join(arg_3)


def Func ( arg_0 ) : arg_0 = np . asarray ( arg_0 ) return np . sqrt ( 8 * np . log ( 2 ) ) * arg_0

def Func(arg_0):
    """Convert a sigma in a Gaussian kernel to a FWHM value.

    Parameters
    ----------
    sigma: float or numpy.array
       sigma value or values

    Returns
    -------
    fwhm: float or numpy.array
       fwhm values corresponding to `sigma` values
    """
    arg_0 = np.asarray(arg_0)
    return np.sqrt(8 * np.log(2)) * arg_0

Convert a sigma in a Gaussian kernel to a FWHM value .


return om.OMApplication(elem=self.OMSymbol(module='Python', name='tuple'),
                                arguments=l)

def Func ( arg_0 , arg_1 ) : return om . OMApplication ( elem = arg_0 . OMSymbol ( module = 'Python' , name = 'tuple' ) , arguments = arg_1 )

def Func(arg_0, arg_1):
        """
        Convert a tuple of OM objects into an OM object

        EXAMPLES::

            >>> from openmath import openmath as om
            >>> from openmath.convert_pickle  import PickleConverter
            >>> converter = PickleConverter()
            >>> o = converter.Func([om.OMInteger(2), om.OMInteger(3)]); o
            OMApplication(elem=OMSymbol(name='tuple', cd='Python', id=None, cdbase='http://python.org/'),
                     arguments=[OMInteger(integer=2, id=None), OMInteger(integer=3, id=None)], id=None, cdbase=None)
            >>> converter.to_python(o)
            (2, 3)
        """
        return om.OMApplication(elem=arg_0.OMSymbol(module='Python', name='tuple'),
                                arguments=arg_1)

Convert a tuple of OM objects into an OM object

        EXAMPLES::

            >>> from openmath import openmath as om
            >>> from openmath.convert_pickle  import PickleConverter
            >>> converter = PickleConverter()
            >>> o = converter.OMTuple([om.OMInteger(2), om.OMInteger(3)]); o
            OMApplication(elem=OMSymbol(name='tuple', cd='Python', id=None, cdbase='http://python.org/'),
                     arguments=[OMInteger(integer=2, id=None), OMInteger(integer=3, id=None)], id=None, cdbase=None)
            >>> converter.to_python(o)
            (2, 3)


(
    number, thousandsSep=True, partition=False, base1024=True, appendBytes=True
)

return "{}{}{}".format(snum, magsuffix, bytesuffix)

def
Func
(
arg_0
,
arg_1
=
True
,
arg_2
=
False
,
arg_3
=
True
,
arg_4
=
True
)
:
arg_5
=
""
arg_6
=
""
if
arg_2
:
arg_7
=
0
if
arg_3
:
while
arg_0
>=
1024
:
arg_7
+=
1
arg_0
=
arg_0
>>
10
else
:
while
arg_0
>=
1000
:
arg_7
+=
1
arg_0
/=
1000.0
arg_5
=
[
""
,
"K"
,
"M"
,
"G"
,
"T"
,
"P"
]
[
arg_7
]
if
arg_4
:
if
arg_0
==
1
:
arg_6
=
" Byte"
else
:
arg_6
=
" Bytes"
if
arg_1
and
(
arg_0
>=
1000
or
arg_5
)
:
arg_8
=
"{:,d}"
.
format
(
arg_0
)
else
:
arg_8
=
str
(
arg_0
)
return
"{}{}{}"
.
format
(
arg_8
,
arg_5
,
arg_6
)

def Func(
    arg_0, arg_1=True, arg_2=False, arg_3=True, arg_4=True
):
    """Convert bytes into human-readable representation."""
    arg_5 = ""
    arg_6 = ""

    if arg_2:
        arg_7 = 0
        if arg_3:
            while arg_0 >= 1024:
                arg_7 += 1
                arg_0 = arg_0 >> 10
        else:
            while arg_0 >= 1000:
                arg_7 += 1
                arg_0 /= 1000.0
        # TODO: use "9 KB" instead of "9K Bytes"?
        # TODO use 'kibi' for base 1024?
        # http://en.wikipedia.org/wiki/Kibi-#IEC_standard_prefixes
        arg_5 = ["", "K", "M", "G", "T", "P"][arg_7]

    if arg_4:
        if arg_0 == 1:
            arg_6 = " Byte"
        else:
            arg_6 = " Bytes"

    if arg_1 and (arg_0 >= 1000 or arg_5):
        # locale.setlocale(locale.LC_ALL, "")
        # # TODO: make precision configurable
        # snum = locale.format("%d", number, thousandsSep)
        arg_8 = "{:,d}".format(arg_0)
    else:
        arg_8 = str(arg_0)

    return "{}{}{}".format(arg_8, arg_5, arg_6)

Convert bytes into human - readable representation .


def Func(arg_0, arg_1=0):
        """
        Downloads the latest Ubuntu image and writes it to a microSD card.

        Based on the instructions from:

            https://wiki.ubuntu.com/ARM/RaspberryPi

        For recommended SD card brands, see:

            http://elinux.org/RPi_SD_cards

        Note, if you get an error like:

            Kernel panic-not syncing: VFS: unable to mount root fs

        that means the SD card is corrupted. Try re-imaging the card or use a different card.
        """
        arg_0.assume_localhost()

        arg_1 = int(arg_1)

        if not arg_0.dryrun:
            arg_2 = 'SD card present at %s? ' % arg_0.env.sd_device
            arg_3 = raw_input(arg_2).strip()
            print('inp:', arg_3)
            if not arg_1 and arg_3 and not arg_3.lower().startswith('y'):
                return

        arg_4 = arg_0.local_renderer

        # Confirm SD card is present.
        arg_4.local('ls {sd_device}')

        # Download image.
        arg_4.env.ubuntu_image_fn = os.path.abspath(os.path.split(arg_0.env.ubuntu_download_url)[-1])
        arg_4.local('[ ! -f {ubuntu_image_fn} ] && wget {ubuntu_download_url} || true')

        # Ensure SD card is unmounted.
        with arg_0.settings(warn_only=True):
            arg_4.sudo('[ -d "{sd_media_mount_dir}" ] && umount {sd_media_mount_dir}')
        with arg_0.settings(warn_only=True):
            arg_4.sudo('[ -d "{sd_media_mount_dir2}" ] && umount {sd_media_mount_dir2}')

        arg_4.pc('Writing the image onto the card.')
        arg_4.sudo('xzcat {ubuntu_image_fn} | dd bs=4M of={sd_device}')

        # Flush all writes to disk.
        arg_4.run('sync')

Downloads the latest Ubuntu image and writes it to a microSD card .


def
Func
(
)
:
arg_0
=
list
(
streamlink
.
get_plugins
(
)
.
keys
(
)
)
arg_1
=
", "
.
join
(
sorted
(
arg_0
)
)
if
console
.
json
:
console
.
msg_json
(
arg_0
)
else
:
console
.
msg
(
"Loaded plugins: {0}"
,
arg_1
)

def Func():
    """Outputs a list of all plugins Streamlink has loaded."""

    arg_0 = list(streamlink.get_plugins().keys())
    arg_1 = ", ".join(sorted(arg_0))

    if console.json:
        console.msg_json(arg_0)
    else:
        console.msg("Loaded plugins: {0}", arg_1)

Outputs a list of all plugins Streamlink has loaded .


def Func(arg_0, arg_1, arg_2):
    '''Set the axis scaling'''

    arg_3 = dict()
    if arg_2 == 'x':
        arg_4 = 'linthreshx'
        arg_5 = 'basex'
        arg_6 = 'linscalex'
        arg_7 = arg_0.set_xscale
        arg_8 = arg_0.set_xlim
    else:
        arg_4 = 'linthreshy'
        arg_5 = 'basey'
        arg_6 = 'linscaley'
        arg_7 = arg_0.set_yscale
        arg_8 = arg_0.set_ylim

    # Map ticker scales
    if arg_1 == 'mel':
        arg_9 = 'symlog'
        arg_3[arg_4] = 1000.0
        arg_3[arg_5] = 2

    elif arg_1 == 'log':
        arg_9 = 'symlog'
        arg_3[arg_5] = 2
        arg_3[arg_4] = core.note_to_hz('C2')
        arg_3[arg_6] = 0.5

    elif arg_1 in ['cqt', 'cqt_hz', 'cqt_note']:
        arg_9 = 'log'
        arg_3[arg_5] = 2

    elif arg_1 == 'tempo':
        arg_9 = 'log'
        arg_3[arg_5] = 2
        arg_8(16, 480)
    else:
        return

    arg_7(arg_9, **arg_3)


(A=None, B=None, rho=1., T=1., NFFT=4096, sides='default',
        norm=False)

def Func(arg_0=None, arg_1=None, arg_2=1., arg_3=1., arg_4=4096, arg_5='default',
        arg_6=False):
    r"""Computes power spectral density given ARMA values.

    This function computes the power spectral density values
    given the ARMA parameters of an ARMA model. It assumes that
    the driving sequence is a white noise process of zero mean and
    variance :math:`\rho_w`. The sampling frequency and noise variance are
    used to scale the PSD output, which length is set by the user with the
    `NFFT` parameter.

    :param array A:   Array of AR parameters (complex or real)
    :param array B:   Array of MA parameters (complex or real)
    :param float rho: White noise variance to scale the returned PSD
    :param float T:   Sample interval in seconds to scale the returned PSD
    :param int NFFT:  Final size of the PSD
    :param str sides: Default PSD is two-sided, but sides can be set to centerdc.

    .. warning:: By convention, the AR or MA arrays does not contain the
        A0=1 value.

    If :attr:`B` is None, the model is a pure AR model. If :attr:`A` is None,
    the model is a pure MA model.

    :return: two-sided PSD

    .. rubric:: Details:

    AR case: the power spectral density is:

    .. math:: P_{ARMA}(f) = T \rho_w \left|\frac{B(f)}{A(f)}\right|^2

    where:

    .. math:: A(f) = 1 + \sum_{k=1}^q b(k) e^{-j2\pi fkT}
    .. math:: B(f) = 1 + \sum_{k=1}^p a(k) e^{-j2\pi fkT}

    .. rubric:: **Example:**

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

        import spectrum.arma
        from pylab import plot, log10, legend
        plot(10*log10(spectrum.arma.Func([1,0.5],[0.5,0.5])), label='ARMA(2,2)')
        plot(10*log10(spectrum.arma.Func([1,0.5],None)), label='AR(2)')
        plot(10*log10(spectrum.arma.Func(None,[0.5,0.5])), label='MA(2)')
        legend()

    :References: [Marple]_
    """
    if arg_4 is None:
        arg_4 = 4096

    if arg_0 is None and arg_1 is None:
        raise ValueError("Either AR or MA model must be provided")

    arg_7 = np.zeros(arg_4, dtype=complex)

    if arg_0 is not None:
        arg_8 = len(arg_0)
        arg_9 = np.zeros(arg_4, dtype=complex)
        arg_9[0] = 1.+0j
        for arg_10 in range(0, arg_8):
            arg_9[arg_10+1] = arg_0[arg_10]
        arg_11 = fft(arg_9, arg_4)

    if arg_1 is not None:
        arg_12 = len(arg_1)
        arg_13 = np.zeros(arg_4, dtype=complex)
        arg_13[0] = 1.+0j
        for arg_10 in range(0, arg_12):
            arg_13[arg_10+1] = arg_1[arg_10]
        arg_14 = fft(arg_13, arg_4)

    # Changed in version 0.6.9 (divided by T instead of multiply)
    if arg_0 is not None and arg_1 is not None:
        arg_7 = arg_2 / arg_3 * abs(arg_14)**2. / abs(arg_11)**2.
    elif arg_0 is not None:
        arg_7 = arg_2 / arg_3 / abs(arg_11)**2.
    elif arg_1 is not None:
        arg_7 = arg_2 / arg_3 * abs(arg_14)**2.

    arg_7 = np.real(arg_7)
    # The PSD is a twosided PSD.
    # to obtain the centerdc
    if arg_5 != 'default':
        from . import tools
        assert arg_5 in ['centerdc']
        if arg_5 == 'centerdc':
            arg_7 = tools.twosided_2_centerdc(arg_7)

    if arg_6 == True:
        arg_7 /= max(arg_7)

    return arg_7

r"""Computes power spectral density given ARMA values.

    This function computes the power spectral density values
    given the ARMA parameters of an ARMA model. It assumes that
    the driving sequence is a white noise process of zero mean and
    variance :math:`\rho_w`. The sampling frequency and noise variance are
    used to scale the PSD output, which length is set by the user with the
    `NFFT` parameter.

    :param array A:   Array of AR parameters (complex or real)
    :param array B:   Array of MA parameters (complex or real)
    :param float rho: White noise variance to scale the returned PSD
    :param float T:   Sample interval in seconds to scale the returned PSD
    :param int NFFT:  Final size of the PSD
    :param str sides: Default PSD is two-sided, but sides can be set to centerdc.

    .. warning:: By convention, the AR or MA arrays does not contain the
        A0=1 value.

    If :attr:`B` is None, the model is a pure AR model. If :attr:`A` is None,
    the model is a pure MA model.

    :return: two-sided PSD

    .. rubric:: Details:

    AR case: the power spectral density is:

    .. math:: P_{ARMA}(f) = T \rho_w \left|\frac{B(f)}{A(f)}\right|^2

    where:

    .. math:: A(f) = 1 + \sum_{k=1}^q b(k) e^{-j2\pi fkT}
    .. math:: B(f) = 1 + \sum_{k=1}^p a(k) e^{-j2\pi fkT}

    .. rubric:: **Example:**

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

        import spectrum.arma
        from pylab import plot, log10, legend
        plot(10*log10(spectrum.arma.arma2psd([1,0.5],[0.5,0.5])), label='ARMA(2,2)')
        plot(10*log10(spectrum.arma.arma2psd([1,0.5],None)), label='AR(2)')
        plot(10*log10(spectrum.arma.arma2psd(None,[0.5,0.5])), label='MA(2)')
        legend()

    :References: [Marple]_

r Computes power spectral density given ARMA values .


shortcut to render data with `template` and then write to `path`.
    Just add exception catch to `renderer.render_to`

def
Func
(
arg_0
,
arg_1
,
**
arg_2
)
:
try
:
renderer
.
Func
(
arg_0
,
arg_1
,
**
arg_2
)
except
JinjaTemplateNotFound
as
e
:
logger
.
error
(
e
.
__doc__
+
', Template: %r'
%
arg_1
)
sys
.
exit
(
e
.
exit_code
)

def Func(arg_0, arg_1, **arg_2):
    """shortcut to render data with `template` and then write to `path`.
    Just add exception catch to `renderer.Func`"""
    try:
        renderer.Func(arg_0, arg_1, **arg_2)
    except JinjaTemplateNotFound as e:
        logger.error(e.__doc__ + ', Template: %r' % arg_1)
        sys.exit(e.exit_code)

shortcut to render data with template and then write to path . Just add exception catch to renderer . render_to


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
animation
:
log
.
debug
(
'%s: %s'
,
arg_0
.
__class__
.
__name__
,
arg_0
.
current_animation
.
title
)
arg_0
.
frames
=
arg_0
.
animation
.
generate_frames
(
False
)

def Func(arg_0, arg_1):
        """
        Override this method to get called right after ``self.index`` is set.

        :param int old_index: the previous index, before it was changed.
        """
        if arg_0.animation:
            log.debug('%s: %s',
                      arg_0.__class__.__name__, arg_0.current_animation.title)
            arg_0.frames = arg_0.animation.generate_frames(False)

Override this method to get called right after self . index is set .


def Func ( arg_0 ) : arg_1 = os . listdir ( arg_0 ) arg_2 = [ ] for arg_3 in arg_1 : arg_4 = os . path . join ( arg_0 , arg_3 ) if os . path . isdir ( arg_4 ) and arg_3 . startswith ( 'profile_' ) : arg_2 . append ( arg_3 . split ( '_' , 1 ) [ - 1 ] ) return arg_2

def Func(arg_0):
    """list profiles in a given root directory"""
    arg_1 = os.listdir(arg_0)
    arg_2 = []
    for arg_3 in arg_1:
        arg_4 = os.path.join(arg_0, arg_3)
        if os.path.isdir(arg_4) and arg_3.startswith('profile_'):
            arg_2.append(arg_3.split('_',1)[-1])
    return arg_2


return [split('\W+', i)[1] for i in line.split(':')[1].split(' ') if i.startswith('[')]

def
Func
(
arg_0
,
arg_1
)
:
return
[
split
(
'\W+'
,
arg_2
)
[
1
]
for
arg_2
in
arg_1
.
split
(
':'
)
[
1
]
.
split
(
' '
)
if
arg_2
.
startswith
(
'['
)
]

def Func(arg_0, arg_1):
        """Return a list of personalities readed from the input line."""
        return [split('\W+', arg_2)[1] for arg_2 in arg_1.split(':')[1].split(' ') if arg_2.startswith('[')]

Return a list of personalities readed from the input line .


async def Func(arg_0):
    """Asynchronously download a set of lsst-texmf BibTeX bibliographies from
    GitHub.

    Parameters
    ----------
    bibtex_names : sequence of `str`
        Names of lsst-texmf BibTeX files to download. For example:

        .. code-block:: python

           ['lsst', 'lsst-dm', 'refs', 'books', 'refs_ads']

    Returns
    -------
    bibtexs : `list` of `str`
        List of BibTeX file content, in the same order as ``bibtex_names``.
    """
    arg_1 = (
        'https://raw.githubusercontent.com/lsst/lsst-texmf/master/texmf/'
        'bibtex/bib/{name}.bib'
    )
    arg_2 = [arg_1.format(name=name) for name in arg_0]

    arg_3 = []
    async with ClientSession() as session:
        for arg_4 in arg_2:
            arg_5 = asyncio.ensure_future(_download_text(arg_4, session))
            arg_3.append(arg_5)

        return await asyncio.gather(*arg_3)

Asynchronously download a set of lsst - texmf BibTeX bibliographies from GitHub .


def Func ( arg_0 ) : for arg_1 , arg_2 in DEFAULT_ASSETTYPES : arg_3 , arg_4 = Atype . objects . get_or_create ( arg_1 = arg_1 , defaults = { 'description' : arg_2 } ) arg_3 . projects . add ( arg_0 ) arg_3 . full_clean ( ) arg_3 . save ( )

def Func(arg_0):
    """Add or create the default assettypes for the given project

    :param project: the project that needs default assettypes
    :type project: :class:`muke.models.Project`
    :returns: None
    :rtype: None
    :raises: None
    """
    # create assettypes for project
    for arg_1, arg_2 in DEFAULT_ASSETTYPES:
        arg_3, arg_4 = Atype.objects.get_or_create(arg_1=arg_1, defaults={'description': arg_2})
        arg_3.projects.add(arg_0)
        arg_3.full_clean()
        arg_3.save()


def Func ( ) : try : arg_0 = open ( '/proc/uptime' , 'r' ) arg_1 = float ( arg_0 . read ( ) ) arg_0 . close ( ) return arg_1 except ( IOError , ValueError ) : return None

def Func():
    """Returns uptime in seconds or None, on MINIX."""
    try:
        arg_0 = open('/proc/uptime', 'r')
        arg_1 = float(arg_0.read())
        arg_0.close()
        return arg_1
    except (IOError, ValueError):
        return None

Returns uptime in seconds or None on MINIX .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """ Process a single token.
        """
        if arg_0.current_block.is_comment:
            if arg_1 == tokenize.COMMENT:
                arg_0.current_block.add(arg_2, arg_3, arg_4, arg_5)
            else:
                arg_0.new_noncomment(arg_3[0], arg_4[0])
        else:
            if arg_1 == tokenize.COMMENT:
                arg_0.new_comment(arg_2, arg_3, arg_4, arg_5)
            else:
                arg_0.current_block.add(arg_2, arg_3, arg_4, arg_5)


def Func(arg_0, arg_1):
        # type: (bool) -> None
        """
        Sets the ``is_confirmed`` for the bundle.
        """
        arg_0._is_confirmed = arg_1

        for arg_3 in arg_0:
            arg_3.is_confirmed = arg_1


return tuple(['explored%s.set_%05d.xspm_%s_%08d' % (SparseParameter.IDENTIFIER,
                                                         name_idx // 200, name, name_idx)
                                                                        for name in name_list])

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _get_name_list ( arg_2 ) return tuple ( [ 'explored%s.set_%05d.xspm_%s_%08d' % ( SparseParameter . IDENTIFIER , arg_1 // 200 , arg_4 , arg_1 ) for arg_4 in arg_3 ] )

def Func(arg_0, arg_1, arg_2):
        """Formats a name for storage

        :return: A tuple of names with the following format:

            `xspm__spsp__XXXX__spsp__XXXXXXXX` where the first 'XXXX' refer to the property and
            the latter 'XXXXXXX' to the sparse matrix index.

        """
        arg_3 = arg_0._get_name_list(arg_2)
        return tuple(['explored%s.set_%05d.xspm_%s_%08d' % (SparseParameter.IDENTIFIER,
                                                         arg_1 // 200, arg_4, arg_1)
                                                                        for arg_4 in arg_3])


def Func ( arg_0 ) : arg_1 = arg_0 . get_table ( "stops" ) arg_2 = numpy . percentile ( arg_1 [ 'lat' ] . values , 50 ) arg_3 = numpy . percentile ( arg_1 [ 'lon' ] . values , 50 ) return arg_2 , arg_3

def Func(arg_0):
    """
    Get median latitude AND longitude of stops

    Parameters
    ----------
    gtfs: GTFS

    Returns
    -------
    median_lat : float
    median_lon : float
    """
    arg_1 = arg_0.get_table("stops")
    arg_2 = numpy.percentile(arg_1['lat'].values, 50)
    arg_3 = numpy.percentile(arg_1['lon'].values, 50)
    return arg_2, arg_3


(
        graph: BELGraph,
        key: Optional[str] = None,
        tag: Optional[str] = None,
        default_score: Optional[float] = None,
        runs: Optional[int] = None,
        use_tqdm: bool = False,
)

def Func(
        arg_0: arg_1,
        arg_2: arg_3[arg_4] = None,
        arg_5: arg_3[arg_4] = None,
        arg_6: arg_3[arg_7] = None,
        arg_8: arg_3[arg_9] = None,
        arg_10: arg_11 = False,
):
    """Calculate the scores over all biological processes in the sub-graph.

    As an implementation, it simply computes the sub-graphs then calls :func:`calculate_average_scores_on_subgraphs` as
    described in that function's documentation.

    :param graph: A BEL graph with heats already on the nodes
    :param key: The key in the node data dictionary representing the experimental data. Defaults to
     :data:`pybel_tools.constants.WEIGHT`.
    :param tag: The key for the nodes' data dictionaries where the scores will be put. Defaults to 'score'
    :param default_score: The initial score for all nodes. This number can go up or down.
    :param runs: The number of times to run the heat diffusion workflow. Defaults to 100.
    :param use_tqdm: Should there be a progress bar for runners?
    :return: A dictionary of {pybel node tuple: results tuple}
    :rtype: dict[tuple, tuple]

    Suggested usage with :mod:`pandas`:

    >>> import pandas as pd
    >>> from pybel_tools.analysis.heat import Func
    >>> graph = ...  # load graph and data
    >>> scores = Func(graph)
    >>> pd.DataFrame.from_items(scores.items(), orient='index', columns=RESULT_LABELS)

    """
    arg_12 = generate_bioprocess_mechanisms(arg_0, arg_2=arg_2)
    arg_13 = calculate_average_scores_on_subgraphs(
        arg_12,
        arg_2=arg_2,
        arg_5=arg_5,
        arg_6=arg_6,
        arg_8=arg_8,
        arg_10=arg_10
    )
    return arg_13

Calculate the scores over all biological processes in the sub-graph.

    As an implementation, it simply computes the sub-graphs then calls :func:`calculate_average_scores_on_subgraphs` as
    described in that function's documentation.

    :param graph: A BEL graph with heats already on the nodes
    :param key: The key in the node data dictionary representing the experimental data. Defaults to
     :data:`pybel_tools.constants.WEIGHT`.
    :param tag: The key for the nodes' data dictionaries where the scores will be put. Defaults to 'score'
    :param default_score: The initial score for all nodes. This number can go up or down.
    :param runs: The number of times to run the heat diffusion workflow. Defaults to 100.
    :param use_tqdm: Should there be a progress bar for runners?
    :return: A dictionary of {pybel node tuple: results tuple}
    :rtype: dict[tuple, tuple]

    Suggested usage with :mod:`pandas`:

    >>> import pandas as pd
    >>> from pybel_tools.analysis.heat import calculate_average_scores_on_graph
    >>> graph = ...  # load graph and data
    >>> scores = calculate_average_scores_on_graph(graph)
    >>> pd.DataFrame.from_items(scores.items(), orient='index', columns=RESULT_LABELS)

Calculate the scores over all biological processes in the sub - graph .


def Func ( arg_0 ) : try : next ( arg_0 . generate_legal_moves ( ) . __iter__ ( ) ) except StopIteration : return True if arg_0 . is_fourfold_repetition ( ) : return True return False

def Func(arg_0):
        '''
        Checks if the game is over due to checkmate, stalemate or
        fourfold repetition.
        '''

        # Stalemate or checkmate.
        try:
            next(arg_0.generate_legal_moves().__iter__())
        except StopIteration:
            return True

        # Fourfold repetition.
        if arg_0.is_fourfold_repetition():
            return True

        return False

Checks if the game is over due to checkmate stalemate or fourfold repetition .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
prompt_Func
:
arg_2
=
confirm
(
parent
=
arg_1
.
ui
.
control
,
message
=
"Exit Godot?"
,
title
=
"Confirm exit"
,
default
=
YES
)
if
arg_2
==
YES
:
arg_0
.
_on_close
(
arg_1
)
else
:
arg_0
.
_on_close
(
arg_1
)

def Func(arg_0, arg_1):
        """ Handles the user attempting to exit Godot.
        """
        if arg_0.prompt_Func:# and (not is_ok):
            arg_2 = confirm(parent  = arg_1.ui.control,
                             message = "Exit Godot?",
                             title   = "Confirm exit",
                             default = YES)
            if arg_2 == YES:
                arg_0._on_close( arg_1 )
        else:
            arg_0._on_close( arg_1 )

Handles the user attempting to exit Godot .


def
Func
(
arg_0
)
:
if
'error'
in
request
.
args
:
arg_1
=
request
.
args
.
get
(
'error_description'
,
request
.
args
.
get
(
'error'
,
''
)
)
arg_1
=
markupsafe
.
escape
(
arg_1
)
return
(
'Authorization failed: {0}'
.
format
(
arg_1
)
,
httplib
.
BAD_REQUEST
)
try
:
arg_2
=
request
.
args
[
'state'
]
arg_3
=
session
[
_CSRF_KEY
]
arg_4
=
request
.
args
[
'code'
]
except
KeyError
:
return
'Invalid request'
,
httplib
.
BAD_REQUEST
try
:
arg_5
=
json
.
loads
(
arg_2
)
arg_6
=
arg_5
[
'csrf_token'
]
arg_7
=
arg_5
[
'return_url'
]
except
(
ValueError
,
KeyError
)
:
return
'Invalid request state'
,
httplib
.
BAD_REQUEST
if
arg_6
!=
arg_3
:
return
'Invalid request state'
,
httplib
.
BAD_REQUEST
arg_8
=
_get_flow_for_token
(
arg_3
)
if
arg_8
is
:
return
'Invalid request state'
,
httplib
.
BAD_REQUEST
try
:
arg_9
=
arg_8
.
step2_exchange
(
arg_4
)
except
client
.
FlowExchangeError
as
exchange_error
:
current_app
.
logger
.
exception
(
exchange_error
)
arg_10
=
'An error occurred: {0}'
.
format
(
exchange_error
)
return
arg_10
,
httplib
.
BAD_REQUEST
arg_0
.
storage
.
put
(
arg_9
)
if
arg_0
.
authorize_callback
:
arg_0
.
authorize_callback
(
arg_9
)
return
redirect
(
arg_7
)

def Func(arg_0):
        """Flask view that handles the user's return from OAuth2 provider.

        On return, exchanges the authorization code for credentials and stores
        the credentials.
        """
        if 'error' in request.args:
            arg_1 = request.args.get(
                'error_description', request.args.get('error', ''))
            arg_1 = markupsafe.escape(arg_1)
            return ('Authorization failed: {0}'.format(arg_1),
                    httplib.BAD_REQUEST)

        try:
            arg_2 = request.args['state']
            arg_3 = session[_CSRF_KEY]
            arg_4 = request.args['code']
        except KeyError:
            return 'Invalid request', httplib.BAD_REQUEST

        try:
            arg_5 = json.loads(arg_2)
            arg_6 = arg_5['csrf_token']
            arg_7 = arg_5['return_url']
        except (ValueError, KeyError):
            return 'Invalid request state', httplib.BAD_REQUEST

        if arg_6 != arg_3:
            return 'Invalid request state', httplib.BAD_REQUEST

        arg_8 = _get_flow_for_token(arg_3)

        if arg_8 is None:
            return 'Invalid request state', httplib.BAD_REQUEST

        # Exchange the auth code for credentials.
        try:
            arg_9 = arg_8.step2_exchange(arg_4)
        except client.FlowExchangeError as exchange_error:
            current_app.logger.exception(exchange_error)
            arg_10 = 'An error occurred: {0}'.format(exchange_error)
            return arg_10, httplib.BAD_REQUEST

        # Save the credentials to the storage.
        arg_0.storage.put(arg_9)

        if arg_0.authorize_callback:
            arg_0.authorize_callback(arg_9)

        return redirect(arg_7)

Flask view that handles the user s return from OAuth2 provider .


return (np.sum(a > b, dtype=float) / len(a) - 0.5) * 100

def Func ( arg_0 , arg_1 ) : return ( np . sum ( arg_0 > arg_1 , dtype = float ) / len ( arg_0 ) - 0.5 ) * 100

def Func(arg_0, arg_1):
    """Returns the factor of exceedance
    """
    return (np.sum(arg_0 > arg_1, dtype=float) / len(arg_0) - 0.5) * 100


def Func ( arg_0 , arg_1 = None ) : try : arg_0 . __func__ except AttributeError : return _WeakMethodFree ( arg_0 , arg_1 ) return _WeakMethodBound ( arg_0 , arg_1 )

def Func(arg_0, arg_1=None):
    """
    Returns a weak Funcerence to the given method or function.
    If the callback argument is not None, it is called as soon
    as the Funcerenced function is garbage deleted.

    :type  function: callable
    :param function: The function to Funcerence.
    :type  callback: callable
    :param callback: Called when the function dies.
    """
    try:
        arg_0.__func__
    except AttributeError:
        return _WeakMethodFree(arg_0, arg_1)
    return _WeakMethodBound(arg_0, arg_1)

Returns a weak reference to the given method or function.
    If the callback argument is not None, it is called as soon
    as the referenced function is garbage deleted.

    :type  function: callable
    :param function: The function to reference.
    :type  callback: callable
    :param callback: Called when the function dies.

Returns a weak reference to the given method or function . If the callback argument is not None it is called as soon as the referenced function is garbage deleted .


def Func(arg_0, arg_1, arg_2=True):
    r"""
    Convert a number to engineering notation.

    The absolute value of the number (if it is not exactly zero) is bounded to
    the interval [1E-24, 1E+24)

    :param number: Number to convert
    :type  number: integer or float

    :param frac_length: Number of digits of fractional part
    :type  frac_length: `NonNegativeInteger
                        <https://pexdoc.readthedocs.io/en/stable/
                        ptypes.html#nonnegativeinteger>`_

    :param rjust: Flag that indicates whether the number is
                  right-justified (True) or not (False)
    :type  rjust: boolean

    :rtype: string

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for Func.functions.Func

    :raises:
     * RuntimeError (Argument \`frac_length\` is not valid)

     * RuntimeError (Argument \`number\` is not valid)

     * RuntimeError (Argument \`rjust\` is not valid)

    .. [[[end]]]

    The supported engineering suffixes are:

    +----------+-------+--------+
    | Exponent | Name  | Suffix |
    +==========+=======+========+
    | 1E-24    | yocto | y      |
    +----------+-------+--------+
    | 1E-21    | zepto | z      |
    +----------+-------+--------+
    | 1E-18    | atto  | a      |
    +----------+-------+--------+
    | 1E-15    | femto | f      |
    +----------+-------+--------+
    | 1E-12    | pico  | p      |
    +----------+-------+--------+
    | 1E-9     | nano  | n      |
    +----------+-------+--------+
    | 1E-6     | micro | u      |
    +----------+-------+--------+
    | 1E-3     | milli | m      |
    +----------+-------+--------+
    | 1E+0     |       |        |
    +----------+-------+--------+
    | 1E+3     | kilo  | k      |
    +----------+-------+--------+
    | 1E+6     | mega  | M      |
    +----------+-------+--------+
    | 1E+9     | giga  | G      |
    +----------+-------+--------+
    | 1E+12    | tera  | T      |
    +----------+-------+--------+
    | 1E+15    | peta  | P      |
    +----------+-------+--------+
    | 1E+18    | exa   | E      |
    +----------+-------+--------+
    | 1E+21    | zetta | Z      |
    +----------+-------+--------+
    | 1E+24    | yotta | Y      |
    +----------+-------+--------+

    For example:

        >>> import Func
        >>> Func.Func(1235.6789E3, 3, False)
        '1.236M'
    """
    # The decimal module has a to_eng_string() function, but it does not seem
    # to work well in all cases. For example:
    # >>> decimal.Decimal('34.5712233E8').to_eng_string()
    # '3.45712233E+9'
    # >>> decimal.Decimal('34.57122334E8').to_eng_string()
    # '3457122334'
    # It seems that the conversion function does not work in all cases
    #
    # Return formatted zero if number is zero, easier to not deal with this
    # special case through the rest of the algorithm
    if arg_0 == 0:
        arg_0 = "0.{zrs}".format(zrs="0" * arg_1) if arg_1 else "0"
        # Engineering notation numbers can have a sign, a 3-digit integer part,
        # a period, and a fractional part of length frac_length, so the
        # length of the number to the left of, and including, the period is 5
        return "{0} ".format(arg_0.rjust(5 + arg_1)) if arg_2 else arg_0
    # Low-bound number
    arg_3 = +1 if arg_0 >= 0 else -1
    arg_4 = "-" if arg_3 == -1 else ""
    arg_5 = abs(arg_0)
    if arg_5 < 1e-24:
        arg_5 = 1e-24
        arg_0 = arg_3 * 1e-24
    # Round fractional part if requested frac_length is less than length
    # of fractional part. Rounding method is to add a '5' at the decimal
    # position just after the end of frac_length digits
    arg_6 = 3.0 * math.floor(math.floor(math.log10(arg_5)) / 3.0)
    arg_7 = arg_0 / 10 ** arg_6
    # Because exponent is a float, mantissa is a float and its string
    # representation always includes a period
    arg_8 = str(arg_7)
    arg_9 = arg_8.find(".")
    if len(arg_8) - arg_9 - 1 > arg_1:
        arg_7 += arg_3 * 5 * 10 ** (-arg_1 - 1)
        if abs(arg_7) >= 1000:
            arg_6 += 3
            arg_7 = arg_7 / 1e3
        arg_8 = str(arg_7)
        arg_9 = arg_8.find(".")
    # Make fractional part have frac_length digits
    arg_10 = bool(arg_1)
    arg_11 = arg_9 - (not arg_10) + arg_1 + 1
    arg_12 = arg_8[:arg_11].ljust(arg_11, "0")
    # Upper-bound number
    if arg_6 > 24:
        arg_12, arg_6 = (
            "{sign}999.{frac}".format(arg_3=arg_4, frac="9" * arg_1),
            24,
        )
    # Right-justify number, engineering notation numbers can have a sign,
    # a 3-digit integer part and a period, and a fractional part of length
    # frac_length, so the length of the number to the left of the
    # period is 4
    arg_12 = arg_12.rjust(arg_2 * (4 + arg_10 + arg_1))
    # Format number
    arg_13 = "{mant}{suffix}".format(
        arg_7=arg_12, suffix=_POWER_TO_SUFFIX_DICT[arg_6] if arg_6 else " " * bool(arg_2)
    )
    return arg_13

r"""
    Convert a number to engineering notation.

    The absolute value of the number (if it is not exactly zero) is bounded to
    the interval [1E-24, 1E+24)

    :param number: Number to convert
    :type  number: integer or float

    :param frac_length: Number of digits of fractional part
    :type  frac_length: `NonNegativeInteger
                        <https://pexdoc.readthedocs.io/en/stable/
                        ptypes.html#nonnegativeinteger>`_

    :param rjust: Flag that indicates whether the number is
                  right-justified (True) or not (False)
    :type  rjust: boolean

    :rtype: string

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for peng.functions.peng

    :raises:
     * RuntimeError (Argument \`frac_length\` is not valid)

     * RuntimeError (Argument \`number\` is not valid)

     * RuntimeError (Argument \`rjust\` is not valid)

    .. [[[end]]]

    The supported engineering suffixes are:

    +----------+-------+--------+
    | Exponent | Name  | Suffix |
    +==========+=======+========+
    | 1E-24    | yocto | y      |
    +----------+-------+--------+
    | 1E-21    | zepto | z      |
    +----------+-------+--------+
    | 1E-18    | atto  | a      |
    +----------+-------+--------+
    | 1E-15    | femto | f      |
    +----------+-------+--------+
    | 1E-12    | pico  | p      |
    +----------+-------+--------+
    | 1E-9     | nano  | n      |
    +----------+-------+--------+
    | 1E-6     | micro | u      |
    +----------+-------+--------+
    | 1E-3     | milli | m      |
    +----------+-------+--------+
    | 1E+0     |       |        |
    +----------+-------+--------+
    | 1E+3     | kilo  | k      |
    +----------+-------+--------+
    | 1E+6     | mega  | M      |
    +----------+-------+--------+
    | 1E+9     | giga  | G      |
    +----------+-------+--------+
    | 1E+12    | tera  | T      |
    +----------+-------+--------+
    | 1E+15    | peta  | P      |
    +----------+-------+--------+
    | 1E+18    | exa   | E      |
    +----------+-------+--------+
    | 1E+21    | zetta | Z      |
    +----------+-------+--------+
    | 1E+24    | yotta | Y      |
    +----------+-------+--------+

    For example:

        >>> import peng
        >>> peng.peng(1235.6789E3, 3, False)
        '1.236M'

r Convert a number to engineering notation .


def Func ( arg_0 ) : for arg_1 in arg_0 . _meta . indices : arg_1 . ensure ( arg_0 . collection )

def Func(arg_0):
        """Builds all indices, listed in model's Meta class.

           >>> class SomeModel(Model)
           ...     class Meta:
           ...         indices = (
           ...             Index('foo'),
           ...         )

        .. note:: this will result in calls to
                  :meth:`pymongo.collection.Collection.ensure_index`
                  method at import time, so import all your models up
                  front.
        """
        for arg_1 in arg_0._meta.indices:
            arg_1.ensure(arg_0.collection)

Builds all indices listed in model s Meta class .


def Func(arg_0, arg_1):
    """Update received packet metrics"""
    arg_0.update_count(arg_0.RECEIVED_PKT_COUNT)
    arg_0.update_count(arg_0.RECEIVED_PKT_SIZE, incr_by=arg_1)


def Func(arg_0, arg_1, arg_2) -> None:
        """
        Register Param object on interface level object
        """
        nameAvailabilityCheck(arg_0, arg_1, arg_2)
        # resolve name in this scope
        try:
            arg_3 = arg_2._name is not None
        except AttributeError:
            arg_3 = False
        if not arg_3:
            arg_2._name = arg_1
        # add name in this scope
        arg_2._registerScope(arg_1, arg_0)

        if arg_2.hasGenericName:
            arg_2.name = arg_1

        if arg_2._parent is None:
            arg_2._parent = arg_0

        arg_0._params.append(arg_2)