(
        root_dir, location, image_files, dirs, force_no_processing=False)

'            html, body {margin: 0;padding: 0;}'

'            .header {text-align: right;}'

'            .image {max-width: 100%; border-radius: 0.3em;}'

def Func(
        arg_0, arg_1, arg_2, arg_3, arg_4=False):
    """
    Create an index file in the given location, supplying known lists of
    present image files and subdirectories.
    @param {String} root_dir - The root directory of the entire crawl. Used to
        ascertain whether the given location is the top level.
    @param {String} location - The current directory of the crawl. The index
        file will be created here.
    @param {[String]} image_files - A list of image file names in the location.
        These will be displayed in the index file's gallery.
    @param {[String]} dirs - The subdirectories of the location directory.
        These will be displayed as links further down the file structure.
    @param {Boolean=False} force_no_processing - If True, do not attempt to
        actually process thumbnails, PIL images or anything. Simply index
         tags with original file src attributes.
    @return {String} The full path (location plus filename) of the newly
        created index file. Intended for usage cleaning up created files.
    """
    # Put together HTML as a list of the lines we'll want to include
    # Issue #2 exists to do this better than HTML in-code
    arg_5 = \
        'imageMe: ' + arg_1 + ' [' + str(len(arg_2)) + ' image(s)]'
    arg_6 = [
        '<!DOCTYPE html>',
        '',
        '    ',
        '        <title>imageMe</title>'
        '        ',
        '    ',
        '    ',
        '
',
        '
' + arg_5 + '
'
    ]
    # Populate the present subdirectories - this includes '..' unless we're at
    # the top level
    arg_7 = []
    if arg_0 != arg_1:
        arg_7 = ['..']
    arg_7 += arg_3
    if len(arg_7) > 0:
        arg_6.append('
')
    # For each subdirectory, include a link to its index file
    for arg_8 in arg_7:
        arg_9 = arg_8 + '/' + INDEX_FILE_NAME
        arg_6 += [
            '
',
            '    ' + arg_8 + '',
            '
'
        ]
    # Populate the image gallery table
    # Counter to cycle down through table rows
    arg_10 = 1
    arg_6 += ['
', '
']
    # For each image file, potentially create a new
 and create a new
    for arg_11 in arg_2:
        if arg_10 == 1:
            arg_6.append('
')
        arg_12 = _get_thumbnail_src_from_file(
            arg_1, arg_11, arg_4
        )
        arg_13 = _get_image_link_target_from_file(
            arg_1, arg_11, arg_4
        )
        arg_6 += [
            '    ',
            '    ',
            '        ',
            '    ',
            '    	'
        ]
        if arg_10 == IMAGES_PER_ROW:
            arg_10 = 0
            arg_6.append('
')
        arg_10 += 1
    arg_6 += ['
', '
']
    arg_6 += [
        '
',
        '    ',
        ''
    ]
    # Actually create the file, now we've put together the HTML content
    arg_14 = _get_index_file_path(arg_1)
    print('Creating index file %s' % arg_14)
    arg_15 = open(arg_14, 'w')
    arg_15.write('\n'.join(arg_6))
    arg_15.close()
    # Return the path for cleaning up later
    return arg_14

Create an index file in the given location, supplying known lists of
    present image files and subdirectories.
    @param {String} root_dir - The root directory of the entire crawl. Used to
        ascertain whether the given location is the top level.
    @param {String} location - The current directory of the crawl. The index
        file will be created here.
    @param {[String]} image_files - A list of image file names in the location.
        These will be displayed in the index file's gallery.
    @param {[String]} dirs - The subdirectories of the location directory.
        These will be displayed as links further down the file structure.
    @param {Boolean=False} force_no_processing - If True, do not attempt to
        actually process thumbnails, PIL images or anything. Simply index
        <img> tags with original file src attributes.
    @return {String} The full path (location plus filename) of the newly
        created index file. Intended for usage cleaning up created files.

Create an index file in the given location supplying known lists of present image files and subdirectories .


return Result(
            score=Score(
                scaled=course_grade.percent,
                raw=course_grade.percent * 100,
                min=MIN_SCORE,
                max=MAX_SCORE,
            ),
            success=course_grade.passed,
            completion=course_grade.passed
        )

def Func ( arg_0 , arg_1 ) : return Result ( score = Score ( scaled = arg_1 . percent , raw = arg_1 . percent * 100 , min = MIN_SCORE , max = MAX_SCORE , ) , success = arg_1 . passed , completion = arg_1 . passed )

def Func(arg_0, arg_1):
        """
        Get result for the statement.

        Arguments:
            course_grade (CourseGrade): Course grade.
        """
        return Result(
            score=Score(
                scaled=arg_1.percent,
                raw=arg_1.percent * 100,
                min=MIN_SCORE,
                max=MAX_SCORE,
            ),
            success=arg_1.passed,
            completion=arg_1.passed
        )


return sorted([s.name for s in
                       list(self.outgoing_sequence_flows_by_id.values())])

def Func ( arg_0 ) : return sorted ( [ arg_1 . name for arg_1 in list ( arg_0 . outgoing_sequence_flows_by_id . values ( ) ) ] )

def Func(arg_0):
        """
        Returns a list of the names of outgoing sequences. Some may be None.
        """
        return sorted([arg_1.name for arg_1 in
                       list(arg_0.outgoing_sequence_flows_by_id.values())])

Returns a list of the names of outgoing sequences . Some may be None .


def Func(arg_0, arg_1, arg_2, arg_3):
    r'''Calculates a property of a chemical in either the liquid or gas phase
    as a function of temperature only. This means that the property is
    either at 1 atm or along the saturation curve.

    Parameters
    ----------
    T : float
        Temperature of the fluid [K]
    CASRN : str
        CAS number of the fluid
    prop : str
        CoolProp string shortcut for desired property
    phase : str
        Either 'l' or 'g' for liquid or gas properties respectively

    Returns
    -------
    prop : float
        Desired chemical property, [units]

    Notes
    -----
    For liquids above their boiling point, the liquid property is found on the
    saturation line (at higher pressures). Under their boiling point, the
    property is calculated at 1 atm.

    No liquid calculations are permitted above the critical temperature.

    For gases under the chemical's boiling point, the gas property is found
    on the saturation line (at sub-atmospheric pressures). Above the boiling
    point, the property is calculated at 1 atm.

    An exception is raised if the desired CAS is not supported, or if CoolProp
    is not available.

    The list of strings acceptable as an input for property types is:
    http://www.coolprop.org/coolprop/HighLevelAPI.html#table-of-string-inputs-to-propssi-function

    Examples
    --------
    Water at STP according to IAPWS-95

    >>> Func(298.15, '7732-18-5', 'D', 'l')
    997.047636760347

    References
    ----------
    .. [1] Bell, Ian H., Jorrit Wronski, Sylvain Quoilin, and Vincent Lemort.
       "Pure and Pseudo-Pure Fluid Thermophysical Property Evaluation and the
       Open-Source Thermophysical Property Library CoolProp." Industrial &
       Engineering Chemistry Research 53, no. 6 (February 12, 2014):
       2498-2508. doi:10.1021/ie4033999. http://www.coolprop.org/
    '''
    if not has_CoolProp:  # pragma: no cover
        raise Exception('CoolProp library is not installed')
    if arg_1 not in coolprop_dict:
        raise Exception('CASRN not in list of supported fluids')
    arg_4 = coolprop_fluids[arg_1].Tc
    arg_0 = float(arg_0) # Do not allow custom objects here
    if arg_3 == 'l':
        if arg_0 > arg_4:
            raise Exception('For liquid properties, must be under the critical temperature.')
        if PhaseSI('T', arg_0, 'P', 101325, arg_1) in [u'liquid', u'supercritical_liquid']:
            return PropsSI(arg_2, 'T', arg_0, 'P', 101325, arg_1)
        else:
            return PropsSI(arg_2, 'T', arg_0, 'Q', 0, arg_1)
    elif arg_3 == 'g':
        if PhaseSI('T', arg_0, 'P', 101325, arg_1) == 'gas':
            return PropsSI(arg_2, 'T', arg_0, 'P', 101325, arg_1)
        else:
            if arg_0 < arg_4:
                return PropsSI(arg_2, 'T', arg_0, 'Q', 1, arg_1)
            else:
                # catch supercritical_gas and friends
                return PropsSI(arg_2, 'T', arg_0, 'P', 101325, arg_1)
    else:
        raise Exception('Error in CoolProp property function')

r'''Calculates a property of a chemical in either the liquid or gas phase
    as a function of temperature only. This means that the property is
    either at 1 atm or along the saturation curve.

    Parameters
    ----------
    T : float
        Temperature of the fluid [K]
    CASRN : str
        CAS number of the fluid
    prop : str
        CoolProp string shortcut for desired property
    phase : str
        Either 'l' or 'g' for liquid or gas properties respectively

    Returns
    -------
    prop : float
        Desired chemical property, [units]

    Notes
    -----
    For liquids above their boiling point, the liquid property is found on the
    saturation line (at higher pressures). Under their boiling point, the
    property is calculated at 1 atm.

    No liquid calculations are permitted above the critical temperature.

    For gases under the chemical's boiling point, the gas property is found
    on the saturation line (at sub-atmospheric pressures). Above the boiling
    point, the property is calculated at 1 atm.

    An exception is raised if the desired CAS is not supported, or if CoolProp
    is not available.

    The list of strings acceptable as an input for property types is:
    http://www.coolprop.org/coolprop/HighLevelAPI.html#table-of-string-inputs-to-propssi-function

    Examples
    --------
    Water at STP according to IAPWS-95

    >>> CoolProp_T_dependent_property(298.15, '7732-18-5', 'D', 'l')
    997.047636760347

    References
    ----------
    .. [1] Bell, Ian H., Jorrit Wronski, Sylvain Quoilin, and Vincent Lemort.
       "Pure and Pseudo-Pure Fluid Thermophysical Property Evaluation and the
       Open-Source Thermophysical Property Library CoolProp." Industrial &
       Engineering Chemistry Research 53, no. 6 (February 12, 2014):
       2498-2508. doi:10.1021/ie4033999. http://www.coolprop.org/

r Calculates a property of a chemical in either the liquid or gas phase as a function of temperature only . This means that the property is either at 1 atm or along the saturation curve .


def Func ( arg_0 ) : if arg_0 . success and arg_0 . transforms : with arg_0 . reconstruct_context ( ) as context : arg_1 = { result . step_output_data . output_name : arg_0 . _get_value ( context , result . step_output_data ) for result in arg_0 . transforms if result . is_successful_output } return arg_1 else : return None

def Func(arg_0):
        '''Return dictionary of transformed results, with keys being output names.
        Returns None if execution result isn't a success.

        Reconstructs the pipeline context to materialize values.
        '''
        if arg_0.success and arg_0.transforms:
            with arg_0.reconstruct_context() as context:
                arg_1 = {
                    result.step_output_data.output_name: arg_0._get_value(
                        context, result.step_output_data
                    )
                    for result in arg_0.transforms
                    if result.is_successful_output
                }
            return arg_1
        else:
            return None

Return dictionary of transformed results with keys being output names . Returns None if execution result isn t a success .


def
Func
(
arg_0
,
arg_1
=
True
)
:
if
nx
is
:
raise
ImportError
(
"Try installing NetworkX first."
)
if
arg_1
:
arg_2
=
nx
.
MultiDiGraph
(
)
else
:
arg_2
=
nx
.
MultiGraph
(
)
for
arg_3
in
arg_0
.
_results
.
graph
:
for
arg_4
in
arg_3
[
'nodes'
]
:
arg_5
=
copy
.
deepcopy
(
arg_4
[
'properties'
]
)
arg_5
[
'labels'
]
=
arg_4
[
'labels'
]
arg_2
.
add_node
(
arg_4
[
'id'
]
,
**
arg_5
)
for
arg_6
in
arg_3
[
'relationships'
]
:
arg_5
=
copy
.
deepcopy
(
arg_6
[
'properties'
]
)
arg_5
.
update
(
id
=
arg_6
[
'id'
]
,
type
=
arg_6
[
'type'
]
)
arg_2
.
add_edge
(
arg_6
[
'startNode'
]
,
arg_6
[
'endNode'
]
,
key
=
arg_6
.
get
(
'type'
)
,
**
arg_5
)
return
arg_2

def Func(arg_0, arg_1=True):
        """Returns a NetworkX multi-graph instance built from the result set

        :param directed: boolean, optional (default=`True`).
            Whether to create a direted or an undirected graph.
        """
        if nx is None:
            raise ImportError("Try installing NetworkX first.")
        if arg_1:
            arg_2 = nx.MultiDiGraph()
        else:
            arg_2 = nx.MultiGraph()
        for arg_3 in arg_0._results.graph:
            for arg_4 in arg_3['nodes']:
                arg_5 = copy.deepcopy(arg_4['properties'])
                arg_5['labels'] = arg_4['labels']
                arg_2.add_node(arg_4['id'], **arg_5)
            for arg_6 in arg_3['relationships']:
                arg_5 = copy.deepcopy(arg_6['properties'])
                arg_5.update(
                    id=arg_6['id'],
                    type=arg_6['type']
                )
                arg_2.add_edge(arg_6['startNode'], arg_6['endNode'],
                               key=arg_6.get('type'), **arg_5)
        return arg_2

Returns a NetworkX multi - graph instance built from the result set


(self, range_start=datetime.date.min, range_end=datetime.date.max, exclude_dates=tuple())

def Func ( arg_0 , arg_1 = arg_2 . date . min , arg_5 = arg_2 . date . max , arg_7 = arg_8 ( ) ) : arg_9 = arg_0 . timezone arg_10 = arg_0 . period arg_11 = arg_0 . weekdays arg_12 = arg_6 ( arg_1 , arg_0 . start_date ) arg_13 = arg_5 if arg_0 . end_date : arg_13 = arg_4 ( arg_13 , arg_0 . end_date ) while arg_12 <= arg_13 : if arg_12 . weekday ( ) in arg_11 and arg_12 not in arg_7 : yield Period ( arg_9 . localize ( arg_2 . datetime . combine ( arg_12 , arg_10 . start ) ) , arg_9 . localize ( arg_2 . datetime . combine ( arg_12 , arg_10 . end ) ) ) arg_12 += arg_2 . timedelta ( days = 1 )

def Func(arg_0, arg_1=arg_2.date.min, arg_5=arg_2.date.max, arg_7=arg_8()):
        """Returns an iterator of Period tuples for every day this schedule is in effect, between range_start
        and range_end."""
        arg_9 = arg_0.timezone
        arg_10 = arg_0.period
        arg_11 = arg_0.weekdays

        arg_12 = arg_6(arg_1, arg_0.start_date)
        arg_13 = arg_5
        if arg_0.end_date:
            arg_13 = arg_4(arg_13, arg_0.end_date)

        while arg_12 <= arg_13:
            if arg_12.weekday() in arg_11 and arg_12 not in arg_7:
                yield Period(
                    arg_9.localize(arg_2.datetime.combine(arg_12, arg_10.start)),
                    arg_9.localize(arg_2.datetime.combine(arg_12, arg_10.end))
                )
            arg_12 += arg_2.timedelta(days=1)

Returns an iterator of Period tuples for every day this schedule is in effect between range_start and range_end .


def Func(arg_0, arg_1):
        """Extracts the wildcards and file replacements from the `trajectory`"""
        arg_0.env_name = arg_1.v_environment_name
        arg_0.traj_name = arg_1.v_name
        arg_0.set_name =  arg_1.f_wildcard('$set')
        arg_0.run_name = arg_1.f_wildcard('$')

Extracts the wildcards and file replacements from the trajectory


def
Func
(
)
:
arg_0
=
options
.
get
(
'setup'
)
arg_1
=
options
.
get
(
'packages'
)
if
arg_0
else
if
arg_1
:
arg_2
=
[
x
for
x
in
arg_1
if
'.'
not
in
x
]
else
:
arg_2
=
[
'.'
]
arg_3
=
[
]
for
arg_4
in
arg_2
:
arg_3
+=
list
(
path
(
arg_4
)
.
walkfiles
(
)
)
arg_5
=
' '
.
join
(
arg_3
)
arg_6
=
options
.
paved
.
pycheck
.
Func
.
param
sh
(
'Func {param} {files} | tee Func.sc'
.
format
(
arg_6
=
arg_6
,
arg_5
=
arg_5
)
)

def Func():
    '''Print "Source Lines of Code" and export to file.

    Export is hudson_ plugin_ compatible: Func.sc

    requirements:
     - Func_ should be installed.
     - tee and pipes are used

    options.paved.pycheck.Func.param

    .. _Func: http://www.dwheeler.com/Func/
    .. _hudson: http://hudson-ci.org/
    .. _plugin: http://wiki.hudson-ci.org/display/HUDSON/SLOCCount+Plugin
    '''

    # filter out  subpackages
    arg_0 = options.get('setup')
    arg_1 = options.get('packages') if arg_0 else None

    if arg_1:
        arg_2 = [x for x in arg_1 if '.' not in x]
    else:
        arg_2 = ['.']

    # Func has strange behaviour with directories,
    # can cause exception in hudson Func plugin.
    # Better to call it with file list
    arg_3=[]
    for arg_4 in arg_2:
        arg_3 += list(path(arg_4).walkfiles())
    #ls=list(set(ls))
    arg_5=' '.join(arg_3)
    arg_6=options.paved.pycheck.Func.param
    sh('Func {param} {files} | tee Func.sc'.format(arg_6=arg_6, arg_5=arg_5))

Print "Source Lines of Code" and export to file.

    Export is hudson_ plugin_ compatible: sloccount.sc

    requirements:
     - sloccount_ should be installed.
     - tee and pipes are used

    options.paved.pycheck.sloccount.param

    .. _sloccount: http://www.dwheeler.com/sloccount/
    .. _hudson: http://hudson-ci.org/
    .. _plugin: http://wiki.hudson-ci.org/display/HUDSON/SLOCCount+Plugin

Print Source Lines of Code and export to file .


def Func(arg_0, arg_1):
        """
        Calculate the enthalpy of the package at the specified temperature.

        :param T: Temperature. [°C]

        :returns: Enthalpy. [kWh]
        """

        if arg_0.isCoal:
            return arg_0.Funcfr_coal(arg_1)

        arg_2 = 0.0
        for arg_3 in arg_0.material.compounds:
            arg_4 = arg_0.material.get_compound_index(arg_3)
            arg_5 = thermo.H(arg_3, arg_1, arg_0._compound_masses[arg_4])
            arg_2 = arg_2 + arg_5
        return arg_2

Calculate the enthalpy of the package at the specified temperature .


def Func(arg_0):
    """ Performs a single run of the experiment.

    :param kwargs: Dict of arguments

        traj: The trajectory containing all parameters set to the corresponding run index.

        runfunc: The user's job function

        runargs: The arguments handed to the user's job function (as *args)

        runkwargs: The keyword arguments handed to the user's job function (as **kwargs)

        clean_up_after_run: Whether to clean up after the run

        automatic_storing: Whether or not the data should be automatically stored

        result_queue: A queue object to store results into in case a pool is used, otherwise None

    :return:

        Results computed by the user's job function which are not stored into the trajectory.
        Returns a nested tuple of run index and result and run information:
        ``((traj.v_idx, result), run_information_dict)``

    """
    arg_1 = logging.getLogger('pypet')
    arg_2 = arg_0['traj']
    arg_3 = arg_0['runfunc']
    arg_4 = arg_0['runargs']
    arg_5 = arg_0['runkwargs']
    arg_6 = arg_0['clean_up_runs']
    arg_7 = arg_0['automatic_storing']
    arg_8 = arg_0['wrap_mode']

    arg_9 = arg_2.v_idx
    arg_10 = len(arg_2)

    arg_1.info('\n=========================================\n '
              'Starting single run #%d of %d '
              '\n=========================================\n' % (arg_9, arg_10))

    # Measure start time
    arg_2.f_start_run(turn_into_run=True)

    # Run the job function of the user
    arg_11 = arg_3(arg_2, *arg_4, **arg_5)

    # Store data if desired
    if arg_7:
        arg_2.f_store()

    # Add the index to the result and the run information
    if arg_8 == pypetconstants.WRAP_MODE_LOCAL:
        arg_11 = ((arg_2.v_idx, arg_11),
                   arg_2.f_get_run_information(arg_2.v_idx, copy=False),
                   arg_2.v_storage_service.references)
        arg_2.v_storage_service.free_references()
    else:
        arg_11 = ((arg_2.v_idx, arg_11),
                   arg_2.f_get_run_information(arg_2.v_idx, copy=False))

    # Measure time of finishing
    arg_2.f_finalize_run(store_meta_data=False,
                        clean_up=arg_6)

    arg_1.info('\n=========================================\n '
              'Finished single run #%d of %d '
              '\n=========================================\n' % (arg_9, arg_10))

    return arg_11

Performs a single run of the experiment .


def Func ( arg_0 ) : arg_1 = arg_0 . _split_into_chunks ( ) arg_2 = dict ( [ ( c . byte , c ) for c in arg_1 ] ) yield ( - 1 , arg_2 [ 0 ] . line ) for arg_3 in arg_1 : if not arg_3 . first : continue arg_4 = set ( ) arg_5 = [ arg_3 ] while arg_5 : arg_6 = arg_5 . pop ( ) arg_4 . add ( arg_6 ) for arg_7 in arg_6 . exits : if arg_7 < 0 : yield ( arg_3 . line , arg_7 ) else : arg_8 = arg_2 [ arg_7 ] if arg_8 in arg_4 : continue arg_9 = arg_8 . byte < arg_6 . byte if arg_8 . first or arg_9 : if arg_8 . line != arg_3 . line : yield ( arg_3 . line , arg_8 . line ) else : arg_5 . append ( arg_8 )

def Func(arg_0):
        """Find the executable arcs in the code.

        Yields pairs: (from,to).  From and to are integer line numbers.  If
        from is < 0, then the arc is an entrance into the code object.  If to
        is < 0, the arc is an exit from the code object.

        """
        arg_1 = arg_0._split_into_chunks()

        # A map from byte offsets to chunks jumped into.
        arg_2 = dict([(c.byte, c) for c in arg_1])

        # There's always an entrance at the first chunk.
        yield (-1, arg_2[0].line)

        # Traverse from the first chunk in each line, and yield arcs where
        # the trace function will be invoked.
        for arg_3 in arg_1:
            if not arg_3.first:
                continue

            arg_4 = set()
            arg_5 = [arg_3]
            while arg_5:
                # Get the chunk we're considering, and make sure we don't
                # consider it again
                arg_6 = arg_5.pop()
                arg_4.add(arg_6)

                # For each exit, add the line number if the trace function
                # would be triggered, or add the chunk to those being
                # considered if not.
                for arg_7 in arg_6.exits:
                    if arg_7 < 0:
                        yield (arg_3.line, arg_7)
                    else:
                        arg_8 = arg_2[arg_7]
                        if arg_8 in arg_4:
                            continue

                        # The trace function is invoked if visiting the first
                        # bytecode in a line, or if the transition is a
                        # backward jump.
                        arg_9 = arg_8.byte < arg_6.byte
                        if arg_8.first or arg_9:
                            if arg_8.line != arg_3.line:
                                yield (arg_3.line, arg_8.line)
                        else:
                            arg_5.append(arg_8)


def Func ( arg_0 ) : io . stdout . write ( arg_0 . shell . separate_out ) arg_1 = arg_0 . shell . prompt_manager . render ( 'out' ) if arg_0 . do_full_cache : io . stdout . write ( arg_1 )

def Func(arg_0):
        """Write the output prompt.

        The default implementation simply writes the prompt to
        ``io.stdout``.
        """
        # Use write, not print which adds an extra space.
        io.stdout.write(arg_0.shell.separate_out)
        arg_1 = arg_0.shell.prompt_manager.render('out')
        if arg_0.do_full_cache:
            io.stdout.write(arg_1)


def Func ( arg_0 , arg_1 = '\n' , arg_2 = None ) : for arg_3 in arg_0 : pfprint ( arg_3 , arg_1 = arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1='\n', arg_2=None):
    """Prints each item from an iterable.

    :param iterable: An iterable yielding values to print
    :param end: String to append to the end of printed output
    :param file: File to which output is printed
    :rtype: None

    Example::

        >>> @pointfree
        ... def prefix_all(prefix, iterable):
        ...     for item in iterable:
        ...         yield "%s%s" % (prefix, item)

        >>> fn = prefix_all("An item: ") >> Func

        >>> fn(["foo", "bar", "baz"])
        An item: foo
        An item: bar
        An item: baz

    """

    for arg_3 in arg_0:
        pfprint(arg_3, arg_1=arg_1, arg_2=arg_2)

Prints each item from an iterable.

    :param iterable: An iterable yielding values to print
    :param end: String to append to the end of printed output
    :param file: File to which output is printed
    :rtype: None

    Example::

        >>> @pointfree
        ... def prefix_all(prefix, iterable):
        ...     for item in iterable:
        ...         yield "%s%s" % (prefix, item)

        >>> fn = prefix_all("An item: ") >> pfprint_all

        >>> fn(["foo", "bar", "baz"])
        An item: foo
        An item: bar
        An item: baz


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
_kernels
.
get
(
arg_1
)
if
arg_2
is
not
:
return
arg_2
else
:
raise
KeyError
(
"Kernel with id not found: %s"
%
arg_1
)

def Func(arg_0, arg_1):
        """Get the single KernelManager object for a kernel by its uuid.

        Parameters
        ==========
        kernel_id : uuid
            The id of the kernel.
        """
        arg_2 = arg_0._kernels.get(arg_1)
        if arg_2 is not None:
            return arg_2
        else:
            raise KeyError("Kernel with id not found: %s" % arg_1)

Get the single KernelManager object for a kernel by its uuid .


def Func ( arg_0 ) : if arg_0 . templates . get ( "Func" ) and not arg_0 . _updated ( "/itemFields" , arg_0 . templates [ "Func" ] , "Func" ) : return arg_0 . templates [ "Func" ] [ "tmplt" ] arg_1 = "/itemFields" arg_2 = arg_0 . _retrieve_data ( arg_1 ) return arg_0 . _cache ( arg_2 , "Func" )

def Func(arg_0):
        """ Get all available item fields
        """
        # Check for a valid cached version
        if arg_0.templates.get("Func") and not arg_0._updated(
            "/itemFields", arg_0.templates["Func"], "Func"
        ):
            return arg_0.templates["Func"]["tmplt"]
        arg_1 = "/itemFields"
        # otherwise perform a normal request and cache the response
        arg_2 = arg_0._retrieve_data(arg_1)
        return arg_0._cache(arg_2, "Func")


def Func(arg_0, arg_1, arg_2):
        """ Styles a node """

        arg_1.set_shape(arg_2.shape)
        arg_1.set_fixedsize(str(arg_2.fixed_size))
        arg_1.set_width(str(arg_2.width))
        arg_1.set_height(str(arg_2.height))
        arg_1.set_color(rgba2hex(arg_2.color_))
        arg_1.set_fillcolor(
            rgba2hex(arg_2.fill_color_)
        )
        for arg_3 in arg_2.style:
            logger.debug("Setting node style: %s" % arg_3)
            arg_1.set_style(arg_3)

        return arg_1


return _operation(wave, "acos", "rad", np.arccos)

def
Func
(
arg_0
)
:
pexdoc
.
exh
.
addex
(
ValueError
,
"Math domain error"
,
bool
(
(
min
(
arg_0
.
_dep_vector
)
<
1
)
or
(
max
(
arg_0
.
_dep_vector
)
>
1
)
)
,
)
return
_operation
(
arg_0
,
"Func"
,
"rad"
,
np
.
arccos
)

def Func(arg_0):
    r"""
    Return the arc cosine of a waveform's dependent variable vector.

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

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

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

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

     * ValueError (Math domain error)

    .. [[[end]]]
    """
    pexdoc.exh.addex(
        ValueError,
        "Math domain error",
        bool((min(arg_0._dep_vector) < -1) or (max(arg_0._dep_vector) > 1)),
    )
    return _operation(arg_0, "Func", "rad", np.arccos)

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

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

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

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

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

     * ValueError (Math domain error)

    .. [[[end]]]

r Return the arc cosine of a waveform s dependent variable vector .


def Func ( arg_0 ) : arg_1 = super ( ManageLearnersForm , arg_0 ) . Func ( ) arg_2 = arg_0 . data . get ( arg_0 . Fields . EMAIL_OR_USERNAME , None ) arg_3 = arg_0 . files . get ( arg_0 . Fields . BULK_UPLOAD , None ) if not arg_2 and not arg_3 : raise ValidationError ( ValidationMessages . NO_FIELDS_SPECIFIED ) if arg_2 and arg_3 : raise ValidationError ( ValidationMessages . BOTH_FIELDS_SPECIFIED ) if arg_2 : arg_4 = arg_0 . Modes . MODE_SINGULAR else : arg_4 = arg_0 . Modes . MODE_BULK arg_1 [ arg_0 . Fields . MODE ] = arg_4 arg_1 [ arg_0 . Fields . NOTIFY ] = arg_0 . Func_notify ( ) arg_0 . _validate_course ( ) arg_0 . _validate_program ( ) if arg_0 . data . get ( arg_0 . Fields . PROGRAM , None ) and arg_0 . data . get ( arg_0 . Fields . COURSE , None ) : raise ValidationError ( ValidationMessages . COURSE_AND_PROGRAM_ERROR ) return arg_1

def Func(arg_0):
        """
        Clean fields that depend on each other.

        In this case, the form can be used to link single user or bulk link multiple users. These are mutually
        exclusive modes, so this method checks that only one field is passed.
        """
        arg_1 = super(ManageLearnersForm, arg_0).Func()

        # Here we take values from `data` (and not `Funced_data`) as we need raw values - field Func methods
        # might "invalidate" the value and set it to None, while all we care here is if it was provided at all or not
        arg_2 = arg_0.data.get(arg_0.Fields.EMAIL_OR_USERNAME, None)
        arg_3 = arg_0.files.get(arg_0.Fields.BULK_UPLOAD, None)

        if not arg_2 and not arg_3:
            raise ValidationError(ValidationMessages.NO_FIELDS_SPECIFIED)

        if arg_2 and arg_3:
            raise ValidationError(ValidationMessages.BOTH_FIELDS_SPECIFIED)

        if arg_2:
            arg_4 = arg_0.Modes.MODE_SINGULAR
        else:
            arg_4 = arg_0.Modes.MODE_BULK

        arg_1[arg_0.Fields.MODE] = arg_4
        arg_1[arg_0.Fields.NOTIFY] = arg_0.Func_notify()

        arg_0._validate_course()
        arg_0._validate_program()

        if arg_0.data.get(arg_0.Fields.PROGRAM, None) and arg_0.data.get(arg_0.Fields.COURSE, None):
            raise ValidationError(ValidationMessages.COURSE_AND_PROGRAM_ERROR)

        return arg_1

Clean fields that depend on each other .


def Func ( arg_0 , arg_1 : arg_2 ) -> None : if arg_1 is None : arg_0 . _Func = NullTelemetryClient ( ) else : arg_0 . _Func = arg_1

def Func(arg_0, arg_1: arg_2) -> None:
        """
        Sets the telemetry client for logging events.
        """
        if arg_1 is None:
            arg_0._Func = NullTelemetryClient()
        else:
            arg_0._Func = arg_1

Sets the telemetry client for logging events .


return f1_score(np.array(y_true), np.array(predictions), average="macro")

def Func ( arg_0 , arg_1 ) : try : arg_2 = [ np . round ( x ) for x in arg_1 ] except TypeError : arg_2 = arg_1 return f1_score ( np . array ( arg_0 ) , np . array ( arg_2 ) , average = "macro" )

def Func(arg_0, arg_1):
    """
    Calculates F1 macro measure.

    Args:
        y_true: list of true values
        y_predicted: list of predicted values

    Returns:
        F1 score
    """
    try:
        arg_2 = [np.round(x) for x in arg_1]
    except TypeError:
        arg_2 = arg_1

    return f1_score(np.array(arg_0), np.array(arg_2), average="macro")


def
Func
(
arg_0
,
*
arg_1
)
:
if
not
arg_1
:
raise
SyntaxError
(
'cannot case empty pattern.'
)
return
arg_0
.
Func_args
(
arg_0
.
_value
,
arg_1
)

def Func(arg_0, *arg_1):
        """
        Indicate whether or not to enter a case suite.

        usage:

        ``` py
        for case in switch(value):
            if case('A'):
                pass
            elif case(1, 3):
                pass # for mulit-Func.
            else:
                pass # for default.
        ```
        """
        if not arg_1:
            raise SyntaxError('cannot case empty pattern.')

        return arg_0.Func_args(arg_0._value, arg_1)

Indicate whether or not to enter a case suite.

        usage:

        ``` py
        for case in switch(value):
            if case('A'):
                pass
            elif case(1, 3):
                pass # for mulit-match.
            else:
                pass # for default.
        ```

Indicate whether or not to enter a case suite .


def Func ( arg_0 , arg_1 ) : if ( arg_0 . maxsize < 1 ) or ( len ( arg_0 . events ) < arg_0 . maxsize ) : arg_0 . events . extend ( arg_1 )

def Func(arg_0, arg_1):
        """Receives a list of events and transmits them to Riemann

        Arguments:
        events -- list of `tensor.objects.Event`
        """
        # Make sure queue isn't oversized
        if (arg_0.maxsize < 1) or (len(arg_0.events) < arg_0.maxsize):
            arg_0.events.extend(arg_1)


return build_versatileimagefield_url_set(
            value,
            self.sizes,
            request=context_request
        )

def Func ( arg_0 , arg_1 ) : arg_2 = None if arg_0 . context : arg_2 = arg_0 . context . get ( 'request' , None ) return build_versatileimagefield_url_set ( arg_1 , arg_0 . sizes , request = arg_2 )

def Func(arg_0, arg_1):
        """For djangorestframework <=2.3.14"""
        arg_2 = None
        if arg_0.context:
            arg_2 = arg_0.context.get('request', None)
        return build_versatileimagefield_url_set(
            arg_1,
            arg_0.sizes,
            request=arg_2
        )


return DummyData(calendar, stop_times, trips, frequencies)

def Func(arg_0, arg_1):
    """Create `calendar`, `stop_times`, `trips` and `shapes`.

    :return: DummyData namedtuple
    """
    # Build stops per route auxiliary map
    arg_2 = defaultdict(lambda: [])
    arg_3 = {}
    for arg_4 in arg_1:
        if not arg_4.route_id:
            continue
        arg_2[arg_4.route_id].append(arg_4)
        arg_3[arg_4.stop_id] = arg_4

    arg_6 = _create_dummy_calendar()

    arg_7 = \
        _create_dummy_trips(
            arg_0,
            arg_2,
            arg_6)

    arg_8 = _create_dummy_stoptimes(arg_7, arg_2)
    arg_9 = _create_dummy_frequencies(arg_7)

    return DummyData(arg_6, arg_8, arg_7, arg_9)

Create calendar stop_times trips and shapes .


def Func(arg_0, arg_1=0):  # HangSheng: return tensor for sequence length, if input is tf.string
    """Return tensor for sequence length, if input is ``tf.string``."""
    arg_2 = arg_0.get_shape().ndims
    if arg_2 == 3:
        return tf.reduce_sum(tf.cast(tf.reduce_any(tf.not_equal(arg_0, arg_1), axis=2), dtype=tf.int32), 1)
    elif arg_2 == 2:
        return tf.reduce_sum(tf.cast(tf.not_equal(arg_0, arg_1), dtype=tf.int32), 1)
    elif arg_2 == 1:
        raise ValueError("Func: data has wrong shape!")
    else:
        raise ValueError(
            "Func: handling data_shape_size %s hasn't been implemented!" % (arg_2)
        )

Return tensor for sequence length if input is tf . string .


def Func(arg_0=None, arg_1=None, arg_2=True):
    """Specify how the return value of this function should be handled.

    Args:
        desc (str): A deprecated description of the return value
        printer (callable): A callable function that can format this return value
        data (bool): A deprecated parameter for specifying that this function
            Func data.
    """

    if arg_2 is False:
        raise ArgumentError("Specifying non data return type in Func is no longer supported")

    def _Func(arg_3):
        annotated(arg_3)
        arg_3.custom_returnvalue(arg_1, arg_0)
        return arg_3

    return _Func

Specify how the return value of this function should be handled.

    Args:
        desc (str): A deprecated description of the return value
        printer (callable): A callable function that can format this return value
        data (bool): A deprecated parameter for specifying that this function
            returns data.

Specify how the return value of this function should be handled .


def
Func
(
arg_0
)
->
Version
:
arg_0
.
_reset
(
)
if
arg_0
.
_received_version
is
:
arg_0
.
_send
(
'(get-info :version)'
)
arg_0
.
_received_version
=
arg_0
.
_recv
(
)
arg_2
,
arg_3
=
shlex
.
split
(
arg_0
.
_received_version
[
1
:
1
]
)
return
Version
(
*
map
(
int
,
arg_3
.
split
(
'.'
)
)
)

def Func(arg_0) -> Version:
        """
        If we fail to parse the version, we assume z3's output has changed, meaning it's a newer
        version than what's used now, and therefore ok.

        Anticipated version_cmd_output format: 'Z3 version 4.4.2'
                                               'Z3 version 4.4.5 - 64 bit - build hashcode $Z3GITHASH'
        """
        arg_0._reset()
        if arg_0._received_version is None:
            arg_0._send('(get-info :version)')
            arg_0._received_version = arg_0._recv()
        arg_2, arg_3 = shlex.split(arg_0._received_version[1:-1])
        return Version(*map(int, arg_3.split('.')))

If we fail to parse the version we assume z3 s output has changed meaning it s a newer version than what s used now and therefore ok .


(self, start_date=None, end_date=None, limit=None)

return query[0:limit].execute() if limit else query.scan()

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_4 = Search ( using = arg_0 . client , index = arg_0 . aggregation_alias , doc_type = arg_0 . bookmark_doc_type ) . sort ( { 'date' : { 'order' : 'desc' } } ) arg_5 = { } if arg_1 : arg_5 [ 'gte' ] = arg_0 . _format_range_dt ( arg_1 . replace ( microsecond = 0 ) ) if arg_2 : arg_5 [ 'lte' ] = arg_0 . _format_range_dt ( arg_2 . replace ( microsecond = 0 ) ) if arg_5 : arg_4 = arg_4 . filter ( 'range' , date = arg_5 ) return arg_4 [ 0 : arg_3 ] . execute ( ) if arg_3 else arg_4 . scan ( )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """List the aggregation's bookmarks."""
        arg_4 = Search(
            using=arg_0.client,
            index=arg_0.aggregation_alias,
            doc_type=arg_0.bookmark_doc_type
        ).sort({'date': {'order': 'desc'}})

        arg_5 = {}
        if arg_1:
            arg_5['gte'] = arg_0._format_range_dt(
                arg_1.replace(microsecond=0))
        if arg_2:
            arg_5['lte'] = arg_0._format_range_dt(
                arg_2.replace(microsecond=0))
        if arg_5:
            arg_4 = arg_4.filter('range', date=arg_5)

        return arg_4[0:arg_3].execute() if arg_3 else arg_4.scan()


def Func ( arg_0 , arg_1 ) : for arg_2 in ( 'next' , 'previous' ) : if not arg_1 . get ( arg_2 ) : continue arg_3 = re . search ( r'page=(?P<num>[\d]+)' , arg_1 [ arg_2 ] ) if arg_3 is None and arg_2 == 'previous' : arg_1 [ arg_2 ] = 1 continue arg_1 [ arg_2 ] = int ( arg_3 . groupdict ( ) [ 'num' ] )

def Func(arg_0, arg_1):
        """
        Convert next and previous from URLs to integers
        """
        for arg_2 in ('next', 'previous'):
            if not arg_1.get(arg_2):
                continue
            arg_3 = re.search(r'page=(?P<num>[\d]+)', arg_1[arg_2])
            if arg_3 is None and arg_2 == 'previous':
                arg_1[arg_2] = 1
                continue
            arg_1[arg_2] = int(arg_3.groupdict()['num'])


def Func(arg_0, arg_1, arg_2=None):
    """Scaling bboxes w.r.t the box center.

    Args:
        bboxes (ndarray): Shape(..., 4).
        scale (float): Scaling factor.
        clip_shape (tuple, optional): If specified, bboxes that exceed the
            boundary will be clipped according to the given shape (h, w).

    Returns:
        ndarray: Scaled bboxes.
    """
    if float(arg_1) == 1.0:
        arg_3 = arg_0.copy()
    else:
        arg_4 = arg_0[..., 2] - arg_0[..., 0] + 1
        arg_5 = arg_0[..., 3] - arg_0[..., 1] + 1
        arg_6 = (arg_4 * (arg_1 - 1)) * 0.5
        arg_7 = (arg_5 * (arg_1 - 1)) * 0.5
        arg_3 = arg_0 + np.stack((-arg_6, -arg_7, arg_6, arg_7), axis=-1)
    if arg_2 is not None:
        return bbox_clip(arg_3, arg_2)
    else:
        return arg_3

Scaling bboxes w . r . t the box center .


(self, start, end, use_shapes=True, filter_name=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
True
,
arg_4
=
)
:
arg_5
=
[
]
arg_6
=
arg_0
.
get_tripIs_active_in_range
(
arg_1
,
arg_2
)
print
(
"gtfs_viz.py: fetched "
+
str
(
len
(
arg_6
)
)
+
" trip ids"
)
arg_7
=
{
}
for
arg_8
in
arg_6
.
itertuples
(
)
:
arg_9
=
arg_8
.
trip_I
arg_10
=
arg_8
.
day_start_ut
arg_11
=
arg_8
.
shape_id
arg_12
=
{
}
arg_13
,
arg_14
=
arg_0
.
get_route_name_and_type_of_tripI
(
arg_9
)
arg_12
[
'route_type'
]
=
int
(
arg_14
)
arg_12
[
'name'
]
=
str
(
arg_13
)
if
arg_4
and
(
arg_13
!=
arg_4
)
:
continue
arg_15
=
[
]
arg_16
=
[
]
arg_17
=
[
]
arg_18
=
[
]
arg_19
=
[
]
arg_20
=
arg_0
.
get_trip_stop_time_data
(
arg_9
,
arg_10
)
for
arg_21
in
arg_20
.
itertuples
(
)
:
arg_15
.
append
(
float
(
arg_21
.
lat
)
)
arg_16
.
append
(
float
(
arg_21
.
lon
)
)
arg_17
.
append
(
float
(
arg_21
.
dep_time_ut
)
)
try
:
arg_19
.
append
(
int
(
arg_21
.
seq
)
)
except
TypeError
:
arg_19
.
append
(
)
if
arg_3
:
try
:
arg_18
.
append
(
int
(
arg_21
.
shape_break
)
)
except
(
TypeError
,
ValueError
)
:
arg_18
.
append
(
)
if
arg_3
:
if
arg_11
not
in
arg_7
:
arg_7
[
arg_11
]
=
shapes
.
get_shape_points2
(
arg_0
.
conn
.
cursor
(
)
,
arg_11
)
arg_22
=
arg_7
[
arg_11
]
try
:
arg_12
[
'times'
]
=
shapes
.
interpolate_shape_times
(
arg_22
[
'd'
]
,
arg_18
,
arg_17
)
arg_12
[
'lats'
]
=
arg_22
[
'lats'
]
arg_12
[
'lons'
]
=
arg_22
[
'lons'
]
arg_23
=
arg_18
[
0
]
arg_24
=
arg_18
[
1
]
arg_12
[
'times'
]
=
arg_12
[
'times'
]
[
arg_23
:
arg_24
+
1
]
arg_12
[
'lats'
]
=
arg_12
[
'lats'
]
[
arg_23
:
arg_24
+
1
]
arg_12
[
'lons'
]
=
arg_12
[
'lons'
]
[
arg_23
:
arg_24
+
1
]
except
:
arg_12
[
'times'
]
=
arg_17
arg_12
[
'lats'
]
=
arg_15
arg_12
[
'lons'
]
=
arg_16
else
:
arg_12
[
'times'
]
=
arg_17
arg_12
[
'lats'
]
=
arg_15
arg_12
[
'lons'
]
=
arg_16
arg_5
.
append
(
arg_12
)
return
{
"trips"
:
arg_5
}

def Func(arg_0, arg_1, arg_2, arg_3=True, arg_4=None):
        """
        Get complete trip data for visualizing public transport operation based on gtfs.

        Parameters
        ----------
        start: number
            Earliest position data to return (in unix time)
        end: number
            Latest position data to return (in unix time)
        use_shapes: bool, optional
            Whether or not shapes should be included
        filter_name: str
            Pick only routes having this name.

        Returns
        -------
        trips: dict
            trips['trips'] is a list whose each element (e.g. el = trips['trips'][0])
            is a dict with the following properties:
                el['lats'] -- list of latitudes
                el['lons'] -- list of longitudes
                el['times'] -- list of passage_times
                el['route_type'] -- type of vehicle as specified by GTFS
                el['name'] -- name of the route
        """
        arg_5 = []
        arg_6 = arg_0.get_tripIs_active_in_range(arg_1, arg_2)
        print("gtfs_viz.py: fetched " + str(len(arg_6)) + " trip ids")
        arg_7 = {}

        # loop over all trips:
        for arg_8 in arg_6.itertuples():
            arg_9 = arg_8.trip_I
            arg_10 = arg_8.day_start_ut
            arg_11 = arg_8.shape_id

            arg_12 = {}

            arg_13, arg_14 = arg_0.get_route_name_and_type_of_tripI(arg_9)
            arg_12['route_type'] = int(arg_14)
            arg_12['name'] = str(arg_13)

            if arg_4 and (arg_13 != arg_4):
                continue

            arg_15 = []
            arg_16 = []
            arg_17 = []
            arg_18 = []
            arg_19 = []

            # get stop_data and store it:
            arg_20 = arg_0.get_trip_stop_time_data(arg_9, arg_10)
            for arg_21 in arg_20.itertuples():
                arg_15.append(float(arg_21.lat))
                arg_16.append(float(arg_21.lon))
                arg_17.append(float(arg_21.dep_time_ut))
                try:
                    arg_19.append(int(arg_21.seq))
                except TypeError:
                    arg_19.append(None)
                if arg_3:
                    try:
                        arg_18.append(int(arg_21.shape_break))
                    except (TypeError, ValueError):
                        arg_18.append(None)

            if arg_3:
                # get shape data (from cache, if possible)
                if arg_11 not in arg_7:
                    arg_7[arg_11] = shapes.get_shape_points2(arg_0.conn.cursor(), arg_11)
                arg_22 = arg_7[arg_11]
                # noinspection PyBroadException
                try:
                    arg_12['times'] = shapes.interpolate_shape_times(arg_22['d'], arg_18, arg_17)
                    arg_12['lats'] = arg_22['lats']
                    arg_12['lons'] = arg_22['lons']
                    arg_23 = arg_18[0]
                    arg_24 = arg_18[-1]
                    arg_12['times'] = arg_12['times'][arg_23:arg_24 + 1]
                    arg_12['lats'] = arg_12['lats'][arg_23:arg_24 + 1]
                    arg_12['lons'] = arg_12['lons'][arg_23:arg_24 + 1]
                except:
                    # In case interpolation fails:
                    arg_12['times'] = arg_17
                    arg_12['lats'] = arg_15
                    arg_12['lons'] = arg_16
            else:
                arg_12['times'] = arg_17
                arg_12['lats'] = arg_15
                arg_12['lons'] = arg_16
            arg_5.append(arg_12)
        return {"trips": arg_5}

Get complete trip data for visualizing public transport operation based on gtfs .


def Func(arg_0, arg_1=False):
        """Create a .pid file in the pid_dir with my pid.

        This must be called after pre_construct, which sets `self.pid_dir`.
        This raises :exc:`PIDFileError` if the pid file exists already.
        """
        arg_2 = os.path.join(arg_0.profile_dir.pid_dir, arg_0.name + u'.pid')
        if os.path.isfile(arg_2):
            arg_3 = arg_0.get_pid_from_file()
            if not arg_1:
                raise PIDFileError(
                    'The pid file [%s] already exists. \nThis could mean that this '
                    'server is already running with [pid=%s].' % (arg_2, arg_3)
                )
        with open(arg_2, 'w') as f:
            arg_0.log.info("Creating pid file: %s" % arg_2)
            f.write(repr(os.getpid())+'\n')

Create a . pid file in the pid_dir with my pid .


def Func ( arg_0 ) : arg_1 = None arg_2 = inspect . getabsfile ( inspect . currentframe ( ) ) for arg_3 , arg_4 , arg_5 in arg_0 . lines : arg_6 = os . path . abspath ( arg_3 ) if not arg_1 : arg_1 = [ arg_6 , arg_4 , arg_5 ] else : if ( not check_standard_dir ( arg_3 ) and arg_6 != arg_2 ) : yield arg_1 arg_1 = [ arg_6 , arg_4 , arg_5 ] else : arg_1 [ 2 ] += arg_5 yield arg_1

def Func(arg_0):
        """Filters code from standard library from self.lines."""
        arg_1 = None
        arg_2 = inspect.getabsfile(inspect.currentframe())
        for arg_3, arg_4, arg_5 in arg_0.lines:
            arg_6 = os.path.abspath(arg_3)
            if not arg_1:
                arg_1 = [arg_6, arg_4, arg_5]
            else:
                if (not check_standard_dir(arg_3) and
                        arg_6 != arg_2):
                    yield arg_1
                    arg_1 = [arg_6, arg_4, arg_5]
                else:
                    arg_1[2] += arg_5
        yield arg_1

Filters code from standard library from self . lines .


def Func ( arg_0 , arg_1 ) : if arg_1 is not None : def minus ( arg_2 , arg_3 ) : return arg_2 - arg_3 return arg_0 . map_function ( minus , arg_1 )

def Func(arg_0, arg_1):
    """For a deflection stack, comput a new grid stack but subtracting the deflections"""

    if arg_1 is not None:
        def minus(arg_2, arg_3):
            return arg_2 - arg_3

        return arg_0.map_function(minus, arg_1)

For a deflection stack comput a new grid stack but subtracting the deflections


def Func ( arg_0 ) : if arg_0 . _filename : with open ( arg_0 . _filename ) as ifile : arg_0 . _data = ifile . read ( ) with QasmParser ( arg_0 . _filename ) as qasm_p : qasm_p . Func_debug ( False ) return qasm_p . Func ( arg_0 . _data )

def Func(arg_0):
        """Parse the data."""
        if arg_0._filename:
            with open(arg_0._filename) as ifile:
                arg_0._data = ifile.read()

        with QasmParser(arg_0._filename) as qasm_p:
            qasm_p.Func_debug(False)
            return qasm_p.Func(arg_0._data)


(filename, scope, redirect_uri=None,
                            message=None, cache=None, login_hint=None,
                            device_uri=None, pkce=None, code_verifier=None,
                            prompt=None)

def Func(arg_0, arg_1, arg_2=None,
                            arg_3=None, arg_4=None, arg_5=None,
                            arg_6=None, arg_7=None, arg_8=None,
                            arg_9=None):
    """Create a Flow from a clientsecrets file.

    Will create the right kind of Flow based on the contents of the
    clientsecrets file or will raise InvalidClientSecretsError for unknown
    types of Flows.

    Args:
        filename: string, File name of client secrets.
        scope: string or iterable of strings, scope(s) to request.
        redirect_uri: string, Either the string 'urn:ietf:wg:oauth:2.0:oob' for
                      a non-web-based application, or a URI that handles the
                      callback from the authorization server.
        message: string, A friendly string to display to the user if the
                 clientsecrets file is missing or invalid. If message is
                 provided then sys.exit will be called in the case of an error.
                 If message in not provided then
                 clientsecrets.InvalidClientSecretsError will be raised.
        cache: An optional cache service client that implements get() and set()
               methods. See clientsecrets.loadfile() for details.
        login_hint: string, Either an email address or domain. Passing this
                    hint will either pre-fill the email box on the sign-in form
                    or select the proper multi-login session, thereby
                    simplifying the login flow.
        device_uri: string, URI for device authorization endpoint. For
                    convenience defaults to Google's endpoints but any
                    OAuth 2.0 provider can be used.

    Returns:
        A Flow object.

    Raises:
        UnknownClientSecretsFlowError: if the file describes an unknown kind of
                                       Flow.
        clientsecrets.InvalidClientSecretsError: if the clientsecrets file is
                                                 invalid.
    """
    try:
        arg_10, arg_11 = clientsecrets.loadfile(arg_0,
                                                          arg_4=arg_4)
        if arg_10 in (clientsecrets.TYPE_WEB,
                           clientsecrets.TYPE_INSTALLED):
            arg_12 = {
                'redirect_uri': arg_2,
                'auth_uri': arg_11['auth_uri'],
                'token_uri': arg_11['token_uri'],
                'login_hint': arg_5,
            }
            arg_13 = arg_11.get('revoke_uri')
            arg_14 = (
                'revoke_uri',
                'device_uri',
                'pkce',
                'code_verifier',
                'prompt'
            )
            for arg_15 in arg_14:
                if locals()[arg_15] is not None:
                    arg_12[arg_15] = locals()[arg_15]

            return OAuth2WebServerFlow(
                arg_11['client_id'], arg_11['client_secret'],
                arg_1, **arg_12)

    except clientsecrets.InvalidClientSecretsError as e:
        if arg_3 is not None:
            if e.args:
                arg_3 = ('The client secrets were invalid: '
                           '\n{0}\n{1}'.format(e, arg_3))
            sys.exit(arg_3)
        else:
            raise
    else:
        raise UnknownClientSecretsFlowError(
            'This OAuth 2.0 flow is unsupported: {0!r}'.format(arg_10))

Create a Flow from a clientsecrets file .


def Func(arg_0, arg_1, arg_2):
        """
        Adds the result of a job to the results list of the job's source job
        set.
        """

        if arg_0._closed:
            return

        arg_3 = arg_0._job_sources[arg_1]
        del arg_0._job_sources[arg_1]
        arg_3.Func(arg_2)

Adds the result of a job to the results list of the job s source job set .


(self, session, after_open, before_close)

def Func(arg_0, arg_1, arg_2, arg_3) -> Session:
        """
        Time intervals between market

        Args:
            session: [allday, day, am, pm, night]
            after_open: mins after open
            before_close: mins before close

        Returns:
            Session of start_time and end_time
        """
        arg_4 = logs.get_logger(arg_0.Func)

        if arg_1 not in arg_0.exch: return SessNA
        arg_5 = arg_0.exch[arg_1]

        arg_6 = shift_time(arg_5[0], int(arg_2) + 1)
        arg_7 = shift_time(arg_5[-1], -int(arg_3))

        arg_8 = pd.Timestamp(arg_6) >= pd.Timestamp(arg_7)
        arg_9 = pd.Timestamp(arg_5[0]) >= pd.Timestamp(arg_5[1])
        if arg_8 and (not arg_9):
            arg_4.warning(f'end time {e_time} is earlier than {s_time} ...')
            return SessNA

        return Session(arg_6, arg_7)


def Func ( arg_0 , arg_1 = 'dB' , arg_2 = 8000 , arg_3 = [ - 100 , 2 ] ) : iir_d . freqz_resp_cas_list ( [ arg_0 . sos ] , arg_1 , arg_2 = arg_2 ) pylab . grid ( ) pylab . ylim ( arg_3 )

def Func(arg_0, arg_1= 'dB', arg_2 = 8000, arg_3 = [-100,2]):
        """
        Frequency response plot
        """
        iir_d.freqz_resp_cas_list([arg_0.sos],arg_1,arg_2=arg_2)
        pylab.grid()
        pylab.ylim(arg_3)


return {
        tuple(sorted([a, b, c], key=str))
        for a, b in graph.edges()
        for c in graph.successors(b)
        if graph.has_edge(c, a)
    }

def Func ( arg_0 : arg_1 ) -> SetOfNodeTriples : return { tuple ( sorted ( [ arg_2 , arg_3 , arg_4 ] , key = str ) ) for arg_2 , arg_3 in arg_0 . edges ( ) for arg_4 in arg_0 . successors ( arg_3 ) if arg_0 . has_edge ( arg_4 , arg_2 ) }

def Func(arg_0: arg_1) -> SetOfNodeTriples:
    """Get a set of triples representing the 3-cycles from a directional graph.

    Each 3-cycle is returned once, with nodes in sorted order.
    """
    return {
        tuple(sorted([arg_2, arg_3, arg_4], key=str))
        for arg_2, arg_3 in arg_0.edges()
        for arg_4 in arg_0.successors(arg_3)
        if arg_0.has_edge(arg_4, arg_2)
    }

Get a set of triples representing the 3 - cycles from a directional graph .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = dict ( time = arg_0 . global_timestep , variables = arg_0 . baseline . get_variables ( ) , arg_4 = dict ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , update = tf . constant ( value = True ) , ) , fn_reference = arg_0 . baseline . reference , fn_loss = arg_0 . fn_baseline_loss , ) if arg_0 . global_model is not None : arg_4 [ 'global_variables' ] = arg_0 . global_model . baseline . get_variables ( ) return arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Returns the baseline optimizer arguments including the time, the list of variables to
        optimize, and various functions which the optimizer might require to perform an update
        step.

        Args:
            states: Dict of state tensors.
            internals: List of prior internal state tensors.
            reward: Reward tensor.

        Returns:
            Baseline optimizer arguments as dict.
        """
        arg_4 = dict(
            time=arg_0.global_timestep,
            variables=arg_0.baseline.get_variables(),
            arg_4=dict(
                arg_1=arg_1,
                arg_2=arg_2,
                arg_3=arg_3,
                update=tf.constant(value=True),
            ),
            fn_reference=arg_0.baseline.reference,
            fn_loss=arg_0.fn_baseline_loss,
            # source_variables=self.network.get_variables()
        )
        if arg_0.global_model is not None:
            arg_4['global_variables'] = arg_0.global_model.baseline.get_variables()
        return arg_4

Returns the baseline optimizer arguments including the time the list of variables to optimize and various functions which the optimizer might require to perform an update step .


(self, query, commit=False, working_columns=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
,
arg_3
=
)
:
log
.
debug
(
"RawlBase.Func()"
)
arg_4
=
[
]
if
arg_3
is
:
arg_3
=
arg_0
.
columns
with
RawlConnection
(
arg_0
.
dsn
)
as
conn
:
arg_5
=
random
.
randrange
(
9999
)
arg_6
=
conn
.
cursor
(
)
try
:
log
.
debug
(
"Executing(%s): %s"
%
(
arg_5
,
arg_1
.
as_string
(
arg_6
)
)
)
except
:
log
.
exception
(
"LOGGING EXCEPTION LOL"
)
arg_6
.
execute
(
arg_1
)
log
.
debug
(
"Executed"
)
if
arg_2
==
True
:
log
.
debug
(
"COMMIT(%s)"
%
arg_5
)
conn
.
commit
(
)
log
.
debug
(
"curs.rowcount: %s"
%
arg_6
.
rowcount
)
if
arg_6
.
rowcount
>
0
:
arg_7
=
arg_6
.
fetchall
(
)
for
arg_8
in
arg_7
:
arg_9
=
0
arg_10
=
{
}
for
arg_11
in
arg_3
:
try
:
arg_11
=
arg_11
.
replace
(
'.'
,
'_'
)
arg_10
[
arg_11
]
=
arg_8
[
arg_9
]
except
IndexError
:
pass
arg_9
+=
1
log
.
debug
(
"Appending dict to result: %s"
%
arg_10
)
arg_12
=
RawlResult
(
arg_3
,
arg_10
)
arg_4
.
append
(
arg_12
)
arg_6
.
close
(
)
return
arg_4

def Func(arg_0, arg_1, arg_2=False, arg_3=None):
        """
        Execute a query with provided parameters

        Parameters
        :query:     SQL string with parameter placeholders
        :commit:    If True, the query will commit
        :returns:   List of rows
        """

        log.debug("RawlBase.Func()")

        arg_4 = []

        if arg_3 is None:
            arg_3 = arg_0.columns

        with RawlConnection(arg_0.dsn) as conn:

            arg_5 = random.randrange(9999)

            arg_6 = conn.cursor()

            try:
                log.debug("Executing(%s): %s" % (arg_5, arg_1.as_string(arg_6)))
            except:
                log.exception("LOGGING EXCEPTION LOL")

            arg_6.execute(arg_1)

            log.debug("Executed")

            if arg_2 == True:
                log.debug("COMMIT(%s)" % arg_5)
                conn.commit()

            log.debug("curs.rowcount: %s" % arg_6.rowcount)

            if arg_6.rowcount > 0:
                #result = curs.fetchall()
                # Process the results into a dict and stuff it in a RawlResult
                # object.  Then append that object to result
                arg_7 = arg_6.fetchall()
                for arg_8 in arg_7:

                    arg_9 = 0
                    arg_10 = {}
                    for arg_11 in arg_3:
                        try:
                            #log.debug("row_dict[%s] = row[%s] which is %s" % (col, i, row[i]))
                            # For aliased columns, we need to get rid of the dot
                            arg_11 = arg_11.replace('.', '_')
                            arg_10[arg_11] = arg_8[arg_9]
                        except IndexError: pass
                        arg_9 += 1

                    log.debug("Appending dict to result: %s" % arg_10)

                    arg_12 = RawlResult(arg_3, arg_10)
                    arg_4.append(arg_12)

            arg_6.close()

        return arg_4


def Func(arg_0=0.2, arg_1=0.8):
    """
    Utility for creating continuous grey scale palette

    Parameters
    ----------
    start : float
        grey value at low end of palette
    end : float
        grey value at high end of palette

    Returns
    -------
    out : function
        Continuous color palette that takes a single
        :class:`int` parameter ``n`` and returns ``n``
        equally spaced colors.

    Examples
    --------
    >>> palette = Func()
    >>> palette(5)
    ['#333333', '#737373', '#989898', '#b5b5b5', '#cccccc']
    """
    arg_2 = 2.2
    arg_3 = ((0.0, arg_0, arg_0), (1.0, arg_1, arg_1))
    arg_4 = {'red': arg_3, 'green': arg_3, 'blue': arg_3}
    arg_5 = mcolors.LinearSegmentedColormap('grey', arg_4)

    def continuous_Funcette(arg_6):
        arg_7 = []
        # The grey scale points are linearly separated in
        # gamma encoded space
        for arg_8 in np.linspace(arg_0**arg_2, arg_1**arg_2, arg_6):
            # Map points onto the [0, 1] palette domain
            arg_8 = (arg_8 ** (1./arg_2) - arg_0) / (arg_1 - arg_0)
            arg_7.append(mcolors.rgb2hex(arg_5(arg_8)))
        return arg_7

    return continuous_Funcette

Utility for creating continuous grey scale palette

    Parameters
    ----------
    start : float
        grey value at low end of palette
    end : float
        grey value at high end of palette

    Returns
    -------
    out : function
        Continuous color palette that takes a single
        :class:`int` parameter ``n`` and returns ``n``
        equally spaced colors.

    Examples
    --------
    >>> palette = grey_pal()
    >>> palette(5)
    ['#333333', '#737373', '#989898', '#b5b5b5', '#cccccc']


(cls, lines, selector_handler=None, strict=False, debug=False)

return cls(json.loads(
                "\n".join([l for l in lines if not cls.REGEX_COMMENT_LINE.match(l)])
            ), selector_handler=selector_handler, strict=strict, debug=debug)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False , arg_4 = False ) : return arg_0 ( json . loads ( "\n" . join ( [ arg_5 for arg_5 in arg_1 if not arg_0 . REGEX_COMMENT_LINE . match ( arg_5 ) ] ) ) , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0, arg_1, arg_2=None, arg_3=False, arg_4=False):
        """
        Interpret input lines as a JSON Parsley script.
        Python-style comment lines are skipped.
        """

        return arg_0(json.loads(
                "\n".join([arg_5 for arg_5 in arg_1 if not arg_0.REGEX_COMMENT_LINE.match(arg_5)])
            ), arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)

Interpret input lines as a JSON Parsley script . Python - style comment lines are skipped .


def Func(arg_0):
    """Analyse an OpenStreetMap changeset."""
    arg_1 = Analyse(arg_0)
    arg_1.full_analysis()
    Funcck.echo(
        'Created: %s. Modified: %s. Deleted: %s' % (arg_1.create, arg_1.modify, arg_1.delete)
        )
    if arg_1.is_suspect:
        Funcck.echo('The changeset {} is suspect! Reasons: {}'.format(
            arg_0,
            ', '.join(arg_1.suspicion_reasons)
            ))
    else:
        Funcck.echo('The changeset %s is not suspect!' % arg_0)


def Func ( arg_0 , arg_1 ) : try : arg_2 = arg_5 [ arg_1 ] except KeyError : arg_3 = translate ( arg_1 ) if len ( arg_5 ) >= _MAXCACHE : arg_4 ( ) [ '_cache' ] = { } arg_5 [ arg_1 ] = arg_2 = re . compile ( arg_3 ) return arg_2 . match ( arg_0 ) is not None

def Func(arg_0, arg_1):
    """Test whether FILENAME matches PATTERN, including case.

    This is a version of fnmatch() which doesn't case-normalize
    its arguments.
    """

    try:
        arg_2 = arg_5[arg_1]
    except KeyError:
        arg_3 = translate(arg_1)
        if len(arg_5) >= _MAXCACHE:
            # _cache.clear()
            arg_4()['_cache'] = {}
        arg_5[arg_1] = arg_2 = re.compile(arg_3)
    return arg_2.match(arg_0) is not None

Test whether FILENAME matches PATTERN including case .


def Func(arg_0, arg_1, arg_2):
        """Resolve a relative url to the appropriate realm name."""
        arg_3 = arg_0._calc_realm_from_path_provider(arg_1, arg_2)
        return arg_3

Resolve a relative url to the appropriate realm name .


def Func(arg_0, arg_1):
        """Returns annotation type or None if found none or more than one.
        Reports errors on failure."""
        for arg_2, arg_2, arg_3 in arg_0.graph.triples((
                arg_1, arg_0.spdx_namespace['annotationType'], None)):
            if arg_3 is not None:
                return arg_3
            else:
                arg_0.error = True
                arg_5 = 'Annotation must have exactly one annotation type.'
                arg_0.logger.log(arg_5)
                return

Returns annotation type or None if found none or more than one . Reports errors on failure .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . list_images ( ) arg_4 = [ i for i in arg_3 [ 'items' ] if i [ 'properties' ] [ 'name' ] == arg_2 and i [ 'properties' ] [ 'imageType' ] == "HDD" and i [ 'properties' ] [ 'location' ] == arg_1 ] return arg_4

def Func(arg_0, arg_1, arg_2):
    """
    Returns all disk images within a location with a given image name.
    The name must match exactly.
    The list may be empty.
    """
    arg_3 = arg_0.list_images()
    arg_4 = [i for i in arg_3['items'] if
                i['properties']['name'] == arg_2 and
                i['properties']['imageType'] == "HDD" and
                i['properties']['location'] == arg_1]
    return arg_4

Returns all disk images within a location with a given image name . The name must match exactly . The list may be empty .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . _filtered_clauses ( arg_1 ) arg_2 = set ( arg_2 ) arg_3 = set ( arg_3 ) arg_5 = set ( product . category for product in arg_3 ) arg_6 = arg_2 | arg_5 arg_4 = ( arg_10 for arg_10 in arg_4 if hasattr ( arg_10 , 'product' ) and arg_10 . product in arg_3 or hasattr ( arg_10 , 'category' ) and arg_10 . category in arg_6 ) arg_7 = [ ] arg_8 = set ( ) arg_9 = set ( ) for arg_10 in arg_4 : arg_11 = arg_10 . discount arg_12 = ConditionController . for_condition ( arg_11 ) arg_13 = arg_10 . past_use_count if arg_13 >= arg_10 . quantity : pass elif arg_11 not in arg_9 : arg_14 = arg_11 in arg_8 if arg_14 or arg_12 . is_met ( arg_1 , filtered = True ) : arg_7 . append ( DiscountAndQuantity ( arg_11 = arg_11 , arg_10 = arg_10 , quantity = arg_10 . quantity - arg_13 , ) ) arg_8 . add ( arg_11 ) else : arg_9 . add ( arg_11 ) return arg_7

def Func(arg_0, arg_1, arg_2, arg_3):
        ''' Returns all discounts available to this user for the given
        categories and products. The discounts also list the available quantity
        for this user, not including products that are pending purchase. '''

        arg_4 = arg_0._filtered_clauses(arg_1)

        # clauses that match provided categories
        arg_2 = set(arg_2)
        # clauses that match provided products
        arg_3 = set(arg_3)
        # clauses that match categories for provided products
        arg_5 = set(product.category for product in arg_3)
        # (Not relevant: clauses that match products in provided categories)
        arg_6 = arg_2 | arg_5

        arg_4 = (
            arg_10 for arg_10 in arg_4
            if hasattr(arg_10, 'product') and arg_10.product in arg_3 or
            hasattr(arg_10, 'category') and arg_10.category in arg_6
        )

        arg_7 = []

        # Markers so that we don't need to evaluate given conditions
        # more than once
        arg_8 = set()
        arg_9 = set()

        for arg_10 in arg_4:
            arg_11 = arg_10.discount
            arg_12 = ConditionController.for_condition(arg_11)

            arg_13 = arg_10.past_use_count
            if arg_13 >= arg_10.quantity:
                # This clause has exceeded its use count
                pass
            elif arg_11 not in arg_9:
                # This clause is still available
                arg_14 = arg_11 in arg_8
                if arg_14 or arg_12.is_met(arg_1, filtered=True):
                    # This clause is valid for this user
                    arg_7.append(DiscountAndQuantity(
                        arg_11=arg_11,
                        arg_10=arg_10,
                        quantity=arg_10.quantity - arg_13,
                    ))
                    arg_8.add(arg_11)
                else:
                    # This clause is not valid for this user
                    arg_9.add(arg_11)
        return arg_7

Returns all discounts available to this user for the given categories and products . The discounts also list the available quantity for this user not including products that are pending purchase .


def Func(arg_0, arg_1):
        """
        main.xml from Elsevier assume the existence of a local DTD.
        This procedure install the DTDs next to the main.xml file
        and normalize it using xmllint in order to resolve all namespaces
        and references.
        """
        if exists(join(arg_1, 'resolved_main.xml')):
            return
        arg_2 = open(join(arg_1, 'main.xml')).read()
        arg_3 = ['art501.dtd','art510.dtd','art520.dtd','art540.dtd']
        arg_4 = 0
        for arg_5 in arg_3:
            if arg_5 in arg_2:
                arg_0._extract_correct_dtd_package(arg_5.split('.')[0], arg_1)
                arg_4 = 1

        if not arg_4:
            arg_6 = "It looks like the path " + arg_1
            arg_6 += "does not contain an art501, art510, art520 or art540 in main.xml file"
            arg_0.logger.error(arg_6)
            raise ValueError(arg_6)
        arg_7 = ["xmllint", "--format", "--loaddtd",
                   join(arg_1, 'main.xml'),
                   "--output", join(arg_1, 'resolved_main.xml')]
        arg_8, arg_8, arg_9 = run_shell_command(arg_7)
        if arg_9:
            arg_6 = "Error in cleaning %s: %s" % (
                join(arg_1, 'main.xml'), arg_9)
            arg_0.logger.error(arg_6)
            raise ValueError(arg_6)

main . xml from Elsevier assume the existence of a local DTD . This procedure install the DTDs next to the main . xml file and normalize it using xmllint in order to resolve all namespaces and references .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : if capybara . wait_on_first_by_default : arg_2 . setdefault ( "minimum" , 1 ) try : arg_3 = arg_0 . find_all ( * arg_1 , ** arg_2 ) return arg_3 [ 0 ] if len ( arg_3 ) > 0 else None except ExpectationNotMet : return None

def Func(arg_0, *arg_1, **arg_2):
        """
        Find the first element on the page matching the given selector and options, or None if no
        element matches.

        By default, no waiting behavior occurs. However, if ``capybara.wait_on_first_by_default``
        is set to true, it will trigger Capybara's waiting behavior for a minimum of 1 matching
        element to be found.

        Args:
            *args: Variable length argument list for :class:`SelectorQuery`.
            **kwargs: Arbitrary keyword arguments for :class:`SelectorQuery`.

        Returns:
            Element: The found element or None.
        """

        if capybara.wait_on_first_by_default:
            arg_2.setdefault("minimum", 1)

        try:
            arg_3 = arg_0.find_all(*arg_1, **arg_2)
            return arg_3[0] if len(arg_3) > 0 else None
        except ExpectationNotMet:
            return None

Find the first element on the page matching the given selector and options or None if no element matches .


return type(str(name), (OctaveUserClass,), values)

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . eval ( 'fieldnames(%s);' % arg_1 , nout = 1 ) . ravel ( ) . tolist ( ) arg_3 = arg_0 . eval ( 'methods(%s);' % arg_1 , nout = 1 ) . ravel ( ) . tolist ( ) arg_4 = weakref . ref ( arg_0 ) arg_5 = _DocDescriptor ( arg_4 , arg_1 ) arg_6 = dict ( __doc__ = arg_5 , _name = arg_1 , _ref = arg_4 , _attrs = arg_2 , __module__ = 'oct2py.dynamic' ) for arg_7 in arg_3 : arg_5 = _MethodDocDescriptor ( arg_4 , arg_1 , arg_7 ) arg_8 = '%s_%s' % ( arg_1 , arg_7 ) arg_9 = dict ( __doc__ = arg_5 ) arg_10 = type ( str ( arg_8 ) , ( OctaveUserClassMethod , ) , arg_9 ) arg_6 [ arg_7 ] = arg_10 ( arg_4 , arg_7 , arg_1 ) for arg_11 in arg_2 : arg_6 [ arg_11 ] = OctaveUserClassAttr ( arg_4 , arg_11 , arg_11 ) return type ( str ( arg_1 ) , ( OctaveUserClass , ) , arg_6 )

def Func(arg_0, arg_1):
    """Make an Octave class for a given class name"""
    arg_2 = arg_0.eval('fieldnames(%s);' % arg_1, nout=1).ravel().tolist()
    arg_3 = arg_0.eval('methods(%s);' % arg_1, nout=1).ravel().tolist()
    arg_4 = weakref.ref(arg_0)

    arg_5 = _DocDescriptor(arg_4, arg_1)
    arg_6 = dict(__doc__=arg_5, _name=arg_1, _ref=arg_4, _attrs=arg_2,
                  __module__='oct2py.dynamic')

    for arg_7 in arg_3:
        arg_5 = _MethodDocDescriptor(arg_4, arg_1, arg_7)
        arg_8 = '%s_%s' % (arg_1, arg_7)
        arg_9 = dict(__doc__=arg_5)
        arg_10 = type(str(arg_8),
                          (OctaveUserClassMethod,), arg_9)
        arg_6[arg_7] = arg_10(arg_4, arg_7, arg_1)

    for arg_11 in arg_2:
        arg_6[arg_11] = OctaveUserClassAttr(arg_4, arg_11, arg_11)

    return type(str(arg_1), (OctaveUserClass,), arg_6)


(self, vm_image_name, regions, offer, sku, version)

return self._perform_put(
            self._get_replication_path_using_vm_image_name(vm_image_name),
            _XmlSerializer.replicate_image_to_xml(
                regions,
                offer,
                sku,
                version
            ),
            as_async=True,
            x_ms_version='2015-04-01'
        )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        '''
        Replicate a VM image to multiple target locations. This operation
        is only for publishers. You have to be registered as image publisher
        with Microsoft Azure to be able to call this.

        vm_image_name:
            Specifies the name of the VM Image that is to be used for
            replication
        regions:
            Specified a list of regions to replicate the image to
            Note: The regions in the request body are not additive. If a VM
            Image has already been replicated to Regions A, B, and C, and
            a request is made to replicate to Regions A and D, the VM
            Image will remain in Region A, will be replicated in Region D,
            and will be unreplicated from Regions B and C
        offer:
            Specifies the publisher defined name of the offer. The allowed
            characters are uppercase or lowercase letters, digit,
            hypen(-), period (.).The maximum allowed length is 64 characters.
        sku:
            Specifies the publisher defined name of the Sku. The allowed
            characters are uppercase or lowercase letters, digit,
            hypen(-), period (.). The maximum allowed length is 64 characters.
        version:
            Specifies the publisher defined version of the image.
            The allowed characters are digit and period.
            Format: <MajorVersion>.<MinorVersion>.<Patch>
            Example: '1.0.0' or '1.1.0' The 3 version number to
            follow standard of most of the RPs. See http://semver.org
        '''
        _validate_not_none('vm_image_name', arg_1)
        _validate_not_none('regions', arg_2)
        _validate_not_none('offer', arg_3)
        _validate_not_none('sku', arg_4)
        _validate_not_none('version', arg_5)

        return arg_0._perform_put(
            arg_0._get_replication_path_using_vm_image_name(arg_1),
            _XmlSerializer.replicate_image_to_xml(
                arg_2,
                arg_3,
                arg_4,
                arg_5
            ),
            as_async=True,
            x_ms_version='2015-04-01'
        )

Replicate a VM image to multiple target locations . This operation is only for publishers . You have to be registered as image publisher with Microsoft Azure to be able to call this .


(self, bucket_name, validate=True, headers=None, force=None)

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = None , arg_4 = None ) : if arg_4 : arg_5 = super ( S3Connection , arg_0 ) . Func ( arg_1 , arg_2 , arg_3 ) mimicdb . backend . sadd ( tpl . connection , arg_5 . name ) return arg_5 if mimicdb . backend . sismember ( tpl . connection , arg_1 ) : return Bucket ( arg_0 , arg_1 ) else : if arg_2 : raise S3ResponseError ( 404 , 'NoSuchBucket' ) else : return Bucket ( arg_0 , arg_1 )

def Func(arg_0, arg_1, arg_2=True, arg_3=None, arg_4=None):
        """Return a bucket from MimicDB if it exists. Return a
        S3ResponseError if the bucket does not exist and validate is passed.

        :param boolean force: If true, API call is forced to S3
        """
        if arg_4:
            arg_5 = super(S3Connection, arg_0).Func(arg_1, arg_2, arg_3)
            mimicdb.backend.sadd(tpl.connection, arg_5.name)
            return arg_5

        if mimicdb.backend.sismember(tpl.connection, arg_1):
            return Bucket(arg_0, arg_1)
        else:
            if arg_2:
                raise S3ResponseError(404, 'NoSuchBucket')
            else:
                return Bucket(arg_0, arg_1)

Return a bucket from MimicDB if it exists . Return a S3ResponseError if the bucket does not exist and validate is passed .


def Func(arg_0):
	"""Normalize metadata to improve match accuracy."""

	arg_0 = str(arg_0)
	arg_0 = arg_0.lower()

	arg_0 = re.sub(r'\/\s*\d+', '', arg_0)  # Remove "/<totaltracks>" from track number.
	arg_0 = re.sub(r'^0+([0-9]+)', r'\1', arg_0)  # Remove leading zero(s) from track number.
	arg_0 = re.sub(r'^\d+\.+', '', arg_0)  # Remove dots from track number.
	arg_0 = re.sub(r'[^\w\s]', '', arg_0)  # Remove any non-words.
	arg_0 = re.sub(r'\s+', ' ', arg_0)  # Reduce multiple spaces to a single space.
	arg_0 = re.sub(r'^\s+', '', arg_0)  # Remove leading space.
	arg_0 = re.sub(r'\s+$', '', arg_0)  # Remove trailing space.
	arg_0 = re.sub(r'^the\s+', '', arg_0, re.I)  # Remove leading "the".

	return arg_0

Normalize metadata to improve match accuracy .


def Func(arg_0, arg_1, arg_2):
        """
        Add directed edge to coupling graph.

        src (int): source physical qubit
        dst (int): destination physical qubit
        """
        if arg_1 not in arg_0.physical_qubits:
            arg_0.add_physical_qubit(arg_1)
        if arg_2 not in arg_0.physical_qubits:
            arg_0.add_physical_qubit(arg_2)
        arg_0.graph.Func(arg_1, arg_2)
        arg_0._dist_matrix = None


def Func(arg_0, arg_1=-1):
        """Creates a full mapping from all wildcard translations to the corresponding wildcards"""
        if len(arg_0._reversed_wildcards) > 0:
            # We already created reversed wildcards, so we don't need to do all of them
            # again
            arg_2 = arg_1
        else:
            arg_2 = -1
        for arg_3, arg_4 in arg_0._wildcard_functions.items():
            for arg_5 in range(arg_2, len(arg_0)):
                arg_6 = arg_4(arg_5)
                if not arg_6 in arg_0._reversed_wildcards:
                    arg_0._reversed_wildcards[arg_6] = ([], arg_3)
                arg_0._reversed_wildcards[arg_6][0].append(arg_5)


(
            self,
            resource,
            detail_resource=None,
            resource_id=None,
            querystring=None,
            traverse_pagination=False,
            default=DEFAULT_VALUE_SAFEGUARD,
    )

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = False , arg_6 = arg_7 , ) : arg_8 = arg_6 if arg_6 != arg_0 . DEFAULT_VALUE_SAFEGUARD else { } arg_4 = arg_4 if arg_4 else { } arg_9 = utils . get_cache_key ( arg_1 = arg_1 , arg_4 = arg_4 , arg_5 = arg_5 , arg_3 = arg_3 ) arg_10 = cache . get ( arg_9 ) if not arg_10 : arg_11 = getattr ( arg_0 . client , arg_1 ) ( arg_3 ) arg_11 = getattr ( arg_11 , arg_2 ) if arg_2 else arg_11 arg_10 = arg_11 . get ( ** arg_4 ) if arg_5 : arg_12 = utils . traverse_pagination ( arg_10 , arg_11 ) arg_10 = { 'count' : len ( arg_12 ) , 'next' : 'None' , 'previous' : 'None' , 'results' : arg_12 , } if arg_10 : cache . set ( arg_9 , arg_10 , settings . ENTERPRISE_API_CACHE_TIMEOUT ) return arg_10 or arg_8

def Func(
            arg_0,
            arg_1,
            arg_2=None,
            arg_3=None,
            arg_4=None,
            arg_5=False,
            arg_6=arg_7,
    ):
        """
        Loads a response from a call to one of the Enterprise endpoints.

        :param resource: The endpoint resource name.
        :param detail_resource: The sub-resource to append to the path.
        :param resource_id: The resource ID for the specific detail to get from the endpoint.
        :param querystring: Optional query string parameters.
        :param traverse_pagination: Whether to traverse pagination or return paginated response.
        :param default: The default value to return in case of no response content.
        :return: Data returned by the API.
        """
        arg_8 = arg_6 if arg_6 != arg_0.DEFAULT_VALUE_SAFEGUARD else {}
        arg_4 = arg_4 if arg_4 else {}

        arg_9 = utils.get_cache_key(
            arg_1=arg_1,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_3=arg_3
        )
        arg_10 = cache.get(arg_9)
        if not arg_10:
            # Response is not cached, so make a call.
            arg_11 = getattr(arg_0.client, arg_1)(arg_3)
            arg_11 = getattr(arg_11, arg_2) if arg_2 else arg_11
            arg_10 = arg_11.get(**arg_4)
            if arg_5:
                arg_12 = utils.traverse_pagination(arg_10, arg_11)
                arg_10 = {
                    'count': len(arg_12),
                    'next': 'None',
                    'previous': 'None',
                    'results': arg_12,
                }
            if arg_10:
                # Now that we've got a response, cache it.
                cache.set(arg_9, arg_10, settings.ENTERPRISE_API_CACHE_TIMEOUT)
        return arg_10 or arg_8

Loads a response from a call to one of the Enterprise endpoints .


return value + want_bytes(self.sep) + self.get_signature(value)

def Func ( arg_0 , arg_1 ) : return arg_1 + want_bytes ( arg_0 . sep ) + arg_0 . get_Funcature ( arg_1 )

def Func(arg_0, arg_1):
        """Signs the given string."""
        return arg_1 + want_bytes(arg_0.sep) + arg_0.get_Funcature(arg_1)


(sailthru_client, email, course_url, unenroll)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Maintain a list of courses the user has unenrolled from in the Sailthru user record

    Arguments:
        sailthru_client (object): SailthruClient
        email (str): user's email address
        course_url (str): LMS url for course info page.
        unenroll (boolean): True if unenrolling, False if enrolling

    Returns:
        False if retryable error, else True
    """
    try:
        # get the user 'vars' values from sailthru
        arg_4 = arg_0.api_get("user", {"id": arg_1, "fields": {"vars": 1}})
        if not arg_4.is_ok():
            arg_5 = arg_4.get_error()
            logger.error("Error attempting to read user record from Sailthru: %s", arg_5.get_message())
            return not can_retry_sailthru_request(arg_5)

        arg_6 = arg_4.json

        arg_7 = []
        if arg_6 and "vars" in arg_6 and arg_6["vars"] \
           and "unenrolled" in arg_6["vars"]:
            arg_7 = arg_6["vars"]["unenrolled"]

        arg_8 = False
        # if unenrolling, add course to unenroll list
        if arg_3:
            if arg_2 not in arg_7:
                arg_7.append(arg_2)
                arg_8 = True

        # if enrolling, remove course from unenroll list
        elif arg_2 in arg_7:
            arg_7.remove(arg_2)
            arg_8 = True

        if arg_8:
            # write user record back
            arg_4 = arg_0.api_post(
                'user', {'id': arg_1, 'key': 'email', 'vars': {'unenrolled': arg_7}})

            if not arg_4.is_ok():
                arg_5 = arg_4.get_error()
                logger.error("Error attempting to update user record in Sailthru: %s", arg_5.get_message())
                return not can_retry_sailthru_request(arg_5)

        return True

    except SailthruClientError as exc:
        logger.exception("Exception attempting to update user record for %s in Sailthru - %s", arg_1, text_type(exc))
        return False


def Func(arg_0, arg_1=None):
    """
    Returns the nearest positive semidefinite operator to an operator.

    This method is based on reference [1]. It constrains positivity
    by setting negative eigenvalues to zero and rescaling the positive
    eigenvalues.

    Args:
        rho (array_like): the input operator.
        epsilon(float or None): threshold (>=0) for truncating small
            eigenvalues values to zero.

    Returns:
        numpy.array: A positive semidefinite numpy array.
    """
    if arg_1 is None:
        arg_1 = 0.  # default value

    arg_2 = len(arg_0)
    arg_3 = np.zeros([arg_2, arg_2])
    arg_4, arg_5 = np.linalg.eigh(arg_0)  # v eigenvecrors v[0] < v[1] <...
    for arg_6 in range(arg_2):
        if arg_4[arg_6] < arg_1:
            arg_7 = arg_4[arg_6]
            arg_4[arg_6] = 0.
            # redistribute loop
            arg_8 = 0.
            for arg_9 in range(arg_6 + 1, arg_2):
                arg_8 += arg_7 / (arg_2 - (arg_6 + 1))
                arg_4[arg_9] = arg_4[arg_9] + arg_7 / (arg_2 - (arg_6 + 1))
    for arg_6 in range(arg_2):
        arg_3 = arg_3 + arg_4[arg_6] * outer(arg_5[:, arg_6])
    return arg_3

Returns the nearest positive semidefinite operator to an operator .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
{
"get"
:
{
}
,
"set"
:
{
}
}
arg_4
=
[
]
arg_5
=
[
]
for
arg_6
in
arg_1
:
if
not
isinstance
(
arg_6
,
XMPPFeatureHandler
)
:
continue
arg_6
.
stanza_processor
=
arg_0
for
arg_8
,
arg_9
in
inspect
.
getmembers
(
arg_6
,
callable
)
:
if
not
hasattr
(
arg_9
,
"_pyxmpp_stanza_handled"
)
:
continue
arg_10
,
arg_11
=
arg_9
.
_pyxmpp_stanza_handled
arg_12
=
arg_9
.
_pyxmpp_usage_restriction
if
arg_12
and
arg_12
!=
arg_2
:
continue
if
arg_10
==
"iq"
:
arg_13
=
arg_9
.
_pyxmpp_payload_class_handled
arg_14
=
arg_9
.
_pyxmpp_payload_key
if
(
arg_13
,
arg_14
)
in
arg_3
[
arg_11
]
:
continue
arg_3
[
arg_11
]
[
(
arg_13
,
arg_14
)
]
=
arg_9
continue
elif
arg_10
==
"message"
:
arg_15
=
arg_4
elif
arg_10
==
"presence"
:
arg_15
=
arg_5
else
:
raise
ValueError
,
"Bad handler decoration"
arg_15
.
append
(
arg_9
)
with
arg_0
.
lock
:
arg_0
.
_iq_handlers
=
arg_3
arg_0
.
_presence_handlers
=
arg_5
arg_0
.
_message_handlers
=
arg_4

def Func(arg_0, arg_1, arg_2):
        """Install stanza handlers provided by `handler_objects`"""
        # pylint: disable=W0212
        arg_3 = {"get": {}, "set": {}}
        arg_4 = []
        arg_5 = []
        for arg_6 in arg_1:
            if not isinstance(arg_6, XMPPFeatureHandler):
                continue
            arg_6.stanza_processor = arg_0
            for arg_8, arg_9 in inspect.getmembers(arg_6, callable):
                if not hasattr(arg_9, "_pyxmpp_stanza_handled"):
                    continue
                arg_10, arg_11 = arg_9._pyxmpp_stanza_handled
                arg_12 = arg_9._pyxmpp_usage_restriction
                if arg_12 and arg_12 != arg_2:
                    continue
                if arg_10 == "iq":
                    arg_13 = arg_9._pyxmpp_payload_class_handled
                    arg_14 = arg_9._pyxmpp_payload_key
                    if (arg_13, arg_14) in arg_3[arg_11]:
                        continue
                    arg_3[arg_11][(arg_13, arg_14)] = \
                            arg_9
                    continue
                elif arg_10 == "message":
                    arg_15 = arg_4
                elif arg_10 == "presence":
                    arg_15 = arg_5
                else:
                    raise ValueError, "Bad handler decoration"
                arg_15.append(arg_9)
        with arg_0.lock:
            arg_0._iq_handlers = arg_3
            arg_0._presence_handlers = arg_5
            arg_0._message_handlers = arg_4

Install stanza handlers provided by handler_objects


def Func(arg_0, arg_1, arg_2):
        """Adds a single data item to the pickle result.

         Note that it is NOT checked if the item can be pickled!

        """

        if arg_0.v_stored:
            arg_0._logger.debug('You are changing an already stored result. If '
                                 'you not explicitly overwrite the data on disk, this change '
                                 'might be lost and not propagated to disk.')

        if arg_1 == PickleResult.PROTOCOL:
            raise AttributeError('You cannot name an entry `%s`' % PickleResult.PROTOCOL)

        arg_0._data[arg_1] = arg_2

Adds a single data item to the pickle result .


def Func(arg_0, arg_1):
        """save es and stats"""
        # save raw ES to one csv file
        arg_2 = pd.DataFrame(arg_0.resultsOnSamples)
        arg_2.index.name = 'Term|ES'
        # normalize enrichment scores by using the entire data set, as indicated
        # by Barbie et al., 2009, online methods, pg. 2
        arg_5 = arg_2 / (arg_2.values.max() - arg_2.values.min())
        arg_5 = arg_5.copy()
        arg_5.index.rename('Term|NES', inplace=True)
        arg_0.res2d = arg_5
        arg_0._logger.info("Congratulations. GSEApy runs successfully................\n")
        if arg_0._outdir is None: return
        # write es
        arg_7 = os.path.join(arg_1, "gseapy.samples.raw.es.txt")
        with open(arg_7, 'a') as f:
            if arg_0.scale:
                f.write('# scale the enrichment scores by number of genes in the gene sets\n')
                f.write('# this normalization has not effects on the final NES, ' + \
                        'as indicated by Barbie et al., 2009, online methods, pg. 2\n')
            else:
                f.write('# raw enrichment scores of all data\n')
                f.write('# no scale es by numbers of genes in the gene sets\n')
            arg_2.to_csv(f, sep='\t')

        arg_8 = os.path.join(arg_1, "gseapy.samples.normalized.es.txt")
        with open(arg_8, 'a') as f:
            f.write('# normalize enrichment scores by using the entire data set\n')
            f.write('# as indicated by Barbie et al., 2009, online methods, pg. 2\n')
            arg_5.to_csv(f, sep='\t')
        return


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . _safe_get_element ( arg_1 , arg_2 ) if arg_3 : return arg_3 . text else : return None

def Func(arg_0, arg_1, arg_2=None):
        """Safe get element text.

        Get element as string or None,
        :param root:
            Lxml element.
        :param path:
            String path (i.e. 'Items.Item.Offers.Offer').
        :return:
            String or None.
        """
        arg_3 = arg_0._safe_get_element(arg_1, arg_2)
        if arg_3:
            return arg_3.text
        else:
            return None


(root, depth=0, space_unit="    ", *, source_len=0, file=None)

def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
"    "
,
*
,
arg_3
=
0
,
arg_4
=
)
:
arg_5
=
arg_2
*
arg_1
if
isinstance
(
arg_0
,
str
)
:
print
(
"{0}terminal@(?): {1}"
.
format
(
arg_5
,
arg_0
)
,
arg_4
=
arg_4
)
else
:
if
arg_0
.
position
is
:
arg_6
=
1
elif
arg_0
.
position
<
0
:
arg_6
=
arg_3
+
arg_0
.
position
else
:
arg_6
=
arg_0
.
position
if
arg_0
.
is_value
:
print
(
"{0}{1}@({2}:{3}):\t{4}"
.
format
(
arg_5
,
arg_0
.
node_type
,
arg_6
,
arg_0
.
consumed
,
arg_0
.
svalue
)
,
arg_4
=
arg_4
)
else
:
print
(
"{0}{1}@({2}:{3}):"
.
format
(
arg_5
,
arg_0
.
node_type
,
arg_6
,
arg_0
.
consumed
)
,
arg_4
=
arg_4
)
for
arg_7
in
arg_0
.
children
:
Func
(
arg_7
,
arg_1
+
1
,
arg_3
=
arg_3
,
arg_4
=
arg_4
)

def Func(arg_0, arg_1=0, arg_2="    ", *, arg_3=0, arg_4=None):
  """Pretting print a parse tree."""
  arg_5 = arg_2 * arg_1

  if isinstance(arg_0, str):
    print("{0}terminal@(?): {1}".format(arg_5, arg_0), arg_4=arg_4)
  else:
    if arg_0.position is None:
      arg_6 = -1
    elif arg_0.position < 0:
      arg_6 = arg_3 + arg_0.position
    else:
      arg_6 = arg_0.position

    if arg_0.is_value:
      print("{0}{1}@({2}:{3}):\t{4}".format(arg_5, arg_0.node_type, arg_6, arg_0.consumed, arg_0.svalue), arg_4=arg_4)
    else:
      print("{0}{1}@({2}:{3}):".format(arg_5, arg_0.node_type, arg_6, arg_0.consumed), arg_4=arg_4)
      for arg_7 in arg_0.children:
        Func(arg_7, arg_1 + 1, arg_3=arg_3, arg_4=arg_4)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get ( '/positions/{}' . format ( arg_1 ) ) return Position ( arg_2 )

def Func(arg_0, arg_1):
        '''Get an open position'''
        arg_2 = arg_0.get('/positions/{}'.format(arg_1))
        return Position(arg_2)


def Func ( arg_0 , arg_1 , arg_2 = None ) : return arg_0 . create_board ( dict ( arg_1 = arg_1 , arg_2 = arg_2 ) )

def Func(arg_0, arg_1, arg_2=None):
        '''
        Get a board

        Returns:
            Board: The board with the given `id`
        '''
        return arg_0.create_board(dict(arg_1=arg_1, arg_2=arg_2))


def Func ( arg_0 = 20 ) : arg_1 = { 15 : 0.072144 , 20 : 0.051532 , 25 : 0.043266 } [ arg_0 ] arg_2 , arg_3 = np . polynomial . laguerre . laggauss ( arg_0 ) arg_4 = np . sinh ( arg_2 * arg_1 ) arg_5 = arg_1 * arg_3 * np . cosh ( arg_2 * arg_1 ) * np . exp ( arg_2 ) return arg_4 , arg_5

def Func(arg_0=20):
    """
    Returns Gauss-Laguerre quadrature points rescaled for line scan integration

    Parameters
    ----------
        npts : {15, 20, 25}, optional
            The number of points to

    Notes
    -----
        The scale is set internally as the best rescaling for a line scan
        integral; it was checked numerically for the allowed npts.
        Acceptable pts/scls/approximate line integral scan error:
        (pts,   scl  )      :         ERR
        ------------------------------------
        (15, 0.072144)      :       0.002193
        (20, 0.051532)      :       0.001498
        (25, 0.043266)      :       0.001209

        The previous HG(20) error was ~0.13ish
    """
    arg_1 = { 15:0.072144,
            20:0.051532,
            25:0.043266}[arg_0]
    arg_2, arg_3 = np.polynomial.laguerre.laggauss(arg_0)
    arg_4 = np.sinh(arg_2*arg_1)
    arg_5 = arg_1*arg_3*np.cosh(arg_2*arg_1)*np.exp(arg_2)
    return arg_4, arg_5

Returns Gauss - Laguerre quadrature points rescaled for line scan integration


def Func ( ) : arg_0 = memcache . get ( XSRF_MEMCACHE_ID , namespace = OAUTH2CLIENT_NAMESPACE ) if not arg_0 : arg_1 = SiteXsrfSecretKey . get_or_insert ( key_name = 'site' ) if not arg_1 . secret : arg_1 . secret = _generate_new_Func ( ) arg_1 . put ( ) arg_0 = arg_1 . secret memcache . add ( XSRF_MEMCACHE_ID , arg_0 , namespace = OAUTH2CLIENT_NAMESPACE ) return str ( arg_0 )

def Func():
    """Return the secret key for use for XSRF protection.

    If the Site entity does not have a secret key, this method will also create
    one and persist it.

    Returns:
        The secret key.
    """
    arg_0 = memcache.get(XSRF_MEMCACHE_ID, namespace=OAUTH2CLIENT_NAMESPACE)
    if not arg_0:
        # Load the one and only instance of SiteXsrfSecretKey.
        arg_1 = SiteXsrfSecretKey.get_or_insert(key_name='site')
        if not arg_1.secret:
            arg_1.secret = _generate_new_Func()
            arg_1.put()
        arg_0 = arg_1.secret
        memcache.add(XSRF_MEMCACHE_ID, arg_0,
                     namespace=OAUTH2CLIENT_NAMESPACE)

    return str(arg_0)

Return the secret key for use for XSRF protection .


def Func ( arg_0 ) : if IS_PY3 : arg_1 = sre_Func . Func ( arg_0 , flags = U ) else : arg_1 = sre_Func . Func ( arg_0 . decode ( 'utf-8' ) , flags = U ) return list ( arg_1 )

def Func(arg_0):
    """Regular expression Funcr

    :param s: Regular expression
    :type s: str
    :rtype: list
    """
    if IS_PY3:
        arg_1 = sre_Func.Func(arg_0, flags=U)
    else:
        arg_1 = sre_Func.Func(arg_0.decode('utf-8'), flags=U)
    return list(arg_1)

Regular expression parser

    :param s: Regular expression
    :type s: str
    :rtype: list


def Func(arg_0, arg_1, arg_2):
    """
    Uses Oncotator to add cancer relevant variant annotations to a VCF file. Oncotator can accept
    other genome builds, but the output VCF is based on hg19.

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str vcf_id: FileStoreID for VCF file
    :param str oncotator_db: FileStoreID for Oncotator database
    :return: Annotated VCF FileStoreID
    :rtype: str
    """
    arg_0.fileStore.logToMaster('Running Oncotator')

    arg_3 = {'input.vcf': arg_1,
              'oncotator_db': arg_2}

    arg_4 = arg_0.fileStore.getLocalTempDir()
    for arg_5, arg_6 in arg_3.iteritems():
        arg_3[arg_5] = arg_0.fileStore.readGlobalFile(arg_6, os.path.join(arg_4, arg_5))

    # The Oncotator database may be tar/gzipped
    if tarfile.is_tarfile(arg_3['oncotator_db']):
        arg_7 = tarfile.open(arg_3['oncotator_db'])
        arg_7.extractall(path=arg_4)
        # Get the extracted database directory name
        arg_3['oncotator_db'] = arg_7.getmembers()[0].name
        arg_7.close()

    arg_8 = ['-i', 'VCF',
               '-o', 'VCF',
               '--db-dir', arg_3['oncotator_db'],
               'input.vcf',
               'annotated.vcf',
               'hg19']  # Oncotator annotations are based on hg19

    arg_9 = ['--rm', 'log-driver', 'none',
                         '-e', 'JAVA_OPTS=-Djava.io.tmpdir=/data/ -Xmx{}'.format(arg_0.memory)]
    dockerCall(arg_0=arg_0, workDir=arg_4,
               parameters=arg_8,
               tool='jpfeil/oncotator:1.9--8fffc356981862d50cfacd711b753700b886b605',
               dockerParameters=arg_9)

    return arg_0.fileStore.writeGlobalFile(os.path.join(arg_4, 'annotated.vcf'))

Uses Oncotator to add cancer relevant variant annotations to a VCF file . Oncotator can accept other genome builds but the output VCF is based on hg19 .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
is
:
arg_0
.
_mask
=
try
:
Func
=
load_mask
(
arg_1
)
except
Exception
as
exc
:
raise
Exception
(
'Could not load mask image {}.'
.
format
(
arg_1
)
)
from
exc
else
:
arg_0
.
_mask
=
Func

def Func(arg_0, arg_1):
        """ self.mask setter

        Parameters
        ----------
        image: str or img-like object.
            See NeuroImage constructor docstring.
        """
        if arg_1 is None:
            arg_0._mask = None

        try:
            Func = load_mask(arg_1)
        except Exception as exc:
            raise Exception('Could not load mask image {}.'.format(arg_1)) from exc
        else:
            arg_0._mask = Func