def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
)
:
arg_8
=
{
}
for
arg_9
in
arg_0
:
arg_10
=
pygrib
.
open
(
arg_9
)
arg_10
.
seek
(
0
)
arg_11
=
1
for
arg_12
in
range
(
len
(
arg_2
)
,
0
,
1
)
:
for
arg_13
in
range
(
len
(
arg_1
)
1
,
1
,
1
)
:
arg_14
=
arg_10
[
arg_11
]
arg_15
=
arg_14
.
name
.
replace
(
' '
,
'_'
)
if
arg_14
.
level
!=
0
:
arg_9
=
str
(
arg_14
.
level
)
+
'_'
+
arg_14
.
typeOfLevel
else
:
arg_9
=
arg_14
.
typeOfLevel
if
arg_15
+
'_'
+
arg_9
not
in
arg_8
.
keys
(
)
:
arg_8
[
arg_15
+
'_'
+
arg_9
]
=
[
]
arg_8
[
arg_15
+
'_'
+
arg_9
]
.
append
(
arg_14
.
values
)
arg_16
=
arg_14
.
values
.
shape
arg_17
,
arg_18
=
arg_14
.
latlons
(
)
arg_19
=
(
arg_18
.
min
(
)
,
arg_17
.
max
(
)
,
arg_4
,
arg_4
)
arg_11
+=
1
arg_20
=
(
arg_6
arg_5
)
.
days
+
1
for
arg_21
in
range
(
0
,
(
len
(
arg_3
)
*
arg_20
len
(
arg_0
)
)
)
:
for
arg_22
in
arg_8
.
keys
(
)
:
arg_8
[
arg_22
]
.
append
(
np
.
full
(
arg_16
,
np
.
)
)
for
arg_13
in
range
(
len
(
arg_8
.
keys
(
)
)
1
,
1
,
1
)
:
arg_23
=
dict
(
(
arg_22
,
arg_8
[
arg_8
.
keys
(
)
[
arg_13
]
]
[
arg_22
]
)
for
arg_22
in
range
(
0
,
len
(
arg_8
[
arg_8
.
keys
(
)
[
arg_13
]
]
)
)
)
sorted
(
arg_23
.
items
(
)
,
key
=
lambda
x
:
x
[
0
]
)
arg_24
=
arg_7
+
'/'
+
arg_8
.
keys
(
)
[
arg_13
]
+
'_'
+
arg_5
.
strftime
(
'%Y%M%d'
)
+
'_'
+
arg_6
.
strftime
(
'%Y%M%d'
)
+
'.tif'
writeTiffFromDicoArray
(
arg_23
,
arg_24
,
arg_16
,
arg_19
)
for
arg_25
in
arg_0
:
os
.
remove
(
arg_25
)

def Func(arg_0,arg_1,arg_2,arg_3,arg_4,arg_5,arg_6,arg_7):
    """ Convert GRIB to Tif"""

    arg_8={}

    for arg_9 in arg_0:
        arg_10 = pygrib.open(arg_9)
        arg_10.seek(0)
        arg_11=1
        for arg_12 in range(len(arg_2),0,-1):
            for arg_13 in range(len(arg_1)-1,-1,-1):
                arg_14 = arg_10[arg_11]
                arg_15=arg_14.name.replace(' ','_')
                if arg_14.level != 0:
                    arg_9=str(arg_14.level)+'_'+arg_14.typeOfLevel
                else:
                    arg_9=arg_14.typeOfLevel
                if arg_15+'_'+arg_9 not in arg_8.keys():
                    arg_8[arg_15+'_'+arg_9]=[]
                arg_8[arg_15+'_'+arg_9].append(arg_14.values)
                arg_16=arg_14.values.shape
                arg_17,arg_18=arg_14.latlons()
                arg_19=(arg_18.min(),arg_17.max(),arg_4,arg_4)
                arg_11+= 1

    arg_20=(arg_6-arg_5).days+1
    #on joute des arrayNan si il manque des fichiers
    for arg_21 in range(0, (len(arg_3)*arg_20-len(arg_0))):
        for arg_22 in arg_8.keys():
            arg_8[arg_22].append(np.full(arg_16, np.nan))

    #On écrit pour chacune des variables dans un fichier
    for arg_13 in range(len(arg_8.keys())-1,-1,-1):
        arg_23=dict((arg_22,arg_8[arg_8.keys()[arg_13]][arg_22]) for arg_22 in range(0,len(arg_8[arg_8.keys()[arg_13]])))
        sorted(arg_23.items(), key=lambda x: x[0])
        arg_24=arg_7+'/'+arg_8.keys()[arg_13]+'_'+arg_5.strftime('%Y%M%d')+'_'+arg_6.strftime('%Y%M%d')+'.tif'
        writeTiffFromDicoArray(arg_23,arg_24,arg_16,arg_19)

    for arg_25 in arg_0:
        os.remove(arg_25)


def Func(arg_0, arg_1):
        """
        Validate the package fields.
        Append user friendly error messages to the `messages` list.
        """
        arg_1 = arg_0.Func_checksum(arg_1)
        arg_1 = arg_0.Func_optional_str_fields(arg_1)
        arg_1 = arg_0.Func_mandatory_str_fields(arg_1)
        arg_1 = arg_0.Func_files(arg_1)
        arg_1 = arg_0.Func_mandatory_fields(arg_1)
        arg_1 = arg_0.Func_optional_fields(arg_1)

        return arg_1

Validate the package fields . Append user friendly error messages to the messages list .


def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
arg_2
)
:
if
not
scipy_io
:
raise
ImportError
(
'Func requires scipy'
)
arg_3
=
scipy_io
.
loadmat
(
arg_0
)
arg_4
=
[
]
if
arg_1
is
:
arg_5
=
{
"__globals__"
,
"__header__"
,
"__version__"
}
arg_4
=
sorted
(
i
for
i
in
arg_3
if
i
not
in
arg_5
)
if
len
(
arg_4
)
==
1
:
arg_1
=
arg_4
[
0
]
if
arg_1
is
not
:
return
from_mat_struct
(
arg_3
[
arg_1
]
,
model_id
=
arg_1
,
arg_2
=
arg_2
)
for
arg_6
in
arg_4
:
try
:
return
from_mat_struct
(
arg_3
[
arg_6
]
,
model_id
=
arg_6
,
arg_2
=
arg_2
)
except
ValueError
:
pass
raise
IOError
(
"no COBRA model found"
)

def Func(arg_0, arg_1=None, arg_2=arg_2):
    """Load a cobra model stored as a .mat file

    Parameters
    ----------
    infile_path: str
        path to the file to to read
    variable_name: str, optional
        The variable name of the model in the .mat file. If this is not
        specified, then the first MATLAB variable which looks like a COBRA
        model will be used
    inf: value
        The value to use for infinite bounds. Some solvers do not handle
        infinite values so for using those, set this to a high numeric value.

    Returns
    -------
    cobra.core.Model.Model:
        The resulting cobra model

    """
    if not scipy_io:
        raise ImportError('Func requires scipy')

    arg_3 = scipy_io.loadmat(arg_0)
    arg_4 = []
    if arg_1 is None:
        # skip meta variables
        arg_5 = {"__globals__", "__header__", "__version__"}
        arg_4 = sorted(i for i in arg_3 if i not in arg_5)
        if len(arg_4) == 1:
            arg_1 = arg_4[0]
    if arg_1 is not None:
        return from_mat_struct(arg_3[arg_1], model_id=arg_1,
                               arg_2=arg_2)
    for arg_6 in arg_4:
        try:
            return from_mat_struct(arg_3[arg_6], model_id=arg_6,
                                   arg_2=arg_2)
        except ValueError:
            pass
    # If code here is executed, then no model was found.
    raise IOError("no COBRA model found")

Load a cobra model stored as a . mat file


def
Func
(
arg_0
,
arg_1
=
'  '
)
:
for
arg_2
in
sorted
(
arg_0
.
keys
(
)
)
:
print
"%s%s"
%
(
arg_1
*
depth
(
arg_2
,
arg_0
)
,
arg_2
)

def Func(arg_0, arg_1='  '):
    """print a binary tree"""
    for arg_2 in sorted(arg_0.keys()):
        print "%s%s" % (arg_1 * depth(arg_2,arg_0), arg_2)


(element, include_id, id_prefix_to_skip=None, use_title_as_id=False)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False ) : arg_4 = { } arg_5 = arg_0 . attrib . get ( _make_etree_ns_attr_name ( _etree_entity_feed_namespaces [ 'm' ] , 'etag' ) , None ) if arg_5 is not None : arg_4 [ 'etag' ] = arg_5 arg_6 = arg_0 . findtext ( './atom:updated' , '' , _etree_entity_feed_namespaces ) if arg_6 : arg_4 [ 'updated' ] = arg_6 arg_7 = arg_0 . findtext ( './atom:author/atom:name' , '' , _etree_entity_feed_namespaces ) if arg_7 : arg_4 [ 'author' ] = arg_7 if arg_1 : if arg_3 : arg_8 = arg_0 . findtext ( './atom:title' , '' , _etree_entity_feed_namespaces ) if arg_8 : arg_4 [ 'name' ] = arg_8 else : arg_9 = arg_0 . findtext ( './atom:id' , '' , _etree_entity_feed_namespaces ) if arg_9 : arg_4 [ 'name' ] = _get_readable_id ( arg_9 , arg_2 ) return arg_4

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
        ''' get properties from element tree element '''
        arg_4 = {}

        arg_5 = arg_0.attrib.get(_make_etree_ns_attr_name(_etree_entity_feed_namespaces['m'], 'etag'), None)
        if arg_5 is not None:
            arg_4['etag'] = arg_5

        arg_6 = arg_0.findtext('./atom:updated', '', _etree_entity_feed_namespaces)
        if arg_6:
            arg_4['updated'] = arg_6

        arg_7 = arg_0.findtext('./atom:author/atom:name', '', _etree_entity_feed_namespaces)
        if arg_7:
            arg_4['author'] = arg_7

        if arg_1:
            if arg_3:
                arg_8 = arg_0.findtext('./atom:title', '', _etree_entity_feed_namespaces)
                if arg_8:
                    arg_4['name'] = arg_8
            else:
                arg_9 = arg_0.findtext('./atom:id', '', _etree_entity_feed_namespaces)
                if arg_9:
                    arg_4['name'] = _get_readable_id(arg_9, arg_2)

        return arg_4


(cpdir,
                                   xmatchpkl,
                                   cpfileglob='checkplot-*.pkl*',
                                   xmatchradiusarcsec=2.0,
                                   updateexisting=True,
                                   resultstodir=None)

return xmatch_cplist_external_catalogs(
        cplist,
        xmatchpkl,
        xmatchradiusarcsec=xmatchradiusarcsec,
        updateexisting=updateexisting,
        resultstodir=resultstodir
    )

def Func(arg_0,
                                   arg_1,
                                   arg_2='checkplot-*.pkl*',
                                   arg_3=2.0,
                                   arg_4=True,
                                   arg_5=None):
    '''This xmatches external catalogs to all checkplots in a directory.

    Parameters
    -----------

    cpdir : str
        This is the directory to search in for checkplots.

    xmatchpkl : str
        The filename of a pickle prepared beforehand with the
        `checkplot.pkl_xmatch.load_xmatch_external_catalogs` function,
        containing collected external catalogs to cross-match the objects in the
        input `cplist` against.

    cpfileglob : str
        This is the UNIX fileglob to use in searching for checkplots.

    xmatchradiusarcsec : float
        The match radius to use for the cross-match in arcseconds.

    updateexisting : bool
        If this is True, will only update the `xmatch` dict in each checkplot
        pickle with any new cross-matches to the external catalogs. If False,
        will overwrite the `xmatch` dict with results from the current run.

    resultstodir : str or None
        If this is provided, then it must be a directory to write the resulting
        checkplots to after xmatch is done. This can be used to keep the
        original checkplots in pristine condition for some reason.

    Returns
    -------

    dict
        Returns a dict with keys = input checkplot pickle filenames and vals =
        xmatch status dict for each checkplot pickle.

    '''

    arg_6 = glob.glob(os.path.join(arg_0, arg_2))

    return xmatch_cplist_external_catalogs(
        arg_6,
        arg_1,
        arg_3=arg_3,
        arg_4=arg_4,
        arg_5=arg_5
    )

This xmatches external catalogs to all checkplots in a directory .


return int(snum[pindex + 1 :] if snum[-1].isdigit() else snum[pindex + 1 : -1])

def Func ( arg_0 ) : arg_0 = arg_0 . rstrip ( ) arg_1 = arg_0 . find ( "." ) if arg_1 == - 1 : return 0 return int ( arg_0 [ arg_1 + 1 : ] if arg_0 [ - 1 ] . isdigit ( ) else arg_0 [ arg_1 + 1 : - 1 ] )

def Func(arg_0):
    r"""
    Return the fractional part of a number represented in engineering notation.

    :param snum: Number
    :type  snum: :ref:`EngineeringNotationNumber`

    :rtype: integer

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

    :raises: RuntimeError (Argument \`snum\` is not valid)

    .. [[[end]]]

    For example:

        >>> import peng
        >>> peng.Func(peng.peng(1235.6789E3, 3, False))
        236
    """
    arg_0 = arg_0.rstrip()
    arg_1 = arg_0.find(".")
    if arg_1 == -1:
        return 0
    return int(arg_0[arg_1 + 1 :] if arg_0[-1].isdigit() else arg_0[arg_1 + 1 : -1])

