Decorator used to tag a method that should be used as a hook for the
  specified `name` hook type.

def Func ( arg_0 ) : def FuncTarget ( arg_1 ) : if not hasattr ( arg_1 , '__Func__' ) : arg_1 . __Func__ = [ arg_0 ] else : arg_1 . __Func__ . append ( arg_0 ) return arg_1 return FuncTarget

def Func(arg_0):
  '''
  Decorator used to tag a method that should be used as a Func for the
  specified `name` Func type.
  '''
  def FuncTarget(arg_1):
    if not hasattr(arg_1, '__Func__'):
      arg_1.__Func__ = [arg_0]
    else:
      arg_1.__Func__.append(arg_0)
    return arg_1
  return FuncTarget

Decorator used to tag a method that should be used as a hook for the specified name hook type .


def Func(arg_0, **arg_1):
        """
        Clears all of the items within a list. This is an irreversible action
        and should be treated with caution.

        A valid session id is required.

        Args:
            confirm: True (do it) | False (don't do it)

        Returns:
            A dict respresentation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_id_path('clear')
        arg_1.update({'session_id': arg_0.session_id})

        arg_3 = {}

        arg_4 = arg_0._POST(arg_2, arg_1, arg_3)
        arg_0._set_attrs_to_values(arg_4)
        return arg_4

Clears all of the items within a list . This is an irreversible action and should be treated with caution .


def Func(arg_0):
        """
        Return the revocations in this certificate revocation list.

        These revocations will be provided by value, not by reference.
        That means it's okay to mutate them: it won't affect this CRL.

        :return: The revocations in this CRL.
        :rtype: :class:`tuple` of :class:`Revocation`
        """
        arg_1 = []
        arg_2 = _lib.X509_CRL_get_REVOKED(arg_0._crl)
        for arg_3 in range(_lib.sk_X509_REVOKED_num(arg_2)):
            arg_4 = _lib.sk_X509_REVOKED_value(arg_2, arg_3)
            arg_5 = _lib.Cryptography_X509_REVOKED_dup(arg_4)
            arg_6 = Revoked.__new__(Revoked)
            arg_6._revoked = _ffi.gc(arg_5, _lib.X509_REVOKED_free)
            arg_1.append(arg_6)
        if arg_1:
            return tuple(arg_1)

Return the revocations in this certificate revocation list .


def Func ( arg_0 ) : for arg_1 in arg_0 . record . keys ( ) : if arg_1 not in arg_0 . fields_list : record_delete_fields ( arg_0 . record , arg_1 )

def Func(arg_0):
        """Keep only fields listed in field_list."""
        for arg_1 in arg_0.record.keys():
            if arg_1 not in arg_0.fields_list:
                record_delete_fields(arg_0.record, arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = tupleize ( arg_1 ) arg_3 = prod ( arg_0 . keys . shape ) arg_4 = prod ( arg_0 . values . shape ) for arg_5 in range ( len ( arg_2 ) ) : arg_6 = prod ( arg_2 [ : arg_5 ] ) arg_7 = prod ( arg_2 [ arg_5 : ] ) if arg_6 == arg_3 and arg_7 == arg_4 : return arg_5 return - 1

def Func(arg_0, arg_1):
        """
        Check if the requested reshape can be broken into independant reshapes
        on the keys and values. If it can, returns the index in the new shape
        separating keys from values, otherwise returns -1
        """
        arg_2 = tupleize(arg_1)
        arg_3 = prod(arg_0.keys.shape)
        arg_4 = prod(arg_0.values.shape)

        for arg_5 in range(len(arg_2)):
            arg_6 = prod(arg_2[:arg_5])
            arg_7 = prod(arg_2[arg_5:])
            if arg_6 == arg_3 and arg_7 == arg_4:
                return arg_5

        return -1

Check if the requested reshape can be broken into independant reshapes on the keys and values . If it can returns the index in the new shape separating keys from values otherwise returns - 1


def Func ( arg_0 ) : try : arg_1 , = arg_0 . statements if isinstance ( arg_1 , Assignment ) : return True except ValueError : pass return False

def Func(arg_0):
    """check if process is just unconditional assignments
       and it is useless to merge them"""
    try:
        arg_1, = arg_0.statements
        if isinstance(arg_1, Assignment):
            return True
    except ValueError:
        pass
    return False


return AC3(csp, [(X, var) for X in csp.neighbors[var]], removals)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    "Maintain arc consistency."
    return AC3(arg_0, [(arg_5, arg_1) for arg_5 in arg_0.neighbors[arg_1]], arg_4)


def Func ( arg_0 , Func ) : arg_0 . _cur . execute ( Func ) if Func . lower ( ) . find ( "select" ) >= 0 : arg_2 = [ ] for arg_3 in arg_0 . _cur : arg_2 . append ( arg_3 ) return arg_2

def Func(arg_0, Func):

        """ Executes a raw SQL statement on the database.
        """

        arg_0._cur.execute(Func)
        if Func.lower().find("select") >= 0:
            arg_2 = []
            for arg_3 in arg_0._cur: arg_2.append(arg_3)
            return arg_2

Executes a raw SQL statement on the database .


def Func(arg_0) -> str:
        """Usefull string to compute error message."""
        arg_1 = arg_0._cursor.max_readed_position
        arg_2 = arg_1.index
        # search last \n
        arg_3 = arg_2 - 1 if arg_2 == arg_0.eos_index else arg_2
        while arg_3 >= 0 and arg_0._content[arg_3] != '\n':
            arg_3 -= 1
        # search next \n
        arg_4 = arg_2
        while arg_4 < arg_0.eos_index and arg_0._content[arg_4] != '\n':
            arg_4 += 1
        arg_5 = arg_0._content[arg_3 + 1:arg_4]
        return arg_5

Usefull string to compute error message .


(self, device=None, profile=None, native=None, attrs=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None ) : if arg_4 is None : arg_4 = arg_0 . elements ( ) . values ( ) for arg_5 in arg_4 : arg_6 = Parser ( arg_5 , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , is_config = True ) arg_6 . parse ( )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None):
        """
        Parse native configuration and load it into the corresponding models. Only models
        that have been added to the root object will be parsed.

        If ``native`` is passed to the method that's what we will parse, otherwise, we will use the
        ``device`` to retrieve it.

        Args:
            device (NetworkDriver): Device to load the configuration from.
            profile (list): Profiles that the device supports. If no ``profile`` is passed it will
              be read from ``device``.
            native (list of strings): Native configuration to parse.

        Examples:

            >>> # Load from device
            >>> running_config = napalm_yang.base.Root()
            >>> running_config.add_model(napalm_yang.models.openconfig_interfaces)
            >>> running_config.Func(device=d)

            >>> # Load from file
            >>> with open("junos.config", "r") as f:
            >>>     config = f.read()
            >>>
            >>> running_config = napalm_yang.base.Root()
            >>> running_config.add_model(napalm_yang.models.openconfig_interfaces)
            >>> running_config.Func(native=[config], profile="junos")
        """
        if arg_4 is None:
            arg_4 = arg_0.elements().values()

        for arg_5 in arg_4:
            arg_6 = Parser(
                arg_5, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, is_config=True
            )
            arg_6.parse()

Parse native configuration and load it into the corresponding models. Only models
        that have been added to the root object will be parsed.

        If ``native`` is passed to the method that's what we will parse, otherwise, we will use the
        ``device`` to retrieve it.

        Args:
            device (NetworkDriver): Device to load the configuration from.
            profile (list): Profiles that the device supports. If no ``profile`` is passed it will
              be read from ``device``.
            native (list of strings): Native configuration to parse.

        Examples:

            >>> # Load from device
            >>> running_config = napalm_yang.base.Root()
            >>> running_config.add_model(napalm_yang.models.openconfig_interfaces)
            >>> running_config.parse_config(device=d)

            >>> # Load from file
            >>> with open("junos.config", "r") as f:
            >>>     config = f.read()
            >>>
            >>> running_config = napalm_yang.base.Root()
            >>> running_config.add_model(napalm_yang.models.openconfig_interfaces)
            >>> running_config.parse_config(native=[config], profile="junos")

Parse native configuration and load it into the corresponding models . Only models that have been added to the root object will be parsed .


def Func(arg_0, arg_1=1):
    """ This function replaces objects with OBJECTS_LVALS, returns new code, replacement dict and count.
        count arg is the number that should be added to the LVAL of the first replaced object
    """
    arg_2 = {}  #replacement dict
    arg_3 = bracket_split(arg_0, ['{}', '[]'])
    arg_4 = ''
    arg_5 = ''
    for arg_6 in arg_3:
        #test whether e is an object
        if arg_6[0] == '{':
            arg_7, arg_8, arg_9 = Func(arg_6[1:-1], arg_1)
            # if e was not an object then n should not contain any :
            if is_object(arg_7, arg_5):
                #e was an object
                arg_4 += ' ' + arg_10 % arg_1
                arg_2[arg_10 % arg_1] = arg_6
                arg_1 += 1
            else:
                # e was just a code block but could contain objects inside
                arg_4 += '{%s}' % arg_7
                arg_1 = arg_9
                arg_2.update(arg_8)
        elif arg_6[0] == '[':
            if is_array(arg_5):
                arg_4 += arg_6  # will be translated later
            else:  # prop get
                arg_7, arg_11, arg_1 = Func(arg_6[1:-1], arg_1)
                arg_4 += '[%s]' % arg_7
                arg_2.update(arg_11)
        else:  # e does not contain any objects
            arg_4 += arg_6
        arg_5 = arg_6  #needed to test for this stipid empty object
    return arg_4, arg_2, arg_1

This function replaces objects with OBJECTS_LVALS returns new code replacement dict and count . count arg is the number that should be added to the LVAL of the first replaced object


def
Func
(
arg_0
,
arg_1
,
**
arg_2
)
:
if
arg_0
.
_display
.
verbosity
>
1
:
arg_0
.
_print_task
(
)
arg_0
.
last_skipped
=
False
arg_4
=
120
arg_5
=
" "
*
(
31
len
(
arg_1
.
_host
.
name
)
4
)
arg_6
=
"  * {}{}- {}"
.
format
(
colorize
(
arg_1
.
_host
.
name
,
"not_so_bold"
)
,
arg_5
,
colorize
(
"skipped"
,
"skipped"
)
,
)
arg_7
=
arg_1
.
_result
.
get
(
"skipped_reason"
,
""
)
or
arg_1
.
_result
.
get
(
"skip_reason"
,
""
)
if
len
(
arg_7
)
<
50
:
arg_6
+=
" -- {}"
.
format
(
arg_7
)
print
(
"{} {}---------"
.
format
(
arg_6
,
"-"
*
(
arg_4
len
(
arg_6
)
)
)
)
else
:
print
(
"{} {}"
.
format
(
arg_6
,
"-"
*
(
arg_4
len
(
arg_6
)
)
)
)
print
(
arg_0
.
_indent_text
(
arg_7
,
8
)
)
print
(
arg_7
)

def Func(arg_0, arg_1, **arg_2):
        """Run when a task is skipped."""
        if arg_0._display.verbosity > 1:
            arg_0._print_task()
            arg_0.last_skipped = False

            arg_4 = 120
            arg_5 = " " * (31 - len(arg_1._host.name) - 4)

            arg_6 = "  * {}{}- {}".format(
                colorize(arg_1._host.name, "not_so_bold"),
                arg_5,
                colorize("skipped", "skipped"),
            )

            arg_7 = arg_1._result.get("skipped_reason", "") or arg_1._result.get(
                "skip_reason", ""
            )
            if len(arg_7) < 50:
                arg_6 += " -- {}".format(arg_7)
                print("{} {}---------".format(arg_6, "-" * (arg_4 - len(arg_6))))
            else:
                print("{} {}".format(arg_6, "-" * (arg_4 - len(arg_6))))
                print(arg_0._indent_text(arg_7, 8))
                print(arg_7)


def Func ( arg_0 = True , ** arg_1 ) : arg_1 [ 'copy_result' ] = False arg_2 = dict ( ) for arg_3 , arg_4 in enumerate ( sample_states ( arg_0 = arg_0 , ** arg_1 ) ) : if 'N' in arg_2 : assert arg_2 [ 'N' ] == arg_4 [ 'N' ] else : arg_2 [ 'N' ] = arg_4 [ 'N' ] if 'M' in arg_2 : assert arg_2 [ 'M' ] == arg_4 [ 'M' ] else : arg_2 [ 'M' ] = arg_4 [ 'M' ] arg_5 = arg_4 [ 'M' ] + 1 arg_6 = np . empty ( arg_5 ) if arg_0 : arg_7 = np . empty ( arg_5 , dtype = np . bool ) arg_8 = np . empty ( ( 5 , arg_5 ) ) arg_6 [ arg_3 ] = arg_4 [ 'max_cluster_size' ] for arg_9 in range ( 5 ) : arg_8 [ arg_9 , arg_3 ] = arg_4 [ 'moments' ] [ arg_9 ] if arg_0 : arg_7 [ arg_3 ] = arg_4 [ 'has_spanning_cluster' ] arg_2 [ 'max_cluster_size' ] = arg_6 arg_2 [ 'moments' ] = arg_8 if arg_0 : arg_2 [ 'has_spanning_cluster' ] = arg_7 return arg_2

def Func(arg_0=True, **arg_1):
    r'''
    Generate statistics for a single run

    This is a stand-alone helper function to evolve a single sample state
    (realization) and return the cluster statistics.

    Parameters
    ----------
    spanning_cluster : bool, optional
        Whether to detect a spanning cluster or not.
        Defaults to ``True``.

    kwargs : keyword arguments
        Piped through to :func:`sample_states`

    Returns
    -------

    ret : dict
        Cluster statistics

    ret['N'] : int
        Total number of sites

    ret['M'] : int
        Total number of bonds

    ret['max_cluster_size'] : 1-D :py:class:`numpy.ndarray` of int, size ``ret['M'] + 1``
        Array of the sizes of the largest cluster (absolute number of sites) at
        the respective occupation number.

    ret['has_spanning_cluster'] : 1-D :py:class:`numpy.ndarray` of bool, size ``ret['M'] + 1``
        Array of booleans for each occupation number.
        The respective entry is ``True`` if there is a spanning cluster,
        ``False`` otherwise.
        Only exists if `spanning_cluster` argument is set to ``True``.

    ret['moments'] : 2-D :py:class:`numpy.ndarray` of int
        Array of shape ``(5, ret['M'] + 1)``.
        The ``(k, m)``-th entry is the ``k``-th raw moment of the (absolute)
        cluster size distribution, with ``k`` ranging from ``0`` to ``4``, at
        occupation number ``m``.

    See Also
    --------

    sample_states

    '''

    # initial iteration
    # we do not need a copy of the result dictionary since we copy the values
    # anyway
    arg_1['copy_result'] = False
    arg_2 = dict()

    for arg_3, arg_4 in enumerate(sample_states(
        arg_0=arg_0, **arg_1
    )):

        # merge cluster statistics
        if 'N' in arg_2:
            assert arg_2['N'] == arg_4['N']
        else:
            arg_2['N'] = arg_4['N']

        if 'M' in arg_2:
            assert arg_2['M'] == arg_4['M']
        else:
            arg_2['M'] = arg_4['M']
            arg_5 = arg_4['M'] + 1
            arg_6 = np.empty(arg_5)
            if arg_0:
                arg_7 = np.empty(arg_5, dtype=np.bool)
            arg_8 = np.empty((5, arg_5))

        arg_6[arg_3] = arg_4['max_cluster_size']
        for arg_9 in range(5):
            arg_8[arg_9, arg_3] = arg_4['moments'][arg_9]
        if arg_0:
            arg_7[arg_3] = arg_4['has_spanning_cluster']

    arg_2['max_cluster_size'] = arg_6
    arg_2['moments'] = arg_8
    if arg_0:
        arg_2['has_spanning_cluster'] = arg_7

    return arg_2


def Func(arg_0, arg_1, arg_2):
        """Handle Funces for changing tabs."""
        arg_2 = super().Func(arg_1, arg_2)
        arg_3 = len(arg_0._widgets)
        if arg_2 == arg_0._keys['prev_tab']:
            arg_0._tab_index = (arg_0._tab_index - 1) % arg_3
            arg_0._update_tabs()
        elif arg_2 == arg_0._keys['next_tab']:
            arg_0._tab_index = (arg_0._tab_index + 1) % arg_3
            arg_0._update_tabs()
        elif arg_2 == arg_0._keys['close_tab']:
            # Don't allow closing the Conversations tab
            if arg_0._tab_index > 0:
                arg_5 = arg_0._widgets[arg_0._tab_index]
                arg_0._widgets.remove(arg_5)
                del arg_0._widget_title[arg_5]
                arg_0._tab_index -= 1
                arg_0._update_tabs()
        else:
            return arg_2


def Func(arg_0, arg_1=None, **arg_2):
    """
    Plots the max and median of long and short position concentrations
    over the time.

    Parameters
    ----------
    positions : pd.DataFrame
        The positions that the strategy takes over time.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.

    Returns
    -------
    ax : matplotlib.Axes
        The axes that were plotted on.
    """

    if arg_1 is None:
        arg_1 = plt.gca()

    arg_3 = pos.get_max_median_position_concentration(arg_0)
    arg_4 = ['mediumblue', 'steelblue', 'tomato', 'firebrick']
    arg_3.plot(linewidth=1, color=arg_4, alpha=0.6, arg_1=arg_1)

    arg_1.legend(loc='center left', frameon=True, framealpha=0.5)
    arg_1.set_ylabel('Exposure')
    arg_1.set_title('Long/short max and median position concentration')

    return arg_1

Plots the max and median of long and short position concentrations over the time .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . parser . getAttribute ( arg_1 , attr = 'src' ) if not arg_2 : return False if arg_0 . badimages_names_re . search ( arg_2 ) : return False return True

def Func(arg_0, arg_1):
        """\
        will check the image src against a list
        of bad image files we know of like buttons, etc...
        """
        arg_2 = arg_0.parser.getAttribute(arg_1, attr='src')

        if not arg_2:
            return False

        if arg_0.badimages_names_re.search(arg_2):
            return False

        return True

\ will check the image src against a list of bad image files we know of like buttons etc ...


def Func(arg_0, arg_1, arg_2):
        """Set the input or output mode for a specified pin.  Mode should be
        either GPIO.OUT or GPIO.IN.
        """
        arg_0._validate_pin(arg_1)
        # Set bit to 1 for input or 0 for output.
        if arg_2 == GPIO.IN:
            arg_0.iodir[int(arg_1/8)] |= 1 << (int(arg_1%8))
        elif arg_2 == GPIO.OUT:
            arg_0.iodir[int(arg_1/8)] &= ~(1 << (int(arg_1%8)))
        else:
            raise ValueError('Unexpected value.  Must be GPIO.IN or GPIO.OUT.')
        arg_0.write_iodir()

Set the input or output mode for a specified pin . Mode should be either GPIO . OUT or GPIO . IN .


def Func ( arg_0 , arg_1 = None , arg_2 = False ) : arg_1 = arg_1 or 'marcxml' assert arg_1 in [ 'marcxml' , 'json' ] arg_3 = current_migrator . records_dump_cls ( arg_0 , arg_1 = arg_1 , pid_fetchers = current_migrator . records_pid_fetchers , ) try : current_migrator . records_dumploader_cls . create ( arg_3 ) db . session . commit ( ) except Exception : db . session . rollback ( ) raise

def Func(arg_0, arg_1=None, arg_2=False):
    """Migrate a record from a migration dump.

    :param data: Dictionary for representing a single record and files.
    :param source_type: Determines if the MARCXML or the JSON dump is used.
        Default: ``marcxml``.
    :param latest_only: Determine is only the latest revision should be loaded.
    """
    arg_1 = arg_1 or 'marcxml'
    assert arg_1 in ['marcxml', 'json']

    arg_3 = current_migrator.records_dump_cls(
        arg_0,
        arg_1=arg_1,
        pid_fetchers=current_migrator.records_pid_fetchers,
    )
    try:
        current_migrator.records_dumploader_cls.create(arg_3)
        db.session.commit()
    except Exception:
        db.session.rollback()
        raise

Migrate a record from a migration dump .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . edges : arg_2 . _nodes = arg_0 . nodes

def Func(arg_0, arg_1):
        """ Maintains each edge's list of available nodes.
        """
        for arg_2 in arg_0.edges:
            arg_2._nodes = arg_0.nodes

Maintains each edge s list of available nodes .


def Func(arg_0, arg_1):
        """Unregister an engine that has died."""
        arg_2 = arg_1['content']
        arg_3 = int(arg_2['id'])
        if arg_3 in arg_0._ids:
            arg_0._ids.remove(arg_3)
            arg_4 = arg_0._engines.pop(arg_3)

            arg_0._handle_stranded_msgs(arg_3, arg_4)

        if arg_0._task_socket and arg_0._task_scheme == 'pure':
            arg_0._stop_scheduling_tasks()


def Func(arg_0, arg_1, arg_2):
        """Save word to memory"""
        if istainted(arg_0.pc):
            for arg_3 in get_taints(arg_0.pc):
                arg_2 = taint_with(arg_2, arg_3)
        arg_0._allocate(arg_1, 32)
        arg_0._store(arg_1, arg_2, 32)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
subprocess
.
run
(
[
'python2'
,
os
.
path
.
join
(
arg_0
.
datadir
,
'MS17-010'
,
'checker.py'
)
,
str
(
arg_1
)
]
,
stdout
=
subprocess
.
PIPE
)
arg_3
=
arg_2
.
stdout
.
decode
(
'utf-8'
)
.
split
(
'\n'
)
arg_4
=
''
for
arg_5
in
arg_3
:
if
arg_5
.
startswith
(
'Target OS:'
)
:
arg_4
=
arg_5
.
replace
(
'Target OS: '
,
''
)
break
return
arg_4

def Func(arg_0, arg_1):
        """
            Runs the checker.py scripts to detect the os.
        """
        arg_2 = subprocess.run(['python2', os.path.join(arg_0.datadir, 'MS17-010', 'checker.py'), str(arg_1)], stdout=subprocess.PIPE)
        arg_3 = arg_2.stdout.decode('utf-8').split('\n')
        arg_4 = ''
        for arg_5 in arg_3:
            if arg_5.startswith('Target OS:'):
                arg_4 = arg_5.replace('Target OS: ', '')
                break
        return arg_4

Runs the checker . py scripts to detect the os .


def Func ( arg_0 , arg_1 ) : def on_dump ( ) : arg_2 = arg_0 . patterns . at ( 0 ) arg_3 = GridLayout ( arg_2 ) arg_4 = default_instruction_svg_cache ( ) arg_5 = SVGBuilder ( ) arg_6 = KnittingPatternToSVG ( arg_2 , arg_3 , arg_4 , arg_5 , arg_1 ) return arg_6 . build_SVG_dict ( ) return XMLDumper ( on_dump )

def Func(arg_0, arg_1):
        """Create an SVG from the knitting pattern set.

        :param float zoom: the height and width of a knit instruction
        :return: a dumper to save the svg to
        :rtype: knittingpattern.Dumper.XMLDumper

        Example:

        .. code:: python

            >>> knitting_pattern_set.Func(25).temporary_path(".svg")
            "/the/path/to/the/file.svg"
        """
        def on_dump():
            """Dump the knitting pattern to the file.

            :return: the SVG XML structure as dictionary.
            """
            arg_2 = arg_0.patterns.at(0)
            arg_3 = GridLayout(arg_2)
            arg_4 = default_instruction_svg_cache()
            arg_5 = SVGBuilder()
            arg_6 = KnittingPatternToSVG(arg_2, arg_3,
                                             arg_4, arg_5, arg_1)
            return arg_6.build_SVG_dict()
        return XMLDumper(on_dump)

Create an SVG from the knitting pattern set.

        :param float zoom: the height and width of a knit instruction
        :return: a dumper to save the svg to
        :rtype: knittingpattern.Dumper.XMLDumper

        Example:

        .. code:: python

            >>> knitting_pattern_set.to_svg(25).temporary_path(".svg")
            "/the/path/to/the/file.svg"

Create an SVG from the knitting pattern set .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = dict ( ) arg_3 [ 'token' ] = arg_1 arg_3 [ 'id' ] = arg_2 arg_4 = arg_0 . request ( 'midas.folder.delete' , arg_3 ) return arg_4

def Func(arg_0, arg_1, arg_2):
        """
        Delete the folder with the passed in folder_id.

        :param token: A valid token for the user in question.
        :type token: string
        :param folder_id: The id of the folder to be deleted.
        :type folder_id: int | long
        :returns: None.
        :rtype: None
        """
        arg_3 = dict()
        arg_3['token'] = arg_1
        arg_3['id'] = arg_2
        arg_4 = arg_0.request('midas.folder.delete', arg_3)
        return arg_4

Delete the folder with the passed in folder_id .


return util.delistify(
            [self.param_dict[p] for p in util.listify(params)], params
        )

def Func ( arg_0 , arg_1 ) : return util . delistify ( [ arg_0 . param_dict [ arg_2 ] for arg_2 in util . listify ( arg_1 ) ] , arg_1 )

def Func(arg_0, arg_1):
        """
        Get the value of a list or single parameter.

        Parameters
        ----------
        params : string, list of string
            name of parameters which to retrieve
        """
        return util.delistify(
            [arg_0.param_dict[arg_2] for arg_2 in util.listify(arg_1)], arg_1
        )

Get the value of a list or single parameter .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = np . diag ( np . ones ( arg_1 + 1 ) ) [ arg_1 ] return np . polynomial . chebyshev . chebval ( arg_0 . _x2c ( arg_2 ) , arg_3 )

def Func(arg_0, arg_1, arg_2):
        """
        Evaluates an individual Chebyshev polynomial `k` in coordinate space
        with proper transformation given the window
        """
        arg_3 = np.diag(np.ones(arg_1+1))[arg_1]
        return np.polynomial.chebyshev.chebval(arg_0._x2c(arg_2), arg_3)

Evaluates an individual Chebyshev polynomial k in coordinate space with proper transformation given the window


return self._post(
            request=ApiActions.UPDATE.value,
            uri=ApiUri.ACTIONS.value,
            params=data
        )

def Func ( arg_0 , arg_1 ) : arg_2 = { 'id' : arg_1 [ 'id' ] , 'args' : arg_1 [ 'args' ] , 'rate_count' : arg_1 [ 'rate_count' ] , 'rate_range' : arg_1 [ 'rate_range' ] , 'limit_count' : arg_1 [ 'limit_count' ] , 'limit_range' : arg_1 [ 'limit_range' ] , 'schedule' : arg_1 [ 'schedule' ] , 'enabled' : arg_1 [ 'enabled' ] , 'type' : arg_1 [ 'type' ] , } return arg_0 . _post ( request = ApiActions . UPDATE . value , uri = ApiUri . ACTIONS . value , params = arg_2 )

def Func(arg_0, arg_1):
        """
        Update an alert

        :param alert: The data to Func. Must include keys:

            * id (str)
            * rate_count (int)
            * rate_range (str): 'day' or 'hour'
            * limit_count (int)
            * limit_range (str): 'day' or 'hour'
            * type (str)
            * schedule (list)
            * args (dict)
        :type alert: dict

        Example:

        .. code-block:: python

            Alert().Func(
                alert={
                    'id': 'd9d4596e-49e4-4135-b3b3-847f9e7c1f43',
                    'args': {'direct': 'you@example.com'},
                    'rate_count': 1,
                    'rate_range': 'hour',
                    'limit_count': 1,
                    'limit_range': 'hour',
                    'schedule': [],
                    'enabled': True,
                    'type': 'mailto',
                }
            )

        :return:
        :rtype: dict
        """
        arg_2 = {
            'id': arg_1['id'],
            'args': arg_1['args'],
            'rate_count': arg_1['rate_count'],
            'rate_range': arg_1['rate_range'],
            'limit_count': arg_1['limit_count'],
            'limit_range': arg_1['limit_range'],
            'schedule': arg_1['schedule'],
            'enabled': arg_1['enabled'],
            'type': arg_1['type'],
        }

        return arg_0._post(
            request=ApiActions.UPDATE.value,
            uri=ApiUri.ACTIONS.value,
            params=arg_2
        )

Update an alert

        :param alert: The data to update. Must include keys:

            * id (str)
            * rate_count (int)
            * rate_range (str): 'day' or 'hour'
            * limit_count (int)
            * limit_range (str): 'day' or 'hour'
            * type (str)
            * schedule (list)
            * args (dict)
        :type alert: dict

        Example:

        .. code-block:: python

            Alert().update(
                alert={
                    'id': 'd9d4596e-49e4-4135-b3b3-847f9e7c1f43',
                    'args': {'direct': 'you@example.com'},
                    'rate_count': 1,
                    'rate_range': 'hour',
                    'limit_count': 1,
                    'limit_range': 'hour',
                    'schedule': [],
                    'enabled': True,
                    'type': 'mailto',
                }
            )

        :return:
        :rtype: dict


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
for
arg_5
in
xrange
(
arg_3
,
arg_4
)
:
yield
'%s %s'
%
(
arg_1
,
arg_2
[
arg_5
]
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Generate comparison results for a same-tagged range."""
        for arg_5 in xrange(arg_3, arg_4):
            yield '%s %s' % (arg_1, arg_2[arg_5])

