def Func ( arg_0 , arg_1 ) : if arg_1 == "<" + arg_1 [ 1 : - 1 ] + ">" : return arg_1 Func = arg_0 . filename_cache . get ( arg_1 ) if not Func : arg_3 = arg_1 . split ( os . sep ) [ 0 ] if arg_3 == os . curdir or arg_3 == os . pardir : Func = os . path . abspath ( os . path . join ( arg_0 . main_dirname , arg_1 ) ) else : Func = os . path . abspath ( arg_1 ) pass if not os . path . isfile ( Func ) : Func = Mclifns . search_file ( arg_1 , arg_0 . search_path , arg_0 . main_dirname ) if not Func : Func = arg_1 pass Func = os . path . realpath ( os . path . normcase ( Func ) ) arg_0 . filename_cache [ arg_1 ] = Func return Func

def Func(arg_0, arg_1):
        """ Turns `filename' into its canonic representation and returns this
        string. This allows a user to refer to a given file in one of several
        equivalent ways.

        Relative filenames need to be fully resolved, since the current working
        directory might change over the course of execution.

        If filename is enclosed in < ... >, then we assume it is
        one of the bogus internal Python names like <string> which is seen
        for example when executing "exec cmd".
        """

        if arg_1 == "<" + arg_1[1:-1] + ">":
            return arg_1
        Func = arg_0.filename_cache.get(arg_1)
        if not Func:
            arg_3 = arg_1.split(os.sep)[0]
            if arg_3 == os.curdir or arg_3 == os.pardir:
                # We may have invoked the program from a directory
                # other than where the program resides. filename is
                # relative to where the program resides. So make sure
                # to use that.
                Func = os.path.abspath(os.path.join(arg_0.main_dirname,
                                                       arg_1))
            else:
                Func = os.path.abspath(arg_1)
                pass
            if not os.path.isfile(Func):
                Func = Mclifns.search_file(arg_1, arg_0.search_path,
                                              arg_0.main_dirname)
                # FIXME: is this is right for utter failure?
                if not Func: Func = arg_1
                pass
            Func = os.path.realpath(os.path.normcase(Func))
            arg_0.filename_cache[arg_1] = Func
        return Func

Turns filename into its canonic representation and returns this string . This allows a user to refer to a given file in one of several equivalent ways .


def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , list ) : arg_1 = [ arg_1 ] arg_0 . _z = np . delete ( arg_0 . _z , arg_1 ) arg_0 . _x = np . delete ( arg_0 . _x , arg_1 ) return arg_0

def Func(arg_0, arg_1):
        """
        Delete pauli at the indices.

        Args:
            indices(list[int]): the indices of to-be-deleted paulis

        Returns:
            Pauli: self
        """
        if not isinstance(arg_1, list):
            arg_1 = [arg_1]

        arg_0._z = np.delete(arg_0._z, arg_1)
        arg_0._x = np.delete(arg_0._x, arg_1)

        return arg_0


def Func(arg_0):
        """
        Launches the OpenID authentication procedure.
        """

        if arg_0.params.get(arg_0.identifier_param):
            # =================================================================
            # Phase 1 before redirect.
            # =================================================================
            arg_0._log(
                logging.INFO,
                u'Starting OpenID authentication procedure.')

            arg_1 = users.create_Func_url(
                dest_url=arg_0.url, federated_identity=arg_0.identifier)

            arg_0._log(logging.INFO, u'Redirecting user to {0}.'.format(arg_1))

            arg_0.redirect(arg_1)
        else:
            # =================================================================
            # Phase 2 after redirect.
            # =================================================================

            arg_0._log(
                logging.INFO,
                u'Continuing OpenID authentication procedure after redirect.')

            arg_2 = users.get_current_user()

            if arg_2:
                arg_0._log(logging.INFO, u'Authentication successful.')
                arg_0._log(logging.INFO, u'Creating user.')
                arg_0.user = core.User(arg_0,
                                      id=arg_2.federated_identity(),
                                      email=arg_2.email(),
                                      gae_user=arg_2)

                # =============================================================
                # We're done
                # =============================================================
            else:
                raise FailureError(
                    'Unable to authenticate identifier "{0}"!'.format(
                        arg_0.identifier))

Launches the OpenID authentication procedure .


def Func ( arg_0 , arg_1 = 1 , arg_2 = None ) : arg_2 = arg_2 or { } arg_3 = AccessToken ( arg_3 = arg_0 . generate ( ) , expires_at = expires_at ( hours = arg_1 ) , arg_2 = arg_2 ) return arg_3

def Func(arg_0, arg_1=1, arg_2=None):
        """
        Creates an access token.

        TODO: check valid in hours
        TODO: maybe specify how often a token can be used
        """
        arg_2 = arg_2 or {}
        arg_3 = AccessToken(
            arg_3=arg_0.generate(),
            expires_at=expires_at(hours=arg_1),
            arg_2=arg_2)
        return arg_3


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
get_node_ns
(
arg_1
)
if
arg_2
and
arg_2
.
getContent
(
)
!=
VCARD_NS
:
raise
ValueError
(
"Not in the %r namespace"
%
(
VCARD_NS
,
)
)
if
arg_1
.
name
!=
"vCard"
:
raise
ValueError
(
"Bad root element name: %r"
%
(
arg_1
.
name
,
)
)
arg_3
=
arg_1
.
children
arg_4
=
get_node_ns
(
arg_1
)
while
arg_3
:
if
arg_3
.
type
!=
'element'
:
arg_3
=
arg_3
.
next
continue
arg_2
=
get_node_ns
(
arg_3
)
if
(
arg_2
and
arg_4
and
arg_2
.
getContent
(
)
!=
arg_4
.
getContent
(
)
)
:
arg_3
=
arg_3
.
next
continue
if
not
arg_0
.
components
.
has_key
(
arg_3
.
name
)
:
arg_3
=
arg_3
.
next
continue
arg_5
,
arg_6
=
arg_0
.
components
[
arg_3
.
name
]
if
arg_6
in
(
"required"
,
"optional"
)
:
if
arg_0
.
content
.
has_key
(
arg_3
.
name
)
:
raise
ValueError
(
"Duplicate %s"
%
(
arg_3
.
name
,
)
)
try
:
arg_0
.
content
[
arg_3
.
name
]
=
arg_5
(
arg_3
.
name
,
arg_3
)
except
Empty
:
pass
elif
arg_6
==
"multi"
:
if
not
arg_0
.
content
.
has_key
(
arg_3
.
name
)
:
arg_0
.
content
[
arg_3
.
name
]
=
[
]
try
:
arg_0
.
content
[
arg_3
.
name
]
.
append
(
arg_5
(
arg_3
.
name
,
arg_3
)
)
except
Empty
:
pass
arg_3
=
arg_3
.
next

def Func(arg_0,arg_1):
        """Initialize a VCard object from XML node.

        :Parameters:
            - `data`: vcard to parse.
        :Types:
            - `data`: `libxml2.xmlNode`"""
        arg_2=get_node_ns(arg_1)
        if arg_2 and arg_2.getContent()!=VCARD_NS:
            raise ValueError("Not in the %r namespace" % (VCARD_NS,))
        if arg_1.name!="vCard":
            raise ValueError("Bad root element name: %r" % (arg_1.name,))
        arg_3=arg_1.children
        arg_4=get_node_ns(arg_1)
        while arg_3:
            if arg_3.type!='element':
                arg_3=arg_3.next
                continue
            arg_2=get_node_ns(arg_3)
            if (arg_2 and arg_4 and arg_2.getContent()!=arg_4.getContent()):
                arg_3=arg_3.next
                continue
            if not arg_0.components.has_key(arg_3.name):
                arg_3=arg_3.next
                continue
            arg_5,arg_6=arg_0.components[arg_3.name]
            if arg_6 in ("required","optional"):
                if arg_0.content.has_key(arg_3.name):
                    raise ValueError("Duplicate %s" % (arg_3.name,))
                try:
                    arg_0.content[arg_3.name]=arg_5(arg_3.name,arg_3)
                except Empty:
                    pass
            elif arg_6=="multi":
                if not arg_0.content.has_key(arg_3.name):
                    arg_0.content[arg_3.name]=[]
                try:
                    arg_0.content[arg_3.name].append(arg_5(arg_3.name,arg_3))
                except Empty:
                    pass
            arg_3=arg_3.next

Initialize a VCard object from XML node .


def Func ( arg_0 , arg_1 ) : arg_2 = Path ( arg_1 . path ) for arg_3 in arg_0 . file_extensions : if arg_2 . suffixes [ : len ( arg_3 ) ] == arg_3 : return True return False

def Func(arg_0, arg_1):
        """Check if the loader has a supported file extension"""
        arg_2 = Path(arg_1.path)

        for arg_3 in arg_0.file_extensions:
            if arg_2.suffixes[:len(arg_3)] == arg_3:
                return True

        return False


def Func(arg_0, arg_1):
        """Interface to model.Func for attacks.

        Parameters
        ----------
        batch : bool
            Controls whether the index of the axis for a batch of images
            (4 dimensions) or a single image (3 dimensions) should be returned.

        """
        arg_2 = arg_0.__model.Func()
        if not arg_1:
            arg_2 = arg_2 - 1
        return arg_2

Interface to model.channel_axis for attacks.

        Parameters
        ----------
        batch : bool
            Controls whether the index of the axis for a batch of images
            (4 dimensions) or a single image (3 dimensions) should be returned.

Interface to model . channel_axis for attacks .


return '%s_%s_%s' % (prefix, user_or_username, size)

def Func ( arg_0 , arg_1 , arg_2 ) : if isinstance ( arg_0 , get_user_model ( ) ) : arg_0 = arg_0 . username return '%s_%s_%s' % ( arg_2 , arg_0 , arg_1 )

def Func(arg_0, arg_1, arg_2):
    """
    Returns a cache key consisten of a username and image size.
    """
    if isinstance(arg_0, get_user_model()):
        arg_0 = arg_0.username
    return '%s_%s_%s' % (arg_2, arg_0, arg_1)

Returns a cache key consisten of a username and image size .


def Func ( arg_0 , arg_1 ) : if type ( arg_1 ) == list : for arg_2 in arg_1 : arg_0 . c . Func_metric_data ( ** arg_2 ) else : arg_0 . c . Func_metric_data ( ** arg_1 )

def Func(arg_0, arg_1):
        """
        Put metrics to cloudwatch. Metric shoult be instance or list of
        instances of CloudWatchMetric
        """
        if type(arg_1) == list:
            for arg_2 in arg_1:
                arg_0.c.Func_metric_data(**arg_2)
        else:
            arg_0.c.Func_metric_data(**arg_1)

Put metrics to cloudwatch . Metric shoult be instance or list of instances of CloudWatchMetric


def Func ( arg_0 , arg_1 , arg_2 = None ) : inshape ( arg_0 . shape , arg_1 ) arg_3 = [ dim for dim in range ( len ( arg_0 . shape ) ) if dim not in arg_1 ] arg_2 = arg_2 if arg_2 else [ arg_0 . shape [ axis ] for axis in arg_1 ] arg_4 = [ arg_0 . shape [ axis ] for axis in arg_3 ] arg_5 = [ prod ( arg_2 ) ] + arg_4 arg_6 = arg_1 + arg_3 arg_7 = arg_0 . transpose ( * arg_6 ) . reshape ( * arg_5 ) return arg_7

def Func(arg_0, arg_1, arg_2=None):
        """
        Align local bolt array so that axes for iteration are in the keys.

        This operation is applied before most functional operators.
        It ensures that the specified axes are valid, and might transpose/reshape
        the underlying array so that the functional operators can be applied
        over the correct records.

        Parameters
        ----------
        axes: tuple[int]
            One or more axes that will be iterated over by a functional operator

        Returns
        -------
        BoltArrayLocal
        """

        # ensure that the key axes are valid for an ndarray of this shape
        inshape(arg_0.shape, arg_1)

        # compute the set of dimensions/axes that will be used to reshape
        arg_3 = [dim for dim in range(len(arg_0.shape)) if dim not in arg_1]
        arg_2 = arg_2 if arg_2 else [arg_0.shape[axis] for axis in arg_1]
        arg_4 = [arg_0.shape[axis] for axis in arg_3]
        arg_5 = [prod(arg_2)] + arg_4

        # compute the transpose permutation
        arg_6 = arg_1 + arg_3

        # transpose the array so that the keys being mapped over come first, then linearize keys
        arg_7 = arg_0.transpose(*arg_6).reshape(*arg_5)

        return arg_7