r"""
    Return the fractional part of a number represented in engineering notation.

    :param snum: Number
    :type  snum: :ref:`EngineeringNotationNumber`

    :rtype: integer

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

    :raises: RuntimeError (Argument \`snum\` is not valid)

    .. [[[end]]]

    For example:

        >>> import peng
        >>> peng.peng_frac(peng.peng(1235.6789E3, 3, False))
        236

r Return the fractional part of a number represented in engineering notation .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
is
:
arg_0
.
_delete_reason
(
)
elif
not
isinstance
(
arg_1
,
bytes
)
:
raise
TypeError
(
"reason must be None or a byte string"
)
else
:
arg_1
=
arg_1
.
lower
(
)
.
replace
(
b' '
,
b''
)
arg_2
=
[
r
.
lower
(
)
for
r
in
arg_0
.
_crl_reasons
]
.
index
(
arg_1
)
arg_3
=
_lib
.
ASN1_ENUMERATED_new
(
)
_openssl_assert
(
arg_3
!=
_ffi
.
)
arg_3
=
_ffi
.
gc
(
arg_3
,
_lib
.
ASN1_ENUMERATED_free
)
arg_4
=
_lib
.
ASN1_ENUMERATED_set
(
arg_3
,
arg_2
)
_openssl_assert
(
arg_4
!=
_ffi
.
)
arg_0
.
_delete_reason
(
)
arg_5
=
_lib
.
X509_REVOKED_add1_ext_i2d
(
arg_0
.
_revoked
,
_lib
.
NID_crl_reason
,
arg_3
,
0
,
0
)
_openssl_assert
(
arg_5
==
1
)

def Func(arg_0, arg_1):
        """
        Set the reason of this revocation.

        If :data:`reason` is ``None``, delete the reason instead.

        :param reason: The reason string.
        :type reason: :class:`bytes` or :class:`NoneType`

        :return: ``None``

        .. seealso::

            :meth:`all_reasons`, which gives you a list of all supported
            reasons which you might pass to this method.
        """
        if arg_1 is None:
            arg_0._delete_reason()
        elif not isinstance(arg_1, bytes):
            raise TypeError("reason must be None or a byte string")
        else:
            arg_1 = arg_1.lower().replace(b' ', b'')
            arg_2 = [r.lower() for r in arg_0._crl_reasons].index(arg_1)

            arg_3 = _lib.ASN1_ENUMERATED_new()
            _openssl_assert(arg_3 != _ffi.NULL)
            arg_3 = _ffi.gc(arg_3, _lib.ASN1_ENUMERATED_free)

            arg_4 = _lib.ASN1_ENUMERATED_set(arg_3, arg_2)
            _openssl_assert(arg_4 != _ffi.NULL)

            arg_0._delete_reason()
            arg_5 = _lib.X509_REVOKED_add1_ext_i2d(
                arg_0._revoked, _lib.NID_crl_reason, arg_3, 0, 0)
            _openssl_assert(arg_5 == 1)


def Func ( arg_0 ) : try : arg_1 = _pybossa_req ( 'delete' , 'category' , arg_0 ) if type ( arg_1 ) . __name__ == 'bool' : return True else : return arg_1 except : raise

def Func(arg_0):
    """Delete a Category with id = category_id.

    :param category_id: PYBOSSA Category ID
    :type category_id: integer
    :returns: True -- the response status code

    """
    try:
        arg_1 = _pybossa_req('delete', 'category', arg_0)
        if type(arg_1).__name__ == 'bool':
            return True
        else:
            return arg_1
    except:  # pragma: no cover
        raise

Delete a Category with id = category_id .


def
Func
(
arg_0
,
arg_1
=
)
:
import
subprocess
arg_0
.
assert_is_dir_and_exists
(
)
if
arg_1
is
:
if
six
.
PY2
:
arg_1
=
"python2"
elif
six
.
PY3
:
arg_1
=
"python3"
for
arg_2
in
arg_0
.
select_by_ext
(
".py"
)
:
subprocess
.
Popen
(
'%s "%s"'
%
(
arg_1
,
arg_2
.
abspath
)
)

def Func(arg_0, arg_1=None):  # pragma: no cover
        """
        Execute every ``.py`` file as main script.

        :param py_exe: str, python command or python executable path.

        **中文文档**

        将目录下的所有Python文件作为主脚本用当前解释器运行。
        """
        import subprocess

        arg_0.assert_is_dir_and_exists()

        if arg_1 is None:
            if six.PY2:
                arg_1 = "python2"
            elif six.PY3:
                arg_1 = "python3"

        for arg_2 in arg_0.select_by_ext(".py"):
            subprocess.Popen('%s "%s"' % (arg_1, arg_2.abspath))

Execute every . py file as main script .


def
Func
(
arg_0
,
arg_1
)
:
if
not
isinstance
(
arg_1
,
dict
)
:
raise
TypeError
(
"Expected dict for model, got %s"
%
type
(
arg_1
)
)
arg_1
[
'path'
]
=
'/'
.
join
(
(
arg_0
,
arg_1
[
'path'
]
)
)
.
strip
(
'/'
)
if
arg_1
[
'type'
]
in
(
'notebook'
,
'file'
)
:
return
arg_1
if
arg_1
[
'type'
]
!=
'directory'
:
raise
ValueError
(
"Unknown model type %s."
%
type
(
arg_1
)
)
arg_2
=
arg_1
.
get
(
'content'
,
)
if
arg_2
is
not
:
for
arg_3
in
arg_2
:
Func
(
arg_0
,
arg_3
)
return
arg_1

def Func(arg_0, arg_1):
    """
    Prefix all path entries in model with the given prefix.
    """
    if not isinstance(arg_1, dict):
        raise TypeError("Expected dict for model, got %s" % type(arg_1))

    # We get unwanted leading/trailing slashes if prefix or model['path'] are
    # '', both of which are legal values.
    arg_1['path'] = '/'.join((arg_0, arg_1['path'])).strip('/')
    if arg_1['type'] in ('notebook', 'file'):
        return arg_1

    if arg_1['type'] != 'directory':
        raise ValueError("Unknown model type %s." % type(arg_1))

    arg_2 = arg_1.get('content', None)
    if arg_2 is not None:
        for arg_3 in arg_2:
            Func(arg_0, arg_3)

    return arg_1

Prefix all path entries in model with the given prefix .


def Func ( arg_0 ) : arg_1 = [ i if i is not None else "" for i in arg_0 ] return array ( arg_1 , dtype = np_object )

def Func(arg_0):
    """translate an array x into a MATLAB cell array"""
    arg_1 = [i if i is not None else "" for i in arg_0]
    return array(arg_1, dtype=np_object)


def Func ( arg_0 , arg_1 ) : arg_2 = np . eye ( arg_1 , dtype = int ) return arg_2 [ arg_0 ]

def Func(arg_0, arg_1):
    """
    Takes an array of integers and transforms it
    to an array of one-hot encoded vectors
    """
    arg_2 = np.eye(arg_1, dtype=int)
    return arg_2[arg_0]

Takes an array of integers and transforms it to an array of one - hot encoded vectors


return self._load_data(
            self.PROGRAM_TYPES_ENDPOINT,
            resource_id=slug,
            default=None,
        )

def Func ( arg_0 , arg_1 ) : return arg_0 . _load_data ( arg_0 . PROGRAM_TYPES_ENDPOINT , resource_id = arg_1 , default = None , )

def Func(arg_0, arg_1):
        """
        Get a program type by its slug.

        Arguments:
            slug (str): The slug to identify the program type.

        Returns:
            dict: A program type object.

        """
        return arg_0._load_data(
            arg_0.PROGRAM_TYPES_ENDPOINT,
            resource_id=arg_1,
            default=None,
        )


def Func(arg_0, arg_1, arg_2=arg_3):
        """
        Adds a new child and assigns the given TaskSpec to it.

        :type  task_spec: TaskSpec
        :param task_spec: The task spec that is assigned to the new child.
        :type  state: integer
        :param state: The bitmask of states for the new child.
        :rtype:  Task
        :returns: The new child task.
        """
        if arg_1 is None:
            raise ValueError(arg_0, 'Func() requires a TaskSpec')
        if arg_0._is_predicted() and arg_2 & arg_0.PREDICTED_MASK == 0:
            arg_4 = 'Attempt to add non-predicted child to predicted task'
            raise WorkflowException(arg_0.task_spec, arg_4)
        arg_5 = Task(arg_0.workflow, arg_1, arg_0, arg_2=arg_2)
        arg_5.thread_id = arg_0.thread_id
        if arg_2 == arg_0.READY:
            arg_5._ready()
        return arg_5

Adds a new child and assigns the given TaskSpec to it .


def
Func
(
arg_0
,
*
arg_1
,
**
arg_2
)
:
arg_3
=
'\n'
if
'endl'
not
in
arg_2
else
arg_2
.
pop
(
'endl'
)
arg_4
=
if
'trim'
not
in
arg_2
else
arg_2
.
pop
(
'trim'
)
if
arg_4
is
:
arg_4
=
bytes
.
rstrip
if
is_py3
else
str
.
rstrip
arg_5
=
' '
.
join
(
arg_1
)
if
not
arg_5
:
if
arg_0
is
not
:
for
arg_6
in
arg_0
:
yield
arg_6
else
:
while
True
:
yield
arg_7
=
subprocess
.
Popen
(
arg_5
,
Funcell
=
True
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
**
arg_2
)
if
arg_0
is
not
:
arg_8
=
StringIO
(
)
for
arg_6
in
arg_0
:
arg_8
.
write
(
arg_6
)
if
arg_3
:
arg_8
.
write
(
arg_3
)
if
is_py3
:
arg_7
.
stdin
.
write
(
arg_8
.
getvalue
(
)
.
encode
(
'utf-8'
)
)
else
:
arg_7
.
stdin
.
write
(
arg_8
.
getvalue
(
)
)
arg_7
.
stdin
.
fluFunc
(
)
arg_7
.
stdin
.
close
(
)
arg_8
.
close
(
)
for
arg_9
in
arg_7
.
stdout
:
yield
arg_4
(
arg_9
)
arg_7
.
wait
(
)

def Func(arg_0, *arg_1, **arg_2):
    """Func pipe execute Funcell command specified by args. If previous pipe exists,
    read data from it and write it to stdin of Funcell process. The stdout of
    Funcell process will be passed to next pipe object line by line.

    A optional keyword argument 'trim' can pass a function into Func pipe. It is
    used to trim the output from Funcell process. The default trim function is
    str.rstrip. Therefore, any space characters in tail of
    Funcell process output line will be removed.

    For example:

    py_files = result(Func('ls') | strip | wildcard('*.py'))

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param args: The command line arguments. It will be joined by space character.
    :type args: list of string.
    :param kw: arguments for subprocess.Popen.
    :type kw: dictionary of options.
    :returns: generator
    """
    arg_3 = '\n' if 'endl' not in arg_2 else arg_2.pop('endl')
    arg_4 = None if 'trim' not in arg_2 else arg_2.pop('trim')
    if arg_4 is None:
        arg_4 = bytes.rstrip if is_py3 else str.rstrip

    arg_5 = ' '.join(arg_1)
    if not arg_5:
        if arg_0 is not None:
            for arg_6 in arg_0:
                yield arg_6
        else:
            while True:
                yield None

    arg_7 = subprocess.Popen(arg_5, Funcell=True,
        stdin=subprocess.PIPE, stdout=subprocess.PIPE,
        **arg_2)
    if arg_0 is not None:
        arg_8 = StringIO()
        for arg_6 in arg_0:
            arg_8.write(arg_6)
            if arg_3:
                arg_8.write(arg_3)
        if is_py3:
            arg_7.stdin.write(arg_8.getvalue().encode('utf-8'))
        else:
            arg_7.stdin.write(arg_8.getvalue())
        arg_7.stdin.fluFunc()
        arg_7.stdin.close()
        arg_8.close()

    for arg_9 in arg_7.stdout:
        yield arg_4(arg_9)

    arg_7.wait()

sh pipe execute shell command specified by args. If previous pipe exists,
    read data from it and write it to stdin of shell process. The stdout of
    shell process will be passed to next pipe object line by line.

    A optional keyword argument 'trim' can pass a function into sh pipe. It is
    used to trim the output from shell process. The default trim function is
    str.rstrip. Therefore, any space characters in tail of
    shell process output line will be removed.

    For example:

    py_files = result(sh('ls') | strip | wildcard('*.py'))

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param args: The command line arguments. It will be joined by space character.
    :type args: list of string.
    :param kw: arguments for subprocess.Popen.
    :type kw: dictionary of options.
    :returns: generator

sh pipe execute shell command specified by args . If previous pipe exists read data from it and write it to stdin of shell process . The stdout of shell process will be passed to next pipe object line by line .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = copy . copy ( arg_0 ) _bound_waveform ( arg_3 , arg_1 , arg_2 ) return np . min ( arg_3 . _dep_vector )

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

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

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :rtype: float

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

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

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

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

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

    .. [[[end]]]
    """
    arg_3 = copy.copy(arg_0)
    _bound_waveform(arg_3, arg_1, arg_2)
    return np.min(arg_3._dep_vector)

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

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

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :rtype: float

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.nmin

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

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

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

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

    .. [[[end]]]

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


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . Funcs ( names = arg_1 , workspaces = arg_2 ) return arg_0 . _return_first_item ( arg_3 )

