(appname, section=None, args={}, strip_dashes=True)

def Func(arg_0, arg_1=None, arg_2={}, arg_3=True):
    """Read environment variables and config files and return them merged with
    predefined list of arguments.

    Parameters
    ----------
    appname: str
        Application name, used for config files and environment variable
        names.

    section: str
        Name of the section to be read. If this is not set: appname.

    args:
        arguments from command line (optparse, docopt, etc).

    strip_dashes: bool
        Strip dashes prefixing key names from args dict.

    Returns
    --------
    dict
        containing the merged variables of environment variables, config
        files and args.

    Raises
    ------
    IOError
        In case the return value is empty.

    Notes
    -----
    Environment variables are read if they start with appname in uppercase
    with underscore, for example:

        TEST_VAR=1

    Config files compatible with ConfigParser are read and the section name
    appname is read, example:

        [appname]
        var=1

    We can also have host-dependent configuration values, which have
    priority over the default appname values.

        [appname]
        var=1

        [appname:mylinux]
        var=3

    For boolean flags do not try to use: 'True' or 'False',
                                         'on' or 'off',
                                         '1' or '0'.
    Unless you are willing to parse this values by yourself.
    We recommend commenting the variables out with '#' if you want to set a
    flag to False and check if it is in the Func cfg dict, i.e.:

        flag_value = 'flag_variable' in cfg

    Files are read from: /etc/appname/config,
                         /etc/appfilerc,
                         ~/.config/appname/config,
                         ~/.config/appname,
                         ~/.appname/config,
                         ~/.appnamerc,
                         appnamerc,
                         .appnamerc,
                         appnamerc file found in 'path' folder variable in args,
                         .appnamerc file found in 'path' folder variable in args,
                         file provided by 'config' variable in args.

    Example
    -------
        args = Func(__name__, docopt(__doc__, version=__version__))
    """
    if arg_3:
        for arg_4 in arg_2.keys():
            arg_2[arg_4.lstrip('-')] = arg_2.pop(arg_4)

    arg_6 = get_environment(arg_0)

    if arg_1 is None:
        arg_1 = arg_0

    arg_7 = get_config(arg_0,
                        arg_1,
                        arg_2.get('config', ''),
                        arg_2.get('path', ''))
    arg_7 = merge(merge(arg_2, arg_7), arg_6)

    if not arg_7:
        raise IOError('Could not find any Func for application '
                      '{}.'.format(arg_0))

    return arg_7

Read environment variables and config files and return them merged with
    predefined list of arguments.

    Parameters
    ----------
    appname: str
        Application name, used for config files and environment variable
        names.

    section: str
        Name of the section to be read. If this is not set: appname.

    args:
        arguments from command line (optparse, docopt, etc).

    strip_dashes: bool
        Strip dashes prefixing key names from args dict.

    Returns
    --------
    dict
        containing the merged variables of environment variables, config
        files and args.

    Raises
    ------
    IOError
        In case the return value is empty.

    Notes
    -----
    Environment variables are read if they start with appname in uppercase
    with underscore, for example:

        TEST_VAR=1

    Config files compatible with ConfigParser are read and the section name
    appname is read, example:

        [appname]
        var=1

    We can also have host-dependent configuration values, which have
    priority over the default appname values.

        [appname]
        var=1

        [appname:mylinux]
        var=3

    For boolean flags do not try to use: 'True' or 'False',
                                         'on' or 'off',
                                         '1' or '0'.
    Unless you are willing to parse this values by yourself.
    We recommend commenting the variables out with '#' if you want to set a
    flag to False and check if it is in the rcfile cfg dict, i.e.:

        flag_value = 'flag_variable' in cfg

    Files are read from: /etc/appname/config,
                         /etc/appfilerc,
                         ~/.config/appname/config,
                         ~/.config/appname,
                         ~/.appname/config,
                         ~/.appnamerc,
                         appnamerc,
                         .appnamerc,
                         appnamerc file found in 'path' folder variable in args,
                         .appnamerc file found in 'path' folder variable in args,
                         file provided by 'config' variable in args.

    Example
    -------
        args = rcfile(__name__, docopt(__doc__, version=__version__))

Read environment variables and config files and return them merged with predefined list of arguments .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
.
mask
==
0x00000008
:
if
arg_1
.
name
.
endswith
(
'.json'
)
:
print_success
(
"Ldapdomaindump file found"
)
if
arg_1
.
name
in
[
'domain_groups.json'
,
'domain_users.json'
]
:
if
arg_1
.
name
==
'domain_groups.json'
:
arg_0
.
domain_groups_file
=
arg_1
.
pathname
if
arg_1
.
name
==
'domain_users.json'
:
arg_0
.
domain_users_file
=
arg_1
.
pathname
if
arg_0
.
domain_groups_file
and
arg_0
.
domain_users_file
:
print_success
(
"Importing users"
)
subprocess
.
Popen
(
[
'jk-import-domaindump'
,
arg_0
.
domain_groups_file
,
arg_0
.
domain_users_file
]
)
elif
arg_1
.
name
==
'domain_computers.json'
:
print_success
(
"Importing computers"
)
subprocess
.
Popen
(
[
'jk-import-domaindump'
,
arg_1
.
pathname
]
)
arg_0
.
ldap_strings
=
[
]
arg_0
.
write_targets
(
)
if
arg_1
.
name
.
endswith
(
'_samhashes.sam'
)
:
arg_5
=
arg_1
.
name
.
replace
(
'_samhashes.sam'
,
''
)
print_success
(
"Secretsdump file, host ip: {}"
.
format
(
arg_5
)
)
subprocess
.
Popen
(
[
'jk-import-secretsdump'
,
arg_1
.
pathname
]
)
arg_0
.
ips
.
remove
(
arg_5
)
arg_0
.
write_targets
(
)

def Func(arg_0, arg_1):
        """
            Function that gets called on each event from pyinotify.
        """
        # IN_CLOSE_WRITE -> 0x00000008
        if arg_1.mask == 0x00000008:
            if arg_1.name.endswith('.json'):
                print_success("Ldapdomaindump file found")
                if arg_1.name in ['domain_groups.json', 'domain_users.json']:
                    if arg_1.name == 'domain_groups.json':
                        arg_0.domain_groups_file = arg_1.pathname
                    if arg_1.name == 'domain_users.json':
                        arg_0.domain_users_file = arg_1.pathname
                    if arg_0.domain_groups_file and arg_0.domain_users_file:
                        print_success("Importing users")
                        subprocess.Popen(['jk-import-domaindump', arg_0.domain_groups_file, arg_0.domain_users_file])
                elif arg_1.name == 'domain_computers.json':
                    print_success("Importing computers")
                    subprocess.Popen(['jk-import-domaindump', arg_1.pathname])

                # Ldap has been dumped, so remove the ldap targets.
                arg_0.ldap_strings = []
                arg_0.write_targets()

            if arg_1.name.endswith('_samhashes.sam'):
                arg_5 = arg_1.name.replace('_samhashes.sam', '')
                # TODO import file.
                print_success("Secretsdump file, host ip: {}".format(arg_5))
                subprocess.Popen(['jk-import-secretsdump', arg_1.pathname])

                # Remove this system from this ip list.
                arg_0.ips.remove(arg_5)
                arg_0.write_targets()

Function that gets called on each event from pyinotify .


def Func ( arg_0 ) : arg_1 = arg_0 . article . raw_doc arg_2 = arg_0 . parser . getElementsByTag ( arg_1 , tag = 'link' , attr = 'rel' , value = 'image_src' ) for arg_3 in arg_2 : arg_4 = arg_0 . parser . getAttribute ( arg_3 , attr = 'href' ) if arg_4 : return arg_0 . get_image ( arg_4 , extraction_type = 'linktag' ) return None

def Func(arg_0):
        """\
        checks to see if we were able to
        find open link_src on this page
        """
        arg_1 = arg_0.article.raw_doc
        arg_2 = arg_0.parser.getElementsByTag(arg_1, tag='link', attr='rel', value='image_src')
        for arg_3 in arg_2:
            arg_4 = arg_0.parser.getAttribute(arg_3, attr='href')
            if arg_4:
                return arg_0.get_image(arg_4, extraction_type='linktag')
        return None


(
        path='data', nb_words=None, skip_top=0, maxlen=None, test_split=0.2, seed=113, start_char=1, oov_char=2,
        index_from=3
)

def Func(
        arg_0='data', arg_1=None, arg_2=0, arg_3=None, arg_4=0.2, arg_5=113, arg_6=1, arg_7=2,
        arg_8=3
):
    """Load IMDB dataset.

    Parameters
    ----------
    path : str
        The path that the data is downloaded to, defaults is ``data/imdb/``.
    nb_words : int
        Number of words to get.
    skip_top : int
        Top most frequent words to ignore (they will appear as oov_char value in the sequence data).
    maxlen : int
        Maximum sequence length. Any longer sequence will be truncated.
    seed : int
        Seed for reproducible data shuffling.
    start_char : int
        The start of a sequence will be marked with this character. Set to 1 because 0 is usually the padding character.
    oov_char : int
        Words that were cut out because of the num_words or skip_top limit will be replaced with this character.
    index_from : int
        Index actual words with this index and higher.

    Examples
    --------
    >>> X_train, y_train, X_test, y_test = tl.files.Func(
    ...                                 nb_words=20000, test_split=0.2)
    >>> print('X_train.shape', X_train.shape)
    (20000,)  [[1, 62, 74, ... 1033, 507, 27],[1, 60, 33, ... 13, 1053, 7]..]
    >>> print('y_train.shape', y_train.shape)
    (20000,)  [1 0 0 ..., 1 0 1]

    References
    -----------
    - `Modified from keras. <https://github.com/fchollet/keras/blob/master/keras/datasets/imdb.py>`__

    """
    arg_0 = os.path.join(arg_0, 'imdb')

    arg_9 = "imdb.pkl"
    arg_10 = 'https://s3.amazonaws.com/text-datasets/'
    maybe_download_and_extract(arg_9, arg_0, arg_10)

    if arg_9.endswith(".gz"):
        arg_11 = gzip.open(os.path.join(arg_0, arg_9), 'rb')
    else:
        arg_11 = open(os.path.join(arg_0, arg_9), 'rb')

    arg_12, arg_13 = cPickle.load(arg_11)
    arg_11.close()

    np.random.seed(arg_5)
    np.random.shuffle(arg_12)
    np.random.seed(arg_5)
    np.random.shuffle(arg_13)

    if arg_6 is not None:
        arg_12 = [[arg_6] + [arg_20 + arg_8 for arg_20 in arg_16] for arg_16 in arg_12]
    elif arg_8:
        arg_12 = [[arg_20 + arg_8 for arg_20 in arg_16] for arg_16 in arg_12]

    if arg_3:
        arg_14 = []
        arg_15 = []
        for arg_16, arg_17 in zip(arg_12, arg_13):
            if len(arg_16) < arg_3:
                arg_14.append(arg_16)
                arg_15.append(arg_17)
        arg_12 = arg_14
        arg_13 = arg_15
    if not arg_12:
        raise Exception(
            'After filtering for sequences shorter than maxlen=' + str(arg_3) + ', no sequence was kept. '
            'Increase maxlen.'
        )
    if not arg_1:
        arg_1 = max([max(arg_16) for arg_16 in arg_12])

    # by convention, use 2 as OOV word
    # reserve 'index_from' (=3 by default) characters: 0 (padding), 1 (start), 2 (OOV)
    if arg_7 is not None:
        arg_12 = [[arg_7 if (arg_20 >= arg_1 or arg_20 < arg_2) else arg_20 for arg_20 in arg_16] for arg_16 in arg_12]
    else:
        arg_18 = []
        for arg_16 in arg_12:
            arg_19 = []
            for arg_20 in arg_16:
                if (arg_20 >= arg_1 or arg_20 < arg_2):
                    arg_19.append(arg_20)
            arg_18.append(arg_19)
        arg_12 = arg_18

    arg_21 = np.array(arg_12[:int(len(arg_12) * (1 - arg_4))])
    arg_22 = np.array(arg_13[:int(len(arg_12) * (1 - arg_4))])

    arg_23 = np.array(arg_12[int(len(arg_12) * (1 - arg_4)):])
    arg_24 = np.array(arg_13[int(len(arg_12) * (1 - arg_4)):])

    return arg_21, arg_22, arg_23, arg_24