Align local bolt array so that axes for iteration are in the keys .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 0 ) : arg_4 = arg_0 . get_item_by_id ( arg_1 , arg_2 ) if hasattr ( arg_4 , 'depth' ) : arg_3 = arg_4 . depth + arg_3 else : if arg_4 . parent is not None : arg_3 = arg_0 . Func ( arg_1 , arg_4 . parent . id , arg_3 + 1 ) return arg_3

def Func(arg_0, arg_1, arg_2, arg_3=0):
        """Calculates depth of the item in the tree.

        :param str|unicode tree_alias:
        :param int item_id:
        :param int depth:
        :rtype: int
        """
        arg_4 = arg_0.get_item_by_id(arg_1, arg_2)

        if hasattr(arg_4, 'depth'):
            arg_3 = arg_4.depth + arg_3
        else:
            if arg_4.parent is not None:
                arg_3 = arg_0.Func(arg_1, arg_4.parent.id, arg_3 + 1)

        return arg_3

Calculates depth of the item in the tree .


def Func(arg_0, arg_1=None):
        """Create a dictionary of shortend UIDs for all contacts.

        All arguments are only used if the address book is not yet initialized
        and will just be handed to self.load().

        :param query: see self.load()
        :type query: str
        :returns: the contacts mapped by the shortes unique prefix of their UID
        :rtype: dict(str: CarddavObject)
        """
        if arg_0._short_uids is None:
            if not arg_0._loaded:
                arg_0.load(arg_1)
            if not arg_0.contacts:
                arg_0._short_uids = {}
            elif len(arg_0.contacts) == 1:
                arg_0._short_uids = {uid[0:1]: contact
                                    for uid, contact in arg_0.contacts.items()}
            else:
                arg_0._short_uids = {}
                arg_3 = sorted(arg_0.contacts)
                # Prepare for the loop; the first and last items are handled
                # seperatly.
                arg_4, arg_5 = arg_3[:2]
                arg_6 = arg_0._compare_uids(arg_4, arg_5)
                arg_0._short_uids[arg_4[:arg_6 + 1]] = arg_0.contacts[arg_4]
                for arg_7 in arg_3[2:]:
                    # shift the items and the common prefix lenght one further
                    arg_4, arg_5 = arg_5, arg_7
                    arg_8, arg_6 = arg_6, arg_0._compare_uids(arg_4, arg_5)
                    # compute the final prefix length for item1
                    arg_9 = max(arg_8, arg_6)
                    arg_0._short_uids[arg_4[:arg_9 + 1]] = arg_0.contacts[arg_4]
                # Save the last item.
                arg_0._short_uids[arg_5[:arg_6 + 1]] = arg_0.contacts[arg_5]
        return arg_0._short_uids

Create a dictionary of shortend UIDs for all contacts .


def Func(arg_0):
    # type: (Seed) -> None
    """
    Outputs the user's seed to stdout, along with lots of warnings
    about security.
    """
    print(
        'WARNING: Anyone who has your seed can spend your IOTAs! '
        'Clear the screen after recording your seed!'
    )
    compat.input('')
    print('Your seed is:')
    print('')
    print(binary_type(arg_0).decode('ascii'))
    print('')

    print(
        'Clear the screen to prevent shoulder surfing, '
        'and press return to continue.'
    )
    print('https://en.wikipedia.org/wiki/Shoulder_surfing_(computer_security)')
    compat.input('')

Outputs the user s seed to stdout along with lots of warnings about security .


def Func(arg_0,arg_1):
        """ Build a Godot graph instance from parsed data.
        """
        # Get basic graph information.
        arg_2 = arg_1[0] == 'strict'
        arg_3 = arg_1[1]
        arg_4 = arg_3 == 'digraph'
        arg_5 = arg_1[2]
        # Build the graph
        arg_6 = Graph(ID=arg_5, arg_2=arg_2, arg_4=arg_4)
        arg_0.graph = arg_0.build_graph(arg_6, arg_1[3])

Build a Godot graph instance from parsed data .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
Func
=
'\n.. list-table::\n'
if
arg_1
and
not
arg_1
.
isspace
(
)
:
Func
=
(
Func
+
arg_0
.
indent
+
':header-rows: 1\n\n'
+
arg_0
.
_indent_block
(
arg_1
)
+
'\n'
)
else
:
Func
=
Func
+
'\n'
Func
=
Func
+
arg_0
.
_indent_block
(
arg_2
)
+
'\n\n'
return
Func

def Func(arg_0, arg_1, arg_2):
        """Rendering table element. Wrap header and body in it.

        :param header: header part of the table.
        :param body: body part of the table.
        """
        Func = '\n.. list-table::\n'
        if arg_1 and not arg_1.isspace():
            Func = (Func + arg_0.indent + ':header-rows: 1\n\n' +
                     arg_0._indent_block(arg_1) + '\n')
        else:
            Func = Func + '\n'
        Func = Func + arg_0._indent_block(arg_2) + '\n\n'
        return Func

Rendering table element . Wrap header and body in it .


def Func(arg_0, arg_1, arg_2):
        """Computes the precedence of terminal and production.

        The precedence of a terminal is it's level in the PRECEDENCE tuple. For
        a production, the precedence is the right-most terminal (if it exists).
        The default precedence is DEFAULT_PREC - (LEFT, 0).

        Returns:
            precedence - dict[terminal | production] = (assoc, level)

        """
        arg_3 = collections.OrderedDict()

        for arg_4 in arg_0:
            arg_3[arg_4] = DEFAULT_PREC

        arg_5 = range(len(arg_2), 0, -1)
        for arg_6, arg_7 in zip(arg_5, arg_2):
            arg_8 = arg_7[0]
            for arg_9 in arg_7[1:]:
                arg_3[arg_9] = (arg_8, arg_6)

        for arg_10, arg_11 in arg_1:
            if arg_11 is None:
                arg_12 = [arg_9 for arg_9 in arg_10.rhs
                                  if arg_9 in arg_0] or [None]
                arg_3[arg_10] = arg_3.get(arg_12[-1],
                                                        DEFAULT_PREC)
            else:
                arg_3[arg_10] = arg_3.get(arg_11,
                                                        DEFAULT_PREC)

        return arg_3

Computes the precedence of terminal and production .


def Func(arg_0):
    """Try to format anything as a 2D matrix with column names."""
    if type(arg_0) is list and type(arg_0[0]) is dict:
        return Func_listOfDicts(arg_0)
    if type(arg_0) is list and type(arg_0[0]) is list:
        return Func_listOfDicts(dictFlat(arg_0))
    else:
        print(" !! I don't know how to format this object!")
        print(arg_0)

Try to format anything as a 2D matrix with column names .


def
Func
(
arg_0
)
:
arg_0
.
sort
(
)
arg_1
=
1
for
arg_2
in
arg_0
:
arg_3
=
get_abspath
(
arg_2
.
dirname
(
)
)
arg_4
=
arg_2
.
joinpath
(
arg_3
,
"{0:04d}"
.
format
(
arg_1
)
+
OUTPUT_DICOM_EXTENSION
)
log
.
info
(
'Renaming {0} to {1}'
.
format
(
arg_2
,
arg_4
)
)
arg_2
.
rename
(
arg_4
)
arg_1
+=
1

def Func(arg_0):
    """Will rename all files in file_lst to a padded serial
    number plus its extension

    :param file_lst: list of path.py paths
    """
    arg_0.sort()
    arg_1 = 1
    for arg_2 in arg_0:
        arg_3 = get_abspath(arg_2.dirname())
        arg_4 = arg_2.joinpath(arg_3, "{0:04d}".format(arg_1) +
                           OUTPUT_DICOM_EXTENSION)
        log.info('Renaming {0} to {1}'.format(arg_2, arg_4))
        arg_2.rename(arg_4)
        arg_1 += 1


def
Func
(
arg_0
)
:
if
arg_0
.
__thread
:
arg_1
=
[
"who am i"
]
arg_2
,
arg_3
,
arg_4
=
cij
.
util
.
execute
(
arg_1
,
shell
=
True
,
echo
=
True
)
if
arg_2
:
cij
.
warn
(
"cij.dmesg.Func: who am i failed"
)
return
1
arg_5
=
arg_3
.
split
(
)
[
1
]
arg_1
=
[
"pkill -f '{}' -t '{}'"
.
format
(
" "
.
join
(
arg_0
.
__prefix
)
,
arg_5
)
]
arg_2
,
arg_4
,
arg_4
=
cij
.
util
.
execute
(
arg_1
,
shell
=
True
,
echo
=
True
)
if
arg_2
:
cij
.
warn
(
"cij.dmesg.Func: pkill failed"
)
return
1
arg_0
.
__thread
.
join
(
)
arg_0
.
__thread
=
return
0

def Func(arg_0):
        """Terminate DMESG job"""

        if arg_0.__thread:
            arg_1 = ["who am i"]
            arg_2, arg_3, arg_4 = cij.util.execute(arg_1, shell=True, echo=True)
            if arg_2:
                cij.warn("cij.dmesg.Func: who am i failed")
                return 1

            arg_5 = arg_3.split()[1]

            arg_1 = ["pkill -f '{}' -t '{}'".format(" ".join(arg_0.__prefix), arg_5)]
            arg_2, arg_4, arg_4 = cij.util.execute(arg_1, shell=True, echo=True)
            if arg_2:
                cij.warn("cij.dmesg.Func: pkill failed")
                return 1

            arg_0.__thread.join()
            arg_0.__thread = None

        return 0


(code, varnames=None, names=None, constants=None,
                            cells=None, linestarts=None, line_offset=0)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None,
                            arg_4=None, arg_5=None, arg_6=0):
    """Iterate over the instructions in a bytecode string.

    Generates a sequence of Instruction namedtuples giving the details of each
    opcode.  Additional information about the code's runtime environment
    (e.g. variable names, constants) can be specified using optional
    arguments.

    """
    arg_7 = dis.findlabels(arg_0)
    arg_8 = 0
    arg_9 = None
    arg_10 = None
    # enumerate() is not an option, since we sometimes process
    # multiple elements on a single pass through the loop
    arg_11 = len(arg_0)
    arg_12 = 0
    while arg_12 < arg_11:
        arg_13 = arg_0[arg_12]
        arg_14 = arg_12
        if arg_5 is not None:
            arg_9 = arg_5.get(arg_12, None)
            if arg_9 is not None:
                arg_9 += arg_6
        arg_15 = arg_12 in arg_7
        arg_12 = arg_12 + 1
        arg_16 = None
        arg_17 = None
        arg_18 = ''
        if arg_13 >= dis.HAVE_ARGUMENT:
            arg_16 = arg_0[arg_12] + arg_0[arg_12 + 1] * 256 + arg_8
            arg_8 = 0
            arg_12 = arg_12 + 2
            if arg_13 == dis.EXTENDED_ARG:
                arg_8 = arg_16 * 65536
            # Set argval to the dereferenced value of the argument when
            #  availabe, and argrepr to the string representation of argval.
            #    _disassemble_bytes needs the string repr of the
            #    raw name index for LOAD_GLOBAL, LOAD_CONST, etc.
            arg_17 = arg_16
            if arg_13 in dis.hasconst:
                arg_17, arg_18 = dis._get_const_info(arg_16, arg_3)
            elif arg_13 in dis.hasname:
                arg_17, arg_18 = dis._get_name_info(arg_16, arg_2)
            elif arg_13 in dis.hasjrel:
                arg_17 = arg_12 + arg_16
                arg_18 = "to " + repr(arg_17)
            elif arg_13 in dis.haslocal:
                arg_17, arg_18 = dis._get_name_info(arg_16, arg_1)
            elif arg_13 in dis.hascompare:
                arg_17 = dis.cmp_op[arg_16]
                arg_18 = arg_17
            elif arg_13 in dis.hasfree:
                arg_17, arg_18 = dis._get_name_info(arg_16, arg_4)
            elif arg_13 in dis.hasnargs:
                arg_18 = "%d positional, %d keyword pair" % (arg_0[arg_12 - 2], arg_0[arg_12 - 1])
        yield dis.Instruction(dis.opname[arg_13], arg_13,
                              arg_16, arg_17, arg_18,
                              arg_14, arg_9, arg_15)