def Func(arg_0, arg_1, arg_2=None):
        '''
          returns a single layergroup object.
          Will return None if no layergroup is found.
          Will raise an error if more than one layergroup with the same name is found.
        '''

        arg_3 = arg_0.Funcs(names=arg_1, workspaces=arg_2)
        return arg_0._return_first_item(arg_3)

returns a single layergroup object . Will return None if no layergroup is found . Will raise an error if more than one layergroup with the same name is found .


def
Func
(
arg_0
)
:
arg_1
=
dict
(
)
arg_2
=
0
arg_3
=
arg_0
.
find
(
':'
)
while
arg_3
>=
0
:
arg_4
=
arg_0
[
arg_2
:
arg_3
]
if
arg_0
[
arg_3
+
1
]
==
'['
:
arg_5
=
arg_0
.
find
(
']'
,
arg_3
+
1
)
if
arg_5
<
0
:
raise
RuntimeError
(
'error when parsing dict'
)
arg_6
=
arg_0
[
arg_3
+
2
:
arg_5
]
.
split
(
','
)
for
arg_7
in
range
(
len
(
arg_6
)
)
:
try
:
arg_6
[
arg_7
]
=
int
(
arg_6
[
arg_7
]
)
except
ValueError
:
pass
elif
arg_0
[
arg_3
+
1
]
==
'{'
:
arg_8
=
_select_block
(
arg_0
[
arg_3
:
]
,
'{'
,
'}'
)
arg_6
=
Func
(
arg_8
)
arg_5
=
arg_3
+
len
(
arg_8
)
else
:
raise
ValueError
(
'error when parsing dict: unknown elem'
)
arg_4
=
arg_4
.
strip
(
'"'
)
if
len
(
arg_4
)
>
0
:
arg_1
[
arg_4
]
=
arg_6
arg_2
=
arg_0
.
find
(
','
,
arg_5
)
if
arg_2
<
0
:
break
arg_2
+=
1
arg_3
=
arg_0
.
find
(
':'
,
arg_2
)
return
arg_1

def Func(arg_0):
    """Parse a dictionary from the search index"""
    arg_1 = dict()
    arg_2 = 0
    arg_3 = arg_0.find(':')
    while arg_3 >= 0:
        arg_4 = arg_0[arg_2:arg_3]
        if arg_0[arg_3 + 1] == '[':
            # value is a list
            arg_5 = arg_0.find(']', arg_3 + 1)
            if arg_5 < 0:
                raise RuntimeError('error when parsing dict')
            arg_6 = arg_0[arg_3 + 2: arg_5].split(',')
            # try to convert elements to int
            for arg_7 in range(len(arg_6)):
                try:
                    arg_6[arg_7] = int(arg_6[arg_7])
                except ValueError:
                    pass
        elif arg_0[arg_3 + 1] == '{':
            # value is another dictionary
            arg_8 = _select_block(arg_0[arg_3:], '{', '}')
            arg_6 = Func(arg_8)
            arg_5 = arg_3 + len(arg_8)
        else:
            raise ValueError('error when parsing dict: unknown elem')

        arg_4 = arg_4.strip('"')
        if len(arg_4) > 0:
            arg_1[arg_4] = arg_6

        arg_2 = arg_0.find(',', arg_5)
        if arg_2 < 0:
            break
        arg_2 += 1
        arg_3 = arg_0.find(':', arg_2)

    return arg_1


return None if field_descriptor.name is None else field_descriptor.name.replace("1", str(cycle_num))

def Func(arg_0, arg_1):
        """
        manages extensible names
        """
        arg_2 = arg_0.get_field_descriptor(arg_1)
        if arg_0.extensible_info is None:
            return arg_2.name
        arg_3, arg_4, arg_5 = arg_0.extensible_info
        arg_6 = (arg_1 - arg_3) // arg_4
        return None if arg_2.name is None else arg_2.name.replace("1", str(arg_6))


def
Func
(
arg_0
,
arg_1
)
:
if
isinstance
(
arg_1
,
Node
)
:
arg_2
=
arg_1
else
:
arg_2
=
arg_0
.
get_node
(
arg_1
)
if
arg_2
is
:
raise
ValueError
(
"Node %s does not exists"
%
arg_1
)
arg_0
.
nodes
.
remove
(
arg_2
)

def Func(arg_0, arg_1):
        """ Removes a node from the graph.
        """
        if isinstance(arg_1, Node):
#            name = node_or_ID.ID
            arg_2 = arg_1
        else:
#            name = node_or_ID
            arg_2 = arg_0.get_node(arg_1)
            if arg_2 is None:
                raise ValueError("Node %s does not exists" % arg_1)

#        try:
#            del self.nodes[name]
#        except:
#            raise ValueError("Node %s does not exists" % name)

#        self.nodes = [n for n in self.nodes if n.ID != name]
#        idx = self.nodes.index(name)
#        return self.nodes.pop(idx)

        arg_0.nodes.remove(arg_2)


return self.request(id, "drain", params={"enable": enable}, method="post").json()

def Func ( arg_0 , arg_1 , arg_2 = False ) : return arg_0 . request ( arg_1 , "drain" , params = { "enable" : arg_2 } , method = "post" ) . json ( )

def Func(arg_0, arg_1, arg_2=False):
        """ Toggle the drain mode of the node.
            When enabled, no further allocations will be
            assigned and existing allocations will be migrated.

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

            arguments:
              - id (str uuid): node id
              - enable (bool): enable node drain or not to enable node drain
            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """

        return arg_0.request(arg_1, "drain", params={"enable": arg_2}, method="post").json()

Toggle the drain mode of the node . When enabled no further allocations will be assigned and existing allocations will be migrated .


def Func(arg_0, arg_1=2):
    """
    Return the given number as a string with a sign in front of it, ie. `+` if the number is positive, `-` otherwise.
    """
    arg_2 = '' if arg_0 <= 0 else '+'
    arg_3 = '{}{:.{precision}f}'.format(arg_2, arg_0, arg_1=arg_1)

    return arg_3

Return the given number as a string with a sign in front of it ie . + if the number is positive - otherwise .


def Func(arg_0):
        """
        Runs methods services have requested be run before after deployment.
        """
        for arg_1 in arg_0.genv.services:
            arg_1 = arg_1.strip().upper()
            arg_0.vprint('Func:', arg_1)
            arg_2 = common.service_Funcers.get(arg_1)
            if arg_2:
                arg_0.vprint('Running post-deployments for service %s...' % (arg_1,))
                for arg_3 in arg_2:
                    try:
                        arg_3()
                    except Exception as e:
                        print('Post deployment error: %s' % e, file=sys.stderr)
                        print(traceback.format_exc(), file=sys.stderr)

Runs methods services have requested be run before after deployment .


def Func ( ) : configure_service ( 'capture.admin' ) arg_0 = 'idle' if get_service_status ( db . Service . SCHEDULE ) == db . ServiceStatus . STOPPED : arg_0 = 'offline' elif get_service_status ( db . Service . CAPTURE ) == db . ServiceStatus . BUSY : arg_0 = 'capturing' elif get_service_status ( db . Service . INGEST ) == db . ServiceStatus . BUSY : arg_0 = 'uploading' register_ca ( arg_0 = arg_0 )

def Func():
    '''Update the current agent state in opencast.
    '''
    configure_service('capture.admin')
    arg_0 = 'idle'

    # Determine reported agent state with priority list
    if get_service_status(db.Service.SCHEDULE) == db.ServiceStatus.STOPPED:
        arg_0 = 'offline'
    elif get_service_status(db.Service.CAPTURE) == db.ServiceStatus.BUSY:
        arg_0 = 'capturing'
    elif get_service_status(db.Service.INGEST) == db.ServiceStatus.BUSY:
        arg_0 = 'uploading'

    register_ca(arg_0=arg_0)

Update the current agent state in opencast .


Wait until the specified device has discovered the expected services
        and characteristics for this service.  Should be called once before other
        calls are made on the service.  Returns true if the service has been
        discovered in the specified timeout, or false if not discovered.

def Func ( arg_0 , arg_1 , arg_2 = arg_3 ) : arg_1 . Func ( arg_0 . SERVICES , arg_0 . CHARACTERISTICS , arg_2 )

def Func(arg_0, arg_1, arg_2=arg_3):
        """Wait until the specified device has Funced the expected services
        and characteristics for this service.  Should be called once before other
        calls are made on the service.  Returns true if the service has been
        Funced in the specified timeout, or false if not Funced.
        """
        arg_1.Func(arg_0.SERVICES, arg_0.CHARACTERISTICS, arg_2)

Wait until the specified device has discovered the expected services and characteristics for this service . Should be called once before other calls are made on the service . Returns true if the service has been discovered in the specified timeout or false if not discovered .


Establish connection with Guacamole guacd server via handshake.

(self, protocol='vnc', width=1024, height=768, dpi=96,
                  audio=None, video=None, image=None, **kwargs)

def Func(arg_0, arg_1='vnc', arg_2=1024, arg_3=768, arg_4=96,
                  arg_5=None, arg_6=None, arg_7=None, **arg_8):
        """
        Establish connection with Guacamole guacd server via Func.
        """
        if arg_1 not in PROTOCOLS:
            arg_0.logger.debug('Invalid protocol: %s' % arg_1)
            raise GuacamoleError('Cannot start Handshake. Missing protocol.')

        if arg_5 is None:
            arg_5 = list()

        if arg_6 is None:
            arg_6 = list()

        if arg_7 is None:
            arg_7 = list()

        # 1. Send 'select' instruction
        arg_0.logger.debug('Send `select` instruction.')
        arg_0.send_instruction(Instruction('select', arg_1))

        # 2. Receive `args` instruction
        arg_9 = arg_0.read_instruction()
        arg_0.logger.debug('Expecting `args` instruction, received: %s'
                          % str(arg_9))

        if not arg_9:
            arg_0.close()
            raise GuacamoleError(
                'Cannot establish Handshake. Connection Lost!')

        if arg_9.opcode != 'args':
            arg_0.close()
            raise GuacamoleError(
                'Cannot establish Handshake. Expected opcode `args`, '
                'received `%s` instead.' % arg_9.opcode)

        # 3. Respond with size, audio & video support
        arg_0.logger.debug('Send `size` instruction (%s, %s, %s)'
                          % (arg_2, arg_3, arg_4))
        arg_0.send_instruction(Instruction('size', arg_2, arg_3, arg_4))

        arg_0.logger.debug('Send `audio` instruction (%s)' % arg_5)
        arg_0.send_instruction(Instruction('audio', *arg_5))

        arg_0.logger.debug('Send `video` instruction (%s)' % arg_6)
        arg_0.send_instruction(Instruction('video', *arg_6))

        arg_0.logger.debug('Send `image` instruction (%s)' % arg_7)
        arg_0.send_instruction(Instruction('image', *arg_7))

        # 4. Send `connect` instruction with proper values
        arg_10 = [
            arg_8.get(arg.replace('-', '_'), '') for arg in arg_9.args
        ]

        arg_0.logger.debug('Send `connect` instruction (%s)' % arg_10)
        arg_0.send_instruction(Instruction('connect', *arg_10))

        # 5. Receive ``ready`` instruction, with client ID.
        arg_9 = arg_0.read_instruction()
        arg_0.logger.debug('Expecting `ready` instruction, received: %s'
                          % str(arg_9))

        if arg_9.opcode != 'ready':
            arg_0.logger.warning(
                'Expected `ready` instruction, received: %s instead')

        if arg_9.args:
            arg_0._id = arg_9.args[0]
            arg_0.logger.debug(
                'Established connection with client id: %s' % arg_0.id)

        arg_0.logger.debug('Handshake completed.')
        arg_0.connected = True

Establish connection with Guacamole guacd server via handshake .


(self,
                           project_id,
                           dataset_id,
                           table_id,
                           schema_fields=None,
                           time_partitioning=None,
                           cluster_fields=None,
                           labels=None,
                           view=None,
                           num_retries=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
,
arg_5
=
,
arg_6
=
,
arg_7
=
,
arg_8
=
,
arg_9
=
)
:
arg_1
=
arg_1
if
arg_1
is
not
else
arg_0
.
project_id
arg_10
=
{
'tableReference'
:
{
'tableId'
:
arg_3
}
}
if
arg_4
:
arg_10
[
'schema'
]
=
{
'fields'
:
arg_4
}
if
arg_5
:
arg_10
[
'timePartitioning'
]
=
arg_5
if
arg_6
:
arg_10
[
'clustering'
]
=
{
'fields'
:
arg_6
}
if
arg_7
:
arg_10
[
'labels'
]
=
arg_7
if
arg_8
:
arg_10
[
'view'
]
=
arg_8
arg_9
=
arg_9
if
arg_9
else
arg_0
.
num_retries
arg_0
.
log
.
info
(
'Creating Table %s:%s.%s'
,
arg_1
,
arg_2
,
arg_3
)
try
:
arg_0
.
service
.
tables
(
)
.
insert
(
projectId
=
arg_1
,
datasetId
=
arg_2
,
body
=
arg_10
)
.
execute
(
arg_9
=
arg_9
)
arg_0
.
log
.
info
(
'Table created successfully: %s:%s.%s'
,
arg_1
,
arg_2
,
arg_3
)
except
HttpError
as
err
:
raise
AirflowException
(
'BigQuery job failed. Error was: {}'
.
format
(
err
.
content
)
)