Load IMDB dataset.

    Parameters
    ----------
    path : str
        The path that the data is downloaded to, defaults is ``data/imdb/``.
    nb_words : int
        Number of words to get.
    skip_top : int
        Top most frequent words to ignore (they will appear as oov_char value in the sequence data).
    maxlen : int
        Maximum sequence length. Any longer sequence will be truncated.
    seed : int
        Seed for reproducible data shuffling.
    start_char : int
        The start of a sequence will be marked with this character. Set to 1 because 0 is usually the padding character.
    oov_char : int
        Words that were cut out because of the num_words or skip_top limit will be replaced with this character.
    index_from : int
        Index actual words with this index and higher.

    Examples
    --------
    >>> X_train, y_train, X_test, y_test = tl.files.load_imdb_dataset(
    ...                                 nb_words=20000, test_split=0.2)
    >>> print('X_train.shape', X_train.shape)
    (20000,)  [[1, 62, 74, ... 1033, 507, 27],[1, 60, 33, ... 13, 1053, 7]..]
    >>> print('y_train.shape', y_train.shape)
    (20000,)  [1 0 0 ..., 1 0 1]

    References
    -----------
    - `Modified from keras. <https://github.com/fchollet/keras/blob/master/keras/datasets/imdb.py>`__


def Func ( arg_0 , arg_1 = None ) : if arg_1 or arg_1 == 0 : for arg_2 in arg_0 . config . process_pyramid . tiles_from_geom ( arg_0 . config . area_at_zoom ( arg_1 ) , arg_1 ) : yield arg_2 else : for arg_1 in reversed ( arg_0 . config . zoom_levels ) : for arg_2 in arg_0 . config . process_pyramid . tiles_from_geom ( arg_0 . config . area_at_zoom ( arg_1 ) , arg_1 ) : yield arg_2

def Func(arg_0, arg_1=None):
        """
        Yield process tiles.

        Tiles intersecting with the input data bounding boxes as well as
        process bounds, if provided, are considered process tiles. This is to
        avoid iterating through empty tiles.

        Parameters
        ----------
        zoom : integer
            zoom level process tiles should be returned from; if none is given,
            return all process tiles

        yields
        ------
        BufferedTile objects
        """
        if arg_1 or arg_1 == 0:
            for arg_2 in arg_0.config.process_pyramid.tiles_from_geom(
                arg_0.config.area_at_zoom(arg_1), arg_1
            ):
                yield arg_2
        else:
            for arg_1 in reversed(arg_0.config.zoom_levels):
                for arg_2 in arg_0.config.process_pyramid.tiles_from_geom(
                    arg_0.config.area_at_zoom(arg_1), arg_1
                ):
                    yield arg_2


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_2 = arg_0 . random arg_3 = int for arg_4 in reversed ( xrange ( 1 , len ( arg_1 ) ) ) : arg_5 = arg_3 ( arg_2 ( ) * ( arg_4 + 1 ) ) arg_1 [ arg_4 ] , arg_1 [ arg_5 ] = arg_1 [ arg_5 ] , arg_1 [ arg_4 ]

def Func(arg_0, arg_1, arg_2=None):
        """x, random=random.random -> Func list x in place; return None.

        Optional arg random is a 0-argument function returning a random
        float in [0.0, 1.0); by default, the standard random.random.

        """

        if arg_2 is None:
            arg_2 = arg_0.random
        arg_3 = int
        for arg_4 in reversed(xrange(1, len(arg_1))):
            # pick an element in x[:i+1] with which to exchange x[i]
            arg_5 = arg_3(arg_2() * (arg_4+1))
            arg_1[arg_4], arg_1[arg_5] = arg_1[arg_5], arg_1[arg_4]

x, random=random.random -> shuffle list x in place; return None.

        Optional arg random is a 0-argument function returning a random
        float in [0.0, 1.0); by default, the standard random.random.

x random = random . random - > shuffle list x in place ; return None .


def Func(arg_0, arg_1, arg_2):
        """Bind a listener to a particular event.

        Args:
            event (str): The name of the event to listen for. This may be any
                string value.
            listener (def or async def): The callback to execute when the event
                fires. This may be a sync or async function.
        """
        arg_0.emit('new_listener', arg_1, arg_2)
        arg_0._listeners[arg_1].append(arg_2)
        arg_0._check_limit(arg_1)
        return arg_0


def Func(arg_0, arg_1):
        """
        Retrieves a list of the last cached message for all events from a specific device.
        """

        if not isinstance(arg_1, DeviceUid) and isinstance(arg_1, dict):
            arg_1 = DeviceUid(**arg_1)

        arg_2 = "api/v0002/device/types/%s/devices/%s/events" % (arg_1.typeId, arg_1.deviceId)
        arg_3 = arg_0._apiClient.get(arg_2)

        if arg_3.status_code == 200:
            arg_4 = []
            for arg_5 in arg_3.json():
                arg_4.append(LastEvent(**arg_5))
            return arg_4
        else:
            raise ApiException(arg_3)

Retrieves a list of the last cached message for all events from a specific device .


def
Func
(
arg_0
,
arg_1
=
False
)
:
arg_2
=
logging
.
currentframe
(
)
if
arg_2
is
not
:
arg_2
=
arg_2
.
f_back
arg_3
=
"(unknown file)"
,
0
,
"(unknown function)"
while
hasattr
(
arg_2
,
"f_code"
)
:
arg_4
=
arg_2
.
f_code
arg_5
=
os
.
path
.
normcase
(
arg_4
.
co_filename
)
if
arg_5
==
logging
.
_srcfile
or
arg_5
==
arg_0
.
_srcfile
:
arg_2
=
arg_2
.
f_back
continue
arg_3
=
(
arg_4
.
co_filename
,
arg_2
.
f_lineno
,
arg_4
.
co_name
)
if
arg_1
:
arg_6
=
io
.
StringIO
(
)
arg_6
.
write
(
'Stack (most recent call last):\n'
)
traceback
.
print_stack
(
arg_2
,
file
=
arg_6
)
arg_7
=
arg_6
.
getvalue
(
)
if
arg_7
[
1
]
==
'\n'
:
arg_7
=
arg_7
[
:
1
]
arg_6
.
close
(
)
break
return
arg_3

def Func(arg_0, arg_1=False):
        """
        Find the stack frame of the caller so that we can note the source
        file name, line number and function name.
        """
        arg_2 = logging.currentframe()
        # On some versions of IronPython, currentframe() returns None if
        # IronPython isn't run with -X:Frames.
        if arg_2 is not None:
            arg_2 = arg_2.f_back
        arg_3 = "(unknown file)", 0, "(unknown function)"
        while hasattr(arg_2, "f_code"):
            arg_4 = arg_2.f_code
            arg_5 = os.path.normcase(arg_4.co_filename)
            if arg_5 == logging._srcfile or arg_5 == arg_0._srcfile:
                arg_2 = arg_2.f_back
                continue
            arg_3 = (arg_4.co_filename, arg_2.f_lineno, arg_4.co_name)
            if arg_1:
                arg_6 = io.StringIO()
                arg_6.write('Stack (most recent call last):\n')
                traceback.print_stack(arg_2, file=arg_6)
                arg_7 = arg_6.getvalue()
                if arg_7[-1] == '\n':
                    arg_7 = arg_7[:-1]
                arg_6.close()
            break
        return arg_3

Find the stack frame of the caller so that we can note the source file name line number and function name .


def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , ( list , tuple ) ) : arg_1 = [ arg_1 ] with arg_0 . _lock : arg_0 . _all_issues . extend ( arg_1 ) arg_0 . _cleaned_issues = None

def Func(arg_0, arg_1):
        """
        Adds an issue to the collection.

        :param issues: the issue(s) to add
        :type issues: tidypy.Issue or list(tidypy.Issue)
        """

        if not isinstance(arg_1, (list, tuple)):
            arg_1 = [arg_1]
        with arg_0._lock:
            arg_0._all_issues.extend(arg_1)
            arg_0._cleaned_issues = None


def Func ( arg_0 , arg_1 = 100 ) : arg_2 = _connect ( arg_0 ) arg_3 = int ( arg_2 . get ( '%s:%s:' % ( arg_0 . _namespace , arg_0 . _pkey ) ) or '0' ) arg_1 = max ( arg_1 , 10 ) for arg_4 in range ( 1 , arg_3 + 1 , arg_1 ) : arg_5 = arg_0 . get ( list ( range ( arg_4 , arg_4 + arg_1 ) ) ) arg_5 session . commit ( all = True ) yield min ( arg_4 + arg_1 , arg_3 ) , arg_3

def Func(arg_0, arg_1=100):
    '''
    This utility function will iterate over all entities of a provided model,
    refreshing their indices. This is primarily useful after adding an index
    on a column.

    Arguments:

        * *model* - the model whose entities you want to reindex
        * *block_size* - the maximum number of entities you want to fetch from
          Redis at a time, defaulting to 100

    This function will yield its progression through re-indexing all of your
    entities.

    Example use::

        for progress, total in Func(MyModel, block_size=200):
            print "%s of %s"%(progress, total)

    .. note:: This uses the session object to handle index refresh via calls to
      ``.commit()``. If you have any outstanding entities known in the
      session, they will be committed.
    '''
    arg_2 = _connect(arg_0)
    arg_3 = int(arg_2.get('%s:%s:'%(arg_0._namespace, arg_0._pkey)) or '0')
    arg_1 = max(arg_1, 10)
    for arg_4 in range(1, arg_3+1, arg_1):
        # fetches entities, keeping a record in the session
        arg_5 = arg_0.get(list(range(arg_4, arg_4+arg_1)))
        arg_5 # for pyflakes
        # re-save un-modified data, resulting in index-only updates
        session.commit(all=True)
        yield min(arg_4+arg_1, arg_3), arg_3

This utility function will iterate over all entities of a provided model,
    refreshing their indices. This is primarily useful after adding an index
    on a column.

    Arguments:

        * *model* - the model whose entities you want to reindex
        * *block_size* - the maximum number of entities you want to fetch from
          Redis at a time, defaulting to 100

    This function will yield its progression through re-indexing all of your
    entities.

    Example use::

        for progress, total in refresh_indices(MyModel, block_size=200):
            print "%s of %s"%(progress, total)

    .. note:: This uses the session object to handle index refresh via calls to
      ``.commit()``. If you have any outstanding entities known in the
      session, they will be committed.

This utility function will iterate over all entities of a provided model refreshing their indices . This is primarily useful after adding an index on a column .


(self, oauth_scope, callback_uri=None,
                           ax_attrs=["name","email","language","username"])

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = [ "name" , "email" , "language" , "username" ] ) : arg_2 = arg_2 or arg_0 . request . uri arg_4 = arg_0 . _openid_args ( arg_2 , arg_3 = arg_3 , arg_1 = arg_1 ) arg_0 . redirect ( arg_0 . _OPENID_ENDPOINT + "?" + urllib . urlencode ( arg_4 ) )

def Func(arg_0, arg_1, arg_2=None,
                           arg_3=["name","email","language","username"]):
        """Authenticates and authorizes for the given Google resource.

        Some of the available resources are:

        * Gmail Contacts - http://www.google.com/m8/feeds/
        * Calendar - http://www.google.com/calendar/feeds/
        * Finance - http://finance.google.com/finance/feeds/

        You can authorize multiple resources by separating the resource
        URLs with a space.
        """
        arg_2 = arg_2 or arg_0.request.uri
        arg_4 = arg_0._openid_args(arg_2, arg_3=arg_3,
                                 arg_1=arg_1)
        arg_0.redirect(arg_0._OPENID_ENDPOINT + "?" + urllib.urlencode(arg_4))

Authenticates and authorizes for the given Google resource .


def Func ( arg_0 ) : arg_1 = [ k for k in arg_0 . payload . keys ( ) if k in arg_3 . values ( ) ] for arg_2 in arg_1 : arg_0 . registered_claims [ arg_2 ] = arg_0 . payload . pop ( arg_2 )

def Func(arg_0):
        """
        Check for registered claims in the payload and move them to the
        registered_claims property, overwriting any extant claims.
        """
        arg_1 = [k for k in arg_0.payload.keys() if
                             k in arg_3.values()]
        for arg_2 in arg_1:
            arg_0.registered_claims[arg_2] = arg_0.payload.pop(arg_2)

Check for registered claims in the payload and move them to the registered_claims property overwriting any extant claims .


def Func(arg_0, arg_1, arg_2):
        """Rendering the ref anchor of a footnote.

        :param key: identity key for the footnote.
        :param index: the index count of current footnote.
        """
        arg_3 = (
            ''
            '%d'
        ) % (escape(arg_1), escape(arg_1), arg_2)
        return arg_3

Rendering the ref anchor of a footnote .


def Func ( arg_0 , arg_1 , arg_2 = 'llnl' ) : arg_3 = ( '../github-data/' + arg_2 + '/' + arg_1 . name + '/issues' ) arg_4 = False if not os . path . exists ( arg_3 ) : arg_5 = arg_1 . iter_issues ( state = 'all' ) arg_4 = True else : arg_6 = os . listdir ( arg_3 ) arg_7 = str ( arg_6 [ - 1 ] [ : - 5 ] ) if arg_7 == str ( datetime . date . today ( ) ) : if len ( arg_6 ) > 2 : arg_7 = str ( arg_6 [ - 2 ] [ : - 5 ] ) else : arg_5 = arg_1 . iter_issues ( state = 'all' ) arg_4 = True if not arg_4 : arg_5 = arg_1 . iter_issues ( since = arg_7 , state = 'all' ) for arg_8 in arg_5 : arg_0 . issues_json [ arg_1 . name ] . append ( arg_8 . to_json ( ) ) arg_9 = 0 for arg_8 in arg_1 . iter_issues ( state = 'closed' ) : if arg_8 is not None : arg_9 += 1 return arg_9