Iterate over the instructions in a bytecode string .


def Func(arg_0, arg_1):
        """Setup connection to database."""
        arg_0.db = arg_1
        arg_0.hgnc_collection = arg_1.hgnc_gene
        arg_0.user_collection = arg_1.user
        arg_0.whitelist_collection = arg_1.whitelist
        arg_0.institute_collection = arg_1.institute
        arg_0.event_collection = arg_1.event
        arg_0.case_collection = arg_1.case
        arg_0.panel_collection = arg_1.gene_panel
        arg_0.hpo_term_collection = arg_1.hpo_term
        arg_0.disease_term_collection = arg_1.disease_term
        arg_0.variant_collection = arg_1.variant
        arg_0.acmg_collection = arg_1.acmg
        arg_0.clinvar_collection = arg_1.clinvar
        arg_0.clinvar_submission_collection = arg_1.clinvar_submission
        arg_0.exon_collection = arg_1.exon
        arg_0.transcript_collection = arg_1.transcript


return tf.concat([generate_one(d) for d in tf.unstack(dims)],
                   axis=-1)

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = tf . range ( arg_0 ) arg_4 = distributions . SeedStream ( arg_2 , salt = 'MCMCSampleHaltonSequence3' ) def generate_one ( arg_5 ) : arg_2 = arg_4 ( ) arg_6 = lambda _ : tf . random . shuffle ( tf . range ( arg_5 ) , arg_2 = arg_2 ) return tf . map_fn ( arg_6 , arg_3 , parallel_iterations = 1 if arg_2 is not None else 10 ) return tf . concat ( [ generate_one ( arg_5 ) for arg_5 in tf . unstack ( arg_1 ) ] , axis = - 1 )

def Func(arg_0, arg_1, arg_2=None):
  """Uniform iid sample from the space of permutations.

  Draws a sample of size `num_results` from the group of permutations of degrees
  specified by the `dims` tensor. These are packed together into one tensor
  such that each row is one sample from each of the dimensions in `dims`. For
  example, if dims = [2,3] and num_results = 2, the result is a tensor of shape
  [2, 2 + 3] and the first row of the result might look like:
  [1, 0, 2, 0, 1]. The first two elements are a permutation over 2 elements
  while the next three are a permutation over 3 elements.

  Args:
    num_results: A positive scalar `Tensor` of integral type. The number of
      draws from the discrete uniform distribution over the permutation groups.
    dims: A 1D `Tensor` of the same dtype as `num_results`. The degree of the
      permutation groups from which to sample.
    seed: (Optional) Python integer to seed the random number generator.

  Returns:
    permutations: A `Tensor` of shape `[num_results, sum(dims)]` and the same
    dtype as `dims`.
  """
  arg_3 = tf.range(arg_0)
  arg_4 = distributions.SeedStream(arg_2, salt='MCMCSampleHaltonSequence3')
  def generate_one(arg_5):
    arg_2 = arg_4()
    arg_6 = lambda _: tf.random.shuffle(tf.range(arg_5), arg_2=arg_2)
    return tf.map_fn(
        arg_6,
        arg_3,
        parallel_iterations=1 if arg_2 is not None else 10)
  return tf.concat([generate_one(arg_5) for arg_5 in tf.unstack(arg_1)],
                   axis=-1)

Uniform iid sample from the space of permutations .


def Func ( ) : arg_0 = { 'X' : Funcer_move , 'O' : random_move } arg_1 = Board ( ) while not arg_1 . winner : arg_2 , arg_3 = arg_0 [ arg_1 . Funcer ] ( arg_1 ) arg_1 = arg_1 . make_move ( arg_2 , arg_3 ) print ( arg_1 , end = '\n\n' ) print ( arg_1 . winner )

def Func():
    'Play a game of naughts and crosses against the computer.'
    arg_0 = {'X': Funcer_move, 'O': random_move}
    arg_1 = Board()
    while not arg_1.winner:
        arg_2, arg_3 = arg_0[arg_1.Funcer](arg_1)
        arg_1 = arg_1.make_move(arg_2, arg_3)
    print(arg_1, end='\n\n')
    print(arg_1.winner)

Play a game of naughts and crosses against the computer .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
*
arg_3
)
:
arg_2
[
'transaction_code'
]
=
int
(
arg_2
[
arg_1
.
slug
]
.
split
(
';'
)
[
0
]
.
split
(
' '
,
1
)
[
0
]
)
return
arg_2

def Func(arg_0, arg_1, arg_2, *arg_3):
    """
    mBank Collect uses transaction code 911 to distinguish icoming mass
    payments transactions, adding transaction_code may be helpful in further
    processing
    """
    arg_2['transaction_code'] = int(
        arg_2[arg_1.slug].split(';')[0].split(' ', 1)[0])

    return arg_2

mBank Collect uses transaction code 911 to distinguish icoming mass payments transactions adding transaction_code may be helpful in further processing


def
Func
(
arg_0
,
arg_1
)
:
def
arg_13
(
arg_2
,
arg_3
)
:
arg_4
=
arg_11
.
line
arg_5
=
Composer
.
compose_node
(
arg_11
,
arg_2
,
arg_3
)
arg_5
.
__line__
=
arg_4
+
1
return
arg_5
def
arg_14
(
arg_5
,
arg_7
=
False
)
:
if
ANSIBLE_VERSION
<
2
:
arg_8
=
Constructor
.
construct_mapping
(
arg_11
,
arg_5
,
arg_7
=
arg_7
)
else
:
arg_8
=
AnsibleConstructor
.
construct_mapping
(
arg_11
,
arg_5
,
arg_7
=
arg_7
)
if
hasattr
(
arg_5
,
'__line__'
)
:
arg_8
[
arg_9
]
=
arg_5
.
__line__
else
:
arg_8
[
arg_9
]
=
arg_8
.
_line_number
arg_8
[
arg_10
]
=
arg_1
return
arg_8
try
:
if
ANSIBLE_VERSION
<
2
:
arg_11
=
yaml
.
Loader
(
arg_0
)
else
:
import
inspect
arg_12
=
{
}
if
'vault_password'
in
inspect
.
getargspec
(
AnsibleLoader
.
__init__
)
.
args
:
arg_12
[
'vault_password'
]
=
DEFAULT_VAULT_PASSWORD
arg_11
=
AnsibleLoader
(
arg_0
,
**
arg_12
)
arg_11
.
compose_node
=
arg_13
arg_11
.
construct_mapping
=
arg_14
arg_0
=
arg_11
.
get_single_data
(
)
except
(
yaml
.
parser
.
ParserError
,
yaml
.
scanner
.
ScannerError
)
as
e
:
raise
SystemExit
(
"Failed to parse YAML in %s: %s"
%
(
arg_1
,
str
(
e
)
)
)
return
arg_0

def Func(arg_0, arg_1):
    """Parses yaml as ansible.utils.parse_yaml but with linenumbers.

    The line numbers are stored in each node's LINE_NUMBER_KEY key.
    """

    def arg_13(arg_2, arg_3):
        # the line number where the previous token has ended (plus empty lines)
        arg_4 = arg_11.line
        arg_5 = Composer.compose_node(arg_11, arg_2, arg_3)
        arg_5.__line__ = arg_4 + 1
        return arg_5

    def arg_14(arg_5, arg_7=False):
        if ANSIBLE_VERSION < 2:
            arg_8 = Constructor.construct_mapping(arg_11, arg_5, arg_7=arg_7)
        else:
            arg_8 = AnsibleConstructor.construct_mapping(arg_11, arg_5, arg_7=arg_7)
        if hasattr(arg_5, '__line__'):
            arg_8[arg_9] = arg_5.__line__
        else:
            arg_8[arg_9] = arg_8._line_number
        arg_8[arg_10] = arg_1
        return arg_8

    try:
        if ANSIBLE_VERSION < 2:
            arg_11 = yaml.Loader(arg_0)
        else:
            import inspect
            arg_12 = {}
            if 'vault_password' in inspect.getargspec(AnsibleLoader.__init__).args:
                arg_12['vault_password'] = DEFAULT_VAULT_PASSWORD
            arg_11 = AnsibleLoader(arg_0, **arg_12)
        arg_11.compose_node = arg_13
        arg_11.construct_mapping = arg_14
        arg_0 = arg_11.get_single_data()
    except (yaml.parser.ParserError, yaml.scanner.ScannerError) as e:
        raise SystemExit("Failed to parse YAML in %s: %s" % (arg_1, str(e)))
    return arg_0

Parses yaml as ansible . utils . parse_yaml but with linenumbers .


def Func ( arg_0 , arg_1 , arg_2 = True ) : from modelx . core . cells import shareable_parameters if len ( arg_1 ) : arg_3 = shareable_parameters ( arg_0 ) else : arg_3 = get_all_params ( arg_0 . values ( ) ) arg_4 = None for arg_5 in arg_0 . values ( ) : arg_6 = cells_to_dataframe ( arg_5 , arg_1 ) if arg_2 and arg_6 . isnull ( ) . all ( ) . all ( ) : continue if arg_6 . index . names != [ None ] : if isinstance ( arg_6 . index , pd . MultiIndex ) : if _pd_ver < ( 0 , 20 ) : arg_6 = _reset_naindex ( arg_6 ) arg_6 = arg_6 . reset_index ( ) arg_7 = set ( arg_3 ) - set ( arg_6 ) for arg_8 in arg_7 : arg_6 [ arg_8 ] = np . nan if arg_4 is None : arg_4 = arg_6 else : try : arg_4 = pd . merge ( arg_4 , arg_6 , how = "outer" ) except MergeError : arg_4 = pd . concat ( [ arg_4 , arg_6 ] , axis = 1 ) except ValueError : arg_9 = set ( arg_4 . columns ) & set ( arg_6 . columns ) for arg_10 in arg_9 : if ( len ( [ str ( arg_11 [ arg_10 ] . dtype ) for arg_11 in ( arg_4 , arg_6 ) if str ( arg_11 [ arg_10 ] . dtype ) == "object" ] ) == 1 ) : if str ( arg_4 [ arg_10 ] . dtype ) == "object" : arg_11 = arg_6 else : arg_11 = arg_4 arg_11 [ [ arg_10 ] ] = arg_11 [ arg_10 ] . astype ( "object" ) arg_4 = pd . merge ( arg_4 , arg_6 , how = "outer" ) if arg_4 is None : return pd . DataFrame ( ) else : return arg_4 . set_index ( arg_3 ) if arg_3 else arg_4

def Func(arg_0, arg_1, arg_2=True):
    """Convert multiple cells to a frame.

    If args is an empty sequence, all values are included.
    If args is specified, cellsiter must have shareable parameters.

    Args:
        cellsiter: A mapping from cells names to CellsImpl objects.
        args: A sequence of arguments
    """
    from modelx.core.cells import shareable_parameters

    if len(arg_1):
        arg_3 = shareable_parameters(arg_0)
    else:
        arg_3 = get_all_params(arg_0.values())

    arg_4 = None

    for arg_5 in arg_0.values():
        arg_6 = cells_to_dataframe(arg_5, arg_1)

        if arg_2 and arg_6.isnull().all().all():
            continue  #  Ignore all NA or empty

        if arg_6.index.names != [None]:
            if isinstance(arg_6.index, pd.MultiIndex):
                if _pd_ver < (0, 20):
                    arg_6 = _reset_naindex(arg_6)

            arg_6 = arg_6.reset_index()

        arg_7 = set(arg_3) - set(arg_6)

        for arg_8 in arg_7:
            arg_6[arg_8] = np.nan

        if arg_4 is None:
            arg_4 = arg_6
        else:
            try:
                arg_4 = pd.merge(arg_4, arg_6, how="outer")
            except MergeError:
                # When no common column exists, i.e. all cells are scalars.
                arg_4 = pd.concat([arg_4, arg_6], axis=1)
            except ValueError:
                # When common columns are not coercible (numeric vs object),
                # Make the numeric column object type
                arg_9 = set(arg_4.columns) & set(arg_6.columns)
                for arg_10 in arg_9:

                    # When only either of them has object dtype
                    if (
                        len(
                            [
                                str(arg_11[arg_10].dtype)
                                for arg_11 in (arg_4, arg_6)
                                if str(arg_11[arg_10].dtype) == "object"
                            ]
                        )
                        == 1
                    ):

                        if str(arg_4[arg_10].dtype) == "object":
                            arg_11 = arg_6
                        else:
                            arg_11 = arg_4
                        arg_11[[arg_10]] = arg_11[arg_10].astype("object")

                # Try again
                arg_4 = pd.merge(arg_4, arg_6, how="outer")

    if arg_4 is None:
        return pd.DataFrame()
    else:
        return arg_4.set_index(arg_3) if arg_3 else arg_4


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if not isinstance ( arg_2 , ( list , tuple , np . ndarray ) ) : arg_2 = [ arg_2 ] * arg_3 assert arg_3 == len ( arg_2 ) for arg_4 , arg_5 in zip ( [ '' , '2' , '3' ] [ : arg_3 ] , arg_2 ) : arg_0 . setParam ( getattr ( ode , 'Param{}{}' . format ( arg_1 , arg_4 ) ) , arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3):
    '''Set the given param for each of the DOFs for a joint.'''
    if not isinstance(arg_2, (list, tuple, np.ndarray)):
        arg_2 = [arg_2] * arg_3
    assert arg_3 == len(arg_2)
    for arg_4, arg_5 in zip(['', '2', '3'][:arg_3], arg_2):
        arg_0.setParam(getattr(ode, 'Param{}{}'.format(arg_1, arg_4)), arg_5)