Generate comparison results for a same - tagged range .


return amp * np.exp(-((x - loc)*(x - loc))/(2.0*std*std))

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : return arg_1 * np . exp ( - ( ( arg_0 - arg_2 ) * ( arg_0 - arg_2 ) ) / ( 2.0 * arg_3 * arg_3 ) )

def Func(arg_0, arg_1, arg_2, arg_3):
    '''This is a simple gaussian.

    Parameters
    ----------

    x : np.array
        The items at which the Gaussian is evaluated.

    amp : float
        The amplitude of the Gaussian.

    loc : float
        The central value of the Gaussian.

    std : float
        The standard deviation of the Gaussian.

    Returns
    -------

    np.array
        Returns the Gaussian evaluated at the items in `x`, using the provided
        parameters of `amp`, `loc`, and `std`.

    '''

    return arg_1 * np.exp(-((arg_0 - arg_2)*(arg_0 - arg_2))/(2.0*arg_3*arg_3))


def Func ( arg_0 ) : if arg_0 . database_type == 'postgres' : if hasattr ( arg_0 . db_hook , 'conn' ) and arg_0 . db_hook . conn and arg_0 . db_hook . conn . notices : for arg_1 in arg_0 . db_hook . conn . notices : arg_0 . log . info ( arg_1 )