def Func(arg_0, arg_1, arg_2='llnl'):
        """
        Retrieves the number of closed issues.
        """
        #JSON
        arg_3 = ('../github-data/' + arg_2 + '/' + arg_1.name + '/issues')
        arg_4 = False
        if not os.path.exists(arg_3): #no previous path, get all issues
            arg_5 = arg_1.iter_issues(state='all')
            arg_4 = True
        else:
            arg_6 = os.listdir(arg_3)
            arg_7 = str(arg_6[-1][:-5])
            if arg_7 == str(datetime.date.today()):
                #most recent date is actually today, get previous most recent date
                if len(arg_6) > 2:
                    arg_7 = str(arg_6[-2][:-5])
                else:
                    #This means there is only one file, today. Retrieve every issue
                    arg_5 = arg_1.iter_issues(state='all')
                    arg_4 = True
            if not arg_4:#there's a previous saved JSON that's not today
                arg_5 = arg_1.iter_issues(since=arg_7, state='all')
        for arg_8 in arg_5:
            arg_0.issues_json[arg_1.name].append(arg_8.to_json())
        #CSV
        arg_9 = 0
        for arg_8 in arg_1.iter_issues(state='closed'):
            if arg_8 is not None:
                arg_9 += 1
        return arg_9


(T=298.15, P=101325, MW=None, AvailableMethods=False, Method=None, CASRN='')

def
Func
(
arg_0
=
298.15
,
arg_1
=
101325
,
arg_2
=
,
arg_3
=
False
,
arg_4
=
,
arg_5
=
''
)
:
def
list_methods
(
)
:
arg_6
=
[
]
if
arg_5
in
GharagheiziFunc_data
.
index
:
arg_6
.
append
(
'Ghazerati Appendix, at 298K'
)
arg_6
.
append
(
'None'
)
return
arg_6
if
arg_3
:
return
list_methods
(
)
if
not
arg_4
:
arg_4
=
list_methods
(
)
[
0
]
if
arg_4
==
'Ghazerati Appendix, at 298K'
:
arg_7
=
float
(
GharagheiziFunc_data
.
at
[
arg_5
,
'Func'
]
)
elif
arg_4
==
'None'
or
not
arg_7
or
not
arg_2
:
return
else
:
raise
Exception
(
'Failure in in function'
)
arg_7
=
property_molar_to_mass
(
arg_7
,
arg_2
)
return
arg_7

def Func(arg_0=298.15, arg_1=101325, arg_2=None, arg_3=False, arg_4=None, arg_5=''):  # pragma: no cover
    '''This function handles the calculation of a chemical's enthalpy of sublimation.
    Generally this, is used by the chemical class, as all parameters are passed.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.
    '''
    def list_methods():
        arg_6 = []
#        if Hfus(T=T, P=P, MW=MW, CASRN=CASRN) and Hvap(T=T, P=P, MW=MW, CASRN=CASRN):
#            methods.append('Hfus + Hvap')
        if arg_5 in GharagheiziFunc_data.index:
            arg_6.append('Ghazerati Appendix, at 298K')
        arg_6.append('None')
        return arg_6
    if arg_3:
        return list_methods()
    if not arg_4:
        arg_4 = list_methods()[0]
    # This is the calculate, given the method section
#    if Method == 'Hfus + Hvap':
#        p1 = Hfus(T=T, P=P, MW=MW, CASRN=CASRN)
#        p2 = Hvap(T=T, P=P, MW=MW, CASRN=CASRN)
#        if p1 and p2:
#            _Func = p1 + p2
#        else:
#            _Func = None
    if arg_4 == 'Ghazerati Appendix, at 298K':
        arg_7 = float(GharagheiziFunc_data.at[arg_5, 'Func'])
    elif arg_4 == 'None' or not arg_7 or not arg_2:
        return None
    else:
        raise Exception('Failure in in function')
    arg_7 = property_molar_to_mass(arg_7, arg_2)
    return arg_7

This function handles the calculation of a chemical s enthalpy of sublimation . Generally this is used by the chemical class as all parameters are passed .


(src, dst, symlink=False, rellink=False)

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = False ) : arg_4 = os . symlink if arg_2 else shutil . Func2 if arg_2 and os . path . lexists ( arg_1 ) : os . remove ( arg_1 ) if arg_3 : arg_4 ( os . path . relpath ( arg_0 , os . path . dirname ( arg_1 ) ) , arg_1 ) else : arg_4 ( arg_0 , arg_1 )

def Func(arg_0, arg_1, arg_2=False, arg_3=False):
    """Copy or symlink the file."""
    arg_4 = os.symlink if arg_2 else shutil.Func2
    if arg_2 and os.path.lexists(arg_1):
        os.remove(arg_1)
    if arg_3:  # relative symlink from dst
        arg_4(os.path.relpath(arg_0, os.path.dirname(arg_1)), arg_1)
    else:
        arg_4(arg_0, arg_1)


(self, image, image_format, save_kwargs,
                      width, height)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = BytesIO ( ) arg_1 . thumbnail ( ( arg_4 , arg_5 ) , Image . ANTIALIAS ) arg_1 . save ( arg_6 , ** arg_3 ) return arg_6

def Func(arg_0, arg_1, arg_2, arg_3,
                      arg_4, arg_5):
        """
        Return a BytesIO instance of `image` that fits in a bounding box.

        Bounding box dimensions are `width`x`height`.
        """
        arg_6 = BytesIO()
        arg_1.thumbnail(
            (arg_4, arg_5),
            Image.ANTIALIAS
        )
        arg_1.save(
            arg_6,
            **arg_3
        )
        return arg_6

Return a BytesIO instance of image that fits in a bounding box .


def Func ( arg_0 ) : @ wraps ( arg_0 ) def wrapper ( arg_1 , * arg_2 , ** arg_3 ) : if 'enterprise_uuid' not in arg_3 : raise Http404 arg_4 = arg_3 [ 'enterprise_uuid' ] arg_5 = get_enterprise_customer_or_404 ( arg_4 ) if not arg_1 . user . is_authenticated : arg_6 = urlparse ( arg_1 . get_full_path ( ) ) arg_7 = parse_qs ( arg_6 . query ) arg_7 . update ( { 'tpa_hint' : arg_5 . identity_provider , FRESH_LOGIN_PARAMETER : 'yes' } ) arg_8 = '{current_path}?{query_string}' . format ( current_path = quote ( arg_6 . path ) , query_string = urlencode ( arg_7 , doseq = True ) ) return redirect ( '{login_url}?{params}' . format ( login_url = '/login' , params = urlencode ( { 'next' : arg_8 } ) ) ) return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) return wrapper

def Func(arg_0):
    """
    View decorator for allowing authenticated user with valid enterprise UUID.

    This decorator requires enterprise identifier as a parameter
    `enterprise_uuid`.

    This decorator will throw 404 if no kwarg `enterprise_uuid` is provided to
    the decorated view .

    If there is no enterprise in database against the kwarg `enterprise_uuid`
    or if the user is not authenticated then it will redirect the user to the
    enterprise-linked SSO login page.

    Usage::
        @Func()
        def my_view(request, enterprise_uuid):
            # Some functionality ...

        OR

        class MyView(View):
            ...
            @method_decorator(Func)
            def get(self, request, enterprise_uuid):
                # Some functionality ...

    """
    @wraps(arg_0)
    def wrapper(arg_1, *arg_2, **arg_3):
        """
        Wrap the decorator.
        """
        if 'enterprise_uuid' not in arg_3:
            raise Http404

        arg_4 = arg_3['enterprise_uuid']
        arg_5 = get_enterprise_customer_or_404(arg_4)

        # Now verify if the user is logged in. If user is not logged in then
        # send the user to the login screen to sign in with an
        # Enterprise-linked IdP and the pipeline will get them back here.
        if not arg_1.user.is_authenticated:
            arg_6 = urlparse(arg_1.get_full_path())
            arg_7 = parse_qs(arg_6.query)
            arg_7.update({
                'tpa_hint': arg_5.identity_provider,
                FRESH_LOGIN_PARAMETER: 'yes'
            })
            arg_8 = '{current_path}?{query_string}'.format(
                current_path=quote(arg_6.path),
                query_string=urlencode(arg_7, doseq=True)
            )
            return redirect(
                '{login_url}?{params}'.format(
                    login_url='/login',
                    params=urlencode(
                        {'next': arg_8}
                    )
                )
            )

        # Otherwise, they can proceed to the original view.
        return arg_0(arg_1, *arg_2, **arg_3)

    return wrapper

View decorator for allowing authenticated user with valid enterprise UUID.

    This decorator requires enterprise identifier as a parameter
    `enterprise_uuid`.

    This decorator will throw 404 if no kwarg `enterprise_uuid` is provided to
    the decorated view .

    If there is no enterprise in database against the kwarg `enterprise_uuid`
    or if the user is not authenticated then it will redirect the user to the
    enterprise-linked SSO login page.

    Usage::
        @enterprise_login_required()
        def my_view(request, enterprise_uuid):
            # Some functionality ...

        OR

        class MyView(View):
            ...
            @method_decorator(enterprise_login_required)
            def get(self, request, enterprise_uuid):
                # Some functionality ...

View decorator for allowing authenticated user with valid enterprise UUID .


(self, panel_obj, hgnc_gene, action, info=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
)
:
arg_5
=
[
'add'
,
'delete'
,
'edit'
]
if
arg_3
not
in
arg_5
:
raise
ValueError
(
"Invalid action {0}"
.
format
(
arg_3
)
)
arg_4
=
arg_4
or
{
}
arg_6
=
{
'hgnc_id'
:
arg_2
[
'hgnc_id'
]
,
'action'
:
arg_3
,
'info'
:
arg_4
,
'symbol'
:
arg_2
[
'hgnc_symbol'
]
,
}
arg_7
=
arg_0
.
panel_collection
.
find_one_and_update
(
{
'_id'
:
arg_1
[
'_id'
]
}
,
{
'$addToSet'
:
{
'pending'
:
arg_6
}
}
,
return_document
=
pymongo
.
ReturnDocument
.
AFTER
)
return
arg_7

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """Add a pending action to a gene panel

        Store the pending actions in panel.pending

        Args:
            panel_obj(dict): The panel that is about to be updated
            hgnc_gene(dict)
            action(str): choices=['add','delete','edit']
            info(dict): additional gene info (disease_associated_transcripts,
                        reduced_penetrance, mosaicism, database_entry_version ,
                        inheritance_models, comment)

        Returns:
            updated_panel(dict):

        """

        arg_5 = ['add', 'delete', 'edit']
        if arg_3 not in arg_5:
            raise ValueError("Invalid action {0}".format(arg_3))

        arg_4 = arg_4 or {}
        arg_6 = {
            'hgnc_id': arg_2['hgnc_id'],
            'action': arg_3,
            'info': arg_4,
            'symbol': arg_2['hgnc_symbol'],
        }

        arg_7 = arg_0.panel_collection.find_one_and_update(
            {'_id': arg_1['_id']},
            {
                '$addToSet': {
                    'pending': arg_6
                }
            },
            return_document=pymongo.ReturnDocument.AFTER
        )

        return arg_7


def Func ( arg_0 ) : if not arg_0 . is_running ( ) : arg_1 = arg_0 . _platform_impl . _process_name raise NoSuchProcess ( arg_0 . pid , arg_1 ) if hasattr ( arg_0 . _platform_impl , "Func_process" ) : arg_0 . _platform_impl . Func_process ( ) else : arg_0 . send_signal ( signal . SIGCONT )

def Func(arg_0):
        """Resume process execution."""
        # safety measure in case the current process has been killed in
        # meantime and the kernel reused its PID
        if not arg_0.is_running():
            arg_1 = arg_0._platform_impl._process_name
            raise NoSuchProcess(arg_0.pid, arg_1)
        # windows
        if hasattr(arg_0._platform_impl, "Func_process"):
            arg_0._platform_impl.Func_process()
        else:
            # posix
            arg_0.send_signal(signal.SIGCONT)