Set the given param for each of the DOFs for a joint .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is not None : arg_3 , arg_4 = remove_nodes ( arg_0 , arg_2 ) else : arg_3 , arg_4 = arg_0 . nodes_df , arg_0 . edges_df with pd . HDFStore ( arg_1 , mode = 'w' ) as arg_5 : arg_5 [ 'nodes' ] = arg_3 arg_5 [ 'edges' ] = arg_4 arg_5 [ 'two_way' ] = pd . Series ( [ arg_0 . _twoway ] ) arg_5 [ 'impedance_names' ] = pd . Series ( arg_0 . impedance_names )

def Func(arg_0, arg_1, arg_2=None):
    """
    Save a Network's data to a Pandas HDFStore.

    Parameters
    ----------
    network : pandana.Network
    filename : str
    rm_nodes : array_like
        A list, array, Index, or Series of node IDs that should *not*
        be saved as part of the Network.

    """
    if arg_2 is not None:
        arg_3, arg_4 = remove_nodes(arg_0, arg_2)
    else:
        arg_3, arg_4 = arg_0.nodes_df, arg_0.edges_df

    with pd.HDFStore(arg_1, mode='w') as arg_5:
        arg_5['nodes'] = arg_3
        arg_5['edges'] = arg_4

        arg_5['two_way'] = pd.Series([arg_0._twoway])
        arg_5['impedance_names'] = pd.Series(arg_0.impedance_names)

Save a Network s data to a Pandas HDFStore .


def Func(arg_0, arg_1):
        """
        Makes a striplog of all Funcions.

        Args:
            Striplog. The striplog instance to Func with.

        Returns:
            Striplog. The result of the Funcion.
        """
        if not isinstance(arg_1, arg_0.__class__):
            arg_2 = "You can only Func striplogs with each other."
            raise StriplogError(arg_2)

        arg_3 = []
        for arg_4 in arg_0:
            for arg_5 in arg_1:
                try:
                    arg_3.append(arg_4.Func(arg_5))
                except IntervalError:
                    # The intervals don't overlap
                    pass
        return Striplog(arg_3)

Makes a striplog of all intersections.

        Args:
            Striplog. The striplog instance to intersect with.

        Returns:
            Striplog. The result of the intersection.


def Func ( ) : arg_0 = get_docker_env ( ) arg_1 , arg_2 , arg_3 = arg_0 [ 'DOCKER_HOST' ] , arg_0 [ 'DOCKER_CERT_PATH' ] , arg_0 [ 'DOCKER_TLS_VERIFY' ] arg_4 = { 'base_url' : arg_1 . replace ( 'tcp://' , 'https://' ) , 'timeout' : None , 'version' : 'auto' } if arg_3 and arg_2 : arg_4 [ 'tls' ] = docker . tls . TLSConfig ( client_cert = ( os . path . join ( arg_2 , 'cert.pem' ) , os . path . join ( arg_2 , 'key.pem' ) ) , ca_cert = os . path . join ( arg_2 , 'ca.pem' ) , verify = True , ssl_version = None , assert_hostname = False ) return docker . Client ( ** arg_4 )

def Func():
    """Ripped off and slightly modified based on docker-py's
    kwargs_from_env utility function."""
    arg_0 = get_docker_env()
    arg_1, arg_2, arg_3 = arg_0['DOCKER_HOST'], arg_0['DOCKER_CERT_PATH'], arg_0['DOCKER_TLS_VERIFY']

    arg_4 = {'base_url': arg_1.replace('tcp://', 'https://'),
              'timeout': None,
              'version': 'auto'}
    if arg_3 and arg_2:
        arg_4['tls'] = docker.tls.TLSConfig(
            client_cert=(os.path.join(arg_2, 'cert.pem'),
                         os.path.join(arg_2, 'key.pem')),
            ca_cert=os.path.join(arg_2, 'ca.pem'),
            verify=True,
            ssl_version=None,
            assert_hostname=False)
    return docker.Client(**arg_4)

Ripped off and slightly modified based on docker - py s kwargs_from_env utility function .


return self.__traverse(curr_node, 0,  *args)

def Func(arg_0, *arg_1):
        """
        Find a node in the tree. If the node is not found it is added first and then returned.

        :param args: a tuple
        :return: returns the node
        """
        arg_2 = arg_0.__root
        return arg_0.__traverse(arg_2, 0,  *arg_1)

Find a node in the tree . If the node is not found it is added first and then returned .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_conn ( ) return arg_2 . __getattr__ ( arg_1 ) . describe ( )

def Func(arg_0, arg_1):
        """
        Get the description of an object from Salesforce.
        This description is the object's schema and
        some extra metadata that Salesforce stores for each object.

        :param obj: The name of the Salesforce object that we are getting a description of.
        :type obj: str
        :return: the description of the Salesforce object.
        :rtype: dict
        """
        arg_2 = arg_0.get_conn()

        return arg_2.__getattr__(arg_1).describe()

Get the description of an object from Salesforce . This description is the object s schema and some extra metadata that Salesforce stores for each object .


def Func(arg_0, arg_1, arg_2, arg_3):
        """ Copy memory writes from Manticore back into Unicorn in real-time """
        if arg_0.write_backs_disabled:
            return
        if type(arg_2) is bytes:
            arg_0._emu.mem_write(arg_1, arg_2)
        else:
            if issymbolic(arg_2):
                arg_4 = [Operators.CHR(Operators.EXTRACT(arg_2, offset, 8)) for offset in range(0, arg_3, 8)]
                arg_5 = []
                for arg_6 in arg_4:
                    if issymbolic(arg_6):
                        arg_6 = chr(solver.get_value(arg_0._cpu.memory.constraints, arg_6))
                    arg_5.append(arg_6)
                arg_4 = arg_5
            else:
                arg_4 = [Operators.CHR(Operators.EXTRACT(arg_2, offset, 8)) for offset in range(0, arg_3, 8)]
            logger.debug(f"Writing back {hr_size(size // 8)} to {hex(where)}: {data}")
            # TODO - the extra encoding is to handle null bytes output as strings when we concretize. That's probably a bug.
            arg_0._emu.mem_write(arg_1, b''.join(arg_7.encode('utf-8') if type(arg_7) is str else arg_7 for arg_7 in arg_4))

Copy memory writes from Manticore back into Unicorn in real - time


(
            self,
            start=0,
            stop=None,
            threshold=None,
            security_level=None,
    )

return extended.GetInputsCommand(self.adapter)(
            seed=self.seed,
            start=start,
            stop=stop,
            threshold=threshold,
            securityLevel=security_level
        )

def Func ( arg_0 , arg_1 = 0 , arg_2 = None , arg_3 = None , arg_4 = None , ) : return extended . GetInputsCommand ( arg_0 . adapter ) ( seed = arg_0 . seed , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , securityLevel = arg_4 )

def Func(
            arg_0,
            arg_1=0,
            arg_2=None,
            arg_3=None,
            arg_4=None,
    ):
        # type: (int, Optional[int], Optional[int], Optional[int]) -> dict
        """
        Gets all possible inputs of a seed and returns them, along with
        the total balance.

        This is either done deterministically (by generating all
        addresses until :py:meth:`find_transactions` returns an empty
        result), or by providing a key range to search.

        :param start:
            Starting key index.
            Defaults to 0.

        :param stop:
            Stop before this index.

            Note that this parameter behaves like the ``stop`` attribute
            in a :py:class:`slice` object; the stop index is *not*
            included in the result.

            If ``None`` (default), then this method will not stop until
            it finds an unused address.

        :param threshold:
            If set, determines the minimum threshold for a successful
            result:

            - As soon as this threshold is reached, iteration will stop.
            - If the command runs out of addresses before the threshold
              is reached, an exception is raised.

            .. note::
                This method does not attempt to "optimize" the result
                (e.g., smallest number of inputs, get as close to
                ``threshold`` as possible, etc.); it simply accumulates
                inputs in order until the threshold is met.

            If ``threshold`` is 0, the first address in the key range
            with a non-zero balance will be returned (if it exists).

            If ``threshold`` is ``None`` (default), this method will
            return **all** inputs in the specified key range.

        :param security_level:
            Number of iterations to use when generating new addresses
            (see :py:meth:`get_new_addresses`).

            This value must be between 1 and 3, inclusive.

            If not set, defaults to
            :py:attr:`AddressGenerator.DEFAULT_SECURITY_LEVEL`.

        :return:
            Dict with the following structure::

                {
                    'inputs': List[Address],
                        Addresses with nonzero balances that can be used
                        as inputs.

                    'totalBalance': int,
                        Aggregate balance from all matching addresses.
                }

            Note that each Address in the result has its ``balance``
            attribute set.

            Example:

            .. code-block:: python

                response = iota.Func(...)

                input0 = response['inputs'][0] # type: Address
                input0.balance # 42

        :raise:
            - :py:class:`iota.adapter.BadApiResponse` if ``threshold``
              is not met.  Not applicable if ``threshold`` is ``None``.

        References:

        - https://github.com/iotaledger/wiki/blob/master/api-proposal.md#getinputs
        """
        return extended.GetInputsCommand(arg_0.adapter)(
            seed=arg_0.seed,
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            securityLevel=arg_4
        )

Gets all possible inputs of a seed and returns them, along with
        the total balance.

        This is either done deterministically (by generating all
        addresses until :py:meth:`find_transactions` returns an empty
        result), or by providing a key range to search.

        :param start:
            Starting key index.
            Defaults to 0.

        :param stop:
            Stop before this index.

            Note that this parameter behaves like the ``stop`` attribute
            in a :py:class:`slice` object; the stop index is *not*
            included in the result.

            If ``None`` (default), then this method will not stop until
            it finds an unused address.

        :param threshold:
            If set, determines the minimum threshold for a successful
            result:

            - As soon as this threshold is reached, iteration will stop.
            - If the command runs out of addresses before the threshold
              is reached, an exception is raised.

            .. note::
                This method does not attempt to "optimize" the result
                (e.g., smallest number of inputs, get as close to
                ``threshold`` as possible, etc.); it simply accumulates
                inputs in order until the threshold is met.

            If ``threshold`` is 0, the first address in the key range
            with a non-zero balance will be returned (if it exists).

            If ``threshold`` is ``None`` (default), this method will
            return **all** inputs in the specified key range.

        :param security_level:
            Number of iterations to use when generating new addresses
            (see :py:meth:`get_new_addresses`).

            This value must be between 1 and 3, inclusive.

            If not set, defaults to
            :py:attr:`AddressGenerator.DEFAULT_SECURITY_LEVEL`.

        :return:
            Dict with the following structure::

                {
                    'inputs': List[Address],
                        Addresses with nonzero balances that can be used
                        as inputs.

                    'totalBalance': int,
                        Aggregate balance from all matching addresses.
                }

            Note that each Address in the result has its ``balance``
            attribute set.

            Example:

            .. code-block:: python

                response = iota.get_inputs(...)

                input0 = response['inputs'][0] # type: Address
                input0.balance # 42

        :raise:
            - :py:class:`iota.adapter.BadApiResponse` if ``threshold``
              is not met.  Not applicable if ``threshold`` is ``None``.

        References:

        - https://github.com/iotaledger/wiki/blob/master/api-proposal.md#getinputs