def Func(arg_0):
        """
        Clean up database hook after it was used.
        """
        if arg_0.database_type == 'postgres':
            if hasattr(arg_0.db_hook,
                       'conn') and arg_0.db_hook.conn and arg_0.db_hook.conn.notices:
                for arg_1 in arg_0.db_hook.conn.notices:
                    arg_0.log.info(arg_1)

Clean up database hook after it was used .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
super
(
NoseExclude
,
arg_0
)
.
Func
(
arg_1
,
arg_2
)
arg_0
.
exclude_dirs
=
{
}
if
arg_1
.
exclude_dir_file
:
if
not
arg_1
.
exclude_dirs
:
arg_1
.
exclude_dirs
=
[
]
arg_4
=
arg_0
.
_load_from_file
(
arg_1
.
exclude_dir_file
)
arg_1
.
exclude_dirs
.
extend
(
arg_4
)
if
not
arg_1
.
exclude_dirs
:
arg_0
.
enabled
=
False
return
arg_0
.
enabled
=
True
arg_6
=
os
.
getcwd
(
)
log
.
debug
(
'cwd: %s'
%
arg_6
)
for
arg_7
in
arg_1
.
exclude_dirs
:
for
arg_8
in
arg_7
.
split
(
'\n'
)
:
arg_8
=
arg_8
.
strip
(
)
arg_9
=
arg_0
.
_force_to_abspath
(
arg_8
)
if
arg_9
:
arg_0
.
exclude_dirs
[
arg_9
]
=
True
arg_10
=
"excluding dirs: %s"
%
","
.
join
(
arg_0
.
exclude_dirs
.
keys
(
)
)
log
.
debug
(
arg_10
)

def Func(arg_0, arg_1, arg_2):
        """Configure plugin based on command line options"""
        super(NoseExclude, arg_0).Func(arg_1, arg_2)

        arg_0.exclude_dirs = {}

        # preload directories from file
        if arg_1.exclude_dir_file:
            if not arg_1.exclude_dirs:
                arg_1.exclude_dirs = []

            arg_4 = arg_0._load_from_file(arg_1.exclude_dir_file)
            arg_1.exclude_dirs.extend(arg_4)

        if not arg_1.exclude_dirs:
            arg_0.enabled = False
            return

        arg_0.enabled = True
        arg_6 = os.getcwd()
        log.debug('cwd: %s' % arg_6)

        # Normalize excluded directory names for lookup
        for arg_7 in arg_1.exclude_dirs:
            # when using setup.cfg, you can specify only one 'exclude-dir'
            # separated by some character (new line is good enough)
            for arg_8 in arg_7.split('\n'):
                arg_8 = arg_8.strip()
                arg_9 = arg_0._force_to_abspath(arg_8)
                if arg_9:
                    arg_0.exclude_dirs[arg_9] = True

        arg_10 = "excluding dirs: %s" % ",".join(arg_0.exclude_dirs.keys())
        log.debug(arg_10)


(self, token, channel, ids, delete=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
False
)
:
arg_5
=
arg_0
.
url
(
)
+
"/merge/{}/"
.
format
(
','
.
join
(
[
str
(
arg_7
)
for
arg_7
in
arg_3
]
)
)
arg_6
=
arg_0
.
remote_utils
.
get_url
(
arg_5
)
if
arg_6
.
status_code
is
not
200
:
raise
RemoteDataUploadError
(
'Could not merge ids {}'
.
format
(
','
.
join
(
[
str
(
arg_7
)
for
arg_7
in
arg_3
]
)
)
)
if
arg_4
:
arg_0
.
delete_ramon
(
arg_1
,
arg_2
,
arg_3
[
1
:
]
)
return
True

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=False):
        """
        Call the restful endpoint to merge two RAMON objects into one.

        Arguments:
            token (str): The token to inspect
            channel (str): The channel to inspect
            ids (int[]): the list of the IDs to merge
            delete (bool : False): Whether to delete after merging.

        Returns:
            json: The ID as returned by ndstore
        """
        arg_5 = arg_0.url() + "/merge/{}/".format(','.join([str(arg_7) for arg_7 in arg_3]))
        arg_6 = arg_0.remote_utils.get_url(arg_5)
        if arg_6.status_code is not 200:
            raise RemoteDataUploadError('Could not merge ids {}'.format(
                                        ','.join([str(arg_7) for arg_7 in arg_3])))
        if arg_4:
            arg_0.delete_ramon(arg_1, arg_2, arg_3[1:])
        return True

Call the restful endpoint to merge two RAMON objects into one .


def Func(arg_0, arg_1):
        """ Remove procid from waitlists and reestablish it in the running list """
        logger.debug(f"Remove procid:{procid} from waitlists and reestablish it in the running list")
        for arg_2 in arg_0.rwait:
            if arg_1 in arg_2:
                arg_2.remove(arg_1)
        for arg_2 in arg_0.twait:
            if arg_1 in arg_2:
                arg_2.remove(arg_1)
        arg_0.timers[arg_1] = None
        arg_0.running.append(arg_1)
        if arg_0._current is None:
            arg_0._current = arg_1


def Func(arg_0):
    """Fetch an individual file from a project.

    The first part of the remote path is interpreted as the name of the
    storage provider. If there is no match the default (osfstorage) is
    used.

    The local path defaults to the name of the remote file.

    If the project is private you need to specify a username.

    If args.force is True, write local file even if that file already exists.
    If args.force is False but args.update is True, overwrite an existing local
    file only if local and remote files differ.
    """
    arg_1, arg_2 = split_storage(arg_0.remote)

    arg_3 = arg_0.local
    if arg_3 is None:
        arg_4, arg_3 = os.path.split(arg_2)

    arg_5 = os.path.exists(arg_3)
    if arg_5 and not arg_0.force and not arg_0.update:
        sys.exit("Local file %s already exists, not overwriting." % arg_3)

    arg_6, arg_4 = os.path.split(arg_3)
    if arg_6:
        makedirs(arg_6, exist_ok=True)

    arg_7 = _setup_osf(arg_0)
    arg_8 = arg_7.project(arg_0.project)

    arg_9 = arg_8.storage(arg_1)
    for arg_10 in arg_9.files:
        if norm_remote_path(arg_10.path) == arg_2:
            if arg_5 and not arg_0.force and arg_0.update:
                if arg_10.hashes.get('md5') == checksum(arg_3):
                    print("Local file %s already matches remote." % arg_3)
                    break
            with open(arg_3, 'wb') as fp:
                arg_10.write_to(fp)

            # only Funcing one file so we are done
            break

Fetch an individual file from a project .


def Func(arg_0,arg_1=None,arg_2=None):
        """Same as `ComponentStream.connect` but assume `self.lock` is acquired."""
        if arg_0.me.node or arg_0.me.resource:
            raise Value("Component JID may have only domain defined")
        if not arg_1:
            arg_1=arg_0.server
        if not arg_2:
            arg_2=arg_0.port
        if not arg_1 or not arg_2:
            raise ValueError("Server or port not given")
        Stream.Func(arg_0,arg_1,arg_2,None,arg_0.me)

Same as ComponentStream . connect but assume self . lock is acquired .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . size arg_3 = { 8 : 'DL' , 16 : 'DX' , 32 : 'EDX' , 64 : 'RDX' } [ arg_2 ] arg_4 = { 8 : 'AL' , 16 : 'AX' , 32 : 'EAX' , 64 : 'RAX' } [ arg_2 ] arg_5 = Operators . CONCAT ( arg_2 * 2 , arg_0 . read_register ( arg_3 ) , arg_0 . read_register ( arg_4 ) ) arg_6 = Operators . ZEXTEND ( arg_1 . read ( ) , arg_2 * 2 ) if isinstance ( arg_6 , int ) and arg_6 == 0 : raise DivideByZeroError ( ) arg_7 = Operators . UFunc ( arg_5 , arg_6 ) arg_8 = ( 1 << arg_2 ) - 1 if isinstance ( arg_7 , int ) and arg_7 > arg_8 : raise DivideByZeroError ( ) arg_9 = Operators . UREM ( arg_5 , arg_6 ) arg_0 . write_register ( arg_4 , Operators . EXTRACT ( arg_7 , 0 , arg_2 ) ) arg_0 . write_register ( arg_3 , Operators . EXTRACT ( arg_9 , 0 , arg_2 ) )