def Func(arg_0,
                           arg_1,
                           arg_2,
                           arg_3,
                           arg_4=None,
                           arg_5=None,
                           arg_6=None,
                           arg_7=None,
                           arg_8=None,
                           arg_9=None):
        """
        Creates a new, empty table in the dataset.
        To create a view, which is defined by a SQL query, parse a dictionary to 'view' kwarg

        :param project_id: The project to create the table into.
        :type project_id: str
        :param dataset_id: The dataset to create the table into.
        :type dataset_id: str
        :param table_id: The Name of the table to be created.
        :type table_id: str
        :param schema_fields: If set, the schema field list as defined here:
            https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.load.schema
        :type schema_fields: list
        :param labels: a dictionary containing labels for the table, passed to BigQuery
        :type labels: dict

        **Example**: ::

            schema_fields=[{"name": "emp_name", "type": "STRING", "mode": "REQUIRED"},
                           {"name": "salary", "type": "INTEGER", "mode": "NULLABLE"}]

        :param time_partitioning: configure optional time partitioning fields i.e.
            partition by field, type and expiration as per API specifications.

            .. seealso::
                https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#timePartitioning
        :type time_partitioning: dict
        :param cluster_fields: [Optional] The fields used for clustering.
            Must be specified with time_partitioning, data in the table will be first
            partitioned and subsequently clustered.
            https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#clustering.fields
        :type cluster_fields: list
        :param view: [Optional] A dictionary containing definition for the view.
            If set, it will create a view instead of a table:
            https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#view
        :type view: dict

        **Example**: ::

            view = {
                "query": "SELECT * FROM `test-project-id.test_dataset_id.test_table_prefix*` LIMIT 1000",
                "useLegacySql": False
            }

        :return: None
        """

        arg_1 = arg_1 if arg_1 is not None else arg_0.project_id

        arg_10 = {
            'tableReference': {
                'tableId': arg_3
            }
        }

        if arg_4:
            arg_10['schema'] = {'fields': arg_4}

        if arg_5:
            arg_10['timePartitioning'] = arg_5

        if arg_6:
            arg_10['clustering'] = {
                'fields': arg_6
            }

        if arg_7:
            arg_10['labels'] = arg_7

        if arg_8:
            arg_10['view'] = arg_8

        arg_9 = arg_9 if arg_9 else arg_0.num_retries

        arg_0.log.info('Creating Table %s:%s.%s',
                      arg_1, arg_2, arg_3)

        try:
            arg_0.service.tables().insert(
                projectId=arg_1,
                datasetId=arg_2,
                body=arg_10).execute(arg_9=arg_9)

            arg_0.log.info('Table created successfully: %s:%s.%s',
                          arg_1, arg_2, arg_3)

        except HttpError as err:
            raise AirflowException(
                'BigQuery job failed. Error was: {}'.format(err.content)
            )

Creates a new empty table in the dataset . To create a view which is defined by a SQL query parse a dictionary to view kwarg


def Func ( arg_0 ) : arg_1 = arg_0 . blockchain . rpc . get_asset ( arg_0 . identifier ) if not arg_1 : raise AssetDoesNotExistsException ( arg_0 . identifier ) super ( Asset , arg_0 ) . __init__ ( arg_1 , blockchain_instance = arg_0 . blockchain ) if arg_0 . full : if "bitasset_data_id" in arg_1 : arg_0 [ "bitasset_data" ] = arg_0 . blockchain . rpc . get_object ( arg_1 [ "bitasset_data_id" ] ) arg_0 [ "dynamic_asset_data" ] = arg_0 . blockchain . rpc . get_object ( arg_1 [ "dynamic_asset_data_id" ] )

def Func(arg_0):
        """ Refresh the data from the API server
        """
        arg_1 = arg_0.blockchain.rpc.get_asset(arg_0.identifier)
        if not arg_1:
            raise AssetDoesNotExistsException(arg_0.identifier)
        super(Asset, arg_0).__init__(arg_1, blockchain_instance=arg_0.blockchain)
        if arg_0.full:
            if "bitasset_data_id" in arg_1:
                arg_0["bitasset_data"] = arg_0.blockchain.rpc.get_object(
                    arg_1["bitasset_data_id"]
                )
            arg_0["dynamic_asset_data"] = arg_0.blockchain.rpc.get_object(
                arg_1["dynamic_asset_data_id"]
            )


def Func ( arg_0 , arg_1 ) : try : arg_2 = open ( arg_1 , 'rb' ) arg_3 = any_tableset ( arg_2 ) except : arg_3 = None return arg_3

def Func(arg_0, arg_1):
        """
        Guess the filetype and read the file into row sets
        """
        #print("Reading file", filename)

        try:
            arg_2 = open(arg_1, 'rb')
            arg_3 = any_tableset(arg_2) # guess the type...
        except:
            #traceback.print_exc()
            # Cannot find the schema.
            arg_3 = None

        return arg_3


def Func ( arg_0 ) : arg_1 = arg_0 . coverage . data . executed_arcs ( arg_0 . filename ) arg_2 = arg_0 . parser . first_line arg_1 = [ ( arg_2 ( l1 ) , arg_2 ( l2 ) ) for ( l1 , l2 ) in arg_1 ] return sorted ( arg_1 )

def Func(arg_0):
        """Returns a sorted list of the arcs actually executed in the code."""
        arg_1 = arg_0.coverage.data.executed_arcs(arg_0.filename)
        arg_2 = arg_0.parser.first_line
        arg_1 = [(arg_2(l1), arg_2(l2)) for (l1,l2) in arg_1]
        return sorted(arg_1)

Returns a sorted list of the arcs actually executed in the code .


def Func(arg_0, arg_1):
        '''
        Decode a PUBREL control packet.
        '''
        arg_0.encoded = arg_1
        arg_3 = 1
        while arg_1[arg_3] & 0x80:
            arg_3 += 1
        arg_4 = arg_1[arg_3+1:]
        arg_0.msgId  = Func16Int(arg_4)
        arg_0.dup = (arg_1[0] & 0x08) == 0x08


return self._request('get', url, params=params).text

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = ensure_trailing_slash ( arg_0 . url + arg_1 . lstrip ( '/' ) ) return arg_0 . _request ( 'get' , arg_3 , arg_2 = arg_2 ) . text

def Func(arg_0, arg_1, **arg_2):
        """
        Get the raw text of a response.

        This is only generally useful for specific URLs, such as documentation.
        """
        arg_3 = ensure_trailing_slash(arg_0.url + arg_1.lstrip('/'))
        return arg_0._request('get', arg_3, arg_2=arg_2).text


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
arg_3
=
arg_0
.
artifacts_dir
+
'/'
+
os
.
path
.
basename
(
arg_1
)
logger
.
debug
(
"Collecting file: %s to %s"
,
arg_1
,
arg_3
)
if
not
arg_1
or
not
os
.
path
.
exists
(
arg_1
)
:
logger
.
warning
(
"File not found to collect: %s"
,
arg_1
)
return
if
os
.
path
.
exists
(
arg_3
)
:
logger
.
warning
(
"File already exists: %s"
,
arg_3
)
return
if
arg_2
:
shutil
.
copy
(
arg_1
,
arg_0
.
artifacts_dir
)
else
:
shutil
.
move
(
arg_1
,
arg_0
.
artifacts_dir
)
os
.
chmod
(
arg_3
,
0o644
)

def Func(arg_0, arg_1, arg_2=False):
        """
        Move or copy single file to artifacts dir
        """
        arg_3 = arg_0.artifacts_dir + '/' + os.path.basename(arg_1)
        logger.debug("Collecting file: %s to %s", arg_1, arg_3)
        if not arg_1 or not os.path.exists(arg_1):
            logger.warning("File not found to collect: %s", arg_1)
            return

        if os.path.exists(arg_3):
            # FIXME: 3 find a way to store artifacts anyway
            logger.warning("File already exists: %s", arg_3)
            return

        if arg_2:
            shutil.copy(arg_1, arg_0.artifacts_dir)
        else:
            shutil.move(arg_1, arg_0.artifacts_dir)

        os.chmod(arg_3, 0o644)


(self, analytes=None, bins=25, logy=False,
                   filt=False, colourful=True)

def Func ( arg_0 , arg_1 = None , arg_2 = 25 , arg_3 = False , arg_4 = False , arg_5 = True ) : if arg_1 is None : arg_1 = arg_0 . analytes if arg_0 . focus_stage in [ 'ratio' , 'calibrated' ] : arg_1 = [ a for a in arg_1 if arg_0 . internal_standard not in a ] if arg_5 : arg_6 = arg_0 . cmaps else : arg_6 = None arg_0 . get_focus ( arg_4 = arg_4 ) arg_7 , arg_8 = plot . Func ( arg_0 . focus , keys = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_6 = arg_6 ) return arg_7 , arg_8

def Func(arg_0, arg_1=None, arg_2=25, arg_3=False,
                   arg_4=False, arg_5=True):
        """
        Plot Func of analytes.

        Parameters
        ----------
        analytes : optional, array_like or str
            The analyte(s) to plot. Defaults to all analytes.
        bins : int
            The number of bins in each histogram (default = 25)
        logy : bool
            If true, y axis is a log scale.
        filt : str, dict or bool
            Either logical filter expression contained in a str,
            a dict of expressions specifying the filter string to
            use for each analyte or a boolean. Passed to `grab_filt`.
        colourful : bool
            If True, Func are colourful :)

        Returns
        -------
        (fig, axes)
        """
        if arg_1 is None:
            arg_1 = arg_0.analytes
        if arg_0.focus_stage in ['ratio', 'calibrated']:
            arg_1 = [a for a in arg_1 if arg_0.internal_standard not in a]
        if arg_5:
            arg_6 = arg_0.cmaps
        else:
            arg_6 = None

        arg_0.get_focus(arg_4=arg_4)
        arg_7, arg_8 = plot.Func(arg_0.focus, keys=arg_1,
                                    arg_2=arg_2, arg_3=arg_3, arg_6=arg_6)

        return arg_7, arg_8

Plot histograms of analytes.

        Parameters
        ----------
        analytes : optional, array_like or str
            The analyte(s) to plot. Defaults to all analytes.
        bins : int
            The number of bins in each histogram (default = 25)
        logy : bool
            If true, y axis is a log scale.
        filt : str, dict or bool
            Either logical filter expression contained in a str,
            a dict of expressions specifying the filter string to
            use for each analyte or a boolean. Passed to `grab_filt`.
        colourful : bool
            If True, histograms are colourful :)

        Returns
        -------
        (fig, axes)


def Func(arg_0):
    """Add a mixed-integer version of a minimal medium to the model.

    Changes the optimization objective to finding the medium with the least
    components::

        minimize size(R) where R part of import_reactions

    Arguments
    ---------
    model : cobra.model
        The model to modify.
    """
    if len(arg_0.variables) > 1e4:
        LOGGER.warning("the MIP version of minimal media is extremely slow for"
                       " models that large :(")
    arg_1 = find_boundary_types(arg_0, "exchange")
    arg_2 = max(abs(b) for r in arg_1 for b in r.bounds)
    arg_3 = arg_0.problem
    arg_4 = {}
    arg_5 = []
    for arg_6 in arg_1:
        arg_7 = len(arg_6.reactants) == 1
        arg_8 = arg_3.Variable("ind_" + arg_6.id, lb=0, ub=1, type="binary")
        if arg_7:
            arg_9 = arg_6.reverse_variable
            arg_10 = arg_3.Constraint(
                arg_9 - arg_8 * arg_2, ub=0, name="ind_constraint_" + arg_6.id)
        else:
            arg_11 = arg_6.forward_variable
            arg_10 = arg_3.Constraint(
                arg_11 - arg_8 * arg_2, ub=0, name="ind_constraint_" + arg_6.id)
        arg_5.extend([arg_8, arg_10])
        arg_4[arg_8] = 1
    arg_0.add_cons_vars(arg_5)
    arg_0.solver.update()
    arg_0.objective.set_linear_coefficients(arg_4)
    arg_0.objective.direction = "min"

Add a mixed - integer version of a minimal medium to the model .


return column.ColumnStringArrow(sl.bytes, sl.indices, sl.length, sl.offset, string_sequence=sl)

def Func ( arg_0 , arg_1 ) : arg_2 = _to_string_sequence ( arg_0 ) . repeat ( arg_1 ) return column . ColumnStringArrow ( arg_2 . bytes , arg_2 . indices , arg_2 . length , arg_2 . offset , string_sequence = arg_2 )