Gets all possible inputs of a seed and returns them along with the total balance .


Return the names of our marker labels in canonical order.

return sorted(self.channels, key=lambda c: self.channels[c])

def Func ( arg_0 ) : return sorted ( arg_0 . channels , key = lambda c : arg_0 . channels [ c ] )

def Func(arg_0):
        '''Return the names of our marker Func in canonical order.'''
        return sorted(arg_0.channels, key=lambda c: arg_0.channels[c])

Return the names of our marker labels in canonical order .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 ( ) arg_2 . implementation = arg_1 . implementation arg_2 . steps = arg_1 . steps arg_2 . stepsList = [ int ( i ) for i in arg_1 . steps . split ( "," ) ] arg_2 . alpha = arg_1 . alpha arg_2 . verbosity = arg_1 . verbosity arg_2 . maxCategoryCount = arg_1 . maxCategoryCount arg_2 . _sdrClassifier = SDRClassifierFactory . read ( arg_1 ) arg_2 . learningMode = arg_1 . learningMode arg_2 . inferenceMode = arg_1 . inferenceMode arg_2 . recordNum = arg_1 . recordNum return arg_2

def Func(arg_0, arg_1):
    """
    Read state from proto object.

    :param proto: SDRClassifierRegionProto capnproto object
    """
    arg_2 = arg_0()

    arg_2.implementation = arg_1.implementation
    arg_2.steps = arg_1.steps
    arg_2.stepsList = [int(i) for i in arg_1.steps.split(",")]
    arg_2.alpha = arg_1.alpha
    arg_2.verbosity = arg_1.verbosity
    arg_2.maxCategoryCount = arg_1.maxCategoryCount

    arg_2._sdrClassifier = SDRClassifierFactory.read(arg_1)

    arg_2.learningMode = arg_1.learningMode
    arg_2.inferenceMode = arg_1.inferenceMode
    arg_2.recordNum = arg_1.recordNum

    return arg_2


def Func(arg_0, arg_1):
    """ Loads the class from the class_path string """
    if arg_0 is None:
        return arg_1

    arg_2 = arg_0.rsplit('.', 1)
    arg_3 = getattr(
        importlib.import_module(arg_2[0]),
        arg_2[1],
        arg_1
    ) if len(arg_2) > 1 else arg_1

    return arg_3


def Func(arg_0):
    """Set current keyring backend.
    """
    global arg_1
    if not isinstance(arg_0, backend.KeyringBackend):
        raise TypeError("The keyring must be a subclass of KeyringBackend")
    arg_1 = arg_0


def
Func
(
arg_0
,
arg_1
=
0.1
,
arg_2
=
)
:
arg_3
=
{
}
arg_3
[
'dataset'
]
=
arg_0
.
frame_id
arg_3
[
'fraction'
]
=
arg_1
if
arg_2
is
not
:
arg_3
[
'seed'
]
=
arg_2
arg_4
=
{
}
arg_4
[
'job'
]
=
h2o
.
api
(
"POST /3/MissingInserter"
,
data
=
arg_3
)
H2OJob
(
arg_4
,
job_type
=
(
"Insert Missing Values"
)
)
.
poll
(
)
arg_0
.
_ex
.
_cache
.
flush
(
)
return
arg_0

def Func(arg_0, arg_1=0.1, arg_2=None):
        """
        Insert missing values into the current frame, modifying it in-place.

        Randomly replaces a user-specified fraction of entries in a H2O dataset with missing
        values.

        :param float fraction: A number between 0 and 1 indicating the fraction of entries to replace with missing.
        :param int seed: The seed for the random number generator used to determine which values to make missing.

        :returns: the original H2OFrame with missing values inserted.
        """
        arg_3 = {}
        arg_3['dataset'] = arg_0.frame_id  # Eager; forces eval now for following REST call
        arg_3['fraction'] = arg_1
        if arg_2 is not None: arg_3['seed'] = arg_2
        arg_4 = {}
        arg_4['job'] = h2o.api("POST /3/MissingInserter", data=arg_3)
        H2OJob(arg_4, job_type=("Insert Missing Values")).poll()
        arg_0._ex._cache.flush()
        return arg_0

Insert missing values into the current frame modifying it in - place .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
u"_"
+
arg_2
+
u"."
arg_4
=
len
(
arg_3
)
for
arg_5
in
arg_0
.
alt_names
.
get
(
"SRVName"
,
[
]
)
:
logger
.
debug
(
"checking {0!r} against {1!r}"
.
format
(
arg_1
,
arg_5
)
)
if
not
arg_5
.
startswith
(
arg_3
)
:
logger
.
debug
(
"{0!r} does not start with {1!r}"
.
format
(
arg_5
,
arg_3
)
)
continue
try
:
arg_6
=
JID
(
arg_5
[
arg_4
:
]
)
except
ValueError
:
continue
if
arg_6
==
arg_1
:
logger
.
debug
(
"Match!"
)
return
True
return
False

def Func(arg_0, arg_1, arg_2):
        """Check if the cerificate is valid for given domain-only JID
        and a service type.

        :Parameters:
            - `jid`: JID requested (domain part only)
            - `srv_type`: service type, e.g. 'xmpp-client'
        :Types:
            - `jid`: `JID`
            - `srv_type`: `unicode`
        :Returntype: `bool`
        """
        arg_3 = u"_" + arg_2 + u"."
        arg_4 = len(arg_3)
        for arg_5 in arg_0.alt_names.get("SRVName", []):
            logger.debug("checking {0!r} against {1!r}".format(arg_1,
                                                                arg_5))
            if not arg_5.startswith(arg_3):
                logger.debug("{0!r} does not start with {1!r}"
                                                .format(arg_5, arg_3))
                continue
            try:
                arg_6 = JID(arg_5[arg_4:])
            except ValueError:
                continue
            if arg_6 == arg_1:
                logger.debug("Match!")
                return True
        return False

Check if the cerificate is valid for given domain - only JID and a service type .


(self, suppress_output=False, inputdata=None, **kw)

def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
,
**
arg_3
)
:
if
arg_2
is
not
:
arg_3
[
"stdin"
]
=
subprocess
.
PIPE
if
arg_1
:
arg_3
[
"stdout"
]
=
open
(
os
.
devnull
,
"w"
)
arg_3
[
"stderr"
]
=
arg_3
[
"stdout"
]
try
:
try
:
arg_4
=
subprocess
.
Popen
(
arg_0
.
cmd
,
**
arg_3
)
finally
:
if
arg_1
:
arg_3
[
"stdout"
]
.
close
(
)
except
OSError
as
e
:
arg_5
=
"Failed starting command {!r}: {}"
.
format
(
arg_0
.
cmd
,
e
)
raise
QuiltError
(
arg_5
)
if
arg_2
is
not
:
arg_4
.
stdin
.
write
(
arg_2
)
arg_4
.
stdin
.
close
(
)
arg_6
=
arg_4
.
wait
(
)
if
arg_6
!=
0
:
raise
SubprocessError
(
arg_0
.
cmd
,
arg_6
)

def Func(arg_0, arg_1=False, arg_2=None, **arg_3):
        """Run command as a subprocess and wait until it is finished.

        The command should be given as a list of strings to avoid problems
        with shell quoting.  If the command exits with a return code other
        than 0, a SubprocessError is raised.
        """
        if arg_2 is not None:
            arg_3["stdin"] = subprocess.PIPE
        if arg_1:
            arg_3["stdout"] = open(os.devnull, "w")
            arg_3["stderr"] = arg_3["stdout"]
        try:
            try:
                arg_4 = subprocess.Popen(arg_0.cmd, **arg_3)
            finally:
                if arg_1:
                    arg_3["stdout"].close()
        except OSError as e:
            arg_5 = "Failed starting command {!r}: {}".format(arg_0.cmd, e)
            raise QuiltError(arg_5)

        if arg_2 is not None:
            arg_4.stdin.write(arg_2)
            arg_4.stdin.close()
        arg_6 = arg_4.wait()
        if arg_6 != 0:
            raise SubprocessError(arg_0.cmd, arg_6)

Run command as a subprocess and wait until it is finished .


return (not self.isBool(type)) \
            and (not self.isString(type)) \
            and (not self.isNum(type))

def Func ( arg_0 , arg_1 ) : return ( not arg_0 . isBool ( arg_1 ) ) and ( not arg_0 . isString ( arg_1 ) ) and ( not arg_0 . isNum ( arg_1 ) )

def Func(arg_0, arg_1):
        """
        is the type a byte array value?

        :param type: PKCS#11 type like `CKA_MODULUS`
        :rtype: bool
        """
        return (not arg_0.isBool(arg_1)) \
            and (not arg_0.isString(arg_1)) \
            and (not arg_0.isNum(arg_1))


(self, other, max_distance=1e-6, points_per_edge=8)

def Func ( arg_0 , arg_1 , arg_2 = 1e-6 , arg_3 = 8 ) : if isinstance ( arg_1 , LineString ) : pass elif isinstance ( arg_1 , tuple ) : arg_1 = LineString ( [ arg_1 ] ) else : arg_1 = LineString ( arg_1 ) if len ( arg_0 . coords ) == 0 and len ( arg_1 . coords ) == 0 : return True elif 0 in [ len ( arg_0 . coords ) , len ( arg_1 . coords ) ] : return False arg_4 = arg_0 . subdivide ( arg_3 ) arg_5 = arg_1 . subdivide ( arg_3 ) arg_6 = arg_4 . compute_pointwise_distances ( arg_5 ) arg_7 = arg_5 . compute_pointwise_distances ( arg_4 ) arg_8 = max ( np . max ( arg_6 ) , np . max ( arg_7 ) ) return arg_8 < arg_2

def Func(arg_0, arg_1, arg_2=1e-6, arg_3=8):
        """
        Compare this and another LineString's coordinates.

        This is an approximate method based on pointwise distances and can
        in rare corner cases produce wrong outputs.

        Parameters
        ----------
        other : imgaug.augmentables.lines.LineString \
                or tuple of number \
                or ndarray \
                or list of ndarray \
                or list of tuple of number
            The other line string or its coordinates.

        max_distance : float
            Max distance of any point from the other line string before
            the two line strings are evaluated to be unequal.

        points_per_edge : int, optional
            How many points to interpolate on each edge.

        Returns
        -------
        bool
            Whether the two LineString's coordinates are almost identical,
            i.e. the max distance is below the threshold.
            If both have no coordinates, ``True`` is returned.
            If only one has no coordinates, ``False`` is returned.
            Beyond that, the number of points is not evaluated.

        """
        if isinstance(arg_1, LineString):
            pass
        elif isinstance(arg_1, tuple):
            arg_1 = LineString([arg_1])
        else:
            arg_1 = LineString(arg_1)

        if len(arg_0.coords) == 0 and len(arg_1.coords) == 0:
            return True
        elif 0 in [len(arg_0.coords), len(arg_1.coords)]:
            # only one of the two line strings has no coords
            return False

        arg_4 = arg_0.subdivide(arg_3)
        arg_5 = arg_1.subdivide(arg_3)

        arg_6 = arg_4.compute_pointwise_distances(arg_5)
        arg_7 = arg_5.compute_pointwise_distances(arg_4)
        arg_8 = max(np.max(arg_6), np.max(arg_7))
        return  arg_8 < arg_2

Compare this and another LineString s coordinates .


def Func ( arg_0 : arg_1 ) -> typing . Counter [ str ] : arg_2 = group_as_dict ( _iter_author_publiations ( arg_0 ) ) return Counter ( count_dict_values ( count_defaultdict ( arg_2 ) ) )

def Func(arg_0: arg_1) -> typing.Counter[str]:
    """Count the number of publications of each author to the given graph."""
    arg_2 = group_as_dict(_iter_author_publiations(arg_0))
    return Counter(count_dict_values(count_defaultdict(arg_2)))