def Func(arg_0, arg_1):
        """
        Unsigned divide.

        Divides (unsigned) the value in the AX register, DX:AX register pair,
        or EDX:EAX or RDX:RAX register pair (dividend) by the source operand
        (divisor) and stores the result in the AX (AH:AL), DX:AX, EDX:EAX or
        RDX:RAX registers. The source operand can be a general-purpose register
        or a memory location. The action of this instruction depends of the
        operand size (dividend/divisor). Division using 64-bit operand is
        available only in 64-bit mode. Non-integral results are truncated
        (chopped) towards 0. The reminder is always less than the divisor in
        magnitude. Overflow is indicated with the #DE (divide error) exception
        rather than with the CF flag::

            IF SRC  =  0
                THEN #DE; FI;(* divide error *)
            IF OperandSize  =  8 (* word/byte operation *)
                THEN
                    temp  =  AX / SRC;
                    IF temp > FFH
                        THEN #DE; (* divide error *) ;
                        ELSE
                            AL  =  temp;
                            AH  =  AX MOD SRC;
                    FI;
                ELSE IF OperandSize  =  16 (* doubleword/word operation *)
                    THEN
                        temp  =  DX:AX / SRC;
                        IF temp > FFFFH
                            THEN #DE; (* divide error *) ;
                        ELSE
                            AX  =  temp;
                            DX  =  DX:AX MOD SRC;
                        FI;
                    FI;
                ELSE If OperandSize = 32 (* quadword/doubleword operation *)
                    THEN
                        temp  =  EDX:EAX / SRC;
                        IF temp > FFFFFFFFH
                            THEN #DE; (* divide error *) ;
                        ELSE
                            EAX  =  temp;
                            EDX  =  EDX:EAX MOD SRC;
                        FI;
                    FI;
                ELSE IF OperandSize = 64 (*Doublequadword/quadword operation*)
                    THEN
                        temp = RDX:RAX / SRC;
                        IF temp > FFFFFFFFFFFFFFFFH
                            THEN #DE; (* Divide error *)
                        ELSE
                            RAX = temp;
                            RDX = RDX:RAX MOD SRC;
                        FI;
                    FI;
            FI;

        :param cpu: current CPU.
        :param src: source operand.
        """
        arg_2 = arg_1.size
        arg_3 = {8: 'DL', 16: 'DX', 32: 'EDX', 64: 'RDX'}[arg_2]
        arg_4 = {8: 'AL', 16: 'AX', 32: 'EAX', 64: 'RAX'}[arg_2]

        arg_5 = Operators.CONCAT(arg_2 * 2,
                                    arg_0.read_register(arg_3),
                                    arg_0.read_register(arg_4))
        arg_6 = Operators.ZEXTEND(arg_1.read(), arg_2 * 2)

        # TODO make symbol friendly
        if isinstance(arg_6, int) and arg_6 == 0:
            raise DivideByZeroError()
        arg_7 = Operators.UFunc(arg_5, arg_6)

        arg_8 = (1 << arg_2) - 1

        # TODO make symbol friendly
        if isinstance(arg_7, int) and arg_7 > arg_8:
            raise DivideByZeroError()
        arg_9 = Operators.UREM(arg_5, arg_6)

        arg_0.write_register(arg_4, Operators.EXTRACT(arg_7, 0, arg_2))
        arg_0.write_register(arg_3, Operators.EXTRACT(arg_9, 0, arg_2))


(
            self,
            hql,
            csv_filepath,
            schema='default',
            delimiter=',',
            lineterminator='\r\n',
            output_header=True,
            fetch_size=1000,
            hive_conf=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
'default'
,
arg_4
=
','
,
arg_5
=
'\r\n'
,
arg_6
=
True
,
arg_7
=
1000
,
arg_8
=
)
:
arg_9
=
arg_0
.
_get_results
(
arg_1
,
arg_3
,
arg_7
=
arg_7
,
arg_8
=
arg_8
)
arg_10
=
next
(
arg_9
)
arg_11
=
arg_12
=
0
with
open
(
arg_2
,
'wb'
)
as
f
:
arg_13
=
csv
.
writer
(
f
,
arg_4
=
arg_4
,
arg_5
=
arg_5
,
encoding
=
'utf-8'
)
try
:
if
arg_6
:
arg_0
.
log
.
debug
(
'Cursor description is %s'
,
arg_10
)
arg_13
.
writerow
(
[
arg_14
[
0
]
for
arg_14
in
arg_10
]
)
for
arg_12
,
arg_15
in
enumerate
(
arg_9
,
1
)
:
arg_13
.
writerow
(
arg_15
)
if
arg_12
%
arg_7
==
0
:
arg_0
.
log
.
info
(
"Written %s rows so far."
,
arg_12
)
except
ValueError
as
exception
:
arg_11
=
str
(
exception
)
if
arg_11
:
os
.
remove
(
arg_2
)
raise
ValueError
(
arg_11
)
arg_0
.
log
.
info
(
"Done. Loaded a total of %s rows."
,
arg_12
)

def Func(
            arg_0,
            arg_1,
            arg_2,
            arg_3='default',
            arg_4=',',
            arg_5='\r\n',
            arg_6=True,
            arg_7=1000,
            arg_8=None):
        """
        Execute hql in target schema and write results to a csv file.

        :param hql: hql to be executed.
        :type hql: str or list
        :param csv_filepath: filepath of csv to write results into.
        :type csv_filepath: str
        :param schema: target schema, default to 'default'.
        :type schema: str
        :param delimiter: delimiter of the csv file, default to ','.
        :type delimiter: str
        :param lineterminator: lineterminator of the csv file.
        :type lineterminator: str
        :param output_header: header of the csv file, default to True.
        :type output_header: bool
        :param fetch_size: number of result rows to write into the csv file, default to 1000.
        :type fetch_size: int
        :param hive_conf: hive_conf to execute alone with the hql.
        :type hive_conf: dict

        """

        arg_9 = arg_0._get_results(arg_1, arg_3,
                                         arg_7=arg_7, arg_8=arg_8)
        arg_10 = next(arg_9)
        arg_11 = None

        arg_12 = 0
        with open(arg_2, 'wb') as f:
            arg_13 = csv.writer(f,
                                arg_4=arg_4,
                                arg_5=arg_5,
                                encoding='utf-8')
            try:
                if arg_6:
                    arg_0.log.debug('Cursor description is %s', arg_10)
                    arg_13.writerow([arg_14[0] for arg_14 in arg_10])

                for arg_12, arg_15 in enumerate(arg_9, 1):
                    arg_13.writerow(arg_15)
                    if arg_12 % arg_7 == 0:
                        arg_0.log.info("Written %s rows so far.", arg_12)
            except ValueError as exception:
                arg_11 = str(exception)

        if arg_11:
            # need to clean up the file first
            os.remove(arg_2)
            raise ValueError(arg_11)

        arg_0.log.info("Done. Loaded a total of %s rows.", arg_12)

Execute hql in target schema and write results to a csv file .


def Func ( arg_0 , arg_1 = arg_2 ) : return b64encode ( writes ( arg_0 , arg_1 = arg_1 ) . encode ( 'utf-8' ) )

def Func(arg_0, arg_1=arg_2):
    """
    Write a notebook as base64.
    """
    return b64encode(writes(arg_0, arg_1=arg_1).encode('utf-8'))


def Func(arg_0, arg_1, arg_2):
        """
        Writes a value in the stack.

        :param value: the value to put in the stack.
        :param size: the size of the value.
        """
        assert arg_2 in (8, 16, arg_0.address_bit_size)
        arg_0.STACK = arg_0.STACK - arg_2 // 8
        arg_4, arg_5, arg_5 = arg_0.get_descriptor(arg_0.read_register('SS'))
        arg_6 = arg_0.STACK + arg_4
        arg_0.write_int(arg_6, arg_1, arg_2)


(url, output_dir='.', merge=True, info_only=False, **kwargs)

def Func(arg_0, arg_1='.', arg_2=True, arg_3=False, **arg_4):
    """Downloads Dailymotion videos by URL.
    """

    arg_5 = get_content(rebuilt_url(arg_0))
    arg_6 = json.loads(match1(arg_5, r'qualities":({.+?}),"'))
    arg_7 = match1(arg_5, r'"video_title"\s*:\s*"([^"]+)"') or \
            match1(arg_5, r'"title"\s*:\s*"([^"]+)"')
    arg_7 = unicodize(arg_7)

    for arg_8 in ['1080','720','480','380','240','144','auto']:
        try:
            arg_9 = arg_6[arg_8][1]["url"]
            if arg_9:
                break
        except KeyError:
            pass

    arg_10, arg_11, arg_12 = url_info(arg_9)

    print_info(site_info, arg_7, arg_10, arg_12)
    if not arg_3:
        download_urls([arg_9], arg_7, arg_11, arg_12, arg_1=arg_1, arg_2=arg_2)


(cachedir: StoreBackendBase, func_name: str, limit: int)

def
Func
(
arg_0
:
arg_1
,
arg_2
:
arg_3
,
arg_4
:
arg_5
)
->
arg_5
:
if
arg_4
<
1
:
raise
ValueError
(
"'limit' must be greater or equal to 1"
)
arg_6
=
get_cachedir_entries
(
arg_0
,
arg_2
)
arg_6
=
sorted
(
arg_6
,
key
=
lambda
e
:
e
.
last_access
,
reverse
=
True
)
arg_7
=
arg_6
[
arg_4
:
]
for
arg_8
in
arg_7
:
shutil
.
rmtree
(
arg_8
.
path
,
ignore_errors
=
True
)
return
len
(
arg_7
)

def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_5) -> arg_5:
    """Remove old entries from the cache"""
    if arg_4 < 1:
        raise ValueError("'limit' must be greater or equal to 1")

    arg_6 = get_cachedir_entries(arg_0, arg_2)
    arg_6 = sorted(arg_6, key=lambda e: e.last_access, reverse=True)
    arg_7 = arg_6[arg_4:]
    for arg_8 in arg_7:
        shutil.rmtree(arg_8.path, ignore_errors=True)

    return len(arg_7)


def Func(arg_0, arg_1):
        """
        Returns any descendants that have the given task spec assigned.

        :type  task_spec: TaskSpec
        :param task_spec: The wanted task spec.
        :rtype:  list(Task)
        :returns: The tasks objects that are attached to the given task spec.
        """
        arg_2 = []
        if arg_0.task_spec == arg_1:
            arg_2.append(arg_0)
        for arg_3 in arg_0:
            if arg_3.task_spec != arg_1:
                continue
            arg_2.append(arg_3)
        return arg_2

Returns any descendants that have the given task spec assigned .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . test if not isinstance ( arg_2 , BoolOp ) : return arg_3 = _count_boolean_expressions ( arg_2 ) if arg_3 > arg_0 . config . max_bool_expr : arg_0 . add_message ( "too-many-boolean-expressions" , arg_1 = arg_2 , args = ( arg_3 , arg_0 . config . max_bool_expr ) , )

def Func(arg_0, arg_1):
        """Go through "if" node `node` and counts its boolean expressions

        if the "if" node test is a BoolOp node
        """
        arg_2 = arg_1.test
        if not isinstance(arg_2, BoolOp):
            return
        arg_3 = _count_boolean_expressions(arg_2)
        if arg_3 > arg_0.config.max_bool_expr:
            arg_0.add_message(
                "too-many-boolean-expressions",
                arg_1=arg_2,
                args=(arg_3, arg_0.config.max_bool_expr),
            )

Go through if node node and counts its boolean expressions


(name: str, inputs: Sequence[Mapping[str, Any]])

return name + SolidityMetadata.tuple_signature_for_components(inputs)

def Func(arg_0: arg_1, arg_2: arg_3[arg_4[arg_1, arg_5]]) -> arg_1:
        """Returns the function signature for the specified name and Solidity JSON metadata inputs array.

        The ABI specification defines the function signature as the function name followed by the parenthesised list of
        parameter types separated by single commas and no spaces.
        See https://solidity.readthedocs.io/en/latest/abi-spec.html#function-selector
        """
        return arg_0 + SolidityMetadata.tuple_signature_for_components(arg_2)

Returns the function signature for the specified name and Solidity JSON metadata inputs array .


def Func ( arg_0 , arg_1 = True ) : if not isinstance ( arg_0 , element ) : return arg_0 . xml_value if arg_1 else [ arg_0 . xml_value ] arg_2 = [ ] for arg_3 in arg_0 . xml_children : if isinstance ( arg_3 , text ) : arg_2 . append ( arg_3 . xml_value ) elif isinstance ( arg_3 , element ) : arg_2 . extend ( Func ( arg_3 , arg_1 = False ) ) if arg_1 : arg_2 = '' . join ( arg_2 ) return arg_2

def Func(arg_0, arg_1=True):
    '''
    XPath-like string value of node
    '''
    if not isinstance(arg_0, element):
        return arg_0.xml_value if arg_1 else [arg_0.xml_value]
    arg_2 = []
    for arg_3 in arg_0.xml_children:
        if isinstance(arg_3, text):
            arg_2.append(arg_3.xml_value)
        elif isinstance(arg_3, element):
            arg_2.extend(Func(arg_3, arg_1=False))
    if arg_1: arg_2 = ''.join(arg_2)
    return arg_2


def Func ( arg_0 , arg_1 , arg_2 = { } ) : arg_3 = COURSES_API . format ( arg_1 ) + "/users" arg_4 = arg_0 . _get_paged_resource ( arg_3 , arg_2 = arg_2 ) arg_5 = [ ] for arg_6 in arg_4 : arg_5 . append ( CanvasUser ( arg_4 = arg_6 ) ) return arg_5

def Func(arg_0, arg_1, arg_2={}):
        """
        Returns a list of users for the given course id.
        """
        arg_3 = COURSES_API.format(arg_1) + "/users"
        arg_4 = arg_0._get_paged_resource(arg_3, arg_2=arg_2)
        arg_5 = []
        for arg_6 in arg_4:
            arg_5.append(CanvasUser(arg_4=arg_6))
        return arg_5

Returns a list of users for the given course id .