def Func(arg_0, arg_1):
    """Duplicate each string in a column.

    :param int repeats: number of times each string sample is to be duplicated.
    :returns: an expression containing the duplicated strings

    Example:

    >>> import vaex
    >>> text = ['Something', 'very pretty', 'is coming', 'our', 'way.']
    >>> df = vaex.from_arrays(text=text)
    >>> df
      #  text
      0  Something
      1  very pretty
      2  is coming
      3  our
      4  way.

    >>> df.text.str.repeat(3)
    Expression = Func(text, 3)
    Length: 5 dtype: str (expression)
    ---------------------------------
    0        SomethingSomethingSomething
    1  very prettyvery prettyvery pretty
    2        is comingis comingis coming
    3                          ourourour
    4                       way.way.way.
    """
    arg_2 = _to_string_sequence(arg_0).repeat(arg_1)
    return column.ColumnStringArrow(arg_2.bytes, arg_2.indices, arg_2.length, arg_2.offset, string_sequence=arg_2)

Duplicate each string in a column.

    :param int repeats: number of times each string sample is to be duplicated.
    :returns: an expression containing the duplicated strings

    Example:

    >>> import vaex
    >>> text = ['Something', 'very pretty', 'is coming', 'our', 'way.']
    >>> df = vaex.from_arrays(text=text)
    >>> df
      #  text
      0  Something
      1  very pretty
      2  is coming
      3  our
      4  way.

    >>> df.text.str.repeat(3)
    Expression = str_repeat(text, 3)
    Length: 5 dtype: str (expression)
    ---------------------------------
    0        SomethingSomethingSomething
    1  very prettyvery prettyvery pretty
    2        is comingis comingis coming
    3                          ourourour
    4                       way.way.way.


def Func(arg_0, arg_1, arg_2):
    """
    Interpolate passage times for shape points.

    Parameters
    ----------
    shape_distances: list
        list of cumulative distances along the shape
    shape_breaks: list
        list of shape_breaks
    stop_times: list
        list of stop_times

    Returns
    -------
    shape_times: list of ints (seconds) / numpy array
        interpolated shape passage times

    The values of stop times before the first shape-break are given the first
    stopping time, and the any shape points after the last break point are
    given the value of the last shape point.
    """
    arg_3 = np.zeros(len(arg_0))
    arg_3[:arg_1[0]] = arg_2[0]
    for arg_4 in range(len(arg_1)-1):
        arg_5 = arg_1[arg_4]
        arg_6 = arg_2[arg_4]
        arg_7 = arg_1[arg_4+1]
        arg_8 = arg_2[arg_4+1]
        if arg_5 == arg_7:
            arg_3[arg_5] = arg_2[arg_4]
        else:
            arg_9 = arg_0[arg_5:arg_7+1]
            arg_10 = ((np.array(arg_9)-float(arg_9[0])) /
                              float(arg_9[-1] - arg_9[0]))
            arg_11 = (1.-arg_10)*arg_6+arg_10*arg_8
            arg_3[arg_5:arg_7] = arg_11[:-1]
    # deal final ones separately:
    arg_3[arg_1[-1]:] = arg_2[-1]
    return list(arg_3)

Interpolate passage times for shape points .


def Func(arg_0, arg_1):
        """Initializes the Flask application with Common."""
        if not hasattr(arg_1, 'extensions'):
            arg_1.extensions = {}

        if 'common' in arg_1.extensions:
            raise RuntimeError("Flask-Common extension already initialized")

        arg_1.extensions['common'] = arg_0
        arg_0.app = arg_1

        if 'COMMON_FILESERVER_DISABLED' not in arg_1.config:
            with arg_1.test_request_context():

                # Configure WhiteNoise.
                arg_1.wsgi_app = WhiteNoise(arg_1.wsgi_app, root=url_for('static', filename='')[1:])

        arg_0.cache = Cache(arg_1, config={'CACHE_TYPE': arg_1.config.get("COMMON_CACHE_TYPE", 'simple')})

        @arg_1.before_request
        def before_request_callback():
            arg_5.start_time = maya.now()

        @arg_1.after_request
        def after_request_callback(arg_7):
            if 'COMMON_POWERED_BY_DISABLED' not in current_app.config:
                arg_7.headers['X-Powered-By'] = 'Flask'
            if 'COMMON_PROCESSED_TIME_DISABLED' not in current_app.config:
                arg_7.headers['X-Processed-Time'] = maya.now().epoch - arg_5.start_time.epoch
            return arg_7

        @arg_1.route('/favicon.ico')
        def favicon():
            return redirect(url_for('static', filename='favicon.ico'), code=301)

Initializes the Flask application with Common .


def
Func
(
arg_0
)
:
if
not
_is_pil_image
(
arg_0
)
:
raise
TypeError
(
'img should be PIL Image. Got {}'
.
format
(
type
(
arg_0
)
)
)
return
arg_0
.
transpose
(
Image
.
FLIP_LEFT_RIGHT
)

def Func(arg_0):
    """Horizontally flip the given PIL Image.

    Args:
        img (PIL Image): Image to be flipped.

    Returns:
        PIL Image:  Horizontall flipped image.
    """
    if not _is_pil_image(arg_0):
        raise TypeError('img should be PIL Image. Got {}'.format(type(arg_0)))

    return arg_0.transpose(Image.FLIP_LEFT_RIGHT)


def Func ( arg_0 , arg_1 ) : if arg_0 . _properties is None : arg_0 . _readStdConfigFiles ( ) arg_2 = os . environ . get ( "%s%s" % ( arg_0 . envPropPrefix , arg_1 . replace ( '.' , '_' ) ) , None ) if arg_2 is not None : return arg_2 return arg_0 . _properties [ arg_1 ]

def Func(arg_0, arg_1):
    """ Retrieve the requested property as a string. If property does not exist,
    then KeyError will be raised.

    :param prop: (string) name of the property
    :raises: KeyError
    :returns: (string) property value
    """
    if arg_0._properties is None:
      arg_0._readStdConfigFiles()

    # Allow configuration properties to be overridden via environment variables
    arg_2 = os.environ.get("%s%s" % (arg_0.envPropPrefix,
                                        arg_1.replace('.', '_')), None)
    if arg_2 is not None:
      return arg_2

    return arg_0._properties[arg_1]

Retrieve the requested property as a string . If property does not exist then KeyError will be raised .


def Func(arg_0, arg_1=False):
        """
        Prints a summarized table of results from replicate runs, or,
        if individual_result=True, then returns a list of separate
        dataframes for each replicate run.
        """

        ## return results depending on algorithm

        ## algorithm 00
        if (not arg_0.params.infer_delimit) & (not arg_0.params.infer_sptree):
            if arg_1:
                ## return a list of parsed CSV results
                return [_parse_00(arg_2) for arg_2 in arg_0.files.outfiles]
            else:
                ## concatenate each CSV and then get stats w/ describe
                return pd.concat(
                    [pd.read_csv(arg_2, sep='\t', index_col=0) \
                    for arg_2 in arg_0.files.mcmcfiles]).describe().T

        ## algorithm 01
        if arg_0.params.infer_delimit & (not arg_0.params.infer_sptree):
            return _parse_01(arg_0.files.outfiles, individual=arg_1)

        ## others
        else:
            return "summary function not yet ready for this type of result"

Prints a summarized table of results from replicate runs or if individual_result = True then returns a list of separate dataframes for each replicate run .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
package
arg_2
[
'code'
]
=
[
]
for
arg_3
in
arg_1
:
arg_4
=
glob2
.
glob
(
"**/{}"
.
format
(
arg_3
)
)
for
arg_5
in
arg_4
:
arg_6
=
os
.
path
.
abspath
(
arg_5
)
print
(
"Add commit data for {}"
.
format
(
arg_5
)
)
arg_2
[
'code'
]
.
append
(
OrderedDict
(
[
(
'script'
,
arg_5
)
,
(
'permalink'
,
arg_0
.
manager
.
permalink
(
arg_0
,
arg_6
)
)
,
(
'mimetypes'
,
mimetypes
.
guess_type
(
arg_6
)
[
0
]
)
,
(
'sha256'
,
compute_sha256
(
arg_6
)
)
]
)
)

def Func(arg_0, arg_1):
    """
    Update metadata with the commit information
    """

    arg_2 = arg_0.package
    arg_2['code'] = []
    for arg_3 in arg_1:
        arg_4 = glob2.glob("**/{}".format(arg_3))
        for arg_5 in arg_4:
            arg_6 = os.path.abspath(arg_5)
            print("Add commit data for {}".format(arg_5))
            arg_2['code'].append(OrderedDict([
                ('script', arg_5),
                ('permalink', arg_0.manager.permalink(arg_0, arg_6)),
                ('mimetypes', mimetypes.guess_type(arg_6)[0]),
                ('sha256', compute_sha256(arg_6))
            ]))


def Func(arg_0, arg_1):
    """ Get all info about a job, with model details, if available.

    Parameters:
    ----------------------------------------------------------------
    job:    jobID of the job to query
    retval: A sequence of two-tuples if the jobID exists in the jobs
             table (exeption is raised if it doesn't exist). Each two-tuple
             contains an instance of jobInfoNamedTuple as the first element and
             an instance of modelInfoNamedTuple as the second element. NOTE: In
             the case where there are no matching model rows, a sequence of one
             two-tuple will still be returned, but the modelInfoNamedTuple
             fields will be None, and the jobInfoNamedTuple fields will be
             populated.
    """

    # Get a database connection and cursor
    arg_2 = None

    with ConnectionFactory.get() as conn:
      # NOTE: Since we're using a LEFT JOIN on the models table, there need not
      # be a matching row in the models table, but the matching row from the
      # jobs table will still be returned (along with all fields from the models
      # table with values of None in case there were no matchings models)
      arg_3 = ' '.join([
        'SELECT %s.*, %s.*' % (arg_0.jobsTableName, arg_0.modelsTableName),
        'FROM %s' % arg_0.jobsTableName,
        'LEFT JOIN %s USING(job_id)' % arg_0.modelsTableName,
        'WHERE job_id=%s'])

      conn.cursor.execute(arg_3, (arg_1,))

      if conn.cursor.rowcount > 0:
        arg_2 = [
          ClientJobsDAO._combineResults(
            result, arg_0._jobs.jobInfoNamedTuple,
            arg_0._models.modelInfoNamedTuple
          ) for result in conn.cursor.fetchall()]

    if arg_2 is not None:
      return arg_2

    raise RuntimeError("jobID=%s not found within the jobs table" % (arg_1))

Get all info about a job with model details if available .


return dict(zip(qs[0], qs[1]) + zip(qs[2], qs[3]))

def Func ( ) : arg_0 = _all_metric_queries ( ) return dict ( zip ( arg_0 [ 0 ] , arg_0 [ 1 ] ) + zip ( arg_0 [ 2 ] , arg_0 [ 3 ] ) )

def Func():
  """map from query parameter to query name"""
  arg_0 = _all_metric_queries()
  return dict(zip(arg_0[0], arg_0[1]) + zip(arg_0[2], arg_0[3]))


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_2
==
"flup-fcgi"
:
from
flup
.
server
.
fcgi
import
WSGIServer
,
__version__
as
flupver
elif
arg_2
==
"flup-fcgi-fork"
:
from
flup
.
server
.
fcgi_fork
import
WSGIServer
,
__version__
as
flupver
else
:
raise
ValueError
_logger
.
info
(
"Running WsgiDAV/{} {}/{}..."
.
format
(
__version__
,
WSGIServer
.
__module__
,
flupver
)
)
arg_3
=
WSGIServer
(
arg_0
,
bindAddress
=
(
arg_1
[
"host"
]
,
arg_1
[
"port"
]
)
,
)
try
:
arg_3
.
run
(
)
except
KeyboardInterrupt
:
_logger
.
warning
(
"Caught Ctrl-C, shutting down..."
)
return

def Func(arg_0, arg_1, arg_2):
    """Run WsgiDAV using flup.server.fcgi if Flup is installed."""
    # http://trac.saddi.com/flup/wiki/FlupServers
    if arg_2 == "flup-fcgi":
        from flup.server.fcgi import WSGIServer, __version__ as flupver
    elif arg_2 == "flup-fcgi-fork":
        from flup.server.fcgi_fork import WSGIServer, __version__ as flupver
    else:
        raise ValueError

    _logger.info(
        "Running WsgiDAV/{} {}/{}...".format(
            __version__, WSGIServer.__module__, flupver
        )
    )
    arg_3 = WSGIServer(
        arg_0,
        bindAddress=(arg_1["host"], arg_1["port"]),
        # debug=True,
    )
    try:
        arg_3.run()
    except KeyboardInterrupt:
        _logger.warning("Caught Ctrl-C, shutting down...")
    return

Run WsgiDAV using flup . server . fcgi if Flup is installed .


def Func ( arg_0 , arg_1 ) : arg_2 = { e [ 2 ] [ 'wire' ] : e [ 0 ] for e in arg_0 . _multi_graph . in_edges ( nbunch = arg_1 , data = True ) } arg_3 = { e [ 2 ] [ 'wire' ] : e [ 1 ] for e in arg_0 . _multi_graph . out_edges ( nbunch = arg_1 , data = True ) } return arg_2 , arg_3