Count the number of publications of each author to the given graph .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = [ ] , [ ] arg_4 = set ( ) for arg_5 in arg_1 : if arg_5 not in arg_4 : arg_4 . add ( arg_5 ) if arg_5 . egg_fragment : arg_2 . append ( arg_5 ) else : arg_3 . append ( arg_5 ) return arg_3 + arg_2

def Func(arg_0, arg_1):
        """
        Returns elements of links in order, non-egg links first, egg links
        second, while eliminating duplicates
        """
        arg_2, arg_3 = [], []
        arg_4 = set()
        for arg_5 in arg_1:
            if arg_5 not in arg_4:
                arg_4.add(arg_5)
                if arg_5.egg_fragment:
                    arg_2.append(arg_5)
                else:
                    arg_3.append(arg_5)
        return arg_3 + arg_2

Returns elements of links in order non - egg links first egg links second while eliminating duplicates


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
os
.
path
.
join
(
arg_0
.
fdir
,
arg_1
)
if
os
.
path
.
isfile
(
arg_2
)
:
arg_3
=
arg_0
.
get_mtime
(
arg_2
)
try
:
arg_4
=
arg_0
.
fmtime
[
arg_1
]
except
KeyError
:
arg_0
.
fmtime
[
arg_1
]
=
arg_3
return
True
if
arg_3
>
arg_4
:
arg_0
.
fmtime
[
arg_1
]
=
arg_3
return
True
else
:
return
False
else
:
logger
.
error
(
'Could not access {}'
.
format
(
arg_2
)
)
raise
KeyError
(
arg_1
)

def Func(arg_0, arg_1):
        """
        Find out if this item has been modified since last

        :param item: A key
        :return: True/False
        """
        arg_2 = os.path.join(arg_0.fdir, arg_1)
        if os.path.isfile(arg_2):
            arg_3 = arg_0.get_mtime(arg_2)

            try:
                arg_4 = arg_0.fmtime[arg_1]
            except KeyError:  # Never been seen before
                arg_0.fmtime[arg_1] = arg_3
                return True

            if arg_3 > arg_4:  # has changed
                arg_0.fmtime[arg_1] = arg_3
                return True
            else:
                return False
        else:
            logger.error('Could not access {}'.format(arg_2))
            raise KeyError(arg_1)


(self, fullname, store_dict, hdf5_group, store_flags, kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """Stores a `store_dict`"""
        for arg_6, arg_7 in arg_2.items():
            # self._logger.log(1, 'SUB-Storing %s [%s]', key, str(store_dict[key]))
            arg_8 = None

            arg_9 = arg_4[arg_6]

            if '.' in arg_6:
                arg_8 = arg_3
                arg_10 = arg_6.split('.')
                arg_6 = arg_10.pop()
                for arg_11 in arg_10:
                    arg_3, arg_12 =  arg_0._all_create_or_get_group(arg_11,
                                                                                arg_3)
                    if arg_12:
                        setattr(arg_3._v_attrs, HDF5StorageService.STORAGE_TYPE,
                                HDF5StorageService.NESTED_GROUP)
                    else:
                        arg_13 = arg_0._all_get_from_attrs(arg_3, HDF5StorageService.STORAGE_TYPE)
                        if arg_13 != HDF5StorageService.NESTED_GROUP:
                            raise ValueError('You want to nested results but `%s` is already '
                                             'of type `%s`!' % (arg_3._v_name, arg_13))

            # Iterate through the data and store according to the storage flags
            if arg_6 in arg_3:
                # We won't change any data that is found on disk
                arg_0._logger.debug(
                    'Found %s already in hdf5 node of %s, so I will ignore it.' %
                    (arg_6, arg_1))
                continue

            if arg_9 == HDF5StorageService.TABLE:
                # self._logger.log(1, 'SUB-Storing %s TABLE', key)
                arg_0._prm_write_into_pytable(arg_6, arg_7, arg_3, arg_1,
                                             **arg_5)
            elif arg_9 == HDF5StorageService.DICT:
                # self._logger.log(1, 'SUB-Storing %s DICT', key)
                arg_0._prm_write_dict_as_table(arg_6, arg_7, arg_3, arg_1,
                                              **arg_5)
            elif arg_9 == HDF5StorageService.ARRAY:
                # self._logger.log(1, 'SUB-Storing %s ARRAY', key)
                arg_0._prm_write_into_array(arg_6, arg_7, arg_3, arg_1,
                                           **arg_5)
            elif arg_9 in (HDF5StorageService.CARRAY,
                          HDF5StorageService.EARRAY,
                          HDF5StorageService.VLARRAY):
                arg_0._prm_write_into_other_array(arg_6, arg_7,
                                                 arg_3, arg_1,
                                                 arg_9=arg_9, **arg_5)
            elif arg_9 in (HDF5StorageService.SERIES,
                          HDF5StorageService.FRAME,
                          #  HDF5StorageService.PANEL
                          ):
                # self._logger.log(1, 'SUB-Storing %s PANDAS', key)
                arg_0._prm_write_pandas_data(arg_6, arg_7, arg_3, arg_1,
                                            arg_9, **arg_5)
            elif arg_9 == HDF5StorageService.SHARED_DATA:
                pass  # Shared data needs to be explicitly created and is not stored on
                # the fly
            else:
                raise RuntimeError('You shall not pass!')

            if arg_8 is not None:
                arg_3 = arg_8


return self._subx(repl, string, count, False)

def Func(arg_0, arg_1, arg_2, arg_3=0):
        """Return the string obtained by replacing the leftmost non-overlapping
        occurrences of pattern in string by the replacement repl."""
        return arg_0._Funcx(arg_1, arg_2, arg_3, False)

Return the string obtained by replacing the leftmost non - overlapping occurrences of pattern in string by the replacement repl .


(cls, datetimes, number, now=None, **options)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
**
arg_4
)
:
if
not
isinstance
(
arg_2
,
int
)
or
arg_2
<
0
:
raise
ValueError
(
'Invalid number: %s'
%
arg_2
)
arg_1
=
tuple
(
arg_1
)
arg_5
=
if
arg_1
and
arg_1
[
0
]
.
tzinfo
is
not
:
arg_5
=
UTC
(
)
if
arg_3
is
:
arg_3
=
datetime
.
now
(
arg_5
)
if
not
hasattr
(
arg_3
,
'second'
)
:
arg_3
=
datetime
.
combine
(
arg_3
,
time
(
23
,
59
,
59
,
999999
,
arg_5
=
arg_5
)
)
arg_6
=
set
(
arg_10
for
arg_10
in
arg_1
if
arg_10
>
arg_3
)
if
arg_2
==
0
:
return
arg_6
arg_7
=
arg_0
.
start
(
arg_3
,
arg_2
,
**
arg_4
)
arg_8
=
(
arg_10
for
arg_10
in
arg_1
if
arg_7
<=
arg_10
<=
arg_3
)
arg_9
=
{
}
for
arg_10
in
sorted
(
arg_8
)
:
arg_9
.
setdefault
(
arg_0
.
mask
(
arg_10
,
**
arg_4
)
,
arg_10
)
return
set
(
arg_9
.
values
(
)
)
|
arg_6

def Func(arg_0, arg_1, arg_2, arg_3=None, **arg_4):
        """Return a set of datetimes, after Funcing ``datetimes``.

        The result will be the ``datetimes`` which are ``number`` of
        units before ``now``, until ``now``, with approximately one
        unit between each of them.  The first datetime for any unit is
        kept, later duplicates are removed.

        If there are ``datetimes`` after ``now``, they will be
        returned unFunced.
        """
        if not isinstance(arg_2, int) or arg_2 < 0:
            raise ValueError('Invalid number: %s' % arg_2)

        arg_1 = tuple(arg_1)

        # Sample the first datetime to see if it is timezone-aware
        arg_5 = None
        if arg_1 and arg_1[0].tzinfo is not None:
            arg_5 = UTC()

        if arg_3 is None:
            arg_3 = datetime.now(arg_5)

        if not hasattr(arg_3, 'second'):
            # now looks like a date, so convert it into a datetime
            arg_3 = datetime.combine(arg_3, time(23, 59, 59, 999999, arg_5=arg_5))

        # Always keep datetimes from the future
        arg_6 = set(arg_10 for arg_10 in arg_1 if arg_10 > arg_3)

        if arg_2 == 0:
            return arg_6

        # Don't consider datetimes from before the start
        arg_7 = arg_0.start(arg_3, arg_2, **arg_4)
        arg_8 = (arg_10 for arg_10 in arg_1 if arg_7 <= arg_10 <= arg_3)

        # Deduplicate datetimes with the same mask() value by keeping
        # the oldest.
        arg_9 = {}
        for arg_10 in sorted(arg_8):
            arg_9.setdefault(arg_0.mask(arg_10, **arg_4), arg_10)

        return set(arg_9.values()) | arg_6

Return a set of datetimes, after filtering ``datetimes``.

        The result will be the ``datetimes`` which are ``number`` of
        units before ``now``, until ``now``, with approximately one
        unit between each of them.  The first datetime for any unit is
        kept, later duplicates are removed.

        If there are ``datetimes`` after ``now``, they will be
        returned unfiltered.

Return a set of datetimes after filtering datetimes .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        List items from query
        """
        assert isinstance(arg_1, dict), "expected filters type 'dict'"
        assert isinstance(arg_2, dict), "expected cursor type 'dict'"

        # start with our base query
        arg_4 = arg_0.get_query()
        assert isinstance(arg_4, peewee.Query)

        # XXX: convert and apply user specified filters
        #filters = {field.name: cursor[field.name] for field in fields}
        #query.where(

        arg_5 = arg_0.get_paginator()
        assert isinstance(arg_5, Pagination)

        # always include an extra row for next cursor position
        arg_3 += 1

        # apply pagination to query
        arg_6 = arg_5.filter_query(arg_4, arg_2, arg_3)
        arg_7 = [ item for item in arg_6 ]

        # determine next cursor position
        arg_8 = arg_7.pop(1)
        arg_9 = arg_8.to_cursor_ref()

        '''
        # is this field allowed for sort?
        if field not in self.sort_fields:
            raise ValueError("Cannot sort on field '{}'".format(field))
        '''

        return arg_7, arg_9


def Func(arg_0, arg_1):
    '''
    Create pyxtuml associations from a linked association in BridgePoint.
    '''
    arg_2 = one(arg_1).R_REL[206]()
    arg_3 = one(arg_1).R_ASSR[211].R_RGO[205]()
    arg_4 = one(arg_3).R_OIR[203].O_OBJ[201]()

    def _mk_assoc(arg_5, arg_6):
        arg_7 = one(arg_5).R_RTO[204]()

        arg_8 = one(arg_7).R_OIR[203].O_OBJ[201]()
        arg_9, arg_10 = _get_related_attributes(arg_3, arg_7)
        if arg_5.Obj_ID != arg_6.Obj_ID:
            arg_11 = arg_12 = ''
        else:
            arg_11 = arg_5.Txt_Phrs
            arg_12 = arg_6.Txt_Phrs

        arg_0.define_association(rel_id=arg_2.Numb,
                             source_kind=arg_4.Key_Lett,
                             target_kind=arg_8.Key_Lett,
                             source_keys=arg_9,
                             target_keys=arg_10,
                             source_conditional=arg_6.Cond,
                             target_conditional=False,
                             arg_11=arg_11,
                             arg_12=arg_12,
                             source_many=arg_6.Mult,
                             target_many=False)

    arg_13 = one(arg_1).R_AONE[209]()
    arg_14 = one(arg_1).R_AOTH[210]()

    _mk_assoc(arg_13, arg_14)
    _mk_assoc(arg_14, arg_13)

Create pyxtuml associations from a linked association in BridgePoint .


(self, particleId, particleState, newBest)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_3 : ( arg_4 , arg_5 ) = arg_0 . _resultsDB . getParticleBest ( arg_1 ) else : arg_4 = arg_5 = None arg_6 = arg_2 [ 'varStates' ] for arg_7 in arg_6 . keys ( ) : arg_8 = copy . deepcopy ( arg_6 [ arg_7 ] ) if arg_3 : arg_8 [ 'bestResult' ] = arg_4 if arg_5 is not None : arg_8 [ 'bestPosition' ] = arg_5 [ arg_7 ] arg_0 . permuteVars [ arg_7 ] . setState ( arg_8 )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Init all of our variable positions, velocities, and optionally the best
    result and best position from the given particle.

    If newBest is true, we get the best result and position for this new
    generation from the resultsDB, This is used when evoloving a particle
    because the bestResult and position as stored in was the best AT THE TIME
    THAT PARTICLE STARTED TO RUN and does not include the best since that
    particle completed.
    """
    # Get the update best position and result?
    if arg_3:
      (arg_4, arg_5) = arg_0._resultsDB.getParticleBest(arg_1)
    else:
      arg_4 = arg_5 = None

    # Replace with the position and velocity of each variable from
    #  saved state
    arg_6 = arg_2['varStates']
    for arg_7 in arg_6.keys():
      arg_8 = copy.deepcopy(arg_6[arg_7])
      if arg_3:
        arg_8['bestResult'] = arg_4
      if arg_5 is not None:
        arg_8['bestPosition'] = arg_5[arg_7]
      arg_0.permuteVars[arg_7].setState(arg_8)