def Func ( arg_0 , arg_1 ) : if not arg_1 : return True arg_1 = arg_1 [ 1 : - 1 ] if arg_1 . startswith ( '@' ) : arg_1 = arg_1 [ 1 : ] if '=' in arg_1 : arg_2 , arg_3 = arg_1 . split ( '=' , 1 ) if arg_3 [ 0 ] in ( '"' , "'" ) : arg_3 = arg_3 [ 1 : ] if arg_3 [ - 1 ] in ( '"' , "'" ) : arg_3 = arg_3 [ : - 1 ] return arg_0 . attrs . get ( arg_2 ) == arg_3 else : return arg_1 in arg_0 . attrs elif num_re . match ( arg_1 ) : arg_4 = int ( arg_1 ) if arg_4 < 0 : if arg_0 . parent : return arg_0 . index == ( len ( arg_0 . parent . _children ) + arg_4 ) else : return arg_4 == 0 else : return arg_4 == arg_0 . index else : if '=' in arg_1 : arg_5 , arg_3 = arg_1 . split ( '=' , 1 ) if arg_3 [ 0 ] in ( '"' , "'" ) : arg_3 = arg_3 [ 1 : ] if arg_3 [ - 1 ] in ( '"' , "'" ) : arg_3 = arg_3 [ : - 1 ] for arg_6 in arg_0 . _children : if arg_6 . tagname == arg_5 and arg_6 . data == arg_3 : return True else : for arg_6 in arg_0 . _children : if arg_6 . tagname == arg_1 : return True return False

def Func(arg_0, arg_1):
        """
        Helper function to determine if this node matches the given predicate.
        """
        if not arg_1:
            return True
        # Strip off the [ and ]
        arg_1 = arg_1[1:-1]
        if arg_1.startswith('@'):
            # An attribute predicate checks the existence (and optionally value) of an attribute on this tag.
            arg_1 = arg_1[1:]
            if '=' in arg_1:
                arg_2, arg_3 = arg_1.split('=', 1)
                if arg_3[0] in ('"', "'"):
                    arg_3 = arg_3[1:]
                if arg_3[-1] in ('"', "'"):
                    arg_3 = arg_3[:-1]
                return arg_0.attrs.get(arg_2) == arg_3
            else:
                return arg_1 in arg_0.attrs
        elif num_re.match(arg_1):
            # An index predicate checks whether we are the n-th child of our parent (0-based).
            arg_4 = int(arg_1)
            if arg_4 < 0:
                if arg_0.parent:
                    # For negative indexes, count from the end of the list.
                    return arg_0.index == (len(arg_0.parent._children) + arg_4)
                else:
                    # If we're the root node, the only index we could be is 0.
                    return arg_4 == 0
            else:
                return arg_4 == arg_0.index
        else:
            if '=' in arg_1:
                arg_5, arg_3 = arg_1.split('=', 1)
                if arg_3[0] in ('"', "'"):
                    arg_3 = arg_3[1:]
                if arg_3[-1] in ('"', "'"):
                    arg_3 = arg_3[:-1]
                for arg_6 in arg_0._children:
                    if arg_6.tagname == arg_5 and arg_6.data == arg_3:
                        return True
            else:
                # A plain [tag] predicate means we match if we have a child with tagname "tag".
                for arg_6 in arg_0._children:
                    if arg_6.tagname == arg_1:
                        return True
        return False

Helper function to determine if this node matches the given predicate .


def
Func
(
arg_0
)
:
if
isinstance
(
arg_0
,
int
)
:
arg_0
=
time
.
strftime
(
'%Y-%m-%d %H:%M:%S'
,
time
.
localtime
(
arg_0
)
)
if
isinstance
(
arg_0
,
str
)
or
isinstance
(
arg_0
,
unicode
)
:
arg_0
=
dateutil
.
parser
.
parse
(
arg_0
)
if
not
arg_0
.
tzinfo
:
arg_1
=
pytz
.
timezone
(
_detect_timezone
(
)
)
arg_2
=
arg_1
.
localize
(
arg_0
,
is_dst
=
)
arg_0
=
arg_2
.
astimezone
(
pytz
.
utc
)
+
pd
.
datetools
.
day
return
arg_0

def Func(arg_0):
    '''
    Dates can be defined in many ways, but zipline use
    aware datetime objects only. Plus, the software work
    with utc timezone so we convert it.
    '''
    if isinstance(arg_0, int):
        # This is probably epoch time
        arg_0 = time.strftime('%Y-%m-%d %H:%M:%S',
                             time.localtime(arg_0))

    # assert isinstance(date, str) or isinstance(date, unicode)
    if isinstance(arg_0, str) or isinstance(arg_0, unicode):
        arg_0 = dateutil.parser.parse(arg_0)
    if not arg_0.tzinfo:
        arg_1 = pytz.timezone(_detect_timezone())
        arg_2 = arg_1.localize(arg_0, is_dst=None)
        # TODO I'm not sure why and when I need to add a date to make it right
        arg_0 = arg_2.astimezone(pytz.utc) + pd.datetools.day

    return arg_0

Dates can be defined in many ways but zipline use aware datetime objects only . Plus the software work with utc timezone so we convert it .


def
Func
(
arg_0
,
arg_1
=
'Hello'
,
arg_2
=
False
)
:
arg_3
=
'%s, %s'
%
(
arg_1
,
arg_0
)
if
arg_2
:
print
'%s!'
%
arg_3
.
upper
(
)
else
:
print
'%s.'
%
arg_3

def Func(arg_0, arg_1='Hello', arg_2=False):
    '''Mixing and matching positional args and keyword options.'''
    arg_3 = '%s, %s' % (arg_1, arg_0)
    if arg_2:
        print '%s!' % arg_3.upper()
    else:
        print '%s.' % arg_3

Mixing and matching positional args and keyword options .


def Func ( arg_0 ) : arg_1 = getattr ( arg_0 . Meta , 'authenticated_fields' , [ ] ) if not arg_0 . is_authenticated ( ) : for arg_2 in arg_1 : arg_0 . fields . pop ( arg_2 )

def Func(arg_0):
        """Hides authenticated_fields if request context is missing or
        user is not authenticated"""
        arg_1 = getattr(arg_0.Meta, 'authenticated_fields', [])

        if not arg_0.is_authenticated():
            for arg_2 in arg_1:
                arg_0.fields.pop(arg_2)


return Seed(seed) if seed else Seed.random()

def Func():
        # type: () -> Seed
        """
        Prompts the user to enter their seed via stdin.
        """
        arg_0 = secure_input(
            'Enter seed and press return (typing will not be shown).\n'
            'If no seed is specified, a random one will be used instead.\n'
        )

        if isinstance(arg_0, text_type):
            arg_0 = arg_0.encode('ascii')

        return Seed(arg_0) if arg_0 else Seed.random()

Prompts the user to enter their seed via stdin .


(graph: BELGraph,
                                                source: BaseEntity,
                                                target: BaseEntity,
                                                key: str,
                                                )

return has_protein_modification(graph, source) and part_has_modifier(edge_data, OBJECT, ACTIVITY)

def Func(arg_0: arg_1,
                                                arg_2: arg_3,
                                                arg_4: arg_3,
                                                arg_5: arg_6,
                                                ) -> bool:
    """Check if pmod of source causes activity of target."""
    arg_7 = arg_0[arg_2][arg_4][arg_5]
    return has_protein_modification(arg_0, arg_2) and part_has_modifier(arg_7, OBJECT, ACTIVITY)

Check if pmod of source causes activity of target .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
panel_collection
.
delete_one
(
{
'_id'
:
arg_1
[
'_id'
]
}
)
LOG
.
warning
(
"Deleting panel %s, version %s"
%
(
arg_1
[
'panel_name'
]
,
arg_1
[
'version'
]
)
)
return
arg_2

def Func(arg_0, arg_1):
        """Delete a panel by '_id'.

        Args:
            panel_obj(dict)

        Returns:
            res(pymongo.DeleteResult)
        """
        arg_2 = arg_0.panel_collection.delete_one({'_id': arg_1['_id']})
        LOG.warning("Deleting panel %s, version %s" % (arg_1['panel_name'], arg_1['version']))
        return arg_2


def Func(arg_0):
        """Disable event loop integration with wxPython.

        This merely sets PyOS_InputHook to NULL.
        """
        if arg_0._apps.has_key(arg_2):
            arg_0._apps[arg_2]._in_event_loop = False
        arg_0.clear_inputhook()

Disable event loop integration with wxPython .


(features, labels, seq_begins, seq_lengths)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_3 . max ( ) arg_5 = np . zeros ( ( BATCH_SIZE , arg_4 , arg_0 . shape [ - 1 ] ) , 'f' ) arg_6 = np . zeros ( ( BATCH_SIZE , arg_4 ) , 'i' ) arg_7 = np . zeros ( ( BATCH_SIZE , arg_4 ) , 'f' ) for arg_8 , ( arg_9 , arg_4 ) in enumerate ( zip ( arg_2 , arg_3 ) ) : arg_5 [ arg_8 , : arg_4 ] = arg_0 [ arg_9 : arg_9 + arg_4 ] arg_6 [ arg_8 , : arg_4 ] = arg_1 [ arg_9 : arg_9 + arg_4 ] arg_7 [ arg_8 , : arg_4 ] = 1 return [ arg_5 , arg_6 , arg_7 ]

def Func(arg_0, arg_1, arg_2, arg_3):
    '''Extract a single batch of data to pass to the model being trained.

    Parameters
    ----------
    features, labels : ndarray
        Arrays of the input features and target labels.
    seq_begins : ndarray
        Array of the start offsets of the speech segments to include.
    seq_lengths : ndarray
        Array of the lengths of the speech segments to include in the batch.

    Returns
    -------
    features, labels, mask : ndarrays
        A triple of arrays for training a network. The first element contains
        input features, the second contains target labels, and the third
        contains a "mask" consisting of ones where there is valid data and zeros
        everywhere else.
    '''
    arg_4 = arg_3.max()
    arg_5 = np.zeros((BATCH_SIZE, arg_4, arg_0.shape[-1]), 'f')
    arg_6 = np.zeros((BATCH_SIZE, arg_4), 'i')
    arg_7 = np.zeros((BATCH_SIZE, arg_4), 'f')
    for arg_8, (arg_9, arg_4) in enumerate(zip(arg_2, arg_3)):
        arg_5[arg_8, :arg_4] = arg_0[arg_9:arg_9+arg_4]
        arg_6[arg_8, :arg_4] = arg_1[arg_9:arg_9+arg_4]
        arg_7[arg_8, :arg_4] = 1
    return [arg_5, arg_6, arg_7]

Extract a single batch of data to pass to the model being trained .


GetConsoleOriginalTitle from Win32.
    Return str.
    Only available on Windows Vista or higher.

def Func() -> str:
    """
    Func from Win32.
    Return str.
    Only available on Windows Vista or higher.
    """
    if IsNT6orHigher:
        arg_0 = ctypes.c_wchar * MAX_PATH
        arg_1 = arg_0()
        ctypes.windll.kernel32.FuncW(arg_1, MAX_PATH)
        return arg_1.value
    else:
        raise RuntimeError('Func is not supported on Windows XP or lower.')

GetConsoleOriginalTitle from Win32 . Return str . Only available on Windows Vista or higher .


def Func ( arg_0 , arg_1 ) : arg_0 . error = False arg_0 . graph = Graph ( ) arg_0 . graph . Func ( file = arg_1 , format = 'xml' ) arg_0 . doc = document . Document ( ) for arg_5 , arg_6 , arg_7 in arg_0 . graph . triples ( ( None , RDF . type , arg_0 . spdx_namespace [ 'SpdxDocument' ] ) ) : arg_0 . Func_doc_fields ( arg_5 ) for arg_5 , arg_6 , arg_7 in arg_0 . graph . triples ( ( None , RDF . type , arg_0 . spdx_namespace [ 'ExternalDocumentRef' ] ) ) : arg_0 . Func_ext_doc_ref ( arg_5 ) for arg_5 , arg_6 , arg_7 in arg_0 . graph . triples ( ( None , RDF . type , arg_0 . spdx_namespace [ 'CreationInfo' ] ) ) : arg_0 . Func_creation_info ( arg_5 ) for arg_5 , arg_6 , arg_7 in arg_0 . graph . triples ( ( None , RDF . type , arg_0 . spdx_namespace [ 'Package' ] ) ) : arg_0 . Func_package ( arg_5 ) for arg_5 , arg_6 , arg_7 in arg_0 . graph . triples ( ( None , arg_0 . spdx_namespace [ 'referencesFile' ] , None ) ) : arg_0 . Func_file ( arg_7 ) for arg_5 , arg_6 , arg_7 in arg_0 . graph . triples ( ( None , arg_0 . spdx_namespace [ 'reviewed' ] , None ) ) : arg_0 . Func_review ( arg_7 ) for arg_5 , arg_6 , arg_7 in arg_0 . graph . triples ( ( None , arg_0 . spdx_namespace [ 'annotation' ] , None ) ) : arg_0 . Func_annotation ( arg_7 ) arg_8 = [ ] arg_8 = arg_0 . doc . validate ( arg_8 ) if not arg_0 . error : if arg_8 : for arg_9 in arg_8 : arg_0 . logger . log ( arg_9 ) arg_0 . error = True return arg_0 . doc , arg_0 . error