def Func(arg_0, arg_1, arg_2):
        """ Returns a description dictionary for pytables table creation"""

        def _convert_lists_and_tuples(arg_3):
            """Converts lists and tuples to numpy arrays"""
            if isinstance(arg_3[0],
                          (list, tuple)):  # and not isinstance(series_of_data[0], np.ndarray):
                # If the first data item is a list, the rest must be as well, since
                # data has to be homogeneous
                for arg_4, arg_5 in enumerate(arg_3):
                    arg_3[arg_4] = np.array(arg_5)

        arg_6 = {}  # dictionary containing the description to build a pytables table
        arg_7 = {}  # dictionary containing the original data types

        for arg_8 in arg_1:
            arg_9 = arg_1[arg_8]

            # remember the original data types
            arg_0._all_set_attributes_to_recall_natives(arg_9[0], PTItemMock(arg_7),
                                                       HDF5StorageService.FORMATTED_COLUMN_PREFIX %
                                                       arg_8)

            _convert_lists_and_tuples(arg_9)

            # get a pytables column from the data
            arg_10 = arg_0._all_get_table_col(arg_8, arg_9, arg_2)

            arg_6[arg_8] = arg_10

        return arg_6, arg_7


def
Func
(
arg_0
,
arg_1
=
" "
)
:
def
_repl_func
(
arg_2
)
:
try
:
if
arg_2
.
group
(
1
)
:
return
unichr
(
int
(
arg_2
.
group
(
2
)
)
)
else
:
try
:
return
cp1252
[
unichr
(
int
(
arg_2
.
group
(
3
)
)
)
]
.
strip
(
)
except
:
return
unichr
(
name2codepoint
[
arg_2
.
group
(
3
)
]
)
except
:
return
arg_1
if
not
isinstance
(
arg_0
,
unicode
)
:
arg_0
=
UnicodeDammit
(
arg_0
)
.
unicode
arg_0
=
arg_0
.
replace
(
" "
,
" "
)
arg_3
=
re
.
compile
(
r'&(?:(#)(\d+)|([^;^> ]+));'
)
return
arg_3
.
sub
(
_repl_func
,
arg_0
)

def Func(arg_0, arg_1=" "):

    """Replaces HTML special characters by readable characters.

    As taken from Leif K-Brooks algorithm on:
    http://groups-beta.google.com/group/comp.lang.python

    """

    def _repl_func(arg_2):
        try:
            if arg_2.group(1): # Numeric character reference
                return unichr( int(arg_2.group(2)) )
            else:
                try: return cp1252[ unichr(int(arg_2.group(3))) ].strip()
                except: return unichr( name2codepoint[arg_2.group(3)] )
        except:
            return arg_1

    # Force to Unicode.
    if not isinstance(arg_0, unicode):
        arg_0 = UnicodeDammit(arg_0).unicode

    # Don't want some weird unicode character here
    # that truncate_spaces() doesn't know of:
    arg_0 = arg_0.replace(" ", " ")

    # The ^> makes sure nothing inside a tag (i.e. href with query arguments) gets processed.
    arg_3 = re.compile(r'&(?:(#)(\d+)|([^;^> ]+));')
    return arg_3.sub(_repl_func, arg_0)

Replaces HTML special characters by readable characters .


def Func(arg_0, arg_1):
        """
        Visit a function call.

        We expect every logging statement and string format to be a function call.

        """
        # CASE 1: We're in a logging statement
        if arg_0.within_logging_statement():
            if arg_0.within_logging_argument() and arg_0.is_format_call(arg_1):
                arg_0.violations.append((arg_1, STRING_FORMAT_VIOLATION))
                super(LoggingVisitor, arg_0).generic_visit(arg_1)
                return

        arg_2 = arg_0.detect_logging_level(arg_1)

        if arg_2 and arg_0.current_logging_level is None:
            arg_0.current_logging_level = arg_2

        # CASE 2: We're in some other statement
        if arg_2 is None:
            super(LoggingVisitor, arg_0).generic_visit(arg_1)
            return

        # CASE 3: We're entering a new logging statement
        arg_0.current_logging_call = arg_1

        if arg_2 == "warn":
            arg_0.violations.append((arg_1, WARN_VIOLATION))

        arg_0.check_exc_info(arg_1)

        for arg_5, arg_6 in enumerate(iter_child_nodes(arg_1)):
            if arg_5 == 1:
                arg_0.current_logging_argument = arg_6
            if arg_5 >= 1:
                arg_0.check_exception_arg(arg_6)
            if arg_5 > 1 and isinstance(arg_6, keyword) and arg_6.arg == "extra":
                arg_0.current_extra_keyword = arg_6

            super(LoggingVisitor, arg_0).visit(arg_6)

            arg_0.current_logging_argument = None
            arg_0.current_extra_keyword = None

        arg_0.current_logging_call = None
        arg_0.current_logging_level = None


def Func ( arg_0 ) : arg_1 = arg_0 . multigraph_Func ( ) try : next ( arg_1 ) except StopIteration : return def add_nodes_from ( arg_2 , arg_3 ) : arg_2 . _multi_graph . add_nodes_from ( arg_3 ) for arg_4 in arg_1 : arg_5 = [ node for node in arg_4 if node . type == "op" ] if not arg_5 : return arg_6 = DAGCircuit ( ) arg_6 . name = arg_0 . name for arg_8 in arg_0 . cregs . values ( ) : arg_6 . add_creg ( arg_8 ) for arg_9 in arg_0 . qregs . values ( ) : arg_6 . add_qreg ( arg_9 ) add_nodes_from ( arg_6 , arg_0 . input_map . values ( ) ) add_nodes_from ( arg_6 , arg_0 . output_map . values ( ) ) add_nodes_from ( arg_6 , arg_5 ) arg_10 = [ arg_12 . qargs for arg_12 in arg_5 if arg_12 . name not in { "barrier" , "snapshot" , "save" , "load" , "noise" } ] arg_11 = { arg_0 . input_map [ wire ] : arg_0 . output_map [ wire ] for wire in arg_0 . wires } for arg_12 in arg_5 : arg_13 = arg_0 . _bits_in_condition ( arg_12 . condition ) + arg_12 . cargs + arg_12 . qargs arg_14 = ( arg_0 . input_map [ ( arg [ 0 ] , arg [ 1 ] ) ] for arg in arg_13 ) for arg_15 in arg_14 : arg_11 [ arg_15 ] , arg_11 [ arg_12 ] = arg_12 , arg_11 [ arg_15 ] arg_6 . _multi_graph . add_edges_from ( arg_11 . items ( ) ) yield { "graph" : arg_6 , "partition" : arg_10 }

def Func(arg_0):
        """Yield a shallow view on a layer of this DAGCircuit for all d Func of this circuit.

        A layer is a circuit whose gates act on disjoint qubits, i.e.
        a layer has depth 1. The total number of Func equals the
        circuit depth d. The Func are indexed from 0 to d-1 with the
        earliest layer at index 0. The Func are constructed using a
        greedy algorithm. Each returned layer is a dict containing
        {"graph": circuit graph, "partition": list of qubit lists}.

        TODO: Gates that use the same cbits will end up in different
        Func as this is currently implemented. This may not be
        the desired behavior.
        """
        arg_1 = arg_0.multigraph_Func()
        try:
            next(arg_1)  # Remove input nodes
        except StopIteration:
            return

        def add_nodes_from(arg_2, arg_3):
            """ Convert DAGNodes into a format that can be added to a
             multigraph and then add to graph"""
            arg_2._multi_graph.add_nodes_from(arg_3)

        for arg_4 in arg_1:

            # Get the op nodes from the layer, removing any input and output nodes.
            arg_5 = [node for node in arg_4 if node.type == "op"]

            # Stop yielding once there are no more op_nodes in a layer.
            if not arg_5:
                return

            # Construct a shallow copy of self
            arg_6 = DAGCircuit()
            arg_6.name = arg_0.name

            for arg_8 in arg_0.cregs.values():
                arg_6.add_creg(arg_8)
            for arg_9 in arg_0.qregs.values():
                arg_6.add_qreg(arg_9)

            add_nodes_from(arg_6, arg_0.input_map.values())
            add_nodes_from(arg_6, arg_0.output_map.values())
            add_nodes_from(arg_6, arg_5)

            # The quantum registers that have an operation in this layer.
            arg_10 = [
                arg_12.qargs
                for arg_12 in arg_5
                if arg_12.name not in {"barrier", "snapshot", "save", "load", "noise"}
            ]

            # Now add the edges to the multi_graph
            # By default we just wire inputs to the outputs.
            arg_11 = {arg_0.input_map[wire]: arg_0.output_map[wire]
                     for wire in arg_0.wires}
            # Wire inputs to op nodes, and op nodes to outputs.
            for arg_12 in arg_5:
                arg_13 = arg_0._bits_in_condition(arg_12.condition) \
                       + arg_12.cargs + arg_12.qargs
                arg_14 = (arg_0.input_map[(arg[0], arg[1])] for arg in arg_13)
                for arg_15 in arg_14:
                    arg_11[arg_15], arg_11[arg_12] = arg_12, arg_11[arg_15]

            # Add wiring to/from the operations and between unused inputs & outputs.
            arg_6._multi_graph.add_edges_from(arg_11.items())
            yield {"graph": arg_6, "partition": arg_10}

Yield a shallow view on a layer of this DAGCircuit for all d layers of this circuit.

        A layer is a circuit whose gates act on disjoint qubits, i.e.
        a layer has depth 1. The total number of layers equals the
        circuit depth d. The layers are indexed from 0 to d-1 with the
        earliest layer at index 0. The layers are constructed using a
        greedy algorithm. Each returned layer is a dict containing
        {"graph": circuit graph, "partition": list of qubit lists}.

        TODO: Gates that use the same cbits will end up in different
        layers as this is currently implemented. This may not be
        the desired behavior.

Yield a shallow view on a layer of this DAGCircuit for all d layers of this circuit .


def Func(arg_0, arg_1, **arg_2):
    """
    Perform the linking of user in the process of logging to the Enterprise Customer.

    Args:
        backend: The class handling the SSO interaction (SAML, OAuth, etc)
        user: The user object in the process of being logged in with
        **kwargs: Any remaining pipeline variables

    """
    arg_3 = arg_0.strategy.request
    arg_4 = get_enterprise_customer_for_running_pipeline(
        arg_3,
        {
            'backend': arg_0.name,
            'kwargs': arg_2
        }
    )
    if arg_4 is None:
        # This pipeline element is not being activated as a part of an Enterprise logistration
        return

    # proceed with the creation of a link between the user and the enterprise customer, then exit.
    arg_5, arg_6 = EnterpriseCustomerUser.objects.update_or_create(
        arg_4=arg_4,
        user_id=arg_1.id
    )
    arg_5.update_session(arg_3)

Perform the linking of user in the process of logging to the Enterprise Customer .


def Func(arg_0, arg_1, *arg_2):
        """Map the line numbers in `lines` to the correct first line of the
        statement.

        Skip any line mentioned in any of the sequences in `ignores`.

        Returns a set of the first lines.

        """
        arg_3 = set()
        for arg_4 in arg_2:
            arg_3.update(arg_4)
        arg_5 = set()
        for arg_6 in arg_1:
            if arg_6 in arg_3:
                continue
            arg_7 = arg_0.first_line(arg_6)
            if arg_7 not in arg_3:
                arg_5.add(arg_7)
        return arg_5

Map the line numbers in lines to the correct first line of the statement .


def Func ( arg_0 , arg_1 = None , arg_2 = True ) : if arg_1 is None : if arg_2 : return cp . deepcopy ( arg_0 . _run_information ) else : return arg_0 . _run_information try : if arg_2 : return arg_0 . _run_information [ arg_1 ] . copy ( ) else : return arg_0 . _run_information [ arg_1 ] except KeyError : arg_1 = arg_0 . f_idx_to_run ( arg_1 ) if arg_2 : return arg_0 . _run_information [ arg_1 ] . copy ( ) else : return arg_0 . _run_information [ arg_1 ]

def Func(arg_0, arg_1=None, arg_2=True):
        """ Returns a dictionary containing information about a single run.

        ONLY useful during a single run if ``v_full_copy` was set to ``True``.
        Otherwise only the current run is available.

        The information dictionaries have the following key, value pairings:

            * completed: Boolean, whether a run was completed

            * idx: Index of a run

            * timestamp: Timestamp of the run as a float

            * time: Formatted time string

            * finish_timestamp: Timestamp of the finishing of the run

            * runtime: Total runtime of the run in human readable format

            * name: Name of the run

            * parameter_summary:

                A string summary of the explored parameter settings for the particular run

            * short_environment_hexsha: The short version of the environment SHA-1 code

        If no name or idx is given then a nested dictionary with keys as run names and
        info dictionaries as values is returned.

        :param name_or_idx: str or int

        :param copy:

            Whether you want the dictionary used by the trajectory or a copy. Note if
            you want the real thing, please do not modify it, i.e. popping or adding stuff. This
            could mess up your whole trajectory.

        :return:

            A run information dictionary or a nested dictionary of information dictionaries
            with the run names as keys.

        """
        if arg_1 is None:
            if arg_2:
                return cp.deepcopy(arg_0._run_information)
            else:
                return arg_0._run_information
        try:
            if arg_2:
                # Since the information dictionaries only contain immutable items
                # (float, int, str)
                # the normal copy operation is sufficient
                return arg_0._run_information[arg_1].copy()
            else:
                return arg_0._run_information[arg_1]
        except KeyError:
            # Maybe the user provided an idx, this would yield a key error and we
            # have to convert it to a run name
            arg_1 = arg_0.f_idx_to_run(arg_1)
            if arg_2:
                return arg_0._run_information[arg_1].copy()
            else:
                return arg_0._run_information[arg_1]