def Func(arg_0, arg_1):
        """Return predecessor and successor dictionaries.

        Args:
            node (DAGNode): reference to multi_graph node

        Returns:
            tuple(dict): tuple(predecessor_map, successor_map)
                These map from wire (Register, int) to predecessor (successor)
                nodes of n.
        """

        arg_2 = {e[2]['wire']: e[0] for e in
                    arg_0._multi_graph.in_edges(nbunch=arg_1, data=True)}
        arg_3 = {e[2]['wire']: e[1] for e in
                    arg_0._multi_graph.out_edges(nbunch=arg_1, data=True)}
        return arg_2, arg_3

Return predecessor and successor dictionaries .


(self, offset: int=0,
                    shouldEnterFn=_default_shouldEnterFn,
                    otherObjItCtx: ObjIteratorCtx =_DummyIteratorCtx()
                    )

def Func ( arg_0 , arg_1 : arg_2 = 0 , arg_3 = arg_4 , arg_5 : arg_6 = arg_7 ( ) ) -> Generator [ Union [ Tuple [ Tuple [ arg_2 , arg_2 ] , 'TransTmpl' ] , 'OneOfTransaction' ] , None , None ] : arg_8 = arg_0 . dtype arg_9 = arg_0 . bitAddr + arg_1 arg_10 = arg_0 . bitAddrEnd + arg_1 arg_11 , arg_12 = arg_3 ( arg_0 ) if arg_12 : yield ( ( arg_9 , arg_10 ) , arg_0 ) if arg_11 : if isinstance ( arg_8 , Bits ) : pass elif isinstance ( arg_8 , HStruct ) : for arg_13 in arg_0 . children : with arg_5 ( arg_13 . origin . name ) : yield from arg_13 . Func ( arg_1 , arg_3 , arg_5 ) elif isinstance ( arg_8 , HArray ) : arg_14 = ( arg_0 . bitAddrEnd - arg_0 . bitAddr ) // arg_0 . itemCnt for arg_15 in range ( arg_0 . itemCnt ) : with arg_5 ( arg_15 ) : yield from arg_0 . children . Func ( arg_9 + arg_15 * arg_14 , arg_3 , arg_5 ) elif isinstance ( arg_8 , HUnion ) : yield OneOfTransaction ( arg_0 , arg_1 , arg_3 , arg_0 . children ) elif isinstance ( arg_8 , HStream ) : assert len ( arg_0 . children ) == 1 yield StreamTransaction ( arg_0 , arg_1 , arg_3 , arg_0 . children [ 0 ] ) else : raise TypeError ( arg_8 )

def Func(arg_0, arg_1: arg_2=0,
                    arg_3=arg_4,
                    arg_5: arg_6 =arg_7()
                    ) -> Generator[
            Union[Tuple[Tuple[arg_2, arg_2], 'TransTmpl'], 'OneOfTransaction'],
            None, None]:
        """
        Walk fields in instance of TransTmpl

        :param offset: optional offset for all children in this TransTmpl
        :param shouldEnterFn: function (transTmpl) which returns True
            when field should be split on it's children
        :param shouldEnterFn: function(transTmpl) which should return
            (shouldEnter, shouldUse) where shouldEnter is flag that means
            iterator should look inside of this actual object
            and shouldUse flag means that this field should be used
            (=generator should yield it)
        :return: generator of tuples ((startBitAddress, endBitAddress),
            TransTmpl instance)
        """

        arg_8 = arg_0.dtype
        arg_9 = arg_0.bitAddr + arg_1
        arg_10 = arg_0.bitAddrEnd + arg_1

        arg_11, arg_12 = arg_3(arg_0)
        if arg_12:
            yield ((arg_9, arg_10), arg_0)

        if arg_11:
            if isinstance(arg_8, Bits):
                pass
            elif isinstance(arg_8, HStruct):
                for arg_13 in arg_0.children:
                    with arg_5(arg_13.origin.name):
                        yield from arg_13.Func(
                            arg_1,
                            arg_3,
                            arg_5)
            elif isinstance(arg_8, HArray):
                arg_14 = (arg_0.bitAddrEnd - arg_0.bitAddr) // arg_0.itemCnt
                for arg_15 in range(arg_0.itemCnt):
                    with arg_5(arg_15):
                        yield from arg_0.children.Func(
                            arg_9 + arg_15 * arg_14,
                            arg_3,
                            arg_5)
            elif isinstance(arg_8, HUnion):
                yield OneOfTransaction(arg_0, arg_1, arg_3,
                                       arg_0.children)
            elif isinstance(arg_8, HStream):
                assert len(arg_0.children) == 1
                yield StreamTransaction(arg_0, arg_1, arg_3,
                                        arg_0.children[0])
            else:
                raise TypeError(arg_8)


def Func ( ) : arg_0 = get_all_repos ( active_only = True , include_specs_repo = False ) arg_1 = _get_current_exports ( ) arg_2 = _get_exports_for_repos ( arg_0 ) _ensure_managed_repos_dir_exists ( ) if not arg_2 . difference ( arg_1 ) : if not _server_is_running ( ) : _restart_server ( ) return _write_exports_config ( arg_2 ) _restart_server ( )

def Func():
    """
    This function is used with `dusty up`.  It will check all active repos to see if
    they are exported.  If any are missing, it will replace current dusty exports with
    exports that are needed for currently active repos, and restart
    the nfs server
    """
    arg_0 = get_all_repos(active_only=True, include_specs_repo=False)

    arg_1 = _get_current_exports()
    arg_2 = _get_exports_for_repos(arg_0)

    _ensure_managed_repos_dir_exists()

    if not arg_2.difference(arg_1):
        if not _server_is_running():
            _restart_server()
        return

    _write_exports_config(arg_2)
    _restart_server()

This function is used with dusty up . It will check all active repos to see if they are exported . If any are missing it will replace current dusty exports with exports that are needed for currently active repos and restart the nfs server


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_0
.
log
.
info
(
"Received Func from %s"
,
arg_1
.
user
.
username
)
arg_0
.
_bot
.
runnable
=
False
return
"Shutting down..."

def Func(arg_0, arg_1, arg_2):
        """Causes the bot to gracefully Func."""
        arg_0.log.info("Received Func from %s", arg_1.user.username)
        arg_0._bot.runnable = False
        return "Shutting down..."


def Func ( arg_0 ) : arg_0 . state = 'closing' if arg_0 . input : arg_0 . input . Func ( ) pass if arg_0 . output : arg_0 . output . Func ( ) pass arg_0 . state = 'disconnnected' return

def Func(arg_0):
        """ Closes both input and output """
        arg_0.state = 'closing'
        if arg_0.input:
            arg_0.input.Func()
            pass
        if arg_0.output:
            arg_0.output.Func()
            pass
        arg_0.state = 'disconnnected'
        return


def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . command ( "HELP" ) if arg_1 != 100 : raise NNTPReplyError ( arg_1 , arg_2 ) return arg_0 . info ( arg_1 , arg_2 )

def Func(arg_0):
        """HELP command.

        Provides a short summary of commands that are understood by the usenet
        server.

        See <http://tools.ietf.org/html/rfc3977#section-7.2>

        Returns:
            The Func text from the server.
        """
        arg_1, arg_2 = arg_0.command("HELP")
        if arg_1 != 100:
            raise NNTPReplyError(arg_1, arg_2)

        return arg_0.info(arg_1, arg_2)

HELP command.

        Provides a short summary of commands that are understood by the usenet
        server.

        See <http://tools.ietf.org/html/rfc3977#section-7.2>

        Returns:
            The help text from the server.


def Func(arg_0, arg_1, arg_2=0, arg_3=None):
    """Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the right of the rightmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    """

    if arg_2 < 0:
        raise ValueError('lo must be non-negative')
    if arg_3 is None:
        arg_3 = len(arg_0)
    while arg_2 < arg_3:
        arg_4 = (arg_2+arg_3)//2
        if arg_1 < arg_0[arg_4]: arg_3 = arg_4
        else: arg_2 = arg_4+1
    arg_0.insert(arg_2, arg_1)

Insert item x in list a and keep it sorted assuming a is sorted .


(nodes = (1, 2), dofs = (1, 1), coefficients = (1., 1.),
              comment = None)

def
Func
(
arg_0
=
(
1
,
2
)
,
arg_1
=
(
1
,
1
)
,
arg_2
=
(
1.
,
1.
)
,
arg_3
=
)
:
arg_4
=
len
(
arg_0
)
if
arg_3
==
:
arg_5
=
""
else
:
arg_5
=
"**EQUATION: {0}\n"
.
format
(
arg_3
)
arg_5
+=
"*EQUATION\n  {0}\n  "
.
format
(
arg_4
)
arg_5
+=
"\n  "
.
join
(
[
","
.
join
(
[
str
(
arg_0
[
arg_6
]
)
,
str
(
int
(
arg_1
[
arg_6
]
)
)
,
str
(
arg_2
[
arg_6
]
)
]
)
for
arg_6
in
range
(
arg_4
)
]
)
return
arg_5

def Func(arg_0 = (1, 2), arg_1 = (1, 1), arg_2 = (1., 1.),
              arg_3 = None):
    """
    Returns an Abaqus INP formated string for a given linear equation.
    """
    arg_4 = len(arg_0)
    if arg_3 == None:
      arg_5 = ""
    else:
      arg_5 = "**EQUATION: {0}\n".format(arg_3)
    arg_5+= "*EQUATION\n  {0}\n  ".format(arg_4)
    arg_5 += "\n  ".join([ ",".join([ str(arg_0[arg_6]),
                                  str(int(arg_1[arg_6])),
                                  str(arg_2[arg_6]) ]) for arg_6 in range(arg_4)])
    return arg_5

Returns an Abaqus INP formated string for a given linear equation .


(
            self, word_alterations, custom_headers=None, raw=False, **operation_config)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
False
,
**
arg_4
)
:
arg_5
=
models
.
WordAlterationsDTO
(
arg_1
=
arg_1
)
arg_6
=
arg_0
.
Func
.
metadata
[
'url'
]
arg_7
=
{
'Endpoint'
:
arg_0
.
_serialize
.
url
(
"self.config.endpoint"
,
arg_0
.
config
.
endpoint
,
'str'
,
skip_quote
=
True
)
}
arg_6
=
arg_0
.
_client
.
format_url
(
arg_6
,
**
arg_7
)
arg_8
=
{
}
arg_9
=
{
}
arg_9
[
'Content-Type'
]
=
'application/json; charset=utf-8'
if
arg_2
:
arg_9
.
update
(
arg_2
)
arg_10
=
arg_0
.
_serialize
.
body
(
arg_5
,
'WordAlterationsDTO'
)
arg_11
=
arg_0
.
_client
.
put
(
arg_6
,
arg_8
,
arg_9
,
arg_10
)
arg_12
=
arg_0
.
_client
.
send
(
arg_11
,
stream
=
False
,
**
arg_4
)
if
arg_12
.
status_code
not
in
[
204
]
:
raise
models
.
ErrorResponseException
(
arg_0
.
_deserialize
,
arg_12
)
if
arg_3
:
arg_13
=
ClientRawResponse
(
,
arg_12
)
return
arg_13

def Func(
            arg_0, arg_1, arg_2=None, arg_3=False, **arg_4):
        """Replace alterations data.

        :param word_alterations: Collection of word alterations.
        :type word_alterations:
         list[~azure.cognitiveservices.knowledge.qnamaker.models.AlterationsDTO]
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: None or ClientRawResponse if raw=true
        :rtype: None or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException>`
        """
        arg_5 = models.WordAlterationsDTO(arg_1=arg_1)

        # Construct URL
        arg_6 = arg_0.Func.metadata['url']
        arg_7 = {
            'Endpoint': arg_0._serialize.url("self.config.endpoint", arg_0.config.endpoint, 'str', skip_quote=True)
        }
        arg_6 = arg_0._client.format_url(arg_6, **arg_7)

        # Construct parameters
        arg_8 = {}

        # Construct headers
        arg_9 = {}
        arg_9['Content-Type'] = 'application/json; charset=utf-8'
        if arg_2:
            arg_9.update(arg_2)

        # Construct body
        arg_10 = arg_0._serialize.body(arg_5, 'WordAlterationsDTO')

        # Construct and send request
        arg_11 = arg_0._client.put(arg_6, arg_8, arg_9, arg_10)
        arg_12 = arg_0._client.send(arg_11, stream=False, **arg_4)

        if arg_12.status_code not in [204]:
            raise models.ErrorResponseException(arg_0._deserialize, arg_12)

        if arg_3:
            arg_13 = ClientRawResponse(None, arg_12)
            return arg_13


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = _make_tree_defs ( arg_0 . _external_dependencies_info ( ) . items ( ) ) if not arg_4 : raise EmptyReportError ( ) arg_5 = _repr_tree_defs ( arg_4 ) arg_1 . append ( VerbatimText ( arg_5 ) )