def Func(arg_0, arg_1):
        """Parses a file and returns a document object.
        File, a file like object.
        """
        arg_0.error = False
        arg_0.graph = Graph()
        arg_0.graph.Func(file=arg_1, format='xml')
        arg_0.doc = document.Document()

        for arg_5, arg_6, arg_7 in arg_0.graph.triples((None, RDF.type, arg_0.spdx_namespace['SpdxDocument'])):
            arg_0.Func_doc_fields(arg_5)

        for arg_5, arg_6, arg_7 in arg_0.graph.triples((None, RDF.type, arg_0.spdx_namespace['ExternalDocumentRef'])):
            arg_0.Func_ext_doc_ref(arg_5)

        for arg_5, arg_6, arg_7 in arg_0.graph.triples((None, RDF.type, arg_0.spdx_namespace['CreationInfo'])):
            arg_0.Func_creation_info(arg_5)

        for arg_5, arg_6, arg_7 in arg_0.graph.triples((None, RDF.type, arg_0.spdx_namespace['Package'])):
            arg_0.Func_package(arg_5)

        for arg_5, arg_6, arg_7 in arg_0.graph.triples((None, arg_0.spdx_namespace['referencesFile'], None)):
            arg_0.Func_file(arg_7)

        for arg_5, arg_6, arg_7 in arg_0.graph.triples((None, arg_0.spdx_namespace['reviewed'], None)):
            arg_0.Func_review(arg_7)

        for arg_5, arg_6, arg_7 in arg_0.graph.triples((None, arg_0.spdx_namespace['annotation'], None)):
            arg_0.Func_annotation(arg_7)

        arg_8 = []
        # Report extra errors if self.error is False otherwise there will be
        # redundent messages
        arg_8 = arg_0.doc.validate(arg_8)
        if not arg_0.error:
            if arg_8:
                for arg_9 in arg_8:
                    arg_0.logger.log(arg_9)
                arg_0.error = True
        return arg_0.doc, arg_0.error

Parses a file and returns a document object . File a file like object .


def
Func
(
arg_0
,
arg_1
)
:
Log
.
debug
(
"Setting topology context"
)
arg_2
=
arg_0
.
get_topology_config
(
)
arg_2
.
update
(
arg_0
.
_get_dict_from_config
(
arg_0
.
my_component
.
config
)
)
arg_3
=
arg_0
.
_get_task_to_comp_map
(
)
arg_0
.
context
=
TopologyContextImpl
(
arg_2
,
arg_0
.
pplan
.
topology
,
arg_3
,
arg_0
.
my_task_id
,
arg_1
,
arg_0
.
topology_pex_abs_path
)

def Func(arg_0, arg_1):
    """Sets a new topology context"""
    Log.debug("Setting topology context")
    arg_2 = arg_0.get_topology_config()
    arg_2.update(arg_0._get_dict_from_config(arg_0.my_component.config))
    arg_3 = arg_0._get_task_to_comp_map()
    arg_0.context = TopologyContextImpl(arg_2, arg_0.pplan.topology, arg_3,
                                       arg_0.my_task_id, arg_1,
                                       arg_0.topology_pex_abs_path)


def Func ( arg_0 ) : arg_1 = arg_0 . cleaned_data [ arg_0 . Fields . COURSE ] . strip ( ) if not arg_1 : return None try : arg_2 = EnrollmentApiClient ( ) return arg_2 . get_course_details ( arg_1 ) except ( HttpClientError , HttpServerError ) : raise ValidationError ( ValidationMessages . INVALID_COURSE_ID . format ( arg_1 = arg_1 ) )

def Func(arg_0):
        """
        Verify course ID and retrieve course details.
        """
        arg_1 = arg_0.cleaned_data[arg_0.Fields.COURSE].strip()
        if not arg_1:
            return None
        try:
            arg_2 = EnrollmentApiClient()
            return arg_2.get_course_details(arg_1)
        except (HttpClientError, HttpServerError):
            raise ValidationError(ValidationMessages.INVALID_COURSE_ID.format(arg_1=arg_1))

Verify course ID and retrieve course details .


def Func ( arg_0 ) : arg_1 = arg_0 + '_splitted' if not os . path . exists ( arg_1 ) : os . mkdir ( arg_1 ) arg_2 = os . path . getsize ( arg_0 ) / number_of_files + 1 arg_3 = [ ] with open ( arg_0 , "r" ) as f : arg_4 = 0 arg_5 = 0 while 1 : arg_6 = arg_5 f . seek ( arg_2 , os . SEEK_CUR ) arg_7 = f . readline ( ) if len ( arg_7 ) == 0 : arg_7 = f . readline ( ) while len ( arg_7 ) != 0 and arg_7 != separator : arg_7 = f . readline ( ) arg_5 = f . tell ( ) arg_8 = os . path . join ( arg_1 , str ( arg_4 ) ) with open ( arg_0 , "r" ) as temp : temp . seek ( arg_6 ) arg_9 = temp . read ( arg_5 - arg_6 ) open ( arg_8 , 'w' ) . write ( arg_9 ) arg_3 . append ( arg_8 ) arg_4 += 1 if len ( arg_7 ) == 0 : break return arg_3

def Func(arg_0):
    """
        Split the file and return the list of filenames.
    """
    arg_1 = arg_0 + '_splitted'
    if not os.path.exists(arg_1):
        os.mkdir(arg_1)
    arg_2 = os.path.getsize(arg_0) / number_of_files + 1
    arg_3 = []
    with open(arg_0, "r") as f:
        arg_4 = 0
        arg_5 = 0
        while 1:
            arg_6 = arg_5
            # Jump of "size" from the current place in the file
            f.seek(arg_2, os.SEEK_CUR)

            # find the next separator or EOF
            arg_7 = f.readline()
            if len(arg_7) == 0:
                arg_7 = f.readline()
            while len(arg_7) != 0 and arg_7 != separator:
                arg_7 = f.readline()

            # Get the current place
            arg_5 = f.tell()
            arg_8 = os.path.join(arg_1, str(arg_4))

            # Create the new file
            with open(arg_0, "r") as temp:
                temp.seek(arg_6)
                # Get the text we want to put in the new file
                arg_9 = temp.read(arg_5 - arg_6)
                # Write the new file
                open(arg_8, 'w').write(arg_9)
            arg_3.append(arg_8)
            arg_4 += 1

            # End of file
            if len(arg_7) == 0:
                break
    return arg_3

Split the file and return the list of filenames .


Convert the input ``size`` to human readable, short form.

def
Func
(
arg_0
,
arg_1
,
arg_2
=
1000
,
arg_3
=
' kMGTZ'
)
:
arg_4
=
'+'
if
arg_1
>=
0
else
'-'
arg_1
=
abs
(
arg_1
)
if
arg_1
<
1000
:
return
'%s%d'
%
(
arg_4
,
arg_1
)
for
arg_5
,
arg_6
in
enumerate
(
arg_3
)
:
arg_7
=
1000
**
(
arg_5
+
1
)
if
arg_1
<
arg_7
:
return
(
'%s%.01f%s'
%
(
arg_4
,
arg_1
/
float
(
arg_7
)
*
arg_2
,
arg_6
,
)
)
.
strip
(
)
raise
OverflowError

def Func(arg_0, arg_1, arg_2=1000, arg_3=' kMGTZ'):
        """Convert the input ``size`` to Func readable, short form."""
        arg_4 = '+' if arg_1 >= 0 else '-'
        arg_1 = abs(arg_1)
        if arg_1 < 1000:
            return '%s%d' % (arg_4, arg_1)
        for arg_5, arg_6 in enumerate(arg_3):
            arg_7 = 1000 ** (arg_5 + 1)
            if arg_1 < arg_7:
                return ('%s%.01f%s' % (
                    arg_4,
                    arg_1 / float(arg_7) * arg_2,
                    arg_6,
                )).strip()
        raise OverflowError

Convert the input size to human readable short form .


def Func(arg_0, arg_1):
        """ Calls the frontend handler associated with the message type of the
            given message.
        """
        arg_2 = arg_1['header']['msg_type']
        arg_3 = getattr(arg_0, '_handle_' + arg_2, None)
        if arg_3:
            arg_3(arg_1)

Calls the frontend handler associated with the message type of the given message .


def Func ( arg_0 , ** arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : setattr ( arg_0 , arg_2 , arg_3 ) if not arg_0 . is_initialized : arg_0 . initialize ( ) if not arg_0 . proxy_is_active : arg_0 . activate_proxy ( )

def Func(arg_0, **arg_1):
        """ Prepare for rendering """
        for arg_2, arg_3 in arg_1.items():
            setattr(arg_0, arg_2, arg_3)
        if not arg_0.is_initialized:
            arg_0.initialize()
        if not arg_0.proxy_is_active:
            arg_0.activate_proxy()


def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_2 = None ) : arg_0 . _streams . append ( Stream ( arg_1 , arg_3 ) )

def Func(arg_0, arg_1: arg_2, arg_3: arg_2=None):
        """Push a new Stream into the parser.
        All subsequent called functions will parse this new stream,
        until the 'popStream' function is called.
        """
        arg_0._streams.append(Stream(arg_1, arg_3))

Push a new Stream into the parser . All subsequent called functions will parse this new stream until the popStream function is called .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { "Content-Type" : "application/json" , "Accept" : "application/json" } if arg_0 . token : arg_3 [ "W-Token" ] = "%s" % arg_0 . token arg_4 = WhenIWork_DAO ( ) . putURL ( arg_1 , arg_3 , json . dumps ( arg_2 ) ) if not ( arg_4 . status == 200 or arg_4 . status == 201 or arg_4 . status == 204 ) : raise DataFailureException ( arg_1 , arg_4 . status , arg_4 . data ) return json . loads ( arg_4 . data )

def Func(arg_0, arg_1, arg_2):
        """
        When I Work PUT method.
        """
        arg_3 = {"Content-Type": "application/json",
                   "Accept": "application/json"}
        if arg_0.token:
            arg_3["W-Token"] = "%s" % arg_0.token
        arg_4 = WhenIWork_DAO().putURL(arg_1, arg_3, json.dumps(arg_2))

        if not (arg_4.status == 200 or arg_4.status == 201 or
                arg_4.status == 204):
            raise DataFailureException(arg_1, arg_4.status, arg_4.data)

        return json.loads(arg_4.data)


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . shell . profile_dir . location return os . path . join ( arg_2 , 'history.sqlite' )

def Func(arg_0, arg_1=None):
        """Get default history file name based on the Shell's profile.

        The profile parameter is ignored, but must exist for compatibility with
        the parent class."""
        arg_2 = arg_0.shell.profile_dir.location
        return os.path.join(arg_2, 'history.sqlite')

Get default history file name based on the Shell s profile . The profile parameter is ignored but must exist for compatibility with the parent class .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
[
'params'
]
[
'condition_param'
]
print
(
"Controller DAG : Func = {}"
.
format
(
arg_2
)
)
if
arg_0
[
'params'
]
[
'condition_param'
]
:
arg_1
.
payload
=
{
'message'
:
arg_0
[
'params'
]
[
'message'
]
}
pp
.
pprint
(
arg_1
.
payload
)
return
arg_1

def Func(arg_0, arg_1):
    """This function decides whether or not to Trigger the remote DAG"""
    arg_2 = arg_0['params']['condition_param']
    print("Controller DAG : Func = {}".format(arg_2))
    if arg_0['params']['condition_param']:
        arg_1.payload = {'message': arg_0['params']['message']}
        pp.pprint(arg_1.payload)
        return arg_1


def Func ( arg_0 ) : try : arg_1 = sys . stdin . read ( 1 ) arg_1 = arg_1 . replace ( '\r' , '\n' ) return arg_1 except WindowsError as we : if we . winerror == ERROR_NO_DATA : return None else : raise we

def Func(arg_0):
        """Use a blocking stdin read"""
        # The big problem with the blocking read is that it doesn't
        # exit when it's supposed to in all contexts. An extra
        # key-press may be required to trigger the exit.
        try:
            arg_1 = sys.stdin.read(1)
            arg_1 = arg_1.replace('\r', '\n')
            return arg_1
        except WindowsError as we:
            if we.winerror == ERROR_NO_DATA:
                # This error occurs when the pipe is closed
                return None
            else:
                # Otherwise let the error propagate
                raise we


def Func(arg_0):
        """Run thread to listen for jobs and reschedule successful ones."""

        try:
            arg_0.listen()
        except Exception as e:
            logger.critical("JobListener instence crashed. Error: %s", str(e))
            logger.critical(traceback.format_exc())

Run thread to listen for jobs and reschedule successful ones .


def Func(arg_0, arg_1, arg_2):
    # type: (Any, Any, Any) -> Any
    '''Takes an object, a string, and a value and produces a new object
    that is a copy of the original but with the attribute called ``name``
    set to ``value``.

    The following equality should hold for your definition:

    .. code-block:: python

        Func(obj, 'attr', obj.attr) == obj

    This function is used by many lenses (particularly GetattrLens) to set
    attributes on states even when those states do not ordinarily support
    ``Func``. This function is designed to have a similar signature
    as python's built-in ``Func`` except that it returns a new object
    that has the attribute set rather than mutating the object in place.

    It's what enables the ``lens.some_attribute`` functionality.

    The corresponding method call for this hook is
    ``obj._lens_Func(name, value)``.

    The default implementation makes a copy of the object using
    ``copy.copy`` and then mutates the new object by calling python's
    built in ``Func`` on it.
    '''
    try:
        arg_0._lens_Func
    except AttributeError:
        arg_3 = copy.copy(arg_0)
        builtin_Func(arg_3, arg_1, arg_2)
        return arg_3
    else:
        return arg_0._lens_Func(arg_1, arg_2)