Init all of our variable positions velocities and optionally the best result and best position from the given particle .


def Func(arg_0, arg_1):
    """Slice a list into several sub lists by a list of given length.

    Args:
        in_list (list): The list to be sliced.
        lens(int or list): The expected length of each out list.

    Returns:
        list: A list of sliced list.
    """
    if not isinstance(arg_1, list):
        raise TypeError('"indices" must be a list of integers')
    elif sum(arg_1) != len(arg_0):
        raise ValueError(
            'sum of lens and list length does not match: {} != {}'.format(
                sum(arg_1), len(arg_0)))
    arg_2 = []
    arg_3 = 0
    for arg_4 in range(len(arg_1)):
        arg_2.append(arg_0[arg_3:arg_3 + arg_1[arg_4]])
        arg_3 += arg_1[arg_4]
    return arg_2

Slice a list into several sub lists by a list of given length .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
copy
(
)
arg_1
.
shape
=
(
10
,
10
)
arg_3
=
plt
.
matshow
(
arg_1
)
plt
.
colorbar
(
)
for
arg_4
in
range
(
10
)
:
for
arg_5
in
range
(
10
)
:
plt
.
text
(
arg_4
0.2
,
arg_5
+
0.2
,
str
(
arg_5
)
+
str
(
arg_4
)
)
plt
.
ylabel
(
'First digit'
)
plt
.
xlabel
(
'Second digit'
)
return
arg_3

def Func(arg_0):
    """
    Plot two digits frequency counts using matplotlib.
    """
    arg_1 = arg_0.copy()
    arg_1.shape = (10,10)
    arg_3 = plt.matshow(arg_1)
    plt.colorbar()
    for arg_4 in range(10):
        for arg_5 in range(10):
            plt.text(arg_4-0.2, arg_5+0.2, str(arg_5)+str(arg_4))
    plt.ylabel('First digit')
    plt.xlabel('Second digit')
    return arg_3