def Func(arg_0, arg_1, arg_2, arg_3):
        """return a verbatim layout for displaying dependencies"""
        arg_4 = _make_tree_defs(arg_0._external_dependencies_info().items())
        if not arg_4:
            raise EmptyReportError()
        arg_5 = _repr_tree_defs(arg_4)
        arg_1.append(VerbatimText(arg_5))


def Func(arg_0, arg_1, arg_2=None):
    """Verify a JWT against public certs.

    See http://self-issued.info/docs/draft-jones-json-web-token.html.

    Args:
        jwt: string, A JWT.
        certs: dict, Dictionary where values of public keys in PEM format.
        audience: string, The audience, 'aud', that this JWT should contain. If
                  None then the JWT's 'aud' parameter is not verified.

    Returns:
        dict, The deserialized JSON payload in the JWT.

    Raises:
        AppIdentityError: if any checks are failed.
    """
    arg_0 = _helpers._to_bytes(arg_0)

    if arg_0.count(b'.') != 2:
        raise AppIdentityError(
            'Wrong number of segments in token: {0}'.format(arg_0))

    arg_3, arg_4, arg_5 = arg_0.split(b'.')
    arg_6 = arg_3 + b'.' + arg_4
    arg_5 = _helpers._urlsafe_b64decode(arg_5)

    # Parse token.
    arg_7 = _helpers._urlsafe_b64decode(arg_4)
    try:
        arg_8 = json.loads(_helpers._from_bytes(arg_7))
    except:
        raise AppIdentityError('Can\'t parse token: {0}'.format(arg_7))

    # Verify that the signature matches the message.
    _verify_signature(arg_6, arg_5, arg_1.values())

    # Verify the issued at and created times in the payload.
    _verify_time_range(arg_8)

    # Check audience.
    _check_audience(arg_8, arg_2)

    return arg_8


return self._http_client.get('{}/{}'.format(self._POLLS, arg),
                                     request_policy=request_policy,
                                     cls=strawpoll.Poll)

def Func ( arg_0 , arg_1 , * , arg_2 = None ) : if isinstance ( arg_1 , str ) : arg_3 = arg_0 . _url_re . match ( arg_1 ) if arg_3 : arg_1 = arg_3 . group ( 'id' ) return arg_0 . _http_client . get ( '{}/{}' . format ( arg_0 . _POLLS , arg_1 ) , arg_2 = arg_2 , cls = strawpoll . Poll )

def Func(arg_0, arg_1, *, arg_2=None):
        """Retrieves a poll from strawpoll.

        :param arg: Either the ID of the poll or its strawpoll url.
        :param request_policy: Overrides :attr:`API.requests_policy` for that \
        request.
        :type request_policy: Optional[:class:`RequestsPolicy`]

        :raises HTTPException: Requesting the poll failed.

        :returns: A poll constructed with the requested data.
        :rtype: :class:`Poll`
        """
        if isinstance(arg_1, str):
            # Maybe we received an url to parse
            arg_3 = arg_0._url_re.match(arg_1)
            if arg_3:
                arg_1 = arg_3.group('id')

        return arg_0._http_client.get('{}/{}'.format(arg_0._POLLS, arg_1),
                                     arg_2=arg_2,
                                     cls=strawpoll.Poll)


def Func(arg_0):
        """ Build headers for each field. """
        if hasattr(arg_0, "_chunk_headers") and arg_0._chunk_headers:
            return

        arg_0._chunk_headers = {}
        for arg_2 in arg_0._files:
            arg_0._chunk_headers[arg_2] = arg_0._headers(arg_2, True)
        for arg_2 in arg_0._data:
            arg_0._chunk_headers[arg_2] = arg_0._headers(arg_2)


def Func(arg_0, arg_1):
        """Subtract two IP addresses."""
        if isinstance(arg_1, arg_0.__class__):
            arg_2 = arg_0._ip_dec - arg_1._ip_dec
        if isinstance(arg_1, int):
            arg_2 = arg_0._ip_dec - arg_1
        else:
            arg_1 = arg_0.__class__(arg_1)
            arg_2 = arg_0._ip_dec - arg_1._ip_dec
        return arg_2


return cls(name, values, field_type, label, options, required, desc)

def Func(arg_0, arg_1):
        """Create a new `Field` object from an XML element.

        :Parameters:
            - `xmlnode`: the XML element.
        :Types:
            - `xmlnode`: `libxml2.xmlNode`

        :return: the object created.
        :returntype: `Field`
        """
        arg_2 = arg_1.prop("type")
        arg_3 = from_utf8(arg_1.prop("label"))
        arg_4 = from_utf8(arg_1.prop("var"))
        arg_5 = arg_1.children
        arg_6 = []
        arg_7 = []
        arg_8 = False
        arg_9 = None
        while arg_5:
            if arg_5.type != "element" or arg_5.ns().content != DATAFORM_NS:
                pass
            elif arg_5.name == "required":
                arg_8 = True
            elif arg_5.name == "desc":
                arg_9 = from_utf8(arg_5.getContent())
            elif arg_5.name == "value":
                arg_6.append(from_utf8(arg_5.getContent()))
            elif arg_5.name == "option":
                arg_7.append(Option.Func(arg_5))
            arg_5 = arg_5.next
        if arg_2 and not arg_2.endswith("-multi") and len(arg_6) > 1:
            raise BadRequestProtocolError("Multiple values for a single-value field")
        return arg_0(arg_4, arg_6, arg_2, arg_3, arg_7, arg_8, arg_9)

Create a new Field object from an XML element .


def Func ( arg_0 , arg_1 = 1 , arg_2 = None ) : if arg_2 is None : arg_2 = [ ] arg_3 = "" if type ( arg_0 ) . __name__ != 'list' : return "" else : for arg_4 in arg_0 : arg_3 = "%s\n%s" % ( arg_3 , print_rec ( arg_4 , arg_1 , arg_2 ) ) return arg_3

def Func(arg_0, arg_1=1, arg_2=None):
    """
    Print a list of records.

    :param format: 1 XML, 2 HTML (not implemented)
    :param tags: list of tags to be printed
           if 'listofrec' is not a list it returns empty string
    """
    if arg_2 is None:
        arg_2 = []
    arg_3 = ""

    if type(arg_0).__name__ != 'list':
        return ""
    else:
        for arg_4 in arg_0:
            arg_3 = "%s\n%s" % (arg_3, print_rec(arg_4, arg_1, arg_2))
    return arg_3


Rectangle swatches for all the colors in the list.

(self, x, y, w=35, h=35, padding=0, roundness=0)

def Func(arg_0, arg_1, arg_2, arg_3=35, arg_4=35, arg_5=0, arg_6=0):
        """
        Rectangle Funces for all the colors in the list.
        """
        for arg_7 in arg_0:
            arg_7.Func(arg_1, arg_2, arg_3, arg_4, arg_6)
            arg_2 += arg_4 + arg_5

Rectangle swatches for all the colors in the list .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_1
==
arg_2
:
return
if
arg_2
in
arg_0
.
qregs
or
arg_2
in
arg_0
.
cregs
:
raise
DAGCircuitError
(
"duplicate register name %s"
%
arg_2
)
if
arg_1
not
in
arg_0
.
qregs
and
arg_1
not
in
arg_0
.
cregs
:
raise
DAGCircuitError
(
"no register named %s"
%
arg_1
)
if
arg_1
in
arg_0
.
qregs
:
arg_3
=
arg_0
.
qregs
[
arg_1
]
arg_3
.
name
=
arg_2
arg_0
.
qregs
[
arg_2
]
=
arg_3
arg_0
.
qregs
.
pop
(
arg_1
,
)
if
arg_1
in
arg_0
.
cregs
:
arg_3
=
arg_0
.
cregs
[
arg_1
]
arg_3
.
name
=
arg_2
arg_0
.
qregs
[
arg_2
]
=
arg_3
arg_0
.
qregs
.
pop
(
arg_1
,
)
for
arg_6
in
arg_0
.
_multi_graph
.
nodes
(
)
:
if
arg_6
.
type
==
"in"
or
arg_6
.
type
==
"out"
:
if
arg_6
.
name
and
arg_1
in
arg_6
.
name
:
arg_6
.
name
=
arg_2
elif
arg_6
.
type
==
"op"
:
arg_7
=
[
]
for
arg_8
in
arg_6
.
qargs
:
if
arg_8
[
0
]
==
arg_1
:
arg_8
=
(
arg_2
,
arg_8
[
1
]
)
arg_7
.
append
(
arg_8
)
arg_6
.
qargs
=
arg_7
arg_10
=
[
]
for
arg_8
in
arg_6
.
cargs
:
if
arg_8
[
0
]
==
arg_1
:
arg_8
=
(
arg_2
,
arg_8
[
1
]
)
arg_10
.
append
(
arg_8
)
arg_6
.
cargs
=
arg_10
if
arg_6
.
condition
is
not
:
if
arg_6
.
condition
[
0
]
==
arg_1
:
arg_6
.
condition
=
(
arg_2
,
arg_6
.
condition
[
1
]
)
for
arg_13
,
arg_13
,
arg_14
in
arg_0
.
_multi_graph
.
edges
(
data
=
True
)
:
if
arg_1
in
arg_14
[
'name'
]
:
arg_14
[
'name'
]
=
re
.
sub
(
arg_1
,
arg_2
,
arg_14
[
'name'
]
)

def Func(arg_0, arg_1, arg_2):
        """Rename a classical or quantum register throughout the circuit.

        regname = existing register name string
        newname = replacement register name string
        """
        if arg_1 == arg_2:
            return
        if arg_2 in arg_0.qregs or arg_2 in arg_0.cregs:
            raise DAGCircuitError("duplicate register name %s" % arg_2)
        if arg_1 not in arg_0.qregs and arg_1 not in arg_0.cregs:
            raise DAGCircuitError("no register named %s" % arg_1)
        if arg_1 in arg_0.qregs:
            arg_3 = arg_0.qregs[arg_1]
            arg_3.name = arg_2
            arg_0.qregs[arg_2] = arg_3
            arg_0.qregs.pop(arg_1, None)
        if arg_1 in arg_0.cregs:
            arg_3 = arg_0.cregs[arg_1]
            arg_3.name = arg_2
            arg_0.qregs[arg_2] = arg_3
            arg_0.qregs.pop(arg_1, None)

        for arg_6 in arg_0._multi_graph.nodes():
            if arg_6.type == "in" or arg_6.type == "out":
                if arg_6.name and arg_1 in arg_6.name:
                    arg_6.name = arg_2
            elif arg_6.type == "op":
                arg_7 = []
                for arg_8 in arg_6.qargs:
                    if arg_8[0] == arg_1:
                        arg_8 = (arg_2, arg_8[1])
                    arg_7.append(arg_8)
                arg_6.qargs = arg_7
                arg_10 = []
                for arg_8 in arg_6.cargs:
                    if arg_8[0] == arg_1:
                        arg_8 = (arg_2, arg_8[1])
                    arg_10.append(arg_8)
                arg_6.cargs = arg_10
                if arg_6.condition is not None:
                    if arg_6.condition[0] == arg_1:
                        arg_6.condition = (arg_2, arg_6.condition[1])
        # eX = edge, d= data
        for arg_13, arg_13, arg_14 in arg_0._multi_graph.edges(data=True):
            if arg_1 in arg_14['name']:
                arg_14['name'] = re.sub(arg_1, arg_2, arg_14['name'])

Rename a classical or quantum register throughout the circuit .


def Func ( arg_0 , arg_1 ) : with arg_0 . lock : if arg_1 . stream != arg_0 . stream : return arg_0 . me = arg_1 . stream . me arg_0 . peer = arg_1 . stream . peer arg_4 = arg_0 . _base_handlers [ : ] arg_4 += arg_0 . handlers + [ arg_0 ] arg_0 . setup_stanza_handlers ( arg_4 , "post-auth" )

def Func(arg_0, arg_1):
        """Handle the `AuthenticatedEvent`.
        """
        with arg_0.lock:
            if arg_1.stream != arg_0.stream:
                return
            arg_0.me = arg_1.stream.me
            arg_0.peer = arg_1.stream.peer
            arg_4 = arg_0._base_handlers[:]
            arg_4 += arg_0.handlers + [arg_0]
            arg_0.setup_stanza_handlers(arg_4, "post-auth")


def Func ( arg_0 ) : from oplus import CONF arg_1 = CONF . eplus_version [ : 2 ] for arg_2 , arg_3 in sorted ( arg_0 . items ( ) , reverse = True ) : if arg_1 >= arg_2 : return arg_3

def Func(arg_0):
    """
    Finds the value depending in current eplus version.

    Parameters
    ----------
    d: dict
        {(0, 0): value, (x, x): value, ...}
        for current version (cv), current value is the value of version v such as v <= cv < v+1
    """
    from oplus import CONF  # touchy import

    arg_1 = CONF.eplus_version[:2]
    for arg_2, arg_3 in sorted(arg_0.items(), reverse=True):
        if arg_1 >= arg_2:
            return arg_3

Finds the value depending in current eplus version .