Returns a dictionary containing information about a single run .


def Func():
    """Get the options for each task that will be run"""
    arg_0 = ()

    arg_1 = get_tasks()
    for arg_2 in arg_1:
        arg_0 += arg_2.option_list

    return arg_0


def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_4 = '' . join ( [ str ( arg_1 ) , str ( arg_2 ) , str ( arg_3 . get ( 'data' , '' ) ) , str ( arg_3 . get ( 'params' , '' ) ) ] ) return hashlib . md5 ( arg_4 . encode ( ) ) . hexdigest ( )

def Func(arg_0, arg_1, arg_2, **arg_3):
    '''Find a hash value for the linear combination of invocation methods.
    '''
    arg_4 = ''.join([str(arg_1), str(arg_2),
        str(arg_3.get('data', '')),
        str(arg_3.get('params', ''))
    ])
    return hashlib.md5(arg_4.encode()).hexdigest()

Find a hash value for the linear combination of invocation methods .


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_0
.
username
==
'root'
:
raise
ValueError
(
'Already root user'
)
arg_1
=
arg_0
.
validate_password
(
arg_1
)
arg_2
,
arg_3
,
arg_4
=
arg_0
.
exec_command
(
'Func su'
)
arg_2
.
write
(
"%s\n"
%
arg_1
)
arg_2
.
flush
(
)
arg_5
=
arg_4
.
read
(
)
if
arg_5
:
raise
ValueError
(
arg_5
)

def Func(arg_0, arg_1=None):
        """
        Enter Func mode
        """
        if arg_0.username == 'root':
            raise ValueError('Already root user')
        arg_1 = arg_0.validate_password(arg_1)
        arg_2, arg_3, arg_4 = arg_0.exec_command('Func su')
        arg_2.write("%s\n" % arg_1)
        arg_2.flush()
        arg_5 = arg_4.read()
        if arg_5:
            raise ValueError(arg_5)


def Func ( arg_0 , arg_1 ) : arg_2 = make_get_request ( arg_0 , 'projects' , params_data = arg_1 ) arg_3 = arg_2 . json ( ) if arg_2 . status_code == 200 : return arg_3 [ 'result' ] else : raise ProjectsNotFoundException ( message = arg_3 [ 'message' ] , error_code = arg_3 [ 'error_code' ] , request_id = arg_3 [ 'request_id' ] )

def Func(arg_0, arg_1):
    """
    Get one or more projects
    """
    # GET /api/projects/0.1/projects
    arg_2 = make_get_request(arg_0, 'projects', params_data=arg_1)
    arg_3 = arg_2.json()
    if arg_2.status_code == 200:
        return arg_3['result']
    else:
        raise ProjectsNotFoundException(
            message=arg_3['message'],
            error_code=arg_3['error_code'],
            request_id=arg_3['request_id'])


def Func ( arg_0 ) : def metaclass ( arg_1 , arg_2 , arg_3 ) : arg_4 = type ( arg_1 , arg_2 , arg_3 ) form . FormTagHandler . register_type ( arg_0 . upper ( ) , arg_4 ) return arg_4 return metaclass

def Func(arg_0):
    """ A metaclass generator. Returns a metaclass which
    will register it's class as the class that handles input type=typeName
    """
    def metaclass(arg_1, arg_2, arg_3):
        arg_4 = type(arg_1, arg_2, arg_3)
        form.FormTagHandler.register_type(arg_0.upper(), arg_4)
        return arg_4
    return metaclass

A metaclass generator . Returns a metaclass which will register it s class as the class that handles input type = typeName


def Func ( arg_0 , arg_1 ) : arg_2 = Route ( 'GET' , '/artists/{spotify_id}/related-artists' , arg_1 = arg_1 ) return arg_0 . request ( arg_2 )

def Func(arg_0, arg_1):
        """Get related artists for an artist by their ID.

        Parameters
        ----------
        spotify_id : str
            The spotify_id to search by.
        """
        arg_2 = Route('GET', '/artists/{spotify_id}/related-artists', arg_1=arg_1)
        return arg_0.request(arg_2)