Plot two digits frequency counts using matplotlib .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Given the form_key will evaluate the document and set values correctly for
        the document given.
        """
        if arg_3 is not None:
            arg_4, arg_5 = trim_field_key(arg_1, arg_3)
        else:
            arg_4, arg_5 = trim_field_key(arg_1, arg_2)

        arg_6 = arg_5[-1] if arg_5 and has_digit(arg_5) else None
        arg_7 = make_key(arg_5)

        if arg_4.lower() == 'id':
            raise KeyError(u"Mongonaut does not work with models which have fields beginning with id_")

        # Create boolean checks to make processing document easier
        arg_8 = (isinstance(arg_1._fields.get(arg_4, None), EmbeddedDocumentField)
                          if hasattr(arg_1, '_fields') else False)
        arg_9 = not arg_6 is None
        arg_10 = arg_4 in arg_1._fields.keys() if hasattr(arg_1, '_fields') else False

        # This ensures you only go through each documents keys once, and do not duplicate data
        if arg_10:
            if arg_8:
                arg_0.set_embedded_doc(arg_1, arg_2, arg_4, arg_7)
            elif arg_9:
                arg_0.set_list_field(arg_1, arg_2, arg_4, arg_7, arg_6)
            else:
                arg_11 = translate_value(arg_1._fields[arg_4],
                                        arg_0.form.cleaned_data[arg_2])
                setattr(arg_1, arg_4, arg_11)

Given the form_key will evaluate the document and set values correctly for the document given .


def Func ( arg_0 , Func ) : arg_0 . _request . body = Func arg_0 . add_matcher ( matcher ( 'BodyMatcher' , Func ) )

def Func(arg_0, Func):
        """
        Defines the body data to match.

        ``body`` argument can be a ``str``, ``binary`` or a regular expression.

        Arguments:
            body (str|binary|regex): body data to match.

        Returns:
            self: current Mock instance.
        """
        arg_0._request.body = Func
        arg_0.add_matcher(matcher('BodyMatcher', Func))


def Func(arg_0, arg_1):
        """Translates integer indices into the appropriate names"""
        if isinstance(arg_1, int):
            if arg_1 == 0:
                arg_1 = arg_0.v_name
            else:
                arg_1 = arg_0.v_name + '_%d' % arg_1
        return arg_1


def Func(arg_0, arg_1, arg_2, arg_3=1):
        # type: (str, float, float) -> None
        """Send a Timer metric with the specified duration in milliseconds"""

        if arg_0._should_send_metric(arg_1, arg_3):
            arg_2 = int(arg_2)
            arg_0._request(
                Timer(
                    arg_0._create_metric_name_for_request(arg_1),
                    arg_2,
                    arg_3
                ).to_request()
            )


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . pop ( "email" ) arg_3 = arg_1 . pop ( "password" ) arg_4 = get_user_model ( ) ( ** arg_1 ) arg_4 . set_password ( arg_3 ) arg_4 . email = arg_2 arg_5 = models . EmailAddress . objects . filter ( arg_2 = arg_2 ) if arg_5 . exists ( ) : arg_6 = arg_5 . get ( ) arg_6 . send_duplicate_notification ( ) else : arg_4 . save ( ) arg_7 = models . EmailAddress . objects . Func ( arg_2 = arg_2 , arg_4 = arg_4 ) arg_7 . send_confirmation ( ) signals . user_registered . send ( sender = arg_0 . __class__ , arg_4 = arg_4 ) return arg_4

def Func(arg_0, arg_1):
        """
        Create a new user from the data passed to the serializer.

        If the provided email has not been verified yet, the user is
        Funcd and a verification email is sent to the address.
        Otherwise we send a notification to the email address that
        someone attempted to register with an email that's already been
        verified.

        Args:
            validated_data (dict):
                The data passed to the serializer after it has been
                validated.

        Returns:
            A new user Funcd from the provided data.
        """
        arg_2 = arg_1.pop("email")
        arg_3 = arg_1.pop("password")

        # We don't save the user instance yet in case the provided email
        # address already exists.
        arg_4 = get_user_model()(**arg_1)
        arg_4.set_password(arg_3)

        # We set an ephemeral email property so that it is included in
        # the data returned by the serializer.
        arg_4.email = arg_2

        arg_5 = models.EmailAddress.objects.filter(arg_2=arg_2)

        if arg_5.exists():
            arg_6 = arg_5.get()
            arg_6.send_duplicate_notification()
        else:
            arg_4.save()

            arg_7 = models.EmailAddress.objects.Func(
                arg_2=arg_2, arg_4=arg_4
            )
            arg_7.send_confirmation()

            signals.user_registered.send(sender=arg_0.__class__, arg_4=arg_4)

        return arg_4

Create a new user from the data passed to the serializer.

        If the provided email has not been verified yet, the user is
        created and a verification email is sent to the address.
        Otherwise we send a notification to the email address that
        someone attempted to register with an email that's already been
        verified.

        Args:
            validated_data (dict):
                The data passed to the serializer after it has been
                validated.

        Returns:
            A new user created from the provided data.

Create a new user from the data passed to the serializer .


def Func(arg_0, arg_1, arg_2, arg_3):
        r'''Method to calculate the integral of a property with respect to
        temperature, using a specified method.  Implements the
        analytical integrals of all available methods except for tabular data,
        the case of multiple coefficient sets needed to encompass the temperature
        range of any of the ZABRANSKY methods, and the CSP methods using the
        vapor phase properties.

        Parameters
        ----------
        T1 : float
            Lower limit of integration, [K]
        T2 : float
            Upper limit of integration, [K]
        method : str
            Method for which to find the integral

        Returns
        -------
        integral : float
            Calculated integral of the property over the given range,
            [`units*K`]
        '''
        if arg_3 == ZABRANSKY_SPLINE:
            return arg_0.Zabransky_spline.Func(arg_1, arg_2)
        elif arg_3 == ZABRANSKY_SPLINE_C:
            return arg_0.Zabransky_spline_iso.Func(arg_1, arg_2)
        elif arg_3 == ZABRANSKY_SPLINE_SAT:
            return arg_0.Zabransky_spline_sat.Func(arg_1, arg_2)
        elif arg_3 == ZABRANSKY_QUASIPOLYNOMIAL:
            return arg_0.Zabransky_quasipolynomial.Func(arg_1, arg_2)
        elif arg_3 == ZABRANSKY_QUASIPOLYNOMIAL_C:
            return arg_0.Zabransky_quasipolynomial_iso.Func(arg_1, arg_2)
        elif arg_3 == ZABRANSKY_QUASIPOLYNOMIAL_SAT:
            return arg_0.Zabransky_quasipolynomial_sat.Func(arg_1, arg_2)
        elif arg_3 == POLING_CONST:
            return (arg_2 - arg_1)*arg_0.POLING_constant
        elif arg_3 == CRCSTD:
            return (arg_2 - arg_1)*arg_0.CRCSTD_constant
        elif arg_3 == DADGOSTAR_SHAW:
            arg_4 = (Dadgostar_Shaw_integral(arg_2, arg_0.similarity_variable)
                    - Dadgostar_Shaw_integral(arg_1, arg_0.similarity_variable))
            return property_mass_to_molar(arg_4, arg_0.MW)
        elif arg_3 in arg_0.tabular_data or arg_3 == COOLPROP or arg_3 in [ROWLINSON_POLING, ROWLINSON_BONDI]:
            return float(quad(arg_0.calculate, arg_1, arg_2, args=(arg_3))[0])
        else:
            raise Exception('Method not valid')

r Method to calculate the integral of a property with respect to temperature using a specified method . Implements the analytical integrals of all available methods except for tabular data the case of multiple coefficient sets needed to encompass the temperature range of any of the ZABRANSKY methods and the CSP methods using the vapor phase properties .


def Func(arg_0=None, arg_1=None, arg_2=arg_2):
    """Measures mesh topology

    Args:
        fbasename (str): input filename.
        log (str): filename to log output

    Returns:
        dict: dictionary with the following keys:
            vert_num (int): number of vertices
            edge_num (int): number of edges
            face_num (int): number of faces
            unref_vert_num (int): number or unreferenced vertices
            boundry_edge_num (int): number of boundary edges
            part_num (int): number of parts (components) in the mesh.
            manifold (bool): True if mesh is two-manifold, otherwise false.
            non_manifold_edge (int): number of non_manifold edges.
            non_manifold_vert (int): number of non-manifold verices
            genus (int or str): genus of the mesh, either a number or
                'undefined' if the mesh is non-manifold.
            holes (int or str): number of holes in the mesh, either a number
                or 'undefined' if the mesh is non-manifold.

    """
    arg_3 = 'TEMP3D_Func.mlx'
    arg_4 = mlx.FilterScript(file_in=arg_0, arg_2=arg_2)
    compute.Func(arg_4)
    arg_4.save_to_file(arg_3)
    arg_4.run_script(arg_1=arg_1, script_file=arg_3)
    arg_5 = arg_4.topology
    return arg_5


async def Func ( arg_0 ) : arg_1 = arg_0 . _get_Func_tasks ( ) if arg_1 : await asyncio . wait ( arg_1 ) arg_0 . _session = None

async def Func(arg_0):
        """ properly Func the client """
        arg_1 = arg_0._get_Func_tasks()

        if arg_1:
            await asyncio.wait(arg_1)

        arg_0._session = None


def Func ( arg_0 , arg_1 ) : if not hasattr ( arg_0 , "actions" ) : return for arg_2 , arg_3 , arg_4 in arg_0 . actions . get ( arg_1 , [ ] ) : arg_2 ( * arg_3 , ** arg_4 )

def Func(arg_0,arg_1):
        """
        Helper method that calls all callbacks registered for the given action.
        """
        if not hasattr(arg_0,"actions"):
            return
        for arg_2,arg_3,arg_4 in arg_0.actions.get(arg_1,[]):
            arg_2(*arg_3,**arg_4)

Helper method that calls all callbacks registered for the given action .


(pbc, relL, relU, absL, absU,
                          uparea, area, hole, proteins)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                          arg_5, arg_6, arg_7, arg_8):
    """
    Adapt the size of the box to accomodate the lipids.

    The PBC is changed **in place**.
    """
    if any(arg_1) and any(arg_2):
        # Determine box from size
        # If one leaflet is defined with an absolute number of lipids
        # then the other leaflet (with relative numbers) will follow
        # from that.
        # box/d/x/y/z needed to define unit cell

        # box is set up already...
        # yet it may be set to 0, then there is nothing we can do.
        if 0 in (arg_0.x, arg_0.y, arg_0.z):
            raise PBCException('Not enough information to set the box size.')
    elif any(arg_3) or any(arg_4):
        # All numbers are absolute.. determine size from number of lipids
        # Box x/y will be set, d/dz/z is needed to set third box vector.
        # The area is needed to determine the size of the x/y plane OR
        # the area will be SET if a box is given.

        if arg_0.z == 0:
            raise PBCException('Not enough information to set the box size.')

        if 0 in (arg_0.x, arg_0.y):
            # We do not know what size the box should be.
            # Let X and Y be the same.
            #T This does not agree with the default pbc being hexagonal...
            arg_0.x = arg_0.y = 1
        # A scaling factor is needed for the box
        # This is the area for the given number of lipids
        arg_10 = sum(arg_4) * arg_5
        arg_11 = sum(arg_3) * arg_6
        # This is the size of the hole, going through both leaflets
        arg_12 = np.pi * arg_7 ** 2
        # This is the area of the PBC xy plane
        arg_13 = arg_0.x * arg_0.y
        # This is the total area of the proteins per leaflet (IMPLEMENT!)
        arg_14 = sum([p.areaxy(0, 2.4) for p in arg_8])
        arg_15 = sum([p.areaxy(-2.4, 0) for p in arg_8])
        # So this is unavailable:
        arg_16 = arg_12 + arg_14
        arg_17 = arg_12 + arg_15
        # This is the current area marked for lipids
        # xysize_up = xysize - unavail_up
        # xysize_lo = xysize - unavail_lo
        # This is how much the unit cell xy needs to be scaled
        # to accomodate the fixed amount of lipids with given area.
        arg_18 = (arg_10 + arg_16)/arg_13
        arg_19 = (arg_11 + arg_17)/arg_13
        arg_20 = max(arg_18, arg_19)
        arg_21 = arg_0.x / arg_0.y
        arg_22 = np.sqrt(arg_20 / arg_21)
        arg_23 = np.sqrt(arg_20 / arg_21)
        arg_0.box[:2,:] *= math.sqrt(arg_20)

Adapt the size of the box to accomodate the lipids .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_2 = TEMPLATE_PATTERNS arg_1 = arg_1 if isinstance ( arg_1 , dict ) else _mutagen_fields_to_single_value ( arg_1 ) assert isinstance ( arg_1 , dict ) arg_3 = get_suggested_filename ( arg_1 ) . replace ( '.mp3' , '' ) if arg_0 == os . getcwd ( ) or arg_0 == '%suggested%' : arg_4 = arg_3 else : arg_5 = arg_0 . replace ( '%suggested%' , arg_3 ) arg_4 = _replace_template_patterns ( arg_5 , arg_1 , arg_2 ) return arg_4

def Func(arg_0, arg_1, arg_2=None):
	"""Create directory structure and file name based on metadata template.

	Parameters:
		template (str): A filepath which can include template patterns as defined by :param template_patterns:.

		metadata (dict): A metadata dict.

		template_patterns (dict): A dict of ``pattern: field`` pairs used to replace patterns with metadata field values.
			Default: :const TEMPLATE_PATTERNS:

	Returns:
		A filepath.
	"""

	if arg_2 is None:
		arg_2 = TEMPLATE_PATTERNS

	arg_1 = arg_1 if isinstance(arg_1, dict) else _mutagen_fields_to_single_value(arg_1)
	assert isinstance(arg_1, dict)

	arg_3 = get_suggested_filename(arg_1).replace('.mp3', '')

	if arg_0 == os.getcwd() or arg_0 == '%suggested%':
		arg_4 = arg_3
	else:
		arg_5 = arg_0.replace('%suggested%', arg_3)
		arg_4 = _replace_template_patterns(arg_5, arg_1, arg_2)

	return arg_4

Create directory structure and file name based on metadata template .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _create_prefix ( arg_1 ) arg_3 = [ ] for arg_4 in arg_0 . _bucket . objects . filter ( Prefix = arg_2 ) : arg_1 = os . path . dirname ( arg_4 . key ) if arg_1 == '' : arg_1 = arg_4 . key + '/' arg_5 = os . path . relpath ( arg_1 , start = arg_2 ) arg_6 = arg_5 . split ( '/' ) if len ( arg_6 ) == 1 : arg_3 . append ( arg_6 [ 0 ] ) arg_3 = list ( set ( arg_3 ) ) for arg_7 in ( '.' , '..' ) : if arg_7 in arg_3 : arg_3 . remove ( arg_7 ) return arg_3

def Func(arg_0, arg_1):
        """List all names of directories that exist at the root of this
        bucket directory.

        Note that *directories* don't exist in S3; rather directories are
        inferred from path names.

        Parameters
        ----------
        dirname : `str`
            Directory name in the bucket relative to ``bucket_root``.

        Returns
        -------
        dirnames : `list`
            List of directory names (`str`), relative to ``bucket_root/``,
            that exist at the root of ``dirname``.
        """
        arg_2 = arg_0._create_prefix(arg_1)
        arg_3 = []
        for arg_4 in arg_0._bucket.objects.filter(Prefix=arg_2):
            # get directory name of every object under this path prefix
            arg_1 = os.path.dirname(arg_4.key)

            # dirname is empty if the object happens to be the directory
            # redirect object object for the prefix directory (directory
            # redirect objects are named after directories and have metadata
            # that tells Fastly to redirect the browser to the index.html
            # contained in the directory).
            if arg_1 == '':
                arg_1 = arg_4.key + '/'

            # Strip out the path prefix from the directory name
            arg_5 = os.path.relpath(arg_1, start=arg_2)

            # If there's only one part then this directory is at the root
            # relative to the prefix. We want this.
            arg_6 = arg_5.split('/')
            if len(arg_6) == 1:
                arg_3.append(arg_6[0])

        # Above algorithm finds root directories for all *files* in sub
        # subdirectories; trim down to the unique set.
        arg_3 = list(set(arg_3))

        # Remove posix-like relative directory names that can appear
        # in the bucket listing.
        for arg_7 in ('.', '..'):
            if arg_7 in arg_3:
                arg_3.remove(arg_7)

        return arg_3

List all names of directories that exist at the root of this bucket directory .


def Func(arg_0, arg_1):
    """
    Renders a Page object as a Twitter Bootstrap styled pagination bar.
    Compatible with Bootstrap 3.x and 4.x only.

    Example::

        {% Func page_obj range=10 %}

    Named Parameters::

        range - The size of the pagination bar (ie, if set to 10 then, at most,
                10 page numbers will display at any given time) Defaults to
                None, which shows all pages.

        size - Accepts "small", and "large". Defaults to
                    None which is the standard size.

        show_prev_next - Accepts "true" or "false". Determines whether or not
                        to show the previous and next page links. Defaults to
                        "true"

        show_first_last - Accepts "true" or "false". Determines whether or not
                          to show the first and last page links. Defaults to
                          "false"

        previous_label - The text to display for the previous page link.
                         Defaults to "←"

        next_label - The text to display for the next page link. Defaults to
                     "→"

        first_label - The text to display for the first page link. Defaults to
                      "«"

        last_label - The text to display for the last page link. Defaults to
                     "»"

        url_view_name - The named URL to use. Defaults to None. If None, then the
                        default template simply appends the url parameter as a
                        relative URL link, eg: 1

        url_param_name - The name of the parameter to use in the URL. If
                         url_view_name is set to None, this string is used as the
                         parameter name in the relative URL path. If a URL
                         name is specified, this string is used as the
                         parameter name passed into the reverse() method for
                         the URL.

        url_extra_args - This is used only in conjunction with url_view_name.
                         When referencing a URL, additional arguments may be
                         passed in as a list.

        url_extra_kwargs - This is used only in conjunction with url_view_name.
                           When referencing a URL, additional named arguments
                           may be passed in as a dictionary.

        url_get_params - The other get parameters to pass, only the page
                         number will be overwritten. Use this to preserve
                         filters.

        url_anchor - The anchor to use in URLs. Defaults to None.

        extra_pagination_classes - A space separated list of CSS class names
                                   that will be added to the top level

                                   HTML element. In particular, this can be
                                   utilized in Bootstrap 4 installatinos  to
                                   add the appropriate alignment classes from
                                   Flexbox utilites, eg:  justify-content-center
    """
    arg_2 = arg_1.split_contents()
    if len(arg_2) < 2:
        raise TemplateSyntaxError("'%s' takes at least one argument"
                                  " (Page object reference)" % arg_2[0])
    arg_3 = arg_0.compile_filter(arg_2[1])
    arg_4 = {}
    arg_2 = arg_2[2:]

    arg_5 = re.compile(r'(\w+)=(.+)')

    if len(arg_2):
        for arg_6 in arg_2:
            arg_7 = arg_5.match(arg_6)
            if not arg_7:
                raise TemplateSyntaxError("Malformed arguments to bootstrap_pagination paginate tag")
            arg_8, arg_9 = arg_7.groups()
            arg_4[arg_8] = arg_0.compile_filter(arg_9)

    return BootstrapPaginationNode(arg_3, arg_4)

Renders a Page object as a Twitter Bootstrap styled pagination bar.
    Compatible with Bootstrap 3.x and 4.x only.

    Example::

        {% bootstrap_paginate page_obj range=10 %}

    Named Parameters::

        range - The size of the pagination bar (ie, if set to 10 then, at most,
                10 page numbers will display at any given time) Defaults to
                None, which shows all pages.

        size - Accepts "small", and "large". Defaults to
                    None which is the standard size.

        show_prev_next - Accepts "true" or "false". Determines whether or not
                        to show the previous and next page links. Defaults to
                        "true"

        show_first_last - Accepts "true" or "false". Determines whether or not
                          to show the first and last page links. Defaults to
                          "false"

        previous_label - The text to display for the previous page link.
                         Defaults to "←"

        next_label - The text to display for the next page link. Defaults to
                     "→"

        first_label - The text to display for the first page link. Defaults to
                      "«"

        last_label - The text to display for the last page link. Defaults to
                     "»"

        url_view_name - The named URL to use. Defaults to None. If None, then the
                        default template simply appends the url parameter as a
                        relative URL link, eg: 1

        url_param_name - The name of the parameter to use in the URL. If
                         url_view_name is set to None, this string is used as the
                         parameter name in the relative URL path. If a URL
                         name is specified, this string is used as the
                         parameter name passed into the reverse() method for
                         the URL.

        url_extra_args - This is used only in conjunction with url_view_name.
                         When referencing a URL, additional arguments may be
                         passed in as a list.

        url_extra_kwargs - This is used only in conjunction with url_view_name.
                           When referencing a URL, additional named arguments
                           may be passed in as a dictionary.

        url_get_params - The other get parameters to pass, only the page
                         number will be overwritten. Use this to preserve
                         filters.

        url_anchor - The anchor to use in URLs. Defaults to None.

        extra_pagination_classes - A space separated list of CSS class names
                                   that will be added to the top level

                                   HTML element. In particular, this can be
                                   utilized in Bootstrap 4 installatinos  to
                                   add the appropriate alignment classes from
                                   Flexbox utilites, eg:  justify-content-center

Renders a Page object as a Twitter Bootstrap styled pagination bar . Compatible with Bootstrap 3 . x and 4 . x only .