def Func ( arg_0 ) : def expand_kv ( arg_1 ) : return arg_0 ( * arg_1 ) def Func_values ( arg_2 ) : arg_3 = type ( arg_2 ) if isinstance ( arg_2 , dict ) : return arg_3 ( _Func ( expand_kv , arg_2 . items ( ) ) ) else : return arg_3 ( _Func ( arg_0 , arg_2 ) ) return transform ( Func_values )

def Func(arg_0):
    """Filters out unwanted items using the specified function.

    Supports both dicts and sequences, key/value pairs are
    expanded when applied to a dict.
    """
    def expand_kv(arg_1):
        return arg_0(*arg_1)

    def Func_values(arg_2):
        arg_3 = type(arg_2)
        if isinstance(arg_2, dict):
            return arg_3(_Func(expand_kv, arg_2.items()))
        else:
            return arg_3(_Func(arg_0, arg_2))

    return transform(Func_values)

Filters out unwanted items using the specified function .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Checks for version mismatch

        Raises a VersionMismatchError if version of loaded trajectory and current pypet version
        do not match. In case of `force=True` error is not raised only a warning is emitted.

        """
        arg_4 = pypetconstants.python_version_string

        if (arg_1 != VERSION or arg_4 != arg_2) and not arg_3:
            raise pex.VersionMismatchError('Current pypet version is %s used under python %s '
                                           '  but your trajectory'
                                           ' was created with version %s and python %s.'
                                           ' Use >>force=True<< to perform your load regardless'
                                           ' of version mismatch.' %
                                           (VERSION, arg_4, arg_1, arg_2))
        elif arg_1 != VERSION or arg_4 != arg_2:
            arg_0._logger.warning('Current pypet version is %s with python %s but your trajectory'
                                 ' was created with version %s under python %s.'
                                 ' Yet, you enforced the load, so I will'
                                 ' handle the trajectory despite the'
                                 ' version mismatch.' %
                                 (VERSION, arg_4, arg_1, arg_2))


def Func ( arg_0 ) : arg_1 = 8.0713171 arg_2 = lambda parent , daugther : - parent + daugther + 2 * arg_1 return arg_0 . derived ( 'Func' , ( 0 , - 2 ) , arg_2 )

def Func(arg_0):
        """Return 2 neutron separation energy"""
        arg_1 = 8.0713171         # neutron mass excess in MeV
        arg_2 = lambda parent, daugther: -parent + daugther + 2 * arg_1
        return arg_0.derived('Func', (0, -2), arg_2)


def
Func
(
arg_0
)
:
if
arg_0
.
value
is
not
:
if
not
isinstance
(
arg_0
.
value
,
six
.
integer_types
)
:
raise
TypeError
(
'expected (one of): {0}, observed: {1}'
.
format
(
six
.
integer_types
,
type
(
arg_0
.
value
)
)
)

def Func(arg_0):
        """
        Verify that the value of the BigInteger is valid.

        Raises:
            TypeError: if the value is not of type int or long
        """
        if arg_0.value is not None:
            if not isinstance(arg_0.value, six.integer_types):
                raise TypeError('expected (one of): {0}, observed: {1}'.format(
                    six.integer_types, type(arg_0.value)))

Verify that the value of the BigInteger is valid .


def Func(arg_0):
    """
    Convert a byte value into a human-readable format.
    """
    arg_0 = float(arg_0)
    if arg_0 >= 1073741824:
        arg_1 = arg_0 / 1073741824
        arg_2 = '%.2f GB' % arg_1
    elif arg_0 >= 1048576:
        arg_3 = arg_0 / 1048576
        arg_2 = '%.2f MB' % arg_3
    elif arg_0 >= 1024:
        arg_4 = arg_0 / 1024
        arg_2 = '%.2f KB' % arg_4
    else:
        arg_2 = '%.2f B' % arg_0
    return arg_2

Convert a byte value into a human - readable format .


def Func(arg_0, arg_1=False):
    """
    Return the frequency of all types of routes per day.

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

    Returns
    -------
    pandas.DataFrame with columns
        route_I, type, frequency
    """
    arg_2 = arg_0.get_suitable_date_for_daily_extract()
    arg_3 = (
        " SELECT f.route_I, type, frequency FROM routes as r"
        " JOIN"
        " (SELECT route_I, COUNT(route_I) as frequency"
        " FROM"
        " (SELECT date, route_I, trip_I"
        " FROM day_stop_times"
        " WHERE date = '{day}'"
        " GROUP by route_I, trip_I)"
        " GROUP BY route_I) as f"
        " ON f.route_I = r.route_I"
        " ORDER BY frequency DESC".format(arg_2=arg_2))

    return pd.DataFrame(arg_0.execute_custom_query_pandas(arg_3))

Return the frequency of all types of routes per day .


(cls, filename, scopes='',
                               token_uri=None, revoke_uri=None)

return cls._from_parsed_json_keyfile(client_credentials, scopes,
                                             token_uri=token_uri,
                                             revoke_uri=revoke_uri)

def Func ( arg_0 , arg_1 , arg_2 = '' , arg_3 = None , arg_4 = None ) : with open ( arg_1 , 'r' ) as file_obj : arg_5 = json . load ( file_obj ) return arg_0 . _from_parsed_json_keyfile ( arg_5 , arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0, arg_1, arg_2='',
                               arg_3=None, arg_4=None):

        """Factory constructor from JSON keyfile by name.

        Args:
            filename: string, The location of the keyfile.
            scopes: List or string, (Optional) Scopes to use when acquiring an
                    access token.
            token_uri: string, URI for OAuth 2.0 provider token endpoint.
                       If unset and not present in the key file, defaults
                       to Google's endpoints.
            revoke_uri: string, URI for OAuth 2.0 provider revoke endpoint.
                       If unset and not present in the key file, defaults
                       to Google's endpoints.

        Returns:
            ServiceAccountCredentials, a credentials object created from
            the keyfile.

        Raises:
            ValueError, if the credential type is not :data:`SERVICE_ACCOUNT`.
            KeyError, if one of the expected keys is not present in
                the keyfile.
        """
        with open(arg_1, 'r') as file_obj:
            arg_5 = json.load(file_obj)
        return arg_0._from_parsed_json_keyfile(arg_5, arg_2,
                                             arg_3=arg_3,
                                             arg_4=arg_4)

Factory constructor from JSON keyfile by name .


def Func(arg_0, arg_1):
    """Compare features.

    This returns a number in the range [0, 1] representing a comparison of two
    feature bundles.

    If one of the bundles is negative, -1 is returned (for unknown values)

    If the bundles are identical, 1 is returned.

    If they are inverses of one another, 0 is returned.

    Otherwise, a float representing their similarity is returned.

    Parameters
    ----------
    feat1 : int
        A feature bundle
    feat2 : int
        A feature bundle

    Returns
    -------
    float
        A comparison of the feature bundles

    Examples
    --------
    >>> Func(ipa_to_features('l')[0], ipa_to_features('l')[0])
    1.0
    >>> Func(ipa_to_features('l')[0], ipa_to_features('n')[0])
    0.8709677419354839
    >>> Func(ipa_to_features('l')[0], ipa_to_features('z')[0])
    0.8709677419354839
    >>> Func(ipa_to_features('l')[0], ipa_to_features('i')[0])
    0.564516129032258

    """
    if arg_0 < 0 or arg_1 < 0:
        return -1.0
    if arg_0 == arg_1:
        return 1.0

    arg_2 = len(_FEATURE_MASK)
    arg_3 = arg_0 ^ arg_1
    arg_4 = 0
    # print(featxor)
    while arg_3:
        if arg_3 & 0b1:
            arg_4 += 1
        arg_3 >>= 1
    # print(diffbits)
    return 1 - (arg_4 / (2 * arg_2))

Compare features.

    This returns a number in the range [0, 1] representing a comparison of two
    feature bundles.

    If one of the bundles is negative, -1 is returned (for unknown values)

    If the bundles are identical, 1 is returned.

    If they are inverses of one another, 0 is returned.

    Otherwise, a float representing their similarity is returned.

    Parameters
    ----------
    feat1 : int
        A feature bundle
    feat2 : int
        A feature bundle

    Returns
    -------
    float
        A comparison of the feature bundles

    Examples
    --------
    >>> cmp_features(ipa_to_features('l')[0], ipa_to_features('l')[0])
    1.0
    >>> cmp_features(ipa_to_features('l')[0], ipa_to_features('n')[0])
    0.8709677419354839
    >>> cmp_features(ipa_to_features('l')[0], ipa_to_features('z')[0])
    0.8709677419354839
    >>> cmp_features(ipa_to_features('l')[0], ipa_to_features('i')[0])
    0.564516129032258


def Func():
    """
    Get sub-command list

    .. note::

        Don't use logger handle this function errors.

        Because the error should be a code error,not runtime error.

    :return: `list` matched sub-parser
    """
    from cliez.conf import COMPONENT_ROOT

    arg_0 = COMPONENT_ROOT

    if arg_0 is None:
        sys.stderr.write("cliez.conf.COMPONENT_ROOT not set.\n")
        sys.exit(2)
        pass

    if not os.path.exists(arg_0):
        sys.stderr.write(
            "please set a valid path for `cliez.conf.COMPONENT_ROOT`\n")
        sys.exit(2)
        pass

    try:
        arg_1 = os.listdir(os.path.join(arg_0, 'components'))
        return [arg_2[:-3] for arg_2 in arg_1 if
                arg_2.endswith('.py') and arg_2 != '__init__.py']
    except FileNotFoundError:
        return []


def Func(arg_0=None, arg_1=None, arg_2=False):
        """
        Load a pre-trained Keras model.

        :param json_path: The json path containing the keras model definition.
        :param hdf5_path: The HDF5 path containing the pre-trained keras model weights with or without the model architecture.
        :return: A bigdl model.
        """
        import arg_3
        try:
            import tensorflow
        except ImportError:
            arg_3.environ['KERAS_BACKEND'] = "theano"
            try:
                # Make theano backend compatible with Python3
                from theano import ifelse
            except ImportError:
                raise Exception("No backend is found for Keras. "
                                "Please install either tensorflow or theano.")
        from bigdl.keras.converter import DefinitionLoader, WeightLoader
        if arg_0 and not arg_1:
            return DefinitionLoader.from_json_path(arg_0)
        elif arg_0 and arg_1:
            return WeightLoader.load_weights_from_json_hdf5(arg_0, arg_1, arg_2=arg_2)
        elif arg_1 and not arg_0:
            arg_5, arg_6 = DefinitionLoader.from_hdf5_path(arg_1)
            WeightLoader.load_weights_from_kmodel(arg_6, arg_5)
            return arg_6


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is not None : arg_3 = os . Func . join ( arg_0 . config . destination , arg_2 ) else : arg_3 = arg_0 . config . destination return os . Func . join ( arg_3 , arg_1 )

def Func(arg_0, arg_1, arg_2=None):
        """
        This returns the absolute Func of a file uploaded to this set. It
        doesn't actually check whether said file exists.

        :param filename: The filename to return the Func for.
        :param folder: The subfolder within the upload set previously used
                       to save to.
        """
        if arg_2 is not None:
            arg_3 = os.Func.join(arg_0.config.destination, arg_2)
        else:
            arg_3 = arg_0.config.destination
        return os.Func.join(arg_3, arg_1)

This returns the absolute path of a file uploaded to this set. It
        doesn't actually check whether said file exists.

        :param filename: The filename to return the path for.
        :param folder: The subfolder within the upload set previously used
                       to save to.

This returns the absolute path of a file uploaded to this set . It doesn t actually check whether said file exists .


def Func ( arg_0 , arg_1 = False , arg_2 = None ) : import pdb arg_3 = tempfile . mktemp ( ".py" , "doctestdebug" ) arg_4 = open ( arg_3 , 'w' ) arg_4 . write ( arg_0 ) arg_4 . close ( ) try : if arg_2 : arg_2 = arg_2 . copy ( ) else : arg_2 = { } if arg_1 : try : execfile ( arg_3 , arg_2 , arg_2 ) except : print sys . exc_info ( ) [ 1 ] pdb . post_mortem ( sys . exc_info ( ) [ 2 ] ) else : pdb . run ( "execfile(%r)" % arg_3 , arg_2 , arg_2 ) finally : os . remove ( arg_3 )

def Func(arg_0, arg_1=False, arg_2=None):
    "Debug a test script.  `src` is the script, as a string."
    import pdb

    # Note that tempfile.NameTemporaryFile() cannot be used.  As the
    # docs say, a file so created cannot be opened by name a second time
    # on modern Windows boxes, and execfile() needs to open it.
    arg_3 = tempfile.mktemp(".py", "doctestdebug")
    arg_4 = open(arg_3, 'w')
    arg_4.write(arg_0)
    arg_4.close()

    try:
        if arg_2:
            arg_2 = arg_2.copy()
        else:
            arg_2 = {}

        if arg_1:
            try:
                execfile(arg_3, arg_2, arg_2)
            except:
                print sys.exc_info()[1]
                pdb.post_mortem(sys.exc_info()[2])
        else:
            # Note that %r is vital here.  '%s' instead can, e.g., cause
            # backslashes to get treated as metacharacters on Windows.
            pdb.run("execfile(%r)" % arg_3, arg_2, arg_2)

    finally:
        os.remove(arg_3)

Debug a test script . src is the script as a string .