Get related artists for an artist by their ID .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Batch map offsets into input

        Parameters
        ------------
        inputs : ``tf.Tensor``
            shape = (b, h, w, c)
        offsets: ``tf.Tensor``
            shape = (b, h, w, 2*n)
        grid_offset: `tf.Tensor``
            Offset grids shape = (h, w, n, 2)

        Returns
        -------
        ``tf.Tensor``
            A Tensor with the shape as (b, h, w, c)

        """
        arg_4 = arg_1.get_shape()
        arg_5 = tf.shape(arg_1)[0]
        arg_6 = int(int(arg_2.get_shape()[3]) / 2)
        arg_7 = arg_4[1]
        arg_8 = arg_4[2]
        arg_9 = arg_4[3]

        # inputs (b, h, w, c) --> (b*c, h, w)
        arg_1 = arg_0._to_bc_h_w(arg_1, arg_4)

        # offsets (b, h, w, 2*n) --> (b, h, w, n, 2)
        arg_2 = tf.reshape(arg_2, (arg_5, arg_7, arg_8, arg_6, 2))
        # offsets (b, h, w, n, 2) --> (b*c, h, w, n, 2)
        # offsets = tf.tile(offsets, [channel, 1, 1, 1, 1])

        arg_10 = tf.expand_dims(arg_3, 0)  # grid_offset --> (1, h, w, n, 2)
        arg_10 = tf.tile(arg_10, [arg_5, 1, 1, 1, 1]) + arg_2  # grid_offset --> (b, h, w, n, 2)

        # clip out of bound
        arg_10 = tf.stack(
            [
                tf.clip_by_value(arg_10[:, :, :, :, 0], 0.0, tf.cast(arg_7 - 1, 'float32')),
                tf.clip_by_value(arg_10[:, :, :, :, 1], 0.0, tf.cast(arg_8 - 1, 'float32'))
            ], axis=-1
        )
        arg_10 = tf.tile(arg_10, [arg_9, 1, 1, 1, 1])

        arg_11 = arg_0._tf_batch_map_coordinates(arg_1, arg_10)
        # (b*c, h, w, n) --> (b, h, w, n, c)
        arg_11 = arg_0._to_b_h_w_n_c(arg_11, [arg_5, arg_7, arg_8, arg_6, arg_9])

        return arg_11


def Func ( ) : global arg_0 global arg_1 if type ( arg_0 ) is not list : arg_0 = list ( arg_0 ) if not arg_1 : arg_1 = [ d . ahioDriverInfo . NAME for d in arg_0 if d . ahioDriverInfo . AVAILABLE ] return arg_1

def Func():
    """Returns a list of available drivers names.
    """
    global arg_0
    global arg_1

    if type(arg_0) is not list:
        arg_0 = list(arg_0)

    if not arg_1:
        arg_1 = [d.ahioDriverInfo.NAME
                       for d in arg_0
                       if d.ahioDriverInfo.AVAILABLE]

    return arg_1

Returns a list of available drivers names .


def Func(arg_0, arg_1, arg_2='NORMAL'):
        """Register a hook into the hook list.

        Args:
            hook (:obj:`Hook`): The hook to be registered.
            priority (int or str or :obj:`Priority`): Hook priority.
                Lower value means higher priority.
        """
        assert isinstance(arg_1, Hook)
        if hasattr(arg_1, 'priority'):
            raise ValueError('"priority" is a reserved attribute for hooks')
        arg_2 = get_priority(arg_2)
        arg_1.priority = arg_2
        # insert the hook to a sorted list
        arg_3 = False
        for arg_4 in range(len(arg_0._hooks) - 1, -1, -1):
            if arg_2 >= arg_0._hooks[arg_4].priority:
                arg_0._hooks.insert(arg_4 + 1, arg_1)
                arg_3 = True
                break
        if not arg_3:
            arg_0._hooks.insert(0, arg_1)


def Func(arg_0=None):
    """Restart any containers associated with Dusty, or associated with
    the provided app_or_service_names."""
    if arg_0:
        log_to_client("Restarting the following apps or services: {}".format(', '.join(arg_0)))
    else:
        log_to_client("Restarting all active containers associated with Dusty")

    if arg_0:
        arg_1 = spec_assembler.get_assembled_specs()
        arg_2 = [arg_1['apps'][app_name] for app_name in arg_0 if app_name in arg_1['apps']]
        arg_3 = set()
        for arg_4 in arg_2:
            if arg_4['repo']:
                arg_3 = arg_3.union(spec_assembler.get_same_container_repos_from_spec(arg_4))
        nfs.update_nfs_with_repos(arg_3)
    else:
        nfs.update_nfs_with_repos(spec_assembler.get_all_repos(active_only=True, include_specs_repo=False))
    compose.restart_running_services(arg_0)

Restart any containers associated with Dusty or associated with the provided app_or_service_names .


def Func(arg_0):
        """ Parses the Xdot attributes of all graph components and adds
            the components to a new canvas.
        """
        from arg_1 import XdotAttrParser

        arg_1 = XdotAttrParser()
        arg_2 = arg_0._component_default()

        for arg_3 in arg_0.nodes:
            arg_4 = arg_1.parse_xdot_data( arg_3._draw_ )
            arg_2.add( *arg_4 )

            arg_4 = arg_1.parse_xdot_data( arg_3._ldraw_ )
            arg_2.add( *arg_4 )

        for arg_5 in arg_0.edges:
            arg_4 = arg_1.parse_xdot_data( arg_5._draw_ )
            arg_2.add( *arg_4 )
            arg_4 = arg_1.parse_xdot_data( arg_5._ldraw_ )
            arg_2.add( *arg_4 )
            arg_4 = arg_1.parse_xdot_data( arg_5._hdraw_ )
            arg_2.add( *arg_4 )
            arg_4 = arg_1.parse_xdot_data( arg_5._tdraw_ )
            arg_2.add( *arg_4 )
            arg_4 = arg_1.parse_xdot_data( arg_5._hldraw_ )
            arg_2.add( *arg_4 )
            arg_4 = arg_1.parse_xdot_data( arg_5._tldraw_ )
            arg_2.add( *arg_4 )

        arg_0.component = arg_2
        arg_0.vp.request_redraw()

Parses the Xdot attributes of all graph components and adds the components to a new canvas .


(username, password, service='login', encoding='utf-8',
                 resetcred=True)

def Func ( arg_0 , arg_1 , arg_2 = 'login' , arg_3 = 'utf-8' , arg_4 = True ) : if sys . version_info >= ( 3 , ) : if isinstance ( arg_0 , str ) : arg_0 = arg_0 . encode ( arg_3 ) if isinstance ( arg_1 , str ) : arg_1 = arg_1 . encode ( arg_3 ) if isinstance ( arg_2 , str ) : arg_2 = arg_2 . encode ( arg_3 ) @ conv_func def my_conv ( arg_5 , arg_6 , arg_7 , arg_8 ) : arg_9 = calloc ( arg_5 , sizeof ( PamResponse ) ) arg_7 [ 0 ] = cast ( arg_9 , POINTER ( PamResponse ) ) for arg_10 in range ( arg_5 ) : if arg_6 [ arg_10 ] . contents . msg_style == PAM_PROMPT_ECHO_OFF : arg_11 = strdup ( arg_1 ) arg_7 . contents [ arg_10 ] . resp = cast ( arg_11 , c_char_p ) arg_7 . contents [ arg_10 ] . resp_retcode = 0 return 0 arg_15 = PamHandle ( ) arg_16 = PamConv ( my_conv , 0 ) arg_17 = pam_start ( arg_2 , arg_0 , byref ( arg_16 ) , byref ( arg_15 ) ) if arg_17 != 0 : return False arg_17 = pam_Func ( arg_15 , 0 ) arg_18 = ( arg_17 == 0 ) if arg_18 and arg_4 : arg_17 = pam_setcred ( arg_15 , PAM_REINITIALIZE_CRED ) pam_end ( arg_15 , arg_17 ) return arg_18

def Func(arg_0, arg_1, arg_2='login', arg_3='utf-8',
                 arg_4=True):
    """Returns True if the given username and password Func for the
    given service.  Returns False otherwise.

    ``username``: the username to Func

    ``password``: the password in plain text

    ``service``: the PAM service to Func against.
                 Defaults to 'login'

    The above parameters can be strings or bytes.  If they are strings,
    they will be encoded using the encoding given by:

    ``encoding``: the encoding to use for the above parameters if they
                  are given as strings.  Defaults to 'utf-8'

    ``resetcred``: Use the pam_setcred() function to
                   reinitialize the credentials.
                   Defaults to 'True'.
    """

    if sys.version_info >= (3,):
        if isinstance(arg_0, str):
            arg_0 = arg_0.encode(arg_3)
        if isinstance(arg_1, str):
            arg_1 = arg_1.encode(arg_3)
        if isinstance(arg_2, str):
            arg_2 = arg_2.encode(arg_3)

    @conv_func
    def my_conv(arg_5, arg_6, arg_7, arg_8):
        """Simple conversation function that responds to any
        prompt where the echo is off with the supplied password"""
        # Create an array of n_messages response objects
        arg_9 = calloc(arg_5, sizeof(PamResponse))
        arg_7[0] = cast(arg_9, POINTER(PamResponse))
        for arg_10 in range(arg_5):
            if arg_6[arg_10].contents.msg_style == PAM_PROMPT_ECHO_OFF:
                arg_11 = strdup(arg_1)
                arg_7.contents[arg_10].resp = cast(arg_11, c_char_p)
                arg_7.contents[arg_10].resp_retcode = 0
        return 0

    arg_15 = PamHandle()
    arg_16 = PamConv(my_conv, 0)
    arg_17 = pam_start(arg_2, arg_0, byref(arg_16), byref(arg_15))

    if arg_17 != 0:
        # TODO: This is not an authentication error, something
        # has gone wrong starting up PAM
        return False

    arg_17 = pam_Func(arg_15, 0)
    arg_18 = (arg_17 == 0)

    # Re-initialize credentials (for Kerberos users, etc)
    # Don't check return code of pam_setcred(), it shouldn't matter
    # if this fails
    if arg_18 and arg_4:
        arg_17 = pam_setcred(arg_15, PAM_REINITIALIZE_CRED)

    pam_end(arg_15, arg_17)

    return arg_18

Returns True if the given username and password authenticate for the
    given service.  Returns False otherwise.

    ``username``: the username to authenticate

    ``password``: the password in plain text

    ``service``: the PAM service to authenticate against.
                 Defaults to 'login'

    The above parameters can be strings or bytes.  If they are strings,
    they will be encoded using the encoding given by:

    ``encoding``: the encoding to use for the above parameters if they
                  are given as strings.  Defaults to 'utf-8'

    ``resetcred``: Use the pam_setcred() function to
                   reinitialize the credentials.
                   Defaults to 'True'.

Returns True if the given username and password authenticate for the given service . Returns False otherwise .


def Func ( arg_0 ) : if isinstance ( arg_0 , string_types ) : with open ( arg_0 , "r" ) as file_handle : return model_from_dict ( json . load ( file_handle ) ) else : return model_from_dict ( json . load ( arg_0 ) )

def Func(arg_0):
    """
    Load a cobra model from a file in JSON format.

    Parameters
    ----------
    filename : str or file-like
        File path or descriptor that contains the JSON document describing the
        cobra model.

    Returns
    -------
    cobra.Model
        The cobra model as represented in the JSON document.

    See Also
    --------
    from_json : Load from a string.
    """
    if isinstance(arg_0, string_types):
        with open(arg_0, "r") as file_handle:
            return model_from_dict(json.load(file_handle))
    else:
        return model_from_dict(json.load(arg_0))

Load a cobra model from a file in JSON format .


(self, path, method=None, type_cast=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if not arg_3 : arg_3 = { } def decorator ( arg_4 ) : arg_0 . s_add ( arg_1 , arg_4 , arg_2 , arg_3 ) return arg_4 return decorator

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Decorator for registering a simple path.

        Args:
            path (str): Path to be matched.
            method (str, optional): Usually used to define one of GET, POST,
                PUT, DELETE. You may use whatever fits your situation though.
                Defaults to None.
            type_cast (dict, optional): Mapping between the param name and
                one of `int`, `float` or `bool`. The value reflected by the
                provided param name will than be casted to the given type.
                Defaults to None.
        """
        if not arg_3:
            arg_3 = {}

        def decorator(arg_4):
            arg_0.s_add(arg_1, arg_4, arg_2, arg_3)
            return arg_4

        return decorator

Decorator for registering a simple path .


def Func(arg_0, arg_1):
        """Gets security groups for interfaces from Redis

        Returns a dictionary of xapi.VIFs with values of the current
        acknowledged status in Redis.

        States not explicitly handled:
        * ack key, no rules - This is the same as just tagging the VIF,
          the instance will be inaccessible
        * rules key, no ack - Nothing will happen, the VIF will
          not be tagged.
        """
        LOG.debug("Getting security groups from Redis for {0}".format(
            arg_1))
        arg_1 = tuple(arg_1)
        arg_2 = [arg_0.vif_key(arg_5.device_id, arg_5.mac_address)
                    for arg_5 in arg_1]

        # Retrieve all fields associated with this key, which should be
        # 'security groups ack' and 'security group rules'.
        arg_3 = arg_0.get_fields_all(arg_2)

        arg_4 = {}
        # Associate the vif with the fields in a dictionary
        for arg_5, arg_6 in zip(arg_1, arg_3):
            if arg_6:
                arg_4[arg_5] = {arg_10: None,
                            arg_9: []}
                arg_7 = arg_6[arg_10].lower()
                arg_8 = arg_6[arg_9]
                if arg_8:
                    arg_8 = json.loads(arg_8)
                    arg_4[arg_5][arg_9] = arg_8["rules"]
                if "true" in arg_7:
                    arg_4[arg_5][arg_10] = True
                elif "false" in arg_7:
                    arg_4[arg_5][arg_10] = False
                else:
                    arg_4.pop(arg_5, None)
                    LOG.debug("Skipping bad ack value %s" % arg_7)

        return arg_4


(self, name, new_name, unique=False, store_in_state=True)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False , arg_4 = True ) : arg_2 = vaex . utils . find_valid_name ( arg_2 , used = [ ] if not arg_3 else list ( arg_0 ) ) arg_5 = arg_0 . columns . get ( arg_1 ) if arg_5 is not None : del arg_0 . columns [ arg_1 ] arg_0 . column_names [ arg_0 . column_names . index ( arg_1 ) ] = arg_2 arg_0 . columns [ arg_2 ] = arg_5 else : arg_9 = arg_0 . virtual_columns [ arg_1 ] del arg_0 . virtual_columns [ arg_1 ] arg_0 . virtual_columns [ arg_2 ] = arg_9 if arg_4 : arg_0 . _renamed_columns . append ( ( arg_1 , arg_2 ) ) for arg_11 in [ arg_0 . ucds , arg_0 . units , arg_0 . descriptions ] : if arg_1 in arg_11 : arg_11 [ arg_2 ] = arg_11 [ arg_1 ] del arg_11 [ arg_1 ] return arg_2

def Func(arg_0, arg_1, arg_2, arg_3=False, arg_4=True):
        """Renames a column, not this is only the in memory name, this will not be reflected on disk"""
        arg_2 = vaex.utils.find_valid_name(arg_2, used=[] if not arg_3 else list(arg_0))
        arg_5 = arg_0.columns.get(arg_1)
        if arg_5 is not None:
            del arg_0.columns[arg_1]
            arg_0.column_names[arg_0.column_names.index(arg_1)] = arg_2
            arg_0.columns[arg_2] = arg_5
        else:
            arg_9 = arg_0.virtual_columns[arg_1]
            del arg_0.virtual_columns[arg_1]
            arg_0.virtual_columns[arg_2] = arg_9
        if arg_4:
            arg_0._renamed_columns.append((arg_1, arg_2))
        for arg_11 in [arg_0.ucds, arg_0.units, arg_0.descriptions]:
            if arg_1 in arg_11:
                arg_11[arg_2] = arg_11[arg_1]
                del arg_11[arg_1]
        return arg_2

Renames a column not this is only the in memory name this will not be reflected on disk


return (particleStates, modelIds, errScores, completedFlags, maturedFlags)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = range ( len ( arg_0 . _allResults ) ) if len ( arg_3 ) == 0 : return ( [ ] , [ ] , [ ] , [ ] , [ ] ) arg_4 = [ ] arg_5 = [ ] arg_6 = [ ] arg_7 = [ ] arg_8 = [ ] for arg_9 in arg_3 : arg_10 = arg_0 . _allResults [ arg_9 ] if not arg_10 [ 'hidden' ] : continue arg_11 = arg_10 [ 'modelParams' ] if arg_11 [ 'particleState' ] [ 'swarmId' ] != arg_1 : continue arg_12 = arg_10 [ 'completed' ] arg_13 = arg_10 [ 'matured' ] arg_14 = arg_11 [ 'particleState' ] arg_15 = arg_14 [ 'genIdx' ] arg_16 = arg_14 [ 'id' ] if arg_2 is not None and arg_15 != arg_2 : continue arg_4 . append ( arg_14 ) arg_5 . append ( arg_10 [ 'modelID' ] ) arg_6 . append ( arg_10 [ 'errScore' ] ) arg_7 . append ( arg_12 ) arg_8 . append ( arg_13 ) return ( arg_4 , arg_5 , arg_6 , arg_7 , arg_8 )

def Func(arg_0, arg_1, arg_2):
    """Return a list of particleStates for all particles in the given
    swarm generation that have been orphaned.

    Parameters:
    ---------------------------------------------------------------------
    swarmId:  A string representation of the sorted list of encoders in this
                 swarm. For example '__address_encoder.__gym_encoder'

    genIdx:  If not None, only return particles at this specific generation
                  index.

    retval:  (particleStates, modelIds, errScores, completed, matured)
              particleStates: list of particleStates
              modelIds: list of modelIds
              errScores: list of errScores, numpy.inf is plugged in
                              if we don't have a result yet
              completed: list of completed booleans
              matured: list of matured booleans
    """

    arg_3 = range(len(arg_0._allResults))
    if len(arg_3) == 0:
      return ([], [], [], [], [])

    # Get the particles of interest
    arg_4 = []
    arg_5 = []
    arg_6 = []
    arg_7 = []
    arg_8 = []
    for arg_9 in arg_3:

      # Get info on this model
      arg_10 = arg_0._allResults[arg_9]
      if not arg_10['hidden']:
        continue

      arg_11 = arg_10['modelParams']
      if arg_11['particleState']['swarmId'] != arg_1:
        continue

      arg_12 = arg_10['completed']
      arg_13 = arg_10['matured']
      arg_14 = arg_11['particleState']
      arg_15 = arg_14['genIdx']
      arg_16 = arg_14['id']

      if arg_2 is not None and arg_15 != arg_2:
        continue

      # Incorporate into return values
      arg_4.append(arg_14)
      arg_5.append(arg_10['modelID'])
      arg_6.append(arg_10['errScore'])
      arg_7.append(arg_12)
      arg_8.append(arg_13)

    return (arg_4, arg_5, arg_6, arg_7, arg_8)

Return a list of particleStates for all particles in the given swarm generation that have been orphaned .


def Func(arg_0):
    """
    Call all the callbacks.
    If any callback raises an Exception,
    unregister the corresponding watch.
    """
    arg_1 = []
    for arg_2, arg_3 in arg_0.watches.items():
      try:
        arg_3(arg_0)
      except Exception as e:
        Log.error("Caught exception while triggering callback: " + str(e))
        Log.debug(traceback.format_exc())
        arg_1.append(arg_2)

    for arg_2 in arg_1:
      arg_0.unregister_watch(arg_2)

Call all the callbacks . If any callback raises an Exception unregister the corresponding watch .


def Func ( ** arg_0 ) : arg_1 = get_bucket ( ** arg_0 ) if arg_1 : return [ arg_2 for arg_2 in arg_1 . list_blobs ( ) ] else : return None

def Func(**arg_0):
    """
    List objects in bucket.

    :param Bucket: name of bucket
    :type Bucket: ``str``

    :returns list of objects in bucket
    :rtype: ``list``
    """
    arg_1 = get_bucket(**arg_0)
    if arg_1:
        return [arg_2 for arg_2 in arg_1.list_blobs()]
    else:
        return None


def Func ( arg_0 , arg_1 ) : if hasattr ( arg_1 , 'localize' ) and arg_0 not in ( datetime . datetime . min , datetime . datetime . max ) : return arg_1 . localize ( arg_0 , is_dst = None ) else : return arg_0 . replace ( tzinfo = arg_1 )

def Func(arg_0, arg_1):
    """
    Makes a naive datetime.datetime in a given time zone aware.
    """
    if hasattr(arg_1, 'localize') and arg_0 not in (datetime.datetime.min, datetime.datetime.max):
        # available for pytz time zones
        return arg_1.localize(arg_0, is_dst=None)
    else:
        # may be wrong around DST changes
        return arg_0.replace(tzinfo=arg_1)

Makes a naive datetime . datetime in a given time zone aware .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
LOG
.
debug
(
"Func condition=%s"
,
arg_2
)
arg_1
.
close
(
)
arg_0
.
done
=
True

def Func(arg_0, arg_1, arg_2):
        """Peer has closed its end of the link."""
        LOG.debug("Func condition=%s", arg_2)
        arg_1.close()
        arg_0.done = True


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 60 ) : arg_0 . _halt_if_already_deleted ( ) arg_2 = locals ( ) del arg_2 [ 'self' ] return arg_0 . _add_record ( SPFResourceRecordSet , ** arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3=60):
        """
        Creates a SPF record attached to this hosted zone.

        :param str name: The fully qualified name of the record to add.
        :param list values: A list of value strings for the record.
        :keyword int ttl: The time-to-live of the record (in seconds).
        :rtype: tuple
        :returns: A tuple in the form of ``(rrset, change_info)``, where
            ``rrset`` is the newly created SPFResourceRecordSet instance.
        """

        arg_0._halt_if_already_deleted()

        # Grab the params/kwargs here for brevity's sake.
        arg_2 = locals()
        del arg_2['self']

        return arg_0._add_record(SPFResourceRecordSet, **arg_2)

Creates a SPF record attached to this hosted zone .


Checks if the input word could be played with a full bag of tiles.

    Returns:
        True or false

Checks if the input word could be played with a full bag of tiles .


(self, datacenter_id, server_id,
                             nic_id, firewall_rule)

def Func(arg_0, arg_1, arg_2,
                             arg_3, arg_4):
        """
        Creates a firewall rule on the specified NIC and server.

        :param      datacenter_id: The unique ID of the data center.
        :type       datacenter_id: ``str``

        :param      server_id: The unique ID of the server.
        :type       server_id: ``str``

        :param      nic_id: The unique ID of the NIC.
        :type       nic_id: ``str``

        :param      firewall_rule: A firewall rule dict.
        :type       firewall_rule: ``dict``

        """
        arg_5 = {
            "name": arg_4.name
        }

        if arg_4.protocol:
            arg_5['protocol'] = arg_4.protocol

        # Optional Properties
        if arg_4.source_mac:
            arg_5['sourceMac'] = arg_4.source_mac

        if arg_4.source_ip:
            arg_5['sourceIp'] = arg_4.source_ip

        if arg_4.target_ip:
            arg_5['targetIp'] = arg_4.target_ip

        if arg_4.port_range_start:
            arg_5['portRangeStart'] = arg_4.port_range_start

        if arg_4.port_range_end:
            arg_5['portRangeEnd'] = arg_4.port_range_end

        if arg_4.icmp_type:
            arg_5['icmpType'] = arg_4.icmp_type

        if arg_4.icmp_code:
            arg_5['icmpCode'] = arg_4.icmp_code

        arg_6 = {
            "properties": arg_5
        }

        arg_7 = arg_0._perform_request(
            url='/datacenters/%s/servers/%s/nics/%s/firewallrules' % (
                arg_1,
                arg_2,
                arg_3),
            method='POST',
            arg_6=json.dumps(arg_6))

        return arg_7

Creates a firewall rule on the specified NIC and server .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
copy
.
deepcopy
(
TESTCASE
)
arg_3
[
"fname"
]
=
arg_2
arg_3
[
"fpath_orig"
]
=
os
.
sep
.
join
(
[
arg_0
[
"conf"
]
[
"TESTCASES"
]
,
arg_3
[
"fname"
]
]
)
if
not
os
.
path
.
exists
(
arg_3
[
"fpath_orig"
]
)
:
cij
.
err
(
'rnr:Func: !case["fpath_orig"]: %r'
%
arg_3
[
"fpath_orig"
]
)
return
arg_3
[
"name"
]
=
os
.
path
.
splitext
(
arg_3
[
"fname"
]
)
[
0
]
arg_3
[
"ident"
]
=
"/"
.
join
(
[
arg_1
[
"ident"
]
,
arg_3
[
"fname"
]
]
)
arg_3
[
"res_root"
]
=
os
.
sep
.
join
(
[
arg_1
[
"res_root"
]
,
arg_3
[
"fname"
]
]
)
arg_3
[
"aux_root"
]
=
os
.
sep
.
join
(
[
arg_3
[
"res_root"
]
,
"_aux"
]
)
arg_3
[
"log_fpath"
]
=
os
.
sep
.
join
(
[
arg_3
[
"res_root"
]
,
"run.log"
]
)
arg_3
[
"fpath"
]
=
os
.
sep
.
join
(
[
arg_3
[
"res_root"
]
,
arg_3
[
"fname"
]
]
)
arg_3
[
"evars"
]
.
update
(
copy
.
deepcopy
(
arg_1
[
"evars"
]
)
)
os
.
makedirs
(
arg_3
[
"res_root"
]
)
os
.
makedirs
(
arg_3
[
"aux_root"
]
)
shutil
.
copyfile
(
arg_3
[
"fpath_orig"
]
,
arg_3
[
"fpath"
]
)
arg_3
[
"hooks"
]
=
hooks_setup
(
arg_0
,
arg_3
,
arg_1
.
get
(
"hooks_pr_tcase"
)
)
return
arg_3

def Func(arg_0, arg_1, arg_2):
    """
    Create and initialize a testcase
    """
    #pylint: disable=locally-disabled, unused-argument

    arg_3 = copy.deepcopy(TESTCASE)

    arg_3["fname"] = arg_2
    arg_3["fpath_orig"] = os.sep.join([arg_0["conf"]["TESTCASES"], arg_3["fname"]])

    if not os.path.exists(arg_3["fpath_orig"]):
        cij.err('rnr:Func: !case["fpath_orig"]: %r' % arg_3["fpath_orig"])
        return None

    arg_3["name"] = os.path.splitext(arg_3["fname"])[0]
    arg_3["ident"] = "/".join([arg_1["ident"], arg_3["fname"]])

    arg_3["res_root"] = os.sep.join([arg_1["res_root"], arg_3["fname"]])
    arg_3["aux_root"] = os.sep.join([arg_3["res_root"], "_aux"])
    arg_3["log_fpath"] = os.sep.join([arg_3["res_root"], "run.log"])

    arg_3["fpath"] = os.sep.join([arg_3["res_root"], arg_3["fname"]])

    arg_3["evars"].update(copy.deepcopy(arg_1["evars"]))

    # Initalize
    os.makedirs(arg_3["res_root"])                       # Create DIRS
    os.makedirs(arg_3["aux_root"])
    shutil.copyfile(arg_3["fpath_orig"], arg_3["fpath"])  # Copy testcase

    # Initialize hooks
    arg_3["hooks"] = hooks_setup(arg_0, arg_3, arg_1.get("hooks_pr_tcase"))

    return arg_3


def Func ( arg_0 ) : Func = [ ] for arg_2 in itertools . product ( * ( ( 0 , 1 ) , ) * arg_0 . dim ) : arg_2 = np . array ( arg_2 ) Func . append ( arg_0 . l + arg_2 * arg_0 . r ) return np . array ( Func )

def Func(arg_0):
        """
        Iterate the vector of all corners of the hyperrectangles

        >>> Tile(3, dim=2).corners
        array([[0, 0],
               [0, 3],
               [3, 0],
               [3, 3]])
        """
        Func = []
        for arg_2 in itertools.product(*((0,1),)*arg_0.dim):
            arg_2 = np.array(arg_2)
            Func.append(arg_0.l + arg_2*arg_0.r)
        return np.array(Func)


def Func(arg_0, arg_1, arg_2):
        """Register a fetcher class for an object class.

        :Parameters:
            - `object_class`: class to be retrieved by the fetcher.
            - `fetcher_class`: the fetcher class.
        :Types:
            - `object_class`: `classobj`
            - `fetcher_class`: `CacheFetcher` based class
        """
        arg_0._lock.acquire()
        try:
            arg_3 = arg_0._caches.get(arg_1)
            if not arg_3:
                arg_3 = Cache(arg_0.max_items, arg_0.default_freshness_period,
                        arg_0.default_expiration_period, arg_0.default_purge_period)
                arg_0._caches[arg_1] = arg_3
            arg_3.set_fetcher(arg_2)
        finally:
            arg_0._lock.release()

Register a fetcher class for an object class .


(self, _get_batch_method, options, is_feature_role=False)

def Func(arg_0, arg_1, arg_2, arg_3=False):
        """
        Assigns enterprise role to users.
        """
        arg_4 = arg_2['role']
        arg_5 = arg_2['batch_limit']
        arg_6 = arg_2['batch_sleep']
        arg_7 = arg_2['batch_offset']

        arg_8 = arg_7

        arg_9 = arg_1(
            arg_7,
            arg_7 + arg_5
        )

        arg_10 = SystemWideEnterpriseRole
        arg_11 = SystemWideEnterpriseUserRoleAssignment

        if arg_3:
            arg_10 = EnterpriseFeatureRole
            arg_11 = EnterpriseFeatureUserRoleAssignment

        arg_12 = arg_10.objects.get(name=arg_4)
        while arg_9.count() > 0:
            for arg_13, arg_14 in enumerate(arg_9):
                LOGGER.info(
                    'Processing user with index %s and id %s',
                    arg_8 + arg_13, arg_14.id
                )
                arg_11.objects.get_or_create(
                    arg_14=arg_14,
                    role=arg_12
                )

            sleep(arg_6)
            arg_8 += len(arg_9)
            arg_9 = arg_1(
                arg_8,
                arg_8 + arg_5
            )


def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
=
arg_0
.
unwrap_callback
(
arg_1
)
if
arg_2
is
:
return
arg_1
try
:
arg_4
,
arg_5
=
arg_0
.
serializer
.
unmarshallers
[
arg_2
]
except
KeyError
:
raise
LookupError
(
'no unmarshaller found for type "{}"'
.
format
(
arg_2
)
)
from
if
arg_4
is
not
:
arg_6
=
arg_4
.
__new__
(
arg_4
)
arg_5
(
arg_6
,
arg_3
)
return
arg_6
else
:
return
arg_5
(
arg_3
)

def Func(arg_0, arg_1):
        """Handle a dict that might contain a wrapped state for a custom type."""
        arg_2, arg_3 = arg_0.unwrap_callback(arg_1)
        if arg_2 is None:
            return arg_1

        try:
            arg_4, arg_5 = arg_0.serializer.unmarshallers[arg_2]
        except KeyError:
            raise LookupError('no unmarshaller found for type "{}"'.format(arg_2)) from None

        if arg_4 is not None:
            arg_6 = arg_4.__new__(arg_4)
            arg_5(arg_6, arg_3)
            return arg_6
        else:
            return arg_5(arg_3)

Handle a dict that might contain a wrapped state for a custom type .


(cls, x, y, z, formatter=numpy_formatter)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=arg_5):
        """Construct a contour generator from a curvilinear grid.

        Note
        ----
        This is an alias for the default constructor.

        Parameters
        ----------
        x : array_like
            x coordinates of each point in `z`.  Must be the same size as `z`.
        y : array_like
            y coordinates of each point in `z`.  Must be the same size as `z`.
        z : array_like
            The 2-dimensional curvilinear grid of data to compute
            contours for.  Masked arrays are supported.
        formatter : callable
            A conversion function to convert from the internal `Matplotlib`_
            contour format to an external format.  See :ref:`formatters` for
            more information.

        Returns
        -------
        : :class:`QuadContourGenerator`
            Initialized contour generator.

        """
        return arg_0(arg_1, arg_2, arg_3, arg_4)

Construct a contour generator from a curvilinear grid .


def Func(arg_0, arg_1):
        """
        Build an MACSignatureKeyInformation struct from a dictionary.

        Args:
            value (dict): A dictionary containing the key/value pairs for a
                MACSignatureKeyInformation struct.

        Returns:
            MACSignatureInformation: a MACSignatureKeyInformation struct

        Raises:
            TypeError: if the input argument is invalid
        """
        if arg_1 is None:
            return None
        if not isinstance(arg_1, dict):
            raise TypeError(
                "MAC/signature key information must be a dictionary."
            )

        arg_2 = arg_1.get('cryptographic_parameters')
        if arg_2:
            arg_2 = arg_0._build_cryptographic_parameters(
                arg_2
            )
        arg_3 = cobjects.MACSignatureKeyInformation(
            unique_identifier=arg_1.get('unique_identifier'),
            arg_2=arg_2
        )
        return arg_3

Build an MACSignatureKeyInformation struct from a dictionary .


def Func(arg_0, arg_1):
    # type: (Any, Any) -> Any
    '''Takes an object and an iterable and produces a new object that is
    a copy of the original with data from ``iterable`` reincorporated. It
    is intended as the inverse of the ``to_iter`` function. Any state in
    ``self`` that is not modelled by the iterable should remain unchanged.

    The following equality should hold for your definition:

    .. code-block:: python

        Func(self, to_iter(self)) == self

    This function is used by EachLens to synthesise states from iterables,
    allowing it to focus every element of an iterable state.

    The corresponding method call for this hook is
    ``obj._lens_Func(iterable)``.

    There is no default implementation.
    '''
    try:
        arg_0._lens_Func
    except AttributeError:
        arg_2 = 'Don\'t know how to create instance of {} from iterable'
        raise NotImplementedError(arg_2.format(type(arg_0)))
    else:
        return arg_0._lens_Func(arg_1)

Takes an object and an iterable and produces a new object that is
    a copy of the original with data from ``iterable`` reincorporated. It
    is intended as the inverse of the ``to_iter`` function. Any state in
    ``self`` that is not modelled by the iterable should remain unchanged.

    The following equality should hold for your definition:

    .. code-block:: python

        from_iter(self, to_iter(self)) == self

    This function is used by EachLens to synthesise states from iterables,
    allowing it to focus every element of an iterable state.

    The corresponding method call for this hook is
    ``obj._lens_from_iter(iterable)``.

    There is no default implementation.

Takes an object and an iterable and produces a new object that is a copy of the original with data from iterable reincorporated . It is intended as the inverse of the to_iter function . Any state in self that is not modelled by the iterable should remain unchanged .


def Func ( arg_0 , Func ) : if isinstance ( Func , File ) : Func = Func . filename os . link ( arg_0 . filename , Func )

def Func(arg_0, Func):
        """ Create hard link as link to this file """
        if isinstance(Func, File):
            Func = Func.filename
        os.link(arg_0.filename, Func)


(command_options="", return_std=False, stdout=None, stderr=None)

def Func(arg_0="", arg_1=False, arg_2=None, arg_3=None):
    """Run pylint from python

    ``command_options`` is a string containing ``pylint`` command line options;
    ``return_std`` (boolean) indicates return of created standard output
    and error (see below);
    ``stdout`` and ``stderr`` are 'file-like' objects in which standard output
    could be written.

    Calling agent is responsible for stdout/err management (creation, close).
    Default standard output and error are those from sys,
    or standalone ones (``subprocess.PIPE``) are used
    if they are not set and ``return_std``.

    If ``return_std`` is set to ``True``, this function returns a 2-uple
    containing standard output and error related to created process,
    as follows: ``(stdout, stderr)``.

    To silently run Pylint on a module, and get its standard output and error:
        >>> (pylint_stdout, pylint_stderr) = Func( 'module_name.py', True)
    """
    # Detect if we use Python as executable or not, else default to `python`
    arg_4 = sys.executable if "python" in sys.executable else "python"

    # Create command line to call pylint
    arg_5 = [arg_4, "-c", "from pylint import epylint;epylint.Run()"]
    arg_6 = shlex.split(arg_0, posix=not sys.platform.startswith("win"))
    arg_7 = arg_5 + arg_6

    # Providing standard output and/or error if not set
    if arg_2 is None:
        if arg_1:
            arg_2 = PIPE
        else:
            arg_2 = sys.stdout
    if arg_3 is None:
        if arg_1:
            arg_3 = PIPE
        else:
            arg_3 = sys.stderr
    # Call pylint in a subprocess
    arg_8 = Popen(
        arg_7,
        shell=False,
        arg_2=arg_2,
        arg_3=arg_3,
        env=_get_env(),
        universal_newlines=True,
    )
    arg_9, arg_10 = arg_8.communicate()
    # Return standard output and error
    if arg_1:
        return StringIO(arg_9), StringIO(arg_10)
    return None

Run pylint from python

    ``command_options`` is a string containing ``pylint`` command line options;
    ``return_std`` (boolean) indicates return of created standard output
    and error (see below);
    ``stdout`` and ``stderr`` are 'file-like' objects in which standard output
    could be written.

    Calling agent is responsible for stdout/err management (creation, close).
    Default standard output and error are those from sys,
    or standalone ones (``subprocess.PIPE``) are used
    if they are not set and ``return_std``.

    If ``return_std`` is set to ``True``, this function returns a 2-uple
    containing standard output and error related to created process,
    as follows: ``(stdout, stderr)``.

    To silently run Pylint on a module, and get its standard output and error:
        >>> (pylint_stdout, pylint_stderr) = py_run( 'module_name.py', True)


return rest_request('POST', 'files/', data=data)

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_1 = arg_0 . _build_effects ( arg_1 ) arg_2 = arg_2 or '' arg_3 = { 'source' : arg_0 . cdn_path ( arg_1 ) } if arg_2 : arg_3 [ 'store' ] = arg_2 return rest_request ( 'POST' , 'files/' , arg_3 = arg_3 )

def Func(arg_0, arg_1=None, arg_2=None):
        """Creates a Local File Copy on Uploadcare Storage.

        Args:
            - effects:
                Adds CDN image effects. If ``self.default_effects`` property
                is set effects will be combined with default effects.
            - store:
                If ``store`` option is set to False the copy of your file will
                be deleted in 24 hour period after the upload.
                Works only if `autostore` is enabled in the project.

        """
        arg_1 = arg_0._build_effects(arg_1)
        arg_2 = arg_2 or ''
        arg_3 = {
            'source': arg_0.cdn_path(arg_1)
        }
        if arg_2:
            arg_3['store'] = arg_2
        return rest_request('POST', 'files/', arg_3=arg_3)

Creates a Local File Copy on Uploadcare Storage .


def Func ( ) : arg_0 = errno ( ) try : arg_1 = os . strerror ( arg_0 ) except ( ValueError ) : return str_cls ( arg_0 ) if isinstance ( arg_1 , str_cls ) : return arg_1 return _try_decode ( arg_1 )

def Func():
    """
    Extracts the last OS error message into a python unicode string

    :return:
        A unicode string error message
    """

    arg_0 = errno()

    try:
        arg_1 = os.strerror(arg_0)
    except (ValueError):
        return str_cls(arg_0)

    if isinstance(arg_1, str_cls):
        return arg_1

    return _try_decode(arg_1)


def Func(arg_0, arg_1):
        """Execute action, add a new tile, update the score & return the reward."""

        arg_2 = np.rot90(arg_0._state, arg_1)
        arg_3 = arg_0._Func_left(arg_2)
        arg_0._state = np.rot90(arg_2, -arg_1)
        arg_0._score += arg_3

        arg_0.add_random_tile()

        return arg_3

Execute action add a new tile update the score & return the reward .


def Func ( arg_0 , arg_1 = ( ) ) : def add ( arg_2 ) : arg_3 . update ( str ( arg_2 ) . encode ( 'utf-8' ) ) arg_3 = hashlib . md5 ( ) for arg_4 in arg_0 . layers : add ( '{}{}{}' . format ( arg_4 . __class__ . __name__ , arg_4 . name , arg_4 . output_shape ) ) for arg_4 in arg_0 . losses : add ( '{}{}' . format ( arg_4 . __class__ . __name__ , arg_4 . weight ) ) for arg_5 in arg_1 : add ( '{}{}{}' . format ( arg_5 . __class__ . __name__ , arg_5 . weight , arg_5 . pattern ) ) return arg_3 . hexdigest ( )

def Func(arg_0, arg_1=()):
        '''Construct a string key for representing a computation graph.

        This key will be unique for a given (a) network topology, (b) set of
        losses, and (c) set of regularizers.

        Returns
        -------
        key : str
            A hash representing the computation graph for the current network.
        '''
        def add(arg_2):
            arg_3.update(str(arg_2).encode('utf-8'))
        arg_3 = hashlib.md5()
        for arg_4 in arg_0.layers:
            add('{}{}{}'.format(arg_4.__class__.__name__, arg_4.name, arg_4.output_shape))
        for arg_4 in arg_0.losses:
            add('{}{}'.format(arg_4.__class__.__name__, arg_4.weight))
        for arg_5 in arg_1:
            add('{}{}{}'.format(arg_5.__class__.__name__, arg_5.weight, arg_5.pattern))
        return arg_3.hexdigest()

Construct a string key for representing a computation graph .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
''
)
:
arg_3
=
find_source_lines
(
arg_1
)
if
arg_3
is
:
arg_0
.
noinfo
(
'file'
,
arg_2
)
return
arg_4
=
find_file
(
arg_1
)
if
arg_4
.
endswith
(
(
'.so'
,
'.dll'
,
'.pyd'
)
)
:
print
'File %r is binary, not printing.'
%
arg_4
elif
not
os
.
path
.
isfile
(
arg_4
)
:
print
'File %r does not exist, not printing.'
%
arg_4
else
:
page
.
page
(
arg_0
.
format
(
open
(
arg_4
)
.
read
(
)
)
,
arg_3
1
)

def Func(arg_0, arg_1, arg_2=''):
        """Show the whole file where an object was defined."""

        arg_3 = find_source_lines(arg_1)
        if arg_3 is None:
            arg_0.noinfo('file', arg_2)
            return

        arg_4 = find_file(arg_1)
        # run contents of file through pager starting at line where the object
        # is defined, as long as the file isn't binary and is actually on the
        # filesystem.
        if arg_4.endswith(('.so', '.dll', '.pyd')):
            print 'File %r is binary, not printing.' % arg_4
        elif not os.path.isfile(arg_4):
            print 'File %r does not exist, not printing.' % arg_4
        else:
            # Print only text files, not extension binaries.  Note that
            # getsourcelines returns lineno with 1-offset and page() uses
            # 0-offset, so we must adjust.
            page.page(arg_0.format(open(arg_4).read()), arg_3-1)

Show the whole file where an object was defined .


def Func ( arg_0 ) : arg_1 = set ( get_active_modules ( ) ) arg_1 . add ( arg_0 ) arg_2 = arg_3 . pathsep . join ( [ m . path for m in arg_1 ] ) arg_3 . environ [ 'CPENV_ACTIVE_MODULES' ] = str ( arg_2 )

def Func(arg_0):
    '''Add a module to CPENV_ACTIVE_MODULES environment variable'''

    arg_1 = set(get_active_modules())
    arg_1.add(arg_0)
    arg_2 = arg_3.pathsep.join([m.path for m in arg_1])
    arg_3.environ['CPENV_ACTIVE_MODULES'] = str(arg_2)


return self.redirect(request, *args, **kwargs)

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        Run some custom GET logic for Enterprise workflows before routing the user through existing views.

        In particular, before routing to existing views:
        - If the requested resource is a course, find the current course run for that course,
          and make that course run the requested resource instead.
        - Look to see whether a request is eligible for direct audit enrollment, and if so, directly enroll the user.
        """
        arg_4, arg_5, arg_6, arg_7 = RouterView.Func_path_variables(**arg_3)
        arg_8 = Func_enterprise_customer_or_404(arg_4)
        if arg_6:
            try:
                arg_5 = RouterView.Func_course_run_id(arg_1.user, arg_8, arg_6)
            except Http404:
                arg_9 = Func_global_context(arg_1, arg_8)
                arg_10 = 'ENTRV000'
                arg_11 = (
                    'Could not find course run with id {course_run_id} '
                    'for course key {course_key} and program_uuid {program_uuid} '
                    'for enterprise_customer_uuid {enterprise_customer_uuid} '
                    'Returned error code {error_code} to user {userid}'.format(
                        arg_6=arg_6,
                        arg_5=arg_5,
                        arg_4=arg_4,
                        arg_10=arg_10,
                        userid=arg_1.user.id,
                        arg_7=arg_7,
                    )
                )
                return render_page_with_error_code_message(arg_1, arg_9, arg_10, arg_11)
            arg_3['course_id'] = arg_5

        # Ensure that the link is saved to the database prior to making some call in a downstream view
        # which may need to know that the user belongs to an enterprise customer.
        with transaction.atomic():
            arg_12, arg_13 = EnterpriseCustomerUser.objects.Func_or_create(
                arg_8=arg_8,
                user_id=arg_1.user.id
            )
            arg_12.update_session(arg_1)

        # Directly enroll in audit mode if the request in question has full direct audit enrollment eligibility.
        arg_14 = arg_5 or arg_7
        if arg_0.eligible_for_direct_audit_enrollment(arg_1, arg_8, arg_14, arg_6):
            try:
                arg_12.enroll(arg_14, 'audit', cohort=arg_1.GET.Func('cohort', None))
                track_enrollment('direct-audit-enrollment', arg_1.user.id, arg_14, arg_1.Func_full_path())
            except (CourseEnrollmentDowngradeError, CourseEnrollmentPermissionError):
                pass
            # The courseware view logic will check for DSC requirements, and route to the DSC page if necessary.
            return redirect(LMS_COURSEWARE_URL.format(course_id=arg_14))

        return arg_0.redirect(arg_1, *arg_2, **arg_3)

Run some custom GET logic for Enterprise workflows before routing the user through existing views .