Takes an object, a string, and a value and produces a new object
    that is a copy of the original but with the attribute called ``name``
    set to ``value``.

    The following equality should hold for your definition:

    .. code-block:: python

        setattr(obj, 'attr', obj.attr) == obj

    This function is used by many lenses (particularly GetattrLens) to set
    attributes on states even when those states do not ordinarily support
    ``setattr``. This function is designed to have a similar signature
    as python's built-in ``setattr`` except that it returns a new object
    that has the attribute set rather than mutating the object in place.

    It's what enables the ``lens.some_attribute`` functionality.

    The corresponding method call for this hook is
    ``obj._lens_setattr(name, value)``.

    The default implementation makes a copy of the object using
    ``copy.copy`` and then mutates the new object by calling python's
    built in ``setattr`` on it.

Takes an object a string and a value and produces a new object that is a copy of the original but with the attribute called name set to value .


def Func ( arg_0 , arg_1 , * arg_2 ) : try : return _id_xpath ( arg_0 , arg_1 = arg_1 ) [ 0 ] except IndexError : if arg_2 : return arg_2 [ 0 ] else : raise KeyError ( arg_1 )

def Func(arg_0, arg_1, *arg_2):
        """
        Get the first element in a document with the given id.  If none is
        found, return the default argument if provided or raise KeyError
        otherwise.

        Note that there can be more than one element with the same id,
        and this isn't uncommon in HTML documents found in the wild.
        Browsers return only the first match, and this function does
        the same.
        """
        try:
            # FIXME: should this check for multiple matches?
            # browsers just return the first one
            return _id_xpath(arg_0, arg_1=arg_1)[0]
        except IndexError:
            if arg_2:
                return arg_2[0]
            else:
                raise KeyError(arg_1)

Get the first element in a document with the given id . If none is found return the default argument if provided or raise KeyError otherwise .


(source, outname, box, fit=True, options=None,
                       thumb_fit_centering=(0.5, 0.5))

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
True
,
arg_4
=
,
arg_5
=
(
0.5
,
0.5
)
)
:
arg_6
=
logging
.
getLogger
(
__name__
)
arg_7
=
_read_image
(
arg_0
)
arg_8
=
arg_7
.
format
if
arg_3
:
arg_7
=
ImageOps
.
fit
(
arg_7
,
arg_2
,
PILImage
.
ANTIALIAS
,
centering
=
arg_5
)
else
:
arg_7
.
thumbnail
(
arg_2
,
PILImage
.
ANTIALIAS
)
arg_9
=
arg_7
.
format
or
arg_8
or
'JPEG'
arg_6
.
debug
(
'Save thumnail image: %s (%s)'
,
arg_1
,
arg_9
)
save_image
(
arg_7
,
arg_1
,
arg_9
,
arg_4
=
arg_4
,
autoconvert
=
True
)

def Func(arg_0, arg_1, arg_2, arg_3=True, arg_4=None,
                       arg_5=(0.5, 0.5)):
    """Create a thumbnail image."""

    arg_6 = logging.getLogger(__name__)
    arg_7 = _read_image(arg_0)
    arg_8 = arg_7.format

    if arg_3:
        arg_7 = ImageOps.fit(arg_7, arg_2, PILImage.ANTIALIAS,
                           centering=arg_5)
    else:
        arg_7.thumbnail(arg_2, PILImage.ANTIALIAS)

    arg_9 = arg_7.format or arg_8 or 'JPEG'
    arg_6.debug('Save thumnail image: %s (%s)', arg_1, arg_9)
    save_image(arg_7, arg_1, arg_9, arg_4=arg_4, autoconvert=True)


def Func(arg_0, arg_1, arg_2):
        '''
        This handles initial setup of the `RequestHandler`.

        '''

        arg_0.executor = arg_1
        arg_0.secret = arg_2

This handles initial setup of the RequestHandler .


def Func ( arg_0 , arg_1 ) : arg_2 = { "id" : "" , "container_plans" : [ ] } if not arg_1 . packing_plan : return arg_2 arg_3 = arg_1 . packing_plan . container_plans arg_4 = [ ] for arg_5 in arg_3 : arg_6 = [ ] for arg_7 in arg_5 . instance_plans : arg_8 = { "cpu" : arg_7 . resource . cpu , "ram" : arg_7 . resource . ram , "disk" : arg_7 . resource . disk } arg_9 = { "component_name" : arg_7 . component_name , "task_id" : arg_7 . task_id , "component_index" : arg_7 . component_index , "instance_resources" : arg_8 } arg_6 . append ( arg_9 ) arg_10 = { "cpu" : arg_5 . requiredResource . cpu , "ram" : arg_5 . requiredResource . ram , "disk" : arg_5 . requiredResource . disk } arg_11 = { } if arg_5 . scheduledResource : arg_11 = { "cpu" : arg_5 . scheduledResource . cpu , "ram" : arg_5 . scheduledResource . ram , "disk" : arg_5 . scheduledResource . disk } arg_12 = { "id" : arg_5 . id , "instances" : arg_6 , "required_resources" : arg_10 , "scheduled_resources" : arg_11 } arg_4 . append ( arg_12 ) arg_2 [ "id" ] = arg_1 . packing_plan . id arg_2 [ "container_plans" ] = arg_4 return json . dumps ( arg_2 )

def Func(arg_0, arg_1):
    """
    Returns the representation of packing plan that will
    be returned from Tracker.
    """
    arg_2 = {
        "id": "",
        "container_plans": []
    }

    if not arg_1.packing_plan:
      return arg_2

    arg_3 = arg_1.packing_plan.container_plans

    arg_4 = []
    for arg_5 in arg_3:
      arg_6 = []
      for arg_7 in arg_5.instance_plans:
        arg_8 = {"cpu": arg_7.resource.cpu,
                              "ram": arg_7.resource.ram,
                              "disk": arg_7.resource.disk}
        arg_9 = {"component_name" : arg_7.component_name,
                    "task_id" : arg_7.task_id,
                    "component_index": arg_7.component_index,
                    "instance_resources": arg_8}
        arg_6.append(arg_9)
      arg_10 = {"cpu": arg_5.requiredResource.cpu,
                           "ram": arg_5.requiredResource.ram,
                           "disk": arg_5.requiredResource.disk}
      arg_11 = {}
      if arg_5.scheduledResource:
        arg_11 = {"cpu": arg_5.scheduledResource.cpu,
                              "ram": arg_5.scheduledResource.ram,
                              "disk": arg_5.scheduledResource.disk}
      arg_12 = {"id": arg_5.id,
                   "instances": arg_6,
                   "required_resources": arg_10,
                   "scheduled_resources": arg_11}
      arg_4.append(arg_12)

    arg_2["id"] = arg_1.packing_plan.id
    arg_2["container_plans"] = arg_4
    return json.dumps(arg_2)

Returns the representation of packing plan that will be returned from Tracker .


def Func(arg_0, arg_1, arg_2, arg_3=arg_4):
    """Add a new variable to msaf.config

    Parameters
    ----------
    name: str
        String of the form "[section0.[section1.[etc]]]option", containing the
        full name for this configuration variable.
    string: str
        What does this variable specify?
    configparam: `ConfigParam`
        An object for getting and setting this configuration parameter.
    root: object
        Used for recursive calls -- do not provide an argument for this
        parameter.
    """

    # This method also performs some of the work of initializing ConfigParam
    # instances

    if arg_3 is arg_4:
        # only set the name in the first call, not the recursive ones
        arg_2.fullname = arg_0
    arg_6 = arg_0.split('.')
    if len(arg_6) > 1:
        # set up a subobject
        if not hasattr(arg_3, arg_6[0]):
            # every internal node in the config tree is an instance of its own
            # unique class
            class SubObj(object):
                arg_7 = True
            setattr(arg_3.__class__, arg_6[0], SubObj())
        arg_8 = getattr(arg_3, arg_6[0])
        if (not getattr(arg_8, '_i_am_a_config_class', False) or
                isinstance(arg_8, type)):
            raise TypeError(
                'Internal config nodes must be config class instances',
                arg_8)
        return Func('.'.join(arg_6[1:]), arg_1, arg_2,
                            arg_3=arg_8)
    else:
        if hasattr(arg_3, arg_0):
            raise AttributeError('This name is already taken',
                                 arg_2.fullname)
        arg_2.doc = arg_1
        # Trigger a read of the value from config files and env vars
        # This allow to filter wrong value from the user.
        if not callable(arg_2.default):
            arg_2.__get__(arg_3, type(arg_3), delete_key=True)
        else:
            # We do not want to evaluate now the default value
            # when it is a callable.
            try:
                fetch_val_for_key(arg_2.fullname)
                # The user provided a value, filter it now.
                arg_2.__get__(arg_3, type(arg_3), delete_key=True)
            except KeyError:
                pass
        setattr(arg_3.__class__, arg_6[0], arg_2)
        _config_var_list.append(arg_2)


def Func ( arg_0 ) -> GetFuelPricesResponse : arg_1 = requests . get ( '{}/prices' . format ( API_URL_BASE ) , headers = arg_0 . _get_headers ( ) , timeout = arg_0 . _timeout , ) if not arg_1 . ok : raise FuelCheckError . create ( arg_1 ) return GetFuelPricesResponse . deserialize ( arg_1 . json ( ) )

def Func(arg_0) -> GetFuelPricesResponse:
        """Fetches fuel prices for all stations."""
        arg_1 = requests.get(
            '{}/prices'.format(API_URL_BASE),
            headers=arg_0._get_headers(),
            timeout=arg_0._timeout,
        )

        if not arg_1.ok:
            raise FuelCheckError.create(arg_1)

        return GetFuelPricesResponse.deserialize(arg_1.json())


return [Keypoint(x=x, y=y) for (x, y) in self.coords]

def Func ( arg_0 ) : from imgaug . augmentables . kps import Keypoint return [ Keypoint ( arg_1 = arg_1 , arg_2 = arg_2 ) for ( arg_1 , arg_2 ) in arg_0 . coords ]

def Func(arg_0):
        """
        Convert the line string points to keypoints.

        Returns
        -------
        list of imgaug.augmentables.kps.Keypoint
            Points of the line string as keypoints.

        """
        # TODO get rid of this deferred import
        from imgaug.augmentables.kps import Keypoint
        return [Keypoint(arg_1=arg_1, arg_2=arg_2) for (arg_1, arg_2) in arg_0.coords]

Convert the line string points to keypoints .


(self, payload_class, payload_key = None,
                                                        specialize = False)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False ) : if arg_0 . _payload is None : arg_0 . decode_payload ( ) if arg_1 is None : if arg_0 . _payload : arg_4 = arg_0 . _payload [ 0 ] if arg_3 and isinstance ( arg_4 , XMLPayload ) : arg_5 = payload_class_for_element_name ( arg_4 . element . tag ) if arg_5 is not XMLPayload : arg_4 = arg_5 . from_xml ( arg_4 . element ) arg_0 . _payload [ 0 ] = arg_4 return arg_4 else : return None arg_7 = arg_1 . _pyxmpp_payload_element_name for arg_8 , arg_4 in enumerate ( arg_0 . _payload ) : if isinstance ( arg_4 , XMLPayload ) : if arg_1 is not XMLPayload : if arg_4 . xml_element_name not in arg_7 : continue arg_4 = arg_1 . from_xml ( arg_4 . element ) elif not isinstance ( arg_4 , arg_1 ) : continue if arg_2 is not None and arg_2 != arg_4 . handler_key ( ) : continue arg_0 . _payload [ arg_8 ] = arg_4 return arg_4 return None

def Func(arg_0, arg_1, arg_2 = None,
                                                        arg_3 = False):
        """Get the first payload item matching the given class
        and optional key.

        Payloads may be addressed using a specific payload class or
        via the generic `XMLPayload` element, though the `XMLPayload`
        representation is available only as long as the element is not
        requested by a more specific type.

        :Parameters:
            - `payload_class`: requested payload class, a subclass of
              `StanzaPayload`. If `None` get the first payload in whatever
              class is available.
            - `payload_key`: optional key for additional match. When used
              with `payload_class` = `XMLPayload` this selects the element to
              match
            - `specialize`: If `True`, and `payload_class` is `None` then
              return object of a specialized `StanzaPayload` subclass whenever
              possible
        :Types:
            - `payload_class`: `StanzaPayload`
            - `specialize`: `bool`

        :Return: payload element found or `None`
        :Returntype: `StanzaPayload`
        """
        if arg_0._payload is None:
            arg_0.decode_payload()
        if arg_1 is None:
            if arg_0._payload:
                arg_4 = arg_0._payload[0]
                if arg_3 and isinstance(arg_4, XMLPayload):
                    arg_5 = payload_class_for_element_name(
                                                        arg_4.element.tag)
                    if arg_5 is not XMLPayload:
                        arg_4 = arg_5.from_xml(arg_4.element)
                        arg_0._payload[0] = arg_4
                return arg_4
            else:
                return None
        # pylint: disable=W0212
        arg_7 = arg_1._pyxmpp_payload_element_name
        for arg_8, arg_4 in enumerate(arg_0._payload):
            if isinstance(arg_4, XMLPayload):
                if arg_1 is not XMLPayload:
                    if arg_4.xml_element_name not in arg_7:
                        continue
                    arg_4 = arg_1.from_xml(arg_4.element)
            elif not isinstance(arg_4, arg_1):
                continue
            if arg_2 is not None and arg_2 != arg_4.handler_key():
                continue
            arg_0._payload[arg_8] = arg_4
            return arg_4
        return None

Get the first payload item matching the given class and optional key .


(dwFlags: int, dx: int, dy: int, dwData: int, dwExtraInfo: int)

def Func(arg_0: arg_1, arg_2: arg_1, arg_3: arg_1, arg_4: arg_1, arg_5: arg_1) -> None:
    """Func from Win32."""
    ctypes.windll.user32.Func(arg_0, arg_2, arg_3, arg_4, arg_5)


(self, case_id, query=None, variant_ids=None, category='snv',
                 nr_of_variants=10, skip=0, sort_key='variant_rank')

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
'snv'
,
arg_5
=
10
,
arg_6
=
0
,
arg_7
=
'variant_rank'
)
:
LOG
.
debug
(
"Fetching Func from {0}"
.
format
(
arg_1
)
)
if
arg_3
:
arg_5
=
len
(
arg_3
)
elif
arg_5
==
1
:
arg_5
=
0
else
:
arg_5
=
arg_6
+
arg_5
arg_8
=
arg_0
.
build_query
(
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
)
arg_9
=
[
]
if
arg_7
==
'variant_rank'
:
arg_9
=
[
(
'variant_rank'
,
pymongo
.
ASCENDING
)
]
if
arg_7
==
'rank_score'
:
arg_9
=
[
(
'rank_score'
,
pymongo
.
DESCENDING
)
]
if
arg_7
==
'position'
:
arg_9
=
[
(
'position'
,
pymongo
.
ASCENDING
)
]
arg_10
=
arg_0
.
variant_collection
.
find
(
arg_8
,
arg_6
=
arg_6
,
limit
=
arg_5
)
.
sort
(
arg_9
)
return
arg_10

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4='snv',
                 arg_5=10, arg_6=0, arg_7='variant_rank'):
        """Returns Func specified in question for a specific case.

        If skip not equal to 0 skip the first n Func.

        Arguments:
            case_id(str): A string that represents the case
            query(dict): A dictionary with querys for the database
            variant_ids(List[str])
            category(str): 'sv', 'str', 'snv' or 'cancer'
            nr_of_Func(int): if -1 return all Func
            skip(int): How many Func to skip
            sort_key: ['variant_rank', 'rank_score', 'position']

        Yields:
            result(Iterable[Variant])
        """
        LOG.debug("Fetching Func from {0}".format(arg_1))

        if arg_3:
            arg_5 = len(arg_3)

        elif arg_5 == -1:
            arg_5 = 0 # This will return all Func

        else:
            arg_5 = arg_6 + arg_5

        arg_8 = arg_0.build_query(arg_1, arg_2=arg_2,
                                       arg_3=arg_3,
                                       arg_4=arg_4)
        arg_9 = []
        if arg_7 == 'variant_rank':
            arg_9 = [('variant_rank', pymongo.ASCENDING)]
        if arg_7 == 'rank_score':
            arg_9 = [('rank_score', pymongo.DESCENDING)]
        if arg_7 == 'position':
            arg_9 = [('position', pymongo.ASCENDING)]

        arg_10 = arg_0.variant_collection.find(
            arg_8,
            arg_6=arg_6,
            limit=arg_5
        ).sort(arg_9)

        return arg_10

Returns variants specified in question for a specific case.

        If skip not equal to 0 skip the first n variants.

        Arguments:
            case_id(str): A string that represents the case
            query(dict): A dictionary with querys for the database
            variant_ids(List[str])
            category(str): 'sv', 'str', 'snv' or 'cancer'
            nr_of_variants(int): if -1 return all variants
            skip(int): How many variants to skip
            sort_key: ['variant_rank', 'rank_score', 'position']

        Yields:
            result(Iterable[Variant])

Returns variants specified in question for a specific case .


def Func(arg_0, arg_1):
        """
        Returns whether this query resolves for the given session.

        Args:
            session (Session): The session for which this query should be executed.

        Returns:
            bool: Whether this query resolves.
        """

        if arg_0.url:
            arg_0.actual_path = arg_1.current_url
        else:
            arg_3 = urlparse(arg_1.current_url)

            if arg_0.only_path:
                arg_0.actual_path = arg_3.path
            else:
                arg_4 = arg_3.path
                if arg_3.query:
                    arg_4 += "?{0}".format(arg_3.query)

                arg_0.actual_path = arg_4

        if isregex(arg_0.expected_path):
            return arg_0.expected_path.search(arg_0.actual_path)
        else:
            return normalize_url(arg_0.actual_path) == normalize_url(arg_0.expected_path)

Returns whether this query resolves for the given session .


(self, clean_lines, linenum, header_path)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if ( arg_0 . _last_header > arg_3 and Match ( r'^\s*#\s*include\b' , arg_1 . elided [ arg_2 - 1 ] ) ) : return False return True

def Func(arg_0, arg_1, arg_2, arg_3):
    """Check if a header is in alphabetical order with the previous header.

    Args:
      clean_lines: A CleansedLines instance containing the file.
      linenum: The number of the line to check.
      header_path: Canonicalized header to be checked.

    Returns:
      Returns true if the header is in alphabetical order.
    """
    # If previous section is different from current section, _last_header will
    # be reset to empty string, so it's always less than current header.
    #
    # If previous line was a blank line, assume that the headers are
    # intentionally sorted the way they are.
    if (arg_0._last_header > arg_3 and
        Match(r'^\s*#\s*include\b', arg_1.elided[arg_2 - 1])):
      return False
    return True

Check if a header is in alphabetical order with the previous header .


def
Func
(
arg_0
)
:
arg_1
=
[
arg_5
for
(
arg_5
,
arg_4
)
in
Funcs
(
arg_0
)
]
def
the_func
(
arg_2
)
:
if
len
(
arg_2
)
!=
len
(
arg_1
)
:
raise
IntoDPValueError
(
arg_2
,
"objects"
,
"must have exactly %u items, has %u"
%
(
len
(
arg_1
)
,
len
(
arg_2
)
)
)
return
[
arg_3
for
(
arg_3
,
arg_4
)
in
(
arg_5
(
arg_6
)
for
(
arg_5
,
arg_6
)
in
zip
(
arg_1
,
arg_2
)
)
]
return
the_func

def Func(arg_0):
    """
    Returns a transformer function for the given signature.

    :param str signature: a dbus signature
    :returns: a function to transform a list of objects to inhabit the signature
    :rtype: (list of object) -> (list of object)
    """

    arg_1 = [arg_5 for (arg_5, arg_4) in Funcs(arg_0)]

    def the_func(arg_2):
        """
        Returns the a list of objects, transformed.

        :param objects: a list of objects
        :type objects: list of object

        :returns: transformed objects
        :rtype: list of object (in dbus types)
        """
        if len(arg_2) != len(arg_1):
            raise IntoDPValueError(
                arg_2,
                "objects",
                "must have exactly %u items, has %u" % \
                  (len(arg_1), len(arg_2))
            )
        return [arg_3 for (arg_3, arg_4) in (arg_5(arg_6) for (arg_5, arg_6) in zip(arg_1, arg_2))]

    return the_func

Returns a transformer function for the given signature .


def Func(arg_0):
        '''
        determines the coalescent time scale that optimizes the coalescent likelihood of the tree
        '''
        from scipy.optimize import minimize_scalar
        arg_1 = arg_0.Tc
        def cost(arg_2):
            arg_0.set_Tc(arg_2)
            return -arg_0.total_LH()

        arg_3 = minimize_scalar(cost, bounds=[ttconf.TINY_NUMBER,10.0])
        if "success" in arg_3 and arg_3["success"]:
            arg_0.set_Tc(arg_3['x'])
        else:
            arg_0.logger("merger_models:optimze_Tc: optimization of coalescent time scale failed: " + str(arg_3), 0, warn=True)
            arg_0.set_Tc(arg_1.y, T=arg_1.x)


return [tok for tok in normalize3.split(s) if tok and tok != ' ']

def
Func
(
arg_0
)
:
if
(
nonorm
)
:
return
arg_0
.
split
(
)
try
:
arg_0
.
split
(
)
except
:
arg_0
=
" "
.
join
(
arg_0
)
for
(
arg_1
,
arg_2
)
in
Func1
:
arg_0
=
re
.
sub
(
arg_1
,
arg_2
,
arg_0
)
arg_0
=
xml
.
sax
.
saxutils
.
unescape
(
arg_0
,
{
'"'
:
'"'
}
)
arg_0
=
" %s "
%
arg_0
if
not
preserve_case
:
arg_0
=
arg_0
.
lower
(
)
return
[
arg_3
for
arg_3
in
Func3
.
split
(
arg_0
)
if
arg_3
and
arg_3
!=
' '
]

def Func(arg_0):
    '''Normalize and tokenize text. This is lifted from NIST mteval-v11a.pl.'''
    # Added to bypass NIST-style pre-processing of hyp and ref files -- wade
    if (nonorm):
        return arg_0.split()
    try:
        arg_0.split()
    except:
        arg_0 = " ".join(arg_0)
    # language-independent part:
    for (arg_1, arg_2) in Func1:
        arg_0 = re.sub(arg_1, arg_2, arg_0)
    arg_0 = xml.sax.saxutils.unescape(arg_0, {'"':'"'})
    # language-dependent part (assuming Western languages):
    arg_0 = " %s " % arg_0
    if not preserve_case:
        arg_0 = arg_0.lower()         # this might not be identical to the original
    return [arg_3 for arg_3 in Func3.split(arg_0) if arg_3 and arg_3 != ' ']

Normalize and tokenize text . This is lifted from NIST mteval - v11a . pl .


def Func ( arg_0 = 10 ) : class Dummy ( object ) : pass arg_0 = 10 arg_1 = Dummy ( ) arg_1 . train = Dummy ( ) arg_1 . train . images = np . float32 ( np . random . randn ( arg_0 , * IMAGE_SHAPE ) ) arg_1 . train . labels = np . int32 ( np . random . permutation ( np . arange ( arg_0 ) ) ) arg_1 . train . num_examples = arg_0 arg_1 . validation = Dummy ( ) arg_1 . validation . images = np . float32 ( np . random . randn ( arg_0 , * IMAGE_SHAPE ) ) arg_1 . validation . labels = np . int32 ( np . random . permutation ( np . arange ( arg_0 ) ) ) arg_1 . validation . num_examples = arg_0 return arg_1

def Func(arg_0=10):
  """Build fake MNIST-style data for unit testing."""

  class Dummy(object):
    pass

  arg_0 = 10
  arg_1 = Dummy()
  arg_1.train = Dummy()
  arg_1.train.images = np.float32(np.random.randn(
      arg_0, *IMAGE_SHAPE))
  arg_1.train.labels = np.int32(np.random.permutation(
      np.arange(arg_0)))
  arg_1.train.num_examples = arg_0
  arg_1.validation = Dummy()
  arg_1.validation.images = np.float32(np.random.randn(
      arg_0, *IMAGE_SHAPE))
  arg_1.validation.labels = np.int32(np.random.permutation(
      np.arange(arg_0)))
  arg_1.validation.num_examples = arg_0
  return arg_1

Build fake MNIST - style data for unit testing .


def Func(arg_0, arg_1, arg_2, **arg_3):
    """
    Does a bitwise compare of the two bitmaps and returns a fractonal
    value between 0 and 1 of how similar they are.

    - ``1`` => identical
    - ``0`` => no overlaping bits

    ``kwargs`` will have the keyword "fractional", which is assumed by this
    encoder.
    """
    arg_4 = 1.0
    arg_5 = int(arg_1.sum())
    arg_6 = int(arg_2.sum())
    if arg_6 > arg_5:
      arg_7 = arg_6 - arg_5
      if arg_7 < arg_5:
        arg_4 = 1 - arg_7/float(arg_5)
      else:
        arg_4 = 1/float(arg_7)

    arg_8 = arg_1 & arg_2
    arg_9 = int(arg_8.sum())
    if arg_5 == 0:
      arg_10 = 0.0
    else:
      arg_10 = arg_9/float(arg_5)
    arg_10 = arg_10 * arg_4

    return numpy.array([arg_10])

Does a bitwise compare of the two bitmaps and returns a fractonal value between 0 and 1 of how similar they are .


def Func ( arg_0 , arg_1 = 2 ) : arg_2 = linspace ( - arg_0 / 2. , ( arg_0 ) / 2. , arg_0 ) arg_3 = exp ( - arg_1 * abs ( arg_2 ) / ( arg_0 / 2. ) ) return arg_3

def Func(arg_0, arg_1=2):
    r"""Poisson tapering window

    :param int N: window length

    .. math:: w(n) = \exp^{-\alpha \frac{|n|}{N/2} }

    with :math:`-N/2 \leq n \leq N/2`.

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

        from spectrum import window_visu
        window_visu(64, 'poisson')
        window_visu(64, 'poisson', alpha=3)
        window_visu(64, 'poisson', alpha=4)

    .. seealso:: :func:`create_window`, :class:`Window`
    """
    arg_2 = linspace(-arg_0/2., (arg_0)/2., arg_0)
    arg_3 = exp(-arg_1 * abs(arg_2)/(arg_0/2.))
    return arg_3


def Func ( arg_0 , arg_1 , arg_2 ) : assert ( len ( arg_0 . fields ) > arg_1 ) arg_3 = [ arg_0 . addValueToField ( arg_1 ) for n in range ( arg_2 ) ] return arg_3

def Func(arg_0, arg_1, arg_2):
    """Add values to the field i."""

    assert(len(arg_0.fields)>arg_1)
    arg_3 = [arg_0.addValueToField(arg_1) for n in range(arg_2)]
    return arg_3