(self, pk, parent_pk=None, timeout=None, interval=0.5, outfile=sys.stdout, **kwargs)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=0.5, arg_5=arg_6.stdout, **arg_8):
        """
        Stream the standard output from a job, project update, or inventory udpate.

        =====API DOCS=====
        Stream the standard output from a job run to stdout.

        :param pk: Primary key of the job resource object to be Funced.
        :type pk: int
        :param parent_pk: Primary key of the unified job template resource object whose latest job run will be
                          Funced if ``pk`` is not set.
        :type parent_pk: int
        :param timeout: Number in seconds after which this method will time out.
        :type timeout: float
        :param interval: Polling interval to refresh content from Tower.
        :type interval: float
        :param outfile: Alternative file than stdout to write job stdout to.
        :type outfile: file
        :param `**kwargs`: Keyword arguments used to look up job resource object to Func if ``pk`` is
                           not provided.
        :returns: A dictionary combining the JSON output of the finished job resource object, as well as
                  two extra fields: "changed", a flag indicating if the job resource object is finished
                  as expected; "id", an integer which is the primary key of the job resource object being
                  Funced.
        :rtype: dict
        :raises tower_cli.exceptions.Timeout: When Func time reaches time out.
        :raises tower_cli.exceptions.JobFailure: When the job being Funced runs into failure.

        =====API DOCS=====
        """

        # If we do not have the unified job info, infer it from parent
        if arg_1 is None:
            arg_1 = arg_0.last_job_data(arg_2, **arg_8)['id']
        arg_9 = '%s%s/' % (arg_0.unified_job_type, arg_1)

        # Pause until job is in running state
        arg_0.wait(arg_1, exit_on=['running', 'successful'], arg_5=arg_5)

        # Loop initialization
        arg_10 = time.time()
        arg_11 = 0
        arg_12 = client.get(arg_9).json()

        click.echo('\033[0;91m------Starting Standard Out Stream------\033[0m', nl=2, file=arg_5)

        # Poll the Ansible Tower instance for status and content, and print standard out to the out file
        while not arg_12['failed'] and arg_12['status'] != 'successful':

            arg_12 = client.get(arg_9).json()

            # Put the process to sleep briefly.
            time.sleep(arg_4)

            # Make request to get standard out
            arg_13 = arg_0.lookup_stdout(arg_1, arg_11, full=False)

            # In the first moments of running the job, the standard out
            # may not be available yet
            if not arg_13.startswith("Waiting for results"):
                arg_14 = len(arg_13.splitlines())
                arg_11 += arg_14
                click.echo(arg_13, nl=0, file=arg_5)

            if arg_3 and time.time() - arg_10 > arg_3:
                raise exc.Timeout('Monitoring aborted due to timeout.')

        # Special final line for closure with workflow jobs
        if arg_0.endpoint == '/workflow_jobs/':
            click.echo(arg_0.lookup_stdout(arg_1, arg_11, full=True), nl=1)

        click.echo('\033[0;91m------End of Standard Out Stream--------\033[0m', nl=2, file=arg_5)

        if arg_12['failed']:
            raise exc.JobFailure('Job failed.')

        # Return the job ID and other response data
        arg_15 = OrderedDict((('changed', True), ('id', arg_1)))
        arg_15.update(arg_12)
        # Make sure to return ID of resource and not update number relevant for project creation and update
        if arg_2:
            arg_15['id'] = arg_2
        else:
            arg_15['id'] = arg_1
        return arg_15

Stream the standard output from a job, project update, or inventory udpate.

        =====API DOCS=====
        Stream the standard output from a job run to stdout.

        :param pk: Primary key of the job resource object to be monitored.
        :type pk: int
        :param parent_pk: Primary key of the unified job template resource object whose latest job run will be
                          monitored if ``pk`` is not set.
        :type parent_pk: int
        :param timeout: Number in seconds after which this method will time out.
        :type timeout: float
        :param interval: Polling interval to refresh content from Tower.
        :type interval: float
        :param outfile: Alternative file than stdout to write job stdout to.
        :type outfile: file
        :param `**kwargs`: Keyword arguments used to look up job resource object to monitor if ``pk`` is
                           not provided.
        :returns: A dictionary combining the JSON output of the finished job resource object, as well as
                  two extra fields: "changed", a flag indicating if the job resource object is finished
                  as expected; "id", an integer which is the primary key of the job resource object being
                  monitored.
        :rtype: dict
        :raises tower_cli.exceptions.Timeout: When monitor time reaches time out.
        :raises tower_cli.exceptions.JobFailure: When the job being monitored runs into failure.

        =====API DOCS=====

Stream the standard output from a job project update or inventory udpate .


def Func ( arg_0 ) : arg_1 = np . sort ( np . concatenate ( [ arg_0 . x [ : - 1 ] + 0.1 * ii * np . diff ( arg_0 . x ) for ii in range ( 10 ) ] ) . flatten ( ) ) arg_2 = np . exp ( - ( arg_0 ( arg_1 ) - arg_0 . y . min ( ) ) ) arg_3 = np . cumsum ( 0.5 * ( arg_2 [ 1 : ] + arg_2 [ : - 1 ] ) * np . diff ( arg_1 ) ) arg_4 = min ( len ( arg_3 ) - 3 , max ( 2 , np . searchsorted ( arg_3 , arg_3 [ - 1 ] * 0.5 ) + 1 ) ) return arg_1 [ arg_4 ]

def Func(arg_0):
    """
    Find the median of the function represented as an interpolation object.
    """
    arg_1 = np.sort(np.concatenate([arg_0.x[:-1] + 0.1*ii*np.diff(arg_0.x)
                                       for ii in range(10)]).flatten())

    arg_2 = np.exp(-(arg_0(arg_1)-arg_0.y.min()))
    arg_3 = np.cumsum(0.5*(arg_2[1:]+arg_2[:-1])*np.diff(arg_1))
    arg_4 = min(len(arg_3)-3, max(2,np.searchsorted(arg_3, arg_3[-1]*0.5)+1))
    return arg_1[arg_4]

Find the median of the function represented as an interpolation object .


def Func ( arg_0 ) : arg_1 = arg_0 . exc_info ( ) if sys . platform == 'cli' : if isinstance ( arg_1 [ 0 ] , StringException ) : arg_1 = ( str ( arg_1 [ 0 ] ) , arg_1 [ 1 ] , arg_1 [ 2 ] ) return arg_1

def Func(arg_0):
        """Bottleneck to fix up IronPython string exceptions
        """
        arg_1 = arg_0.exc_info()
        if sys.platform == 'cli':
            if isinstance(arg_1[0], StringException):
                # IronPython throws these StringExceptions, but
                # traceback checks type(etype) == str. Make a real
                # string here.
                arg_1 = (str(arg_1[0]), arg_1[1], arg_1[2])

        return arg_1


def Func(arg_0, arg_1, arg_2):
        """ Add clinsig filter values to the mongo query object

            Args:
                query(dict): a dictionary of query filters specified by the users
                mongo_query(dict): the query that is going to be submitted to the database

            Returns:
                Func(dict): a dictionary with clinsig key-values

        """
        LOG.debug('clinsig is a query parameter')
        arg_3 = ['mult', 'single', 'exp', 'guideline']
        arg_4 = []
        arg_5 = []
        arg_6 = {}

        for arg_7 in arg_1['clinsig']:
            arg_4.append(int(arg_7))
            # search for human readable clinsig values in newer cases
            arg_4.append(CLINSIG_MAP[int(arg_7)])
            arg_5.append(CLINSIG_MAP[int(arg_7)])

        if arg_1.get('clinsig_confident_always_returned') == True:
            LOG.debug("add CLINSIG filter with trusted_revision_level")

            arg_6 = { "clnsig":
                        {
                            '$elemMatch': {
                                '$or' : [
                                    {
                                        '$and' : [
                                             {'value' : { '$in': arg_4 }},
                                             {'revstat': { '$in': arg_3 }}
                                        ]
                                    },
                                    {
                                        '$and': [
                                            {'value' : re.compile('|'.join(arg_5))},
                                            {'revstat' : re.compile('|'.join(arg_3))}
                                        ]
                                    }
                                ]
                            }
                         }
                    }
        else:
            LOG.debug("add CLINSIG filter for rank: %s" %
                             ', '.join(str(arg_1['clinsig'])))

            arg_6 = {
                    "clnsig":
                        {
                            '$elemMatch': {
                                '$or' : [
                                    { 'value' : { '$in': arg_4 }},
                                    { 'value' : re.compile('|'.join(arg_5)) }
                                ]
                            }
                        }
                }

        return arg_6

Add clinsig filter values to the mongo query object

            Args:
                query(dict): a dictionary of query filters specified by the users
                mongo_query(dict): the query that is going to be submitted to the database

            Returns:
                clinsig_query(dict): a dictionary with clinsig key-values


def Func(arg_0, arg_1):
    """
    Computes the intended new shape of an image-like array after resizing.

    Parameters
    ----------
    from_shape : tuple or ndarray
        Old shape of the array. Usually expected to be a tuple of form ``(H, W)`` or ``(H, W, C)`` or
        alternatively an array with two or three dimensions.

    to_shape : None or tuple of ints or tuple of floats or int or float or ndarray
        New shape of the array.

            * If None, then `from_shape` will be used as the new shape.
            * If an int ``V``, then the new shape will be ``(V, V, [C])``, where ``C`` will be added if it
              is part of `from_shape`.
            * If a float ``V``, then the new shape will be ``(H*V, W*V, [C])``, where ``H`` and ``W`` are the old
              height/width.
            * If a tuple ``(H', W', [C'])`` of ints, then ``H'`` and ``W'`` will be used as the new height
              and width.
            * If a tuple ``(H', W', [C'])`` of floats (except ``C``), then ``H'`` and ``W'`` will
              be used as the new height and width.
            * If a numpy array, then the array's shape will be used.

    Returns
    -------
    to_shape_computed : tuple of int
        New shape.

    """
    if is_np_array(arg_0):
        arg_0 = arg_0.shape
    if is_np_array(arg_1):
        arg_1 = arg_1.shape

    arg_2 = list(arg_0)

    if arg_1 is None:
        pass
    elif isinstance(arg_1, tuple):
        do_assert(len(arg_0) in [2, 3])
        do_assert(len(arg_1) in [2, 3])

        if len(arg_0) == 3 and len(arg_1) == 3:
            do_assert(arg_0[2] == arg_1[2])
        elif len(arg_1) == 3:
            arg_2.append(arg_1[2])

        do_assert(all([arg_3 is None or is_single_number(arg_3) for arg_3 in arg_1[0:2]]),
                  "Expected the first two entries in to_shape to be None or numbers, "
                  + "got types %s." % (str([type(arg_3) for arg_3 in arg_1[0:2]]),))

        for arg_4, arg_5 in enumerate(arg_0[0:2]):
            if arg_1[arg_4] is None:
                arg_2[arg_4] = arg_5
            elif is_single_integer(arg_1[arg_4]):
                arg_2[arg_4] = arg_1[arg_4]
            else:  # float
                arg_2[arg_4] = int(np.round(arg_5 * arg_1[arg_4]))
    elif is_single_integer(arg_1) or is_single_float(arg_1):
        arg_2 = Func(arg_0, (arg_1, arg_1))
    else:
        raise Exception("Expected to_shape to be None or ndarray or tuple of floats or tuple of ints or single int "
                        + "or single float, got %s." % (type(arg_1),))

    return tuple(arg_2)

Computes the intended new shape of an image - like array after resizing .


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_1
or
len
(
arg_1
)
==
0
:
return
arg_2
=
deepcopy
(
arg_1
)
for
arg_3
,
arg_4
in
arg_2
.
items
(
)
:
if
isinstance
(
arg_4
,
(
float
,
int
)
)
:
arg_4
=
str
(
arg_4
)
if
isinstance
(
arg_4
,
string_types
)
:
arg_2
[
arg_3
]
=
[
(
"is"
,
arg_4
)
]
for
arg_3
,
arg_4
in
arg_2
.
items
(
)
:
for
arg_5
,
arg_6
in
enumerate
(
arg_4
)
:
if
isinstance
(
arg_6
,
string_types
)
:
arg_4
[
arg_5
]
=
(
"is"
,
arg_6
)
arg_7
=
"meta_{}"
.
format
(
arg_0
.
getId
(
)
)
arg_0
.
setMetaId
(
arg_7
)
for
arg_8
,
arg_9
in
iteritems
(
arg_2
)
:
if
arg_8
in
[
"SBO"
,
"sbo"
]
:
if
arg_8
==
"SBO"
:
LOGGER
.
warning
(
"'SBO' provider is deprecated, "
"use 'sbo' provider instead"
)
arg_10
=
arg_9
[
0
]
[
1
]
_check
(
arg_0
.
setSBOTerm
(
arg_10
)
,
"Setting SBOTerm: {}"
.
format
(
arg_10
)
)
continue
for
arg_6
in
arg_9
:
arg_11
,
arg_12
=
arg_6
[
0
]
,
arg_6
[
1
]
arg_13
=
QUALIFIER_TYPES
.
get
(
arg_11
,
)
if
arg_13
is
:
arg_13
=
libsbml
.
BQB_IS
LOGGER
.
error
(
"Qualifier type is not supported on "
"annotation: '{}'"
.
format
(
arg_11
)
)
arg_14
=
libsbml
.
BIOLOGICAL_QUALIFIER
if
arg_11
.
startswith
(
"bqm_"
)
:
arg_14
=
libsbml
.
MODEL_QUALIFIER
arg_15
=
libsbml
.
CVTerm
(
)
arg_15
.
setQualifierType
(
arg_14
)
if
arg_14
==
libsbml
.
BIOLOGICAL_QUALIFIER
:
arg_15
.
setBiologicalQualifierType
(
arg_13
)
elif
arg_14
==
libsbml
.
MODEL_QUALIFIER
:
arg_15
.
setModelQualifierType
(
arg_13
)
else
:
raise
CobraSBMLError
(
'Unsupported qualifier: '
'%s'
%
arg_13
)
arg_16
=
"%s/%s/%s"
%
(
URL_IDENTIFIERS_PREFIX
,
arg_8
,
arg_12
)
arg_15
.
addResource
(
arg_16
)
_check
(
arg_0
.
addCVTerm
(
arg_15
)
,
"Setting cvterm: {}, resource: {}"
.
format
(
arg_15
,
arg_16
)
)

def Func(arg_0, arg_1):
    """Set SBase annotations based on cobra annotations.

    Parameters
    ----------
    sbase : libsbml.SBase
        SBML object to annotate
    annotation : cobra annotation structure
        cobra object with annotation information

    FIXME: annotation format must be updated
        (https://github.com/opencobra/cobrapy/issues/684)
    """

    if not arg_1 or len(arg_1) == 0:
        return

    # standardize annotations
    arg_2 = deepcopy(arg_1)

    for arg_3, arg_4 in arg_2.items():
        # handling of non-string annotations (e.g. integers)
        if isinstance(arg_4, (float, int)):
            arg_4 = str(arg_4)
        if isinstance(arg_4, string_types):
            arg_2[arg_3] = [("is", arg_4)]

    for arg_3, arg_4 in arg_2.items():
        for arg_5, arg_6 in enumerate(arg_4):
            if isinstance(arg_6, string_types):
                arg_4[arg_5] = ("is", arg_6)

    # set metaId
    arg_7 = "meta_{}".format(arg_0.getId())
    arg_0.setMetaId(arg_7)

    # rdf_items = []
    for arg_8, arg_9 in iteritems(arg_2):

        # set SBOTerm
        if arg_8 in ["SBO", "sbo"]:
            if arg_8 == "SBO":
                LOGGER.warning("'SBO' provider is deprecated, "
                               "use 'sbo' provider instead")
            arg_10 = arg_9[0][1]
            _check(arg_0.setSBOTerm(arg_10),
                   "Setting SBOTerm: {}".format(arg_10))

            # FIXME: sbo should also be written as CVTerm
            continue

        for arg_6 in arg_9:
            arg_11, arg_12 = arg_6[0], arg_6[1]
            arg_13 = QUALIFIER_TYPES.get(arg_11, None)
            if arg_13 is None:
                arg_13 = libsbml.BQB_IS
                LOGGER.error("Qualifier type is not supported on "
                             "annotation: '{}'".format(arg_11))

            arg_14 = libsbml.BIOLOGICAL_QUALIFIER
            if arg_11.startswith("bqm_"):
                arg_14 = libsbml.MODEL_QUALIFIER

            arg_15 = libsbml.CVTerm()  # type: libsbml.CVTerm
            arg_15.setQualifierType(arg_14)
            if arg_14 == libsbml.BIOLOGICAL_QUALIFIER:
                arg_15.setBiologicalQualifierType(arg_13)
            elif arg_14 == libsbml.MODEL_QUALIFIER:
                arg_15.setModelQualifierType(arg_13)
            else:
                raise CobraSBMLError('Unsupported qualifier: '
                                     '%s' % arg_13)
            arg_16 = "%s/%s/%s" % (URL_IDENTIFIERS_PREFIX, arg_8, arg_12)
            arg_15.addResource(arg_16)
            _check(arg_0.addCVTerm(arg_15),
                   "Setting cvterm: {}, resource: {}".format(arg_15, arg_16))

Set SBase annotations based on cobra annotations .


def Func(arg_0, arg_1):
        """Handle the parsing of command line arguments."""

        arg_2 = argparse.ArgumentParser(
            prog="python -m rflint",
            description="A style checker for robot framework plain text files.",
            formatter_class=argparse.RawDescriptionHelpFormatter,
            epilog = (
                "You can use 'all' in place of RULENAME to refer to all rules. \n"
                "\n"
                "For example: '--ignore all --warn DuplicateTestNames' will ignore all\n"
                "rules except DuplicateTestNames.\n"
                "\n"
                "FORMAT is a string that performs a substitution on the following \n"
                "patterns: {severity}, {linenumber}, {char}, {message}, and {rulename}.\n"
                "\n"
                "For example: --format 'line: {linenumber}: message: {message}'. \n"
                "\n"
                "ARGUMENTFILE is a filename with contents that match the format of \n"
                "standard robot framework argument files\n"
                "\n"
                "If you give a directory as an argument, all files in the directory\n"
                "with the suffix .txt, .robot or .tsv will be processed. With the \n"
                "--recursive option, subfolders within the directory will also be\n"
                "processed."
                )
            )
        arg_2.add_argument("--error", "-e", metavar="RULENAME", action=SetErrorAction,
                            help="Assign a severity of ERROR to the given RULENAME")
        arg_2.add_argument("--ignore", "-i", metavar="RULENAME", action=SetIgnoreAction,
                            help="Ignore the given RULENAME")
        arg_2.add_argument("--warning", "-w", metavar="RULENAME", action=SetWarningAction,
                            help="Assign a severity of WARNING for the given RULENAME")
        arg_2.add_argument("--list", "-l", action="store_true",
                            help="show a list of known rules and exit")
        arg_2.add_argument("--describe", "-d", action="store_true",
                            help="describe the given rules")
        arg_2.add_argument("--no-filenames", action="store_false", dest="print_filenames",
                            default=True,
                            help="suppress the printing of filenames")
        arg_2.add_argument("--format", "-f",
                            help="Define the output format",
                            default='{severity}: {linenumber}, {char}: {message} ({rulename})')
        arg_2.add_argument("--version", action="store_true", default=False,
                            help="Display version number and exit")
        arg_2.add_argument("--verbose", "-v", action="store_true", default=False,
                            help="Give verbose output")
        arg_2.add_argument("--configure", "-c", action=ConfigureAction,
                            help="Configure a rule")
        arg_2.add_argument("--recursive", "-r", action="store_true", default=False,
                            help="Recursively scan subfolders in a directory")
        arg_2.add_argument("--rulefile", "-R", action=RulefileAction,
                            help="import additional rules from the given RULEFILE")
        arg_2.add_argument("--argumentfile", "-A", action=ArgfileLoader,
                            help="read arguments from the given file")
        arg_2.add_argument('args', metavar="file", nargs=argparse.REMAINDER)

        # create a custom namespace, in which we can store a reference to
        # our rules. This lets the custom argument actions access the list
        # of rules
        arg_3 = argparse.Namespace()
        setattr(arg_3, "app", arg_0)
        arg_1 = arg_2.parse_args(arg_1, arg_3)

        arg_4.output_format = arg_1.format

        return arg_1

Handle the parsing of command line arguments .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . _is_string ( arg_2 ) : arg_3 = arg_0 ( token = arg_1 , slug = arg_2 ) arg_3 . load ( use_slug = True ) else : arg_3 = arg_0 ( token = arg_1 , id = arg_2 ) arg_3 . load ( ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """
            Class method that will return an Image object by ID or slug.

            This method is used to validate the type of the image. If it is a
            number, it will be considered as an Image ID, instead if it is a
            string, it will considered as slug.
        """
        if arg_0._is_string(arg_2):
            arg_3 = arg_0(token=arg_1, slug=arg_2)
            arg_3.load(use_slug=True)
        else:
            arg_3 = arg_0(token=arg_1, id=arg_2)
            arg_3.load()
        return arg_3

Class method that will return an Image object by ID or slug .


def Func(arg_0, arg_1):
        """
        This method may be overridden to implement a custom lookup mechanism when
        encountering ``\\input`` or ``\\include`` directives.

        The default implementation looks for a file of the given name relative
        to the directory set by :py:meth:`set_tex_input_directory()`.  If
        `strict_input=True` was set, we ensure strictly that the file resides in
        a subtree of the reference input directory (after canonicalizing the
        paths and resolving all symlinks).

        You may override this method to obtain the input data in however way you
        see fit.  (In that case, a call to `set_tex_input_directory()` may not
        be needed as that function simply sets properties which are used by the
        default implementation of `Func()`.)

        This function accepts the referred filename as argument (the argument to
        the ``\\input`` macro), and should return a string with the file
        contents (or generate a warning or raise an error).
        """
        arg_2 = os.path.realpath(os.path.join(arg_0.tex_input_directory, arg_1))
        if arg_0.strict_input:
            # make sure that the input file is strictly within dirfull, and didn't escape with
            # '../..' tricks or via symlinks.
            arg_3 = os.path.realpath(arg_0.tex_input_directory)
            if not arg_2.startswith(arg_3):
                logger.warning(
                    "Can't access path '%s' leading outside of mandated directory [strict input mode]",
                    arg_1
                )
                return ''

        if not os.path.exists(arg_2) and os.path.exists(arg_2 + '.tex'):
            arg_2 = arg_2 + '.tex'
        if not os.path.exists(arg_2) and os.path.exists(arg_2 + '.latex'):
            arg_2 = arg_2 + '.latex'
        if not os.path.isfile(arg_2):
            logger.warning(u"Error, file doesn't exist: '%s'", arg_1)
            return ''

        logger.debug("Reading input file %r", arg_2)

        try:
            with open(arg_2) as f:
                return f.read()
        except IOError as e:
            logger.warning(u"Error, can't access '%s': %s", arg_1, e)
            return ''

This method may be overridden to implement a custom lookup mechanism when
        encountering ``\\input`` or ``\\include`` directives.

        The default implementation looks for a file of the given name relative
        to the directory set by :py:meth:`set_tex_input_directory()`.  If
        `strict_input=True` was set, we ensure strictly that the file resides in
        a subtree of the reference input directory (after canonicalizing the
        paths and resolving all symlinks).

        You may override this method to obtain the input data in however way you
        see fit.  (In that case, a call to `set_tex_input_directory()` may not
        be needed as that function simply sets properties which are used by the
        default implementation of `read_input_file()`.)

        This function accepts the referred filename as argument (the argument to
        the ``\\input`` macro), and should return a string with the file
        contents (or generate a warning or raise an error).

This method may be overridden to implement a custom lookup mechanism when encountering \\ input or \\ include directives .


(phase, pmags, perrs, fitmags,
                  period, mintime, magseriesepoch,
                  plotfit,
                  magsarefluxes=False,
                  wrap=False,
                  model_over_lc=False)

def Func(arg_0, arg_1, arg_2, arg_3,
                  arg_4, arg_5, arg_6,
                  arg_7,
                  arg_8=False,
                  arg_9=False,
                  arg_10=False):
    '''This makes a plot of the LC model fit.

    Parameters
    ----------

    phase,pmags,perrs : np.array
        The actual mag/flux time-series.

    fitmags : np.array
        The model fit time-series.

    period : float
        The period at which the phased LC was generated.

    mintime : float
        The minimum time value.

    magseriesepoch : float
        The value of time around which the phased LC was folded.

    plotfit : str
        The name of a file to write the plot to.

    magsarefluxes : bool
        Set this to True if the values in `pmags` and `fitmags` are actually
        fluxes.

    wrap : bool
        If True, will wrap the phased LC around 0.0 to make some phased LCs
        easier to look at.

    model_over_lc : bool
        Usually, this function will plot the actual LC over the model LC. Set
        this to True to plot the model over the actual LC; this is most useful
        when you have a very dense light curve and want to be able to see how it
        follows the model.

    Returns
    -------

    Nothing.

    '''

    # set up the figure
    plt.close('all')
    plt.figure(figsize=(8,4.8))

    if arg_10:
        arg_11 = 100
        arg_12 = 0
    else:
        arg_11 = 0
        arg_12 = 100

    if not arg_9:

        plt.plot(arg_0, arg_3, linewidth=3.0, color='red',zorder=arg_11)
        plt.plot(arg_0,arg_1,
                 marker='o',
                 markersize=1.0,
                 linestyle='none',
                 rasterized=True, color='k',zorder=arg_12)

        # set the x axis ticks and label
        plt.gca().set_xticks(
            [0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]
        )

    else:
        plt.plot(np.concatenate([arg_0-1.0,arg_0]),
                 np.concatenate([arg_3,arg_3]),
                 linewidth=3.0,
                 color='red',zorder=arg_11)
        plt.plot(np.concatenate([arg_0-1.0,arg_0]),
                 np.concatenate([arg_1,arg_1]),
                 marker='o',
                 markersize=1.0,
                 linestyle='none',
                 rasterized=True, color='k',zorder=arg_12)

        plt.gca().set_xlim((-0.8,0.8))
        # set the x axis ticks and label
        plt.gca().set_xticks(
            [-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,
             0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8]
        )

    # set the y axis limit and label
    arg_13, arg_14 = plt.ylim()
    if not arg_8:
        plt.gca().invert_yaxis()
        plt.ylabel('magnitude')
    else:
        plt.ylabel('flux')

    plt.xlabel('phase')
    plt.title('period: %.6f, folded at %.6f, fit epoch: %.6f' %
              (arg_4, arg_5, arg_6))
    plt.savefig(arg_7)
    plt.close()


Return the primary measure channel of this qubit.

def
Func
(
arg_0
)
->
MeasureChannel
:
if
arg_0
.
_Funcs
:
return
arg_0
.
_Funcs
[
0
]
else
:
raise
PulseError
(
"No Funcment channels in q[%d]"
%
arg_0
.
_index
)

def Func(arg_0) -> MeasureChannel:
        """Return the primary Func channel of this qubit."""
        if arg_0._Funcs:
            return arg_0._Funcs[0]
        else:
            raise PulseError("No Funcment channels in q[%d]" % arg_0._index)

Return the primary measure channel of this qubit .


def Func ( arg_0 ) : arg_1 = { } arg_1 [ 'trace_id' ] = _hex_to_bytes ( arg_0 . trace_id ) if arg_0 . parent_id : arg_1 [ 'parent_id' ] = _hex_to_bytes ( arg_0 . parent_id ) arg_1 [ 'id' ] = _hex_to_bytes ( arg_0 . span_id ) arg_2 = _get_protobuf_kind ( arg_0 . kind ) if arg_2 : arg_1 [ 'kind' ] = arg_2 if arg_0 . name : arg_1 [ 'name' ] = arg_0 . name if arg_0 . timestamp : arg_1 [ 'timestamp' ] = int ( arg_0 . timestamp * 1000 * 1000 ) if arg_0 . duration : arg_1 [ 'duration' ] = int ( arg_0 . duration * 1000 * 1000 ) if arg_0 . local_endpoint : arg_1 [ 'local_endpoint' ] = _convert_endpoint ( arg_0 . local_endpoint ) if arg_0 . remote_endpoint : arg_1 [ 'remote_endpoint' ] = _convert_endpoint ( arg_0 . remote_endpoint ) if len ( arg_0 . annotations ) > 0 : arg_1 [ 'annotations' ] = _convert_annotations ( arg_0 . annotations ) if len ( arg_0 . tags ) > 0 : arg_1 [ 'tags' ] = arg_0 . tags if arg_0 . debug : arg_1 [ 'debug' ] = arg_0 . debug if arg_0 . shared : arg_1 [ 'shared' ] = arg_0 . shared return zipkin_pb2 . Span ( ** arg_1 )

def Func(arg_0):
    """Converts a py_zipkin Span in a protobuf Span.

    :param span: py_zipkin Span to convert.
    :type span: py_zipkin.encoding.Span
    :return: protobuf's Span
    :rtype: zipkin_pb2.Span
    """

    # Protobuf's composite types (i.e. Span's local_endpoint) are immutable.
    # So we can't create a zipkin_pb2.Span here and then set the appropriate
    # fields since `pb_span.local_endpoint = zipkin_pb2.Endpoint` fails.
    # Instead we just create the kwargs and pass them in to the Span constructor.
    arg_1 = {}

    arg_1['trace_id'] = _hex_to_bytes(arg_0.trace_id)

    if arg_0.parent_id:
        arg_1['parent_id'] = _hex_to_bytes(arg_0.parent_id)

    arg_1['id'] = _hex_to_bytes(arg_0.span_id)

    arg_2 = _get_protobuf_kind(arg_0.kind)
    if arg_2:
        arg_1['kind'] = arg_2

    if arg_0.name:
        arg_1['name'] = arg_0.name
    if arg_0.timestamp:
        arg_1['timestamp'] = int(arg_0.timestamp * 1000 * 1000)
    if arg_0.duration:
        arg_1['duration'] = int(arg_0.duration * 1000 * 1000)

    if arg_0.local_endpoint:
        arg_1['local_endpoint'] = _convert_endpoint(arg_0.local_endpoint)

    if arg_0.remote_endpoint:
        arg_1['remote_endpoint'] = _convert_endpoint(arg_0.remote_endpoint)

    if len(arg_0.annotations) > 0:
        arg_1['annotations'] = _convert_annotations(arg_0.annotations)

    if len(arg_0.tags) > 0:
        arg_1['tags'] = arg_0.tags

    if arg_0.debug:
        arg_1['debug'] = arg_0.debug

    if arg_0.shared:
        arg_1['shared'] = arg_0.shared

    return zipkin_pb2.Span(**arg_1)

Converts a py_zipkin Span in a protobuf Span .


def
Func
(
arg_0
,
arg_1
)
:
if
not
none_and_length_check
(
[
arg_0
,
arg_1
]
)
:
raise
Exception
(
'Function inputs are incorrect format'
)
return
mixing_simple
(
arg_0
,
arg_1
)

def Func(arg_0, arg_1):
    r'''Calculate mixture liquid density using the Func mixing rule.
    Highly inacurate, but easy to use. Assumes idea liquids with
    no excess volume. Average molecular weight should be used with it to obtain
    density.

    .. math::
        V_{mix} = \sum_i x_i V_i

    or in terms of density:

    .. math::

        \rho_{mix} = \sum\frac{x_i}{\rho_i}

    Parameters
    ----------
    xs : array
        Mole fractions of each component, []
    Vms : array
        Molar volumes of each fluids at conditions [m^3/mol]

    Returns
    -------
    Vm : float
        Mixture liquid volume [m^3/mol]

    Notes
    -----
    Units are that of the given volumes.
    It has been suggested to use this equation with weight fractions,
    but the results have been less accurate.

    Examples
    --------
    >>> Func([0.5, 0.5], [4.057e-05, 5.861e-05])
    4.9590000000000005e-05
    '''
    if not none_and_length_check([arg_0, arg_1]):
        raise Exception('Function inputs are incorrect format')
    return mixing_simple(arg_0, arg_1)

r'''Calculate mixture liquid density using the Amgat mixing rule.
    Highly inacurate, but easy to use. Assumes idea liquids with
    no excess volume. Average molecular weight should be used with it to obtain
    density.

    .. math::
        V_{mix} = \sum_i x_i V_i

    or in terms of density:

    .. math::

        \rho_{mix} = \sum\frac{x_i}{\rho_i}

    Parameters
    ----------
    xs : array
        Mole fractions of each component, []
    Vms : array
        Molar volumes of each fluids at conditions [m^3/mol]

    Returns
    -------
    Vm : float
        Mixture liquid volume [m^3/mol]

    Notes
    -----
    Units are that of the given volumes.
    It has been suggested to use this equation with weight fractions,
    but the results have been less accurate.

    Examples
    --------
    >>> Amgat([0.5, 0.5], [4.057e-05, 5.861e-05])
    4.9590000000000005e-05

r Calculate mixture liquid density using the Amgat mixing rule . Highly inacurate but easy to use . Assumes idea liquids with no excess volume . Average molecular weight should be used with it to obtain density .


def Func ( arg_0 , arg_1 , arg_2 = 10000 ) : arg_3 = arg_0 * np . random . randn ( arg_2 , len ( arg_0 ) ) arg_4 = arg_1 * np . random . randn ( arg_2 , len ( arg_1 ) ) return arg_3 - arg_4

def Func(arg_0, arg_1, arg_2=10000):
    """ each element of std0 should correspond with the element of std1 """
    arg_3 = arg_0*np.random.randn(arg_2, len(arg_0))
    arg_4 = arg_1*np.random.randn(arg_2, len(arg_1))
    return arg_3 - arg_4


return enterprise_learner and enterprise_learner.id

def Func ( arg_0 , arg_1 ) : arg_2 = EnterpriseCustomerUser . objects . filter ( user_id = arg_1 . id ) . first ( ) return arg_2 and arg_2 . id

def Func(arg_0, arg_1):
        """
        Get enterprise user id from user object.

        Arguments:
            obj (User): Django User object

        Returns:
            (int): Primary Key identifier for enterprise user object.
        """
        # An enterprise learner can not belong to multiple enterprise customer at the same time
        # but if such scenario occurs we will pick the first.
        arg_2 = EnterpriseCustomerUser.objects.filter(user_id=arg_1.id).first()

        return arg_2 and arg_2.id

Get enterprise user id from user object .


def Func(arg_0):
        """Dispatches the request and on top of that performs request
        pre and postprocessing as well as HTTP exception catching and
        error handling.

        .. versionadded:: 0.7
        """
        arg_0.try_trigger_before_first_request_functions()
        try:
            request_started.send(arg_0)
            arg_1 = arg_0.preprocess_request()
            if arg_1 is None:
                arg_1 = arg_0.dispatch_request()
        except Exception as e:
            arg_1 = arg_0.handle_user_exception(e)
        arg_2 = arg_0.make_response(arg_1)
        arg_2 = arg_0.process_response(arg_2)
        request_finished.send(arg_0, arg_2=arg_2)
        return arg_2

Dispatches the request and on top of that performs request pre and postprocessing as well as HTTP exception catching and error handling .


def Func(arg_0):
        '''Run clean.'''
        arg_1 = os.path.relpath(
            RESOURCE_TARGET_PATH, ROOT_PATH
        )
        if os.path.exists(arg_1):
            os.remove(arg_1)
        else:
            distutils.log.warn(
                '\'{0}\' does not exist -- can\'t clean it'
                .format(arg_1)
            )

        arg_2 = arg_1 + 'c'
        if os.path.exists(arg_2):
            os.remove(arg_2)
        else:
            distutils.log.warn(
                '\'{0}\' does not exist -- can\'t clean it'
                .format(arg_2)
            )
        CleanCommand.Func(arg_0)


(self, domain_name, username=None, alphabet=Domain.DEFAULT_ALPHABET,
            length=Domain.DEFAULT_KEY_LENGTH)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
arg_4
.
DEFAULT_ALPHABET
,
arg_6
=
arg_4
.
DEFAULT_KEY_LENGTH
)
:
try
:
return
arg_0
.
_Func
(
arg_1
,
arg_2
,
arg_3
,
arg_6
)
except
Exception
as
ex
:
_logger
.
warn
(
"Inserting new domain failed: %s"
,
ex
)
raise
DuplicateDomainException

def Func(arg_0, arg_1, arg_2=None, arg_3=arg_4.DEFAULT_ALPHABET,
            arg_6=arg_4.DEFAULT_KEY_LENGTH):
        """ Create a new domain entry in the database.

        :param username: The username to associate with this domain.
        :param alphabet: A character set restriction to impose on keys generated for this domain.
        :param length: The length of the generated key, in case of restrictions on the site.
        """
        # Wrap the actual implementation to do some error handling
        try:
            return arg_0._Func(arg_1, arg_2, arg_3, arg_6)
        except Exception as ex:
            _logger.warn("Inserting new domain failed: %s", ex)
            raise DuplicateDomainException

Create a new domain entry in the database .


(classes, target_folder, parent_package=None, indent=DEFAULT_INDENT)

def Func(arg_0, arg_1, arg_2=None, arg_3=arg_4):
    '''
    This function can be used to build a python package representation of pyschema classes.
    One module is created per namespace in a package matching the namespace hierarchy.

    Args:
        classes: A collection of classes to build the package from
        target_folder: Root folder of the package
        parent_package: Prepended on all import statements in order to support absolute imports.
            parent_package is not used when building the package file structure
        indent: Indent level. Defaults to 4 spaces
    '''
    PackageBuilder(arg_1, arg_2, arg_3).from_classes_with_refs(arg_0)

This function can be used to build a python package representation of pyschema classes . One module is created per namespace in a package matching the namespace hierarchy .


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the Decrypt request payload to a stream.

        Args:
            output_stream (stream): A data stream in which to encode object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the data attribute is not defined.
        """
        arg_6 = utils.BytearrayStream()

        if arg_0._unique_identifier:
            arg_0._unique_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0._cryptographic_parameters:
            arg_0._cryptographic_parameters.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._data:
            arg_0._data.Func(arg_6, arg_2=arg_2)
        else:
            raise ValueError("invalid payload missing the data attribute")

        if arg_0._iv_counter_nonce:
            arg_0._iv_counter_nonce.Func(
                arg_6,
                arg_2=arg_2
            )

        arg_0.length = arg_6.length()
        super(DecryptRequestPayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_1.Func(arg_6.buffer)

Write the data encoding the Decrypt request payload to a stream.

        Args:
            output_stream (stream): A data stream in which to encode object
                data, supporting a write method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the data attribute is not defined.

Write the data encoding the Decrypt request payload to a stream .


def Func ( arg_0 ) : from os . path import join , exists , isdir , splitext , basename , sep if not arg_0 or not exists ( arg_0 ) or not isdir ( arg_0 ) : return None from os import walk import fnmatch import imp for arg_1 , arg_2 , arg_3 in walk ( arg_0 ) : for arg_4 in fnmatch . filter ( arg_3 , '*.py' ) : arg_5 = join ( arg_1 , arg_4 ) arg_6 = splitext ( arg_1 ) [ 0 ] . replace ( sep , '.' ) imp . load_source ( arg_6 , arg_5 )

def Func(arg_0):
    """Descover and load greencard tests."""
    from os.path import join, exists, isdir, splitext, basename, sep
    if not arg_0 or not exists(arg_0) or not isdir(arg_0):
        return None

    from os import walk
    import fnmatch
    import imp

    for arg_1, arg_2, arg_3 in walk(arg_0):
        for arg_4 in fnmatch.filter(arg_3, '*.py'):
            arg_5 = join(arg_1, arg_4)
            arg_6 = splitext(arg_1)[0].replace(sep, '.')
            imp.load_source(arg_6, arg_5)


def Func ( arg_0 ) : arg_1 = apps . get_model ( 'enterprise' , 'EnterpriseCustomer' ) try : return arg_1 . objects . get ( arg_0 = arg_0 ) except arg_1 . DoesNotExist : return None

def Func(arg_0):
    """
    Get the ``EnterpriseCustomer`` instance associated with ``uuid``.

    :param uuid: The universally unique ID of the enterprise customer.
    :return: The ``EnterpriseCustomer`` instance, or ``None`` if it doesn't exist.
    """
    arg_1 = apps.get_model('enterprise', 'EnterpriseCustomer')  # pylint: disable=invalid-name
    try:
        return arg_1.objects.get(arg_0=arg_0)  # pylint: disable=no-member
    except arg_1.DoesNotExist:
        return None

Get the EnterpriseCustomer instance associated with uuid .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
callable
(
arg_2
)
:
raise
QiskitError
(
"Callback is not a callable!"
)
if
arg_1
not
in
arg_0
.
_Funcrs
:
arg_0
.
_Funcrs
[
arg_1
]
=
[
]
arg_4
=
arg_0
.
_Subscription
(
arg_1
,
arg_2
)
if
arg_4
in
arg_0
.
_Funcrs
[
arg_1
]
:
return
False
arg_0
.
_Funcrs
[
arg_1
]
.
append
(
arg_4
)
return
True

def Func(arg_0, arg_1, arg_2):
        """Subscribes to an event, so when it's emitted all the callbacks Funcd,
        will be executed. We are not allowing double registration.

        Args
            event (string): The event to Funcd in the form of:
                            "terra.<component>.<method>.<action>"
            callback (callable): The callback that will be executed when an event is
                                  emitted.
        """
        if not callable(arg_2):
            raise QiskitError("Callback is not a callable!")

        if arg_1 not in arg_0._Funcrs:
            arg_0._Funcrs[arg_1] = []

        arg_4 = arg_0._Subscription(arg_1, arg_2)
        if arg_4 in arg_0._Funcrs[arg_1]:
            # We are not allowing double subscription
            return False

        arg_0._Funcrs[arg_1].append(arg_4)
        return True

Subscribes to an event, so when it's emitted all the callbacks subscribed,
        will be executed. We are not allowing double registration.

        Args
            event (string): The event to subscribed in the form of:
                            "terra.<component>.<method>.<action>"
            callback (callable): The callback that will be executed when an event is
                                  emitted.

Subscribes to an event so when it s emitted all the callbacks subscribed will be executed . We are not allowing double registration .


def Func(arg_0, arg_1, arg_2):
        """
        Get access key of given object

        @param window_name: Window name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to look for, either full name,
        LDTP's name convention, or a Unix glob. Or menu heirarchy
        @type object_name: string

        @return: access key in string format on success, else LdtpExecutionError on failure.
        @rtype: string
        """
        # Used http://www.danrodney.com/mac/ as reference for
        # mapping keys with specific control
        # In Mac noticed (in accessibility inspector) only menu had access keys
        # so, get the menu_handle of given object and
        # return the access key
        arg_3 = arg_0._get_menu_handle(arg_1, arg_2)
        arg_4 = arg_3.AXMenuItemCmdChar
        arg_5 = arg_3.AXMenuItemCmdModifiers
        arg_6 = arg_3.AXMenuItemCmdGlyph
        arg_7 = arg_3.AXMenuItemCmdVirtualKey
        arg_8 = ""
        if arg_5 == 0:
            arg_8 = "<command>"
        elif arg_5 == 1:
            arg_8 = "<shift><command>"
        elif arg_5 == 2:
            arg_8 = "<option><command>"
        elif arg_5 == 3:
            arg_8 = "<option><shift><command>"
        elif arg_5 == 4:
            arg_8 = "<ctrl><command>"
        elif arg_5 == 6:
            arg_8 = "<ctrl><option><command>"
        # Scroll up
        if arg_7 == 115 and arg_6 == 102:
            arg_5 = "<option>"
            arg_4 = "<cursor_left>"
        # Scroll down
        elif arg_7 == 119 and arg_6 == 105:
            arg_5 = "<option>"
            arg_4 = "<right>"
        # Page up
        elif arg_7 == 116 and arg_6 == 98:
            arg_5 = "<option>"
            arg_4 = "<up>"
        # Page down
        elif arg_7 == 121 and arg_6 == 107:
            arg_5 = "<option>"
            arg_4 = "<down>"
        # Line up
        elif arg_7 == 126 and arg_6 == 104:
            arg_4 = "<up>"
        # Line down
        elif arg_7 == 125 and arg_6 == 106:
            arg_4 = "<down>"
        # Noticed in  Google Chrome navigating next tab
        elif arg_7 == 124 and arg_6 == 101:
            arg_4 = "<right>"
        # Noticed in  Google Chrome navigating previous tab
        elif arg_7 == 123 and arg_6 == 100:
            arg_4 = "<left>"
        # List application in a window to Force Quit
        elif arg_7 == 53 and arg_6 == 27:
            arg_4 = "<escape>"
        # FIXME:
        # * Instruments Menu View->Run Browser
        # modifiers==12 virtual_key==48 glpyh==2
        # * Terminal Menu Edit->Start Dictation
        # fn fn - glpyh==148 modifiers==24
        # * Menu Chrome->Clear Browsing Data in Google Chrome
        # virtual_key==51 glpyh==23 [Delete Left (like Backspace on a PC)]
        if not arg_4:
            raise LdtpServerException("No access key associated")
        return arg_8 + arg_4


def Func ( arg_0 , arg_1 = None , arg_2 = False ) : arg_3 = None if arg_1 is not None : arg_3 = utils . unparse_msgid_article ( arg_1 ) arg_4 , arg_5 = arg_0 . command ( "BODY" , arg_3 ) if arg_4 != 222 : raise NNTPReplyError ( arg_4 , arg_5 ) arg_6 = 0 arg_7 = 0 Func = [ ] for arg_9 in arg_0 . info_gen ( arg_4 , arg_5 ) : if arg_2 : if arg_9 . startswith ( "=y" ) : continue arg_9 , arg_6 , arg_7 = yenc . decode ( arg_9 , arg_6 , arg_7 ) Func . append ( arg_9 ) return "" . join ( Func )

def Func(arg_0, arg_1=None, arg_2=False):
        """BODY command.
        """
        arg_3 = None
        if arg_1 is not None:
            arg_3 = utils.unparse_msgid_article(arg_1)

        arg_4, arg_5 = arg_0.command("BODY", arg_3)
        if arg_4 != 222:
            raise NNTPReplyError(arg_4, arg_5)

        arg_6 = 0
        arg_7 = 0

        Func = []
        for arg_9 in arg_0.info_gen(arg_4, arg_5):

            # decode body if required
            if arg_2:
                if arg_9.startswith("=y"):
                    continue
                arg_9, arg_6, arg_7 = yenc.decode(arg_9, arg_6, arg_7)

            # body
            Func.append(arg_9)

        return "".join(Func)


def Func ( arg_0 ) : arg_1 = arg_0 . variables [ 'seqLengths' ] . data arg_2 = np . concatenate ( ( [ 0 ] , np . cumsum ( arg_1 ) [ : - 1 ] ) ) def sample ( ) : arg_3 = np . random . choice ( list ( range ( len ( arg_1 ) ) ) , BATCH_SIZE , replace = False ) return batch_at ( arg_0 . variables [ 'inputs' ] . data , arg_0 . variables [ 'targetClasses' ] . data , arg_2 [ arg_3 ] , arg_1 [ arg_3 ] ) return sample

def Func(arg_0):
    '''Returns a callable that chooses sequences from netcdf data.'''
    arg_1 = arg_0.variables['seqLengths'].data
    arg_2 = np.concatenate(([0], np.cumsum(arg_1)[:-1]))

    def sample():
        arg_3 = np.random.choice(
            list(range(len(arg_1))), BATCH_SIZE, replace=False)
        return batch_at(arg_0.variables['inputs'].data,
                        arg_0.variables['targetClasses'].data,
                        arg_2[arg_3],
                        arg_1[arg_3])

    return sample

Returns a callable that chooses sequences from netcdf data .


def
Func
(
arg_0
)
:
arg_1
=
re
.
compile
(
arg_0
.
DISCOVER_PORT_PATTERN
)
with
open
(
arg_0
.
process_stderr
.
name
,
'r'
)
as
f
:
arg_2
=
0
while
arg_0
.
process
.
pid
and
arg_2
<
10
:
arg_3
=
f
.
readline
(
)
arg_4
=
arg_1
.
match
(
arg_3
)
if
arg_4
is
:
arg_2
+=
1
time
.
sleep
(
1
)
else
:
arg_5
=
int
(
arg_4
.
group
(
'port'
)
)
return
arg_5
else
:
logger
.
warning
(
'JMeter UDP port wasn\'t discovered'
)
return

def Func(arg_0):
        """Searching for line in jmeter.log such as
        Waiting for possible shutdown message on port 4445
        """
        arg_1 = re.compile(arg_0.DISCOVER_PORT_PATTERN)
        with open(arg_0.process_stderr.name, 'r') as f:
            arg_2 = 0
            while arg_0.process.pid and arg_2 < 10:
                arg_3 = f.readline()
                arg_4 = arg_1.match(arg_3)
                if arg_4 is None:
                    arg_2 += 1
                    time.sleep(1)
                else:
                    arg_5 = int(arg_4.group('port'))
                    return arg_5
            else:
                logger.warning('JMeter UDP port wasn\'t discovered')
                return None

Searching for line in jmeter . log such as Waiting for possible shutdown message on port 4445


return ','.join([
      '{}-{}'.format(pair[0], pair[1]) if pair[0] != pair[1] else str(pair[0])
      for pair in interval_list
  ])

def Func ( arg_0 ) : if not arg_0 : return '' arg_0 . sort ( ) arg_1 = [ ] arg_2 = [ ] for arg_3 in arg_0 : if arg_2 and ( arg_3 > arg_2 [ - 1 ] + 1 ) : arg_1 . append ( ( arg_2 [ 0 ] , arg_2 [ - 1 ] ) ) arg_2 = [ arg_3 ] else : arg_2 . append ( arg_3 ) if arg_2 : arg_1 . append ( ( arg_2 [ 0 ] , arg_2 [ - 1 ] ) ) return ',' . join ( [ '{}-{}' . format ( arg_4 [ 0 ] , arg_4 [ 1 ] ) if arg_4 [ 0 ] != arg_4 [ 1 ] else str ( arg_4 [ 0 ] ) for arg_4 in arg_1 ] )

def Func(arg_0):
  """Compact a list of integers into a comma-separated string of intervals.

  Args:
    value_list: A list of sortable integers such as a list of numbers

  Returns:
    A compact string representation, such as "1-5,8,12-15"
  """

  if not arg_0:
    return ''

  arg_0.sort()

  # Start by simply building up a list of separate contiguous intervals
  arg_1 = []
  arg_2 = []
  for arg_3 in arg_0:
    if arg_2 and (arg_3 > arg_2[-1] + 1):
      arg_1.append((arg_2[0], arg_2[-1]))
      arg_2 = [arg_3]
    else:
      arg_2.append(arg_3)

  if arg_2:
    arg_1.append((arg_2[0], arg_2[-1]))

  # For each interval collapse it down to "first, last" or just "first" if
  # if first == last.
  return ','.join([
      '{}-{}'.format(arg_4[0], arg_4[1]) if arg_4[0] != arg_4[1] else str(arg_4[0])
      for arg_4 in arg_1
  ])

Compact a list of integers into a comma - separated string of intervals .


def Func ( arg_0 , arg_1 ) : arg_0 . property_set [ 'commutation_set' ] = defaultdict ( list ) for arg_3 in arg_1 . wires : arg_4 = "{0}[{1}]" . format ( str ( arg_3 [ 0 ] . name ) , str ( arg_3 [ 1 ] ) ) arg_0 . property_set [ 'commutation_set' ] [ arg_4 ] = [ ] for arg_5 in arg_1 . topological_op_nodes ( ) : for ( arg_6 , arg_6 , arg_7 ) in arg_1 . edges ( arg_5 ) : arg_8 = arg_7 [ 'name' ] arg_0 . property_set [ 'commutation_set' ] [ ( arg_5 , arg_8 ) ] = - 1 for arg_3 in arg_1 . wires : arg_4 = "{0}[{1}]" . format ( str ( arg_3 [ 0 ] . name ) , str ( arg_3 [ 1 ] ) ) for arg_9 in arg_1 . nodes_on_wire ( arg_3 ) : arg_10 = arg_0 . property_set [ 'commutation_set' ] [ arg_4 ] if not arg_10 : arg_10 . append ( [ arg_9 ] ) if arg_9 not in arg_10 [ - 1 ] : arg_11 = arg_10 [ - 1 ] [ - 1 ] if _commute ( arg_9 , arg_11 ) : arg_10 [ - 1 ] . append ( arg_9 ) else : arg_10 . append ( [ arg_9 ] ) arg_12 = len ( arg_10 ) arg_0 . property_set [ 'commutation_set' ] [ ( arg_9 , arg_4 ) ] = arg_12 - 1

def Func(arg_0, arg_1):
        """
        Run the pass on the DAG, and write the discovered commutation relations
        into the property_set.
        """
        # Initiate the commutation set
        arg_0.property_set['commutation_set'] = defaultdict(list)

        # Build a dictionary to keep track of the gates on each qubit
        for arg_3 in arg_1.wires:
            arg_4 = "{0}[{1}]".format(str(arg_3[0].name), str(arg_3[1]))
            arg_0.property_set['commutation_set'][arg_4] = []

        # Add edges to the dictionary for each qubit
        for arg_5 in arg_1.topological_op_nodes():
            for (arg_6, arg_6, arg_7) in arg_1.edges(arg_5):

                arg_8 = arg_7['name']
                arg_0.property_set['commutation_set'][(arg_5, arg_8)] = -1

        for arg_3 in arg_1.wires:
            arg_4 = "{0}[{1}]".format(str(arg_3[0].name), str(arg_3[1]))

            for arg_9 in arg_1.nodes_on_wire(arg_3):

                arg_10 = arg_0.property_set['commutation_set'][arg_4]
                if not arg_10:
                    arg_10.append([arg_9])

                if arg_9 not in arg_10[-1]:
                    arg_11 = arg_10[-1][-1]
                    if _commute(arg_9, arg_11):
                        arg_10[-1].append(arg_9)

                    else:
                        arg_10.append([arg_9])

                arg_12 = len(arg_10)
                arg_0.property_set['commutation_set'][(arg_9, arg_4)] = arg_12 - 1

Run the pass on the DAG and write the discovered commutation relations into the property_set .


def Func(arg_0, arg_1, arg_2="00000000"):
        """ Single call wrapper for LCD set."

        Wraps :func:`~ekmmeters.V4Meter.setLcd` and associated init and add methods.

        Args:
            display_list (list): List composed of :class:`~ekmmeters.LCDItems`
            password (str): Optional password.

        Returns:
            bool: Passthrough from :func:`~ekmmeters.V4Meter.setLcd`
        """
        arg_3 = False
        try:
            arg_0.initLcd()
            arg_4 = len(arg_1)
            if (arg_4 > 45) or (arg_4 <= 0):
                ekm_log("LCD item list must have between 1 and 40 items")
                return False

            for arg_5 in arg_1:
                arg_0.addLcdItem(int(arg_5))
            arg_3 = arg_0.setLCD(arg_2)
        except:
            ekm_log(traceback.format_exc(sys.exc_info()))

        return arg_3


def Func ( arg_0 ) : arg_1 = arg_0 [ 'code' ] arg_2 = arg_0 [ 'line' ] + 1 arg_3 = arg_0 [ 'column' ] arg_4 = arg_0 [ 'path' ] arg_5 = 'utf-8' arg_6 = jedi . Script ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) arg_7 = arg_6 . call_signatures ( ) for arg_8 in arg_7 : arg_9 = ( str ( arg_8 . module_name ) , str ( arg_8 . name ) , [ p . description for p in arg_8 . params ] , arg_8 . index , arg_8 . bracket_start , arg_3 ) return arg_9 return [ ]

def Func(arg_0):
    """
    Worker that returns a list of Func.

    A Func is a tuple made of the following parts:
      - module_name: name of the module of the function invoked
      - call_name: name of the function that is being called
      - params: the list of parameter names.
      - index: index of the current parameter
      - bracket_start

    :returns tuple(module_name, call_name, params)
    """
    arg_1 = arg_0['code']
    arg_2 = arg_0['line'] + 1
    arg_3 = arg_0['column']
    arg_4 = arg_0['path']
    # encoding = request_data['encoding']
    arg_5 = 'utf-8'
    # use jedi to get call signatures
    arg_6 = jedi.Script(arg_1, arg_2, arg_3, arg_4, arg_5)
    arg_7 = arg_6.call_signatures()
    for arg_8 in arg_7:
        arg_9 = (str(arg_8.module_name), str(arg_8.name),
                   [p.description for p in arg_8.params], arg_8.index,
                   arg_8.bracket_start, arg_3)
        # todo: add support for multiple signatures, for that we need a custom
        # widget for showing Func.
        return arg_9
    return []

Worker that returns a list of calltips.

    A calltips is a tuple made of the following parts:
      - module_name: name of the module of the function invoked
      - call_name: name of the function that is being called
      - params: the list of parameter names.
      - index: index of the current parameter
      - bracket_start

    :returns tuple(module_name, call_name, params)

Worker that returns a list of calltips .


def Func ( arg_0 , arg_1 = None ) : arg_2 = tuple ( arg_0 ) arg_3 = len ( arg_2 ) arg_1 = arg_3 if arg_1 is None else arg_1 for arg_4 in itertools . product ( range ( arg_3 ) , repeat = arg_1 ) : yield list ( arg_2 [ arg_5 ] for arg_5 in arg_4 )

def Func(arg_0, arg_1=None):
    """Return successive r length permutations of elements in the iterable.

    Similar to itertools.permutation but withouth repeated values filtering.
    """
    arg_2 = tuple(arg_0)
    arg_3 = len(arg_2)
    arg_1 = arg_3 if arg_1 is None else arg_1
    for arg_4 in itertools.product(range(arg_3), repeat=arg_1):
        yield list(arg_2[arg_5] for arg_5 in arg_4)

Return successive r length permutations of elements in the iterable .


(self, from_object, to_object, relation_type, name=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None ) : arg_5 = Relationship ( arg_1 , arg_2 , arg_3 , arg_4 ) arg_0 . relationships . setdefault ( arg_3 , [ ] ) . append ( arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """create a relation ship
        """
        arg_5 = Relationship(arg_1, arg_2, arg_3, arg_4)
        arg_0.relationships.setdefault(arg_3, []).append(arg_5)


return self._make_response(headers={'Location': redirect},
                                   status_code=302)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { 'error' : arg_2 , 'response_type' : None , 'client_id' : None , 'redirect_uri' : None } arg_4 = utils . build_url ( arg_1 , arg_3 ) return arg_0 . _make_response ( headers = { 'Location' : arg_4 } , status_code = 302 )

def Func(arg_0, arg_1, arg_2):
        """Return a HTTP 302 redirect response object containing the error.

        :param redirect_uri: Client redirect URI.
        :type redirect_uri: str
        :param err: OAuth error message.
        :type err: str
        :rtype: requests.Response
        """
        arg_3 = {
            'error': arg_2,
            'response_type': None,
            'client_id': None,
            'redirect_uri': None
        }
        arg_4 = utils.build_url(arg_1, arg_3)
        return arg_0._make_response(headers={'Location': arg_4},
                                   status_code=302)

Return a HTTP 302 redirect response object containing the error .


def
Func
(
arg_0
=
,
arg_1
=
,
arg_2
=
)
:
if
arg_2
is
:
raise
ValueError
(
"network is None."
)
if
arg_0
is
:
raise
ValueError
(
"session is None."
)
if
not
os
.
path
.
exists
(
arg_1
)
:
logging
.
error
(
"file {} doesn't exist."
.
format
(
arg_1
)
)
return
False
else
:
arg_3
=
load_npz
(
arg_1
=
arg_1
)
assign_params
(
arg_0
,
arg_3
,
arg_2
)
logging
.
info
(
"[*] Load {} SUCCESS!"
.
format
(
arg_1
)
)
return
arg_2

def Func(arg_0=None, arg_1=None, arg_2=None):
    """Load model from npz and assign to a network.

    Parameters
    -------------
    sess : Session
        TensorFlow Session.
    name : str
        The name of the `.npz` file.
    network : :class:`Layer`
        The network to be assigned.

    Returns
    --------
    False or network
        Returns False, if the model is not exist.

    Examples
    --------
    - See ``tl.files.save_npz``

    """
    if arg_2 is None:
        raise ValueError("network is None.")
    if arg_0 is None:
        raise ValueError("session is None.")
    if not os.path.exists(arg_1):
        logging.error("file {} doesn't exist.".format(arg_1))
        return False
    else:
        arg_3 = load_npz(arg_1=arg_1)
        assign_params(arg_0, arg_3, arg_2)
        logging.info("[*] Load {} SUCCESS!".format(arg_1))
        return arg_2

Load model from npz and assign to a network .


return Counter(
        (
            'None'
            if ANNOTATIONS not in data or 'Confidence' not in data[ANNOTATIONS] else
            list(data[ANNOTATIONS]['Confidence'])[0]
        )
        for _, _, data in graph.edges(data=True)
        if CITATION in data  # don't bother with unqualified statements
    )

def Func ( arg_0 : arg_1 ) -> typing . Counter [ str ] : return Counter ( ( 'None' if ANNOTATIONS not in arg_3 or 'Confidence' not in arg_3 [ ANNOTATIONS ] else list ( arg_3 [ ANNOTATIONS ] [ 'Confidence' ] ) [ 0 ] ) for arg_2 , arg_2 , arg_3 in arg_0 . edges ( arg_3 = True ) if CITATION in arg_3 )

def Func(arg_0: arg_1) -> typing.Counter[str]:
    """Count the confidences in the graph."""
    return Counter(
        (
            'None'
            if ANNOTATIONS not in arg_3 or 'Confidence' not in arg_3[ANNOTATIONS] else
            list(arg_3[ANNOTATIONS]['Confidence'])[0]
        )
        for arg_2, arg_2, arg_3 in arg_0.edges(arg_3=True)
        if CITATION in arg_3  # don't bother with unqualified statements
    )


def
Func
(
arg_0
)
:
arg_1
=
tracker_access
.
metric_queries
(
)
arg_2
=
tracker_access
.
queries_map
(
)
arg_3
=
arg_0
.
values
(
)
[
0
]
.
keys
(
)
arg_4
=
[
]
for
arg_5
in
arg_3
:
arg_6
=
[
arg_5
]
for
arg_7
in
arg_1
:
try
:
arg_6
.
append
(
str
(
arg_0
[
arg_7
]
[
arg_5
]
)
)
except
KeyError
:
pass
arg_4
.
append
(
arg_6
)
arg_8
=
[
'container id'
]
+
[
arg_2
[
k
]
for
k
in
arg_1
if
k
in
arg_0
.
keys
(
)
]
return
arg_4
,
arg_8

def Func(arg_0):
  """ normalize raw metrics API result to table """
  arg_1 = tracker_access.metric_queries()
  arg_2 = tracker_access.queries_map()
  arg_3 = arg_0.values()[0].keys()
  arg_4 = []
  for arg_5 in arg_3:
    arg_6 = [arg_5]
    for arg_7 in arg_1:
      try:
        arg_6.append(str(arg_0[arg_7][arg_5]))
      except KeyError:
        pass
    arg_4.append(arg_6)
  arg_8 = ['container id'] + [arg_2[k] for k in arg_1 if k in arg_0.keys()]
  return arg_4, arg_8


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in enumerate ( arg_0 . animations ) : arg_3 . layout = arg_3 . layout . clone ( ) if arg_1 and arg_2 : arg_3 . preclear = False

def Func(arg_0, arg_1):
        """
        Give each animation a unique, mutable layout so they can run
        independently.
        """
        # See #868
        for arg_2, arg_3 in enumerate(arg_0.animations):
            arg_3.layout = arg_3.layout.clone()
            if arg_1 and arg_2:
                arg_3.preclear = False

Give each animation a unique mutable layout so they can run independently .


def Func ( arg_0 , arg_1 ) : if arg_1 and arg_1 . namespaced : arg_0 = "r_{0}_{1}" . format ( arg_1 . name , arg_0 [ 2 : ] ) return arg_0

def Func(arg_0, arg_1):
    """ Rename endpoint function name to avoid conflict when namespacing is set to true

    :param fn_name: Name of the route function
    :param instance: Instance bound to the function
    :return: Name of the new namespaced function name
    """

    if arg_1 and arg_1.namespaced:
        arg_0 = "r_{0}_{1}".format(arg_1.name, arg_0[2:])
    return arg_0


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_1
+
"_"
+
arg_0
arg_5
=
[
]
for
arg_6
,
arg_7
in
CONFIG
[
arg_0
]
[
"auth"
]
.
items
(
)
:
arg_5
.
append
(
arg_2
[
arg_6
]
)
if
len
(
arg_5
)
>
1
:
arg_3
.
pwd
[
arg_4
]
=
" :: "
.
join
(
arg_5
)
else
:
arg_3
.
pwd
[
arg_4
]
=
arg_5
[
0
]

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Write the settings into the auth portion of the cfg.

    Args:
        :msg_type: (str) message type to create config entry.
        :profile_name: (str) name of the profile entry
        :auth: (dict) auth parameters
        :cfg: (jsonconfig.Config) config instance.
    """
    arg_4 = arg_1 + "_" + arg_0
    arg_5 = []
    for arg_6, arg_7 in CONFIG[arg_0]["auth"].items():
        arg_5.append(arg_2[arg_6])

    if len(arg_5) > 1:
        arg_3.pwd[arg_4] = " :: ".join(arg_5)
    else:
        arg_3.pwd[arg_4] = arg_5[0]

Write the settings into the auth portion of the cfg .


def Func(arg_0, arg_1):
        """
        Transform the provided content metadata item to the schema expected by the integrated channel.
        """
        arg_2 = arg_1['content_type']
        arg_3 = {}
        for arg_4, arg_5 in arg_0.DATA_TRANSFORM_MAPPING.items():
            # Look for transformer functions defined on subclasses.
            # Favor content type-specific functions.
            arg_6 = (
                getattr(
                    arg_0,
                    'transform_{content_type}_{edx_data_schema_key}'.format(
                        content_type=arg_2,
                        arg_5=arg_5
                    ),
                    None
                )
                or
                getattr(
                    arg_0,
                    'transform_{edx_data_schema_key}'.format(
                        arg_5=arg_5
                    ),
                    None
                )
            )
            if arg_6:
                arg_3[arg_4] = arg_6(arg_1)
            else:
                # The concrete subclass does not define an override for the given field,
                # so just use the data key to index the content metadata item dictionary.
                try:
                    arg_3[arg_4] = arg_1[arg_5]
                except KeyError:
                    # There may be a problem with the DATA_TRANSFORM_MAPPING on
                    # the concrete subclass or the concrete subclass does not implement
                    # the appropriate field tranformer function.
                    LOGGER.exception(
                        'Failed to transform content metadata item field [%s] for [%s]: [%s]',
                        arg_5,
                        arg_0.enterprise_customer.name,
                        arg_1,
                    )

        return arg_3

Transform the provided content metadata item to the schema expected by the integrated channel .


return map(BluezGattService,
                   get_provider()._get_objects(_SERVICE_INTERFACE,
                                               self._device.object_path))

def Func ( arg_0 ) : return map ( BluezGattService , get_provider ( ) . _get_objects ( _SERVICE_INTERFACE , arg_0 . _device . object_path ) )

def Func(arg_0):
        """Return a list of GattService objects that have been discovered for
        this device.
        """
        return map(BluezGattService,
                   get_provider()._get_objects(_SERVICE_INTERFACE,
                                               arg_0._device.object_path))

Return a list of GattService objects that have been discovered for this device .


def Func(arg_0):
    """
    Extract the oritentation EXIF tag from the image, which should be a PIL Image instance,
    and if there is an orientation tag that would rotate the image, apply that rotation to
    the Image instance given to do an in-place rotation.

    :param Image im: Image instance to inspect
    :return: A possibly transposed image instance
    """

    try:
        arg_1 = 0x0112
        if hasattr(arg_0, '_getexif'): # only present in JPEGs
            arg_2 = arg_0._getexif()       # returns None if no EXIF data
            if arg_2 is not None:
                #log.info('EXIF data found: %r', e)
                arg_3 = arg_2[arg_1]
                arg_4 = orientation_funcs[arg_3]
                return arg_4(arg_0)
    except:
        # We'd be here with an invalid orientation value or some random error?
        pass # log.exception("Error applying EXIF Orientation tag")
    return arg_0

Extract the oritentation EXIF tag from the image which should be a PIL Image instance and if there is an orientation tag that would rotate the image apply that rotation to the Image instance given to do an in - place rotation .


def Func ( arg_0 ) : arg_0 . message = MIMEMultipart ( ) arg_0 . _add_header ( ) arg_0 . _add_body ( ) arg_0 . _add_attachments ( )

def Func(arg_0):
        """Put the parts of the email together."""
        arg_0.message = MIMEMultipart()
        arg_0._add_header()
        arg_0._add_body()
        arg_0._add_attachments()


def Func ( arg_0 , arg_1 = "default" , arg_2 = None ) : def create ( arg_3 ) : return selections . SelectionInvert ( arg_3 ) arg_0 . _selection ( create , arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1="default", arg_2=None):
        """Invert the selection, i.e. what is selected will not be, and vice versa

        :param str name:
        :param executor:
        :return:
        """

        def create(arg_3):
            return selections.SelectionInvert(arg_3)
        arg_0._selection(create, arg_1, arg_2=arg_2)

Invert the selection i . e . what is selected will not be and vice versa


def
Func
(
arg_0
)
:
if
arg_0
.
confirm_Func
:
if
arg_0
.
ask_yes_no
(
'Do you really want to Func ([y]/n)?'
,
'y'
)
:
arg_0
.
ask_Func
(
)
else
:
arg_0
.
ask_Func
(
)

def Func(arg_0):
        """Handle interactive Func.

        This method calls the ask_Func callback."""
        if arg_0.confirm_Func:
            if arg_0.ask_yes_no('Do you really want to Func ([y]/n)?','y'):
                arg_0.ask_Func()
        else:
            arg_0.ask_Func()

Handle interactive exit.

        This method calls the ask_exit callback.


(
            self, face_id, person_id, person_group_id=None, large_person_group_id=None, custom_headers=None, raw=False, **operation_config)

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

def Func(
            arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None, arg_6=False, **arg_7):
        """Verify whether two faces belong to a same person. Compares a face Id
        with a Person Id.

        :param face_id: FaceId of the face, comes from Face - Detect
        :type face_id: str
        :param person_id: Specify a certain person in a person group or a
         large person group. personId is created in PersonGroup Person - Create
         or LargePersonGroup Person - Create.
        :type person_id: str
        :param person_group_id: Using existing personGroupId and personId for
         fast loading a specified person. personGroupId is created in
         PersonGroup - Create. Parameter personGroupId and largePersonGroupId
         should not be provided at the same time.
        :type person_group_id: str
        :param large_person_group_id: Using existing largePersonGroupId and
         personId for fast loading a specified person. largePersonGroupId is
         created in LargePersonGroup - Create. Parameter personGroupId and
         largePersonGroupId should not be provided at the same time.
        :type large_person_group_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: VerifyResult or ClientRawResponse if raw=true
        :rtype: ~azure.cognitiveservices.vision.face.models.VerifyResult or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`APIErrorException<azure.cognitiveservices.vision.face.models.APIErrorException>`
        """
        arg_8 = models.VerifyFaceToPersonRequest(arg_1=arg_1, arg_3=arg_3, arg_4=arg_4, arg_2=arg_2)

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

        # Construct parameters
        arg_11 = {}

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

        # Construct body
        arg_13 = arg_0._serialize.body(arg_8, 'VerifyFaceToPersonRequest')

        # Construct and send request
        arg_14 = arg_0._client.post(arg_9, arg_11, arg_12, arg_13)
        arg_15 = arg_0._client.send(arg_14, stream=False, **arg_7)

        if arg_15.status_code not in [200]:
            raise models.APIErrorException(arg_0._deserialize, arg_15)

        arg_16 = None

        if arg_15.status_code == 200:
            arg_16 = arg_0._deserialize('VerifyResult', arg_15)

        if arg_6:
            arg_17 = ClientRawResponse(arg_16, arg_15)
            return arg_17

        return arg_16

Verify whether two faces belong to a same person . Compares a face Id with a Person Id .


def Func ( arg_0 , arg_1 , arg_2 = True ) : return _to_string_sequence ( arg_0 ) . search ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2=True):
    """Check if a string pattern or regex is contained within a sample of a string column.

    :param str pattern: A string or regex pattern
    :param bool regex: If True,
    :returns: an expression which is evaluated to True if the pattern is found in a given sample, and it is False otherwise.

    Example:

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

    >>> df.text.str.contains('very')
    Expression = Func(text, 'very')
    Length: 5 dtype: bool (expression)
    ----------------------------------
    0  False
    1   True
    2  False
    3  False
    4  False
    """
    return _to_string_sequence(arg_0).search(arg_1, arg_2)

Check if a string pattern or regex is contained within a sample of a string column.

    :param str pattern: A string or regex pattern
    :param bool regex: If True,
    :returns: an expression which is evaluated to True if the pattern is found in a given sample, and it is False otherwise.

    Example:

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

    >>> df.text.str.contains('very')
    Expression = str_contains(text, 'very')
    Length: 5 dtype: bool (expression)
    ----------------------------------
    0  False
    1   True
    2  False
    3  False
    4  False

Check if a string pattern or regex is contained within a sample of a string column .


def
Func
(
arg_0
,
arg_1
,
*
arg_2
)
:
arg_3
=
arg_1
(
arg_0
.
_ctx
,
*
arg_2
)
logger
.
debug
(
'Called ftdi_{0} and got response {1}.'
.
format
(
arg_1
.
__name__
,
arg_3
)
)
if
arg_3
!=
0
:
raise
RuntimeError
(
'ftdi_{0} failed with error {1}: {2}'
.
format
(
arg_1
.
__name__
,
arg_3
,
ftdi
.
get_error_string
(
arg_0
.
_ctx
)
)
)

def Func(arg_0, arg_1, *arg_2):
        """Helper function to call the provided command on the FTDI device and
        verify the response matches the expected value.
        """
        arg_3 = arg_1(arg_0._ctx, *arg_2)
        logger.debug('Called ftdi_{0} and got response {1}.'.format(arg_1.__name__, arg_3))
        if arg_3 != 0:
            raise RuntimeError('ftdi_{0} failed with error {1}: {2}'.format(arg_1.__name__, arg_3, ftdi.get_error_string(arg_0._ctx)))

Helper function to call the provided command on the FTDI device and verify the response matches the expected value .


return GraphRenderer(graph, attr_string, attrs['id'])

def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
split_contents
(
)
arg_2
.
pop
(
0
)
arg_3
=
arg_2
.
pop
(
0
)
arg_4
=
dict
(
[
arg_1
.
split
(
"="
)
for
arg_1
in
arg_2
]
)
if
'id'
not
in
arg_4
.
keys
(
)
:
arg_4
[
'id'
]
=
''
.
join
(
[
chr
(
choice
(
range
(
65
,
90
)
)
)
for
i
in
range
(
0
,
5
)
]
)
else
:
arg_4
[
'id'
]
=
arg_4
[
'id'
]
[
1
:
len
(
arg_4
[
'id'
]
)
1
]
arg_5
=
''
.
join
(
[
" %s=%s"
%
(
k
,
v
)
for
k
,
v
in
arg_4
.
iteritems
(
)
]
)
return
GraphRenderer
(
arg_3
,
arg_5
,
arg_4
[
'id'
]
)

def Func(arg_0, arg_1):
    """
    Tag to Func graphs into the template
    """

    arg_2 = arg_1.split_contents()
    arg_2.pop(0)
    arg_3 = arg_2.pop(0)

    arg_4 = dict([arg_1.split("=") for arg_1 in arg_2])

    if 'id' not in arg_4.keys():
        arg_4['id'] = ''.join([chr(choice(range(65, 90))) for i in range(0, 5)])
    else:
        arg_4['id'] = arg_4['id'][1:len(arg_4['id'])-1]

    arg_5 = ''.join([" %s=%s" % (k, v) for k, v in arg_4.iteritems()])
    return GraphRenderer(arg_3, arg_5, arg_4['id'])


def Func(arg_0, arg_1, arg_2=None):
    """
    Compute the entanglement of formation of quantum state.

    The input quantum state must be either a bipartite state vector, or a
    2-qubit density matrix.

    Args:
        state (array_like): (N) array_like or (4,4) array_like, a
            bipartite quantum state.
        d0 (int): the dimension of the first subsystem.
        d1 (int or None): the dimension of the second subsystem.

    Returns:
        float: The entanglement of formation.
    """
    arg_0 = np.array(arg_0)

    if arg_2 is None:
        arg_2 = int(len(arg_0) / arg_1)

    if arg_0.ndim == 2 and len(arg_0) == 4 and arg_1 == 2 and arg_2 == 2:
        return __eof_qubit(arg_0)
    elif arg_0.ndim == 1:
        # trace out largest dimension
        if arg_1 < arg_2:
            arg_3 = [1]
        else:
            arg_3 = [0]
        arg_0 = partial_trace(arg_0, arg_3, dimensions=[arg_1, arg_2])
        return entropy(arg_0)
    else:
        print('Input must be a state-vector or 2-qubit density matrix.')
    return None

Compute the entanglement of formation of quantum state .


def Func ( arg_0 ) : from lxml import etree arg_1 = [ arg_0 . text ] for arg_2 in arg_0 . getchildren ( ) : arg_1 . append ( etree . tostring ( arg_2 , encoding = "utf-8" ) ) arg_1 . append ( arg_2 . tail ) return "" . join ( filter ( None , arg_1 ) )

def Func(arg_0):
    """
    Returns the inner content of a given XML node, including tags.

    Args:
        node (lxml.etree.Element): The node whose inner content is desired.

    Returns:
        str: The inner content of the node.
    """

    from lxml import etree

    # Include text content at the start of the node.
    arg_1 = [arg_0.text]

    for arg_2 in arg_0.getchildren():
        # Include the child serialized to raw XML.
        arg_1.append(etree.tostring(arg_2, encoding="utf-8"))

        # Include any text following the child.
        arg_1.append(arg_2.tail)

    # Discard any non-existent text parts and return.
    return "".join(filter(None, arg_1))

Returns the inner content of a given XML node including tags .


(loc=None,
                    scale_diag=None,
                    scale_identity_multiplier=None,
                    shape_hint=None,
                    validate_args=False,
                    assert_positive=False,
                    name=None,
                    dtype=None)

def Func(arg_0=None,
                    arg_1=None,
                    arg_2=None,
                    arg_3=None,
                    arg_4=False,
                    arg_5=False,
                    arg_6=None,
                    arg_7=None):
  """Creates a LinearOperator representing a diagonal matrix.

  Args:
    loc: Floating-point `Tensor`. This is used for inferring shape in the case
      where only `scale_identity_multiplier` is set.
    scale_diag: Floating-point `Tensor` representing the diagonal matrix.
      `scale_diag` has shape [N1, N2, ...  k], which represents a k x k diagonal
      matrix. When `None` no diagonal term is added to the LinearOperator.
    scale_identity_multiplier: floating point rank 0 `Tensor` representing a
      scaling done to the identity matrix. When `scale_identity_multiplier =
      scale_diag = scale_tril = None` then `scale += IdentityMatrix`. Otherwise
      no scaled-identity-matrix is added to `scale`.
    shape_hint: scalar integer `Tensor` representing a hint at the dimension of
      the identity matrix when only `scale_identity_multiplier` is set.
    validate_args: Python `bool` indicating whether arguments should be checked
      for correctness.
    assert_positive: Python `bool` indicating whether LinearOperator should be
      checked for being positive definite.
    name: Python `str` name given to ops managed by this object.
    dtype: TF `DType` to prefer when converting args to `Tensor`s. Else, we fall
      back to a compatible dtype across all of `loc`, `scale_diag`, and
      `scale_identity_multiplier`.

  Returns:
    `LinearOperator` representing a lower triangular matrix.

  Raises:
    ValueError:  If only `scale_identity_multiplier` is set and `loc` and
      `shape_hint` are both None.
  """

  def _maybe_attach_assertion(arg_8):
    if not arg_4:
      return arg_8
    if arg_5:
      return with_dependencies([
          assert_util.assert_positive(
              arg_8, message="diagonal part must be positive"),
      ], arg_8)
    return with_dependencies([
        assert_util.assert_none_equal(
            arg_8, tf.zeros([], arg_8.dtype), message="diagonal part must be non-zero")
    ], arg_8)

  with tf.name_scope(arg_6 or "Func"):
    if arg_7 is None:
      arg_7 = dtype_util.common_dtype(
          [arg_0, arg_1, arg_2],
          preferred_dtype=tf.float32)
    arg_0 = _convert_to_tensor(arg_0, arg_6="loc", arg_7=arg_7)
    arg_1 = _convert_to_tensor(arg_1, arg_6="scale_diag", arg_7=arg_7)
    arg_2 = _convert_to_tensor(
        arg_2,
        arg_6="scale_identity_multiplier",
        arg_7=arg_7)

    if arg_1 is not None:
      if arg_2 is not None:
        arg_1 += arg_2[..., tf.newaxis]
      return tf.linalg.LinearOperatorDiag(
          diag=_maybe_attach_assertion(arg_1),
          is_non_singular=True,
          is_self_adjoint=True,
          is_positive_definite=arg_5)

    if arg_0 is None and arg_3 is None:
      raise ValueError("Cannot infer `event_shape` unless `loc` or "
                       "`shape_hint` is specified.")

    arg_9 = arg_3
    del arg_3
    if arg_9 is None:
      arg_9 = tf.compat.dimension_value(arg_0.shape[-1])
      if arg_9 is None:
        arg_9 = tf.shape(input=arg_0)[-1]

    if arg_2 is None:
      return tf.linalg.LinearOperatorIdentity(
          arg_9=arg_9,
          arg_7=arg_7,
          is_self_adjoint=True,
          is_positive_definite=True,
          assert_proper_shapes=arg_4)

    return tf.linalg.LinearOperatorScaledIdentity(
        arg_9=arg_9,
        multiplier=_maybe_attach_assertion(arg_2),
        is_non_singular=True,
        is_self_adjoint=True,
        is_positive_definite=arg_5,
        assert_proper_shapes=arg_4)

Creates a LinearOperator representing a diagonal matrix .


Resolve the points to make a line between two points.

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 1 ) : arg_4 = max ( arg_1 . x , arg_2 . x ) - min ( arg_1 . x , arg_2 . x ) arg_5 = max ( arg_1 . y , arg_2 . y ) - min ( arg_1 . y , arg_2 . y ) arg_6 = [ - 1 , 1 ] [ int ( arg_1 . x <= arg_2 . x ) ] arg_7 = [ - 1 , 1 ] [ int ( arg_1 . y <= arg_2 . y ) ] arg_8 = int ( round ( max ( arg_4 , arg_5 ) ) ) if arg_8 == 0 : return for arg_9 in range ( ( arg_8 + 1 ) * arg_3 ) : arg_10 = arg_1 . x arg_11 = arg_1 . y if arg_4 : arg_10 += ( float ( arg_9 ) * arg_4 ) / arg_8 * arg_6 / arg_3 if arg_5 : arg_11 += ( float ( arg_9 ) * arg_5 ) / arg_8 * arg_7 / arg_3 yield Point ( ( arg_10 , arg_11 ) )

def Func(arg_0, arg_1, arg_2, arg_3=1):
        """Resolve the points to make a Func between two points."""
        arg_4 = max(arg_1.x, arg_2.x) - min(arg_1.x, arg_2.x)
        arg_5 = max(arg_1.y, arg_2.y) - min(arg_1.y, arg_2.y)
        arg_6 = [-1, 1][int(arg_1.x <= arg_2.x)]
        arg_7 = [-1, 1][int(arg_1.y <= arg_2.y)]
        arg_8 = int(round(max(arg_4, arg_5)))
        if arg_8 == 0:
            return

        for arg_9 in range((arg_8 + 1) * arg_3):
            arg_10 = arg_1.x
            arg_11 = arg_1.y

            if arg_4:
                arg_10 += (float(arg_9) * arg_4) / arg_8 * arg_6 / arg_3
            if arg_5:
                arg_11 += (float(arg_9) * arg_5) / arg_8 * arg_7 / arg_3

            yield Point((arg_10, arg_11))

Resolve the points to make a line between two points .


(components, current_thumbprint, previous_thumbprint, preview=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
)
:
for
arg_4
in
arg_0
:
arg_5
=
manifest_deployers
.
get
(
arg_4
,
[
]
)
for
arg_6
in
arg_5
:
if
arg_6
.
startswith
(
'burlap.'
)
:
print
(
'skipping %s'
%
arg_6
)
continue
arg_7
=
manifest_deployers_takes_diff
.
get
(
arg_6
,
False
)
arg_8
=
resolve_deployer
(
arg_6
)
arg_9
=
arg_1
.
get
(
arg_4
)
arg_10
=
arg_2
.
get
(
arg_4
)
if
arg_7
:
yield
arg_6
,
partial
(
arg_8
,
arg_10
=
arg_10
,
arg_9
=
arg_9
)
else
:
yield
arg_6
,
partial
(
arg_8
)

def Func(arg_0, arg_1, arg_2, arg_3=False):
    """
    Returns a generator yielding the named functions needed for a deployment.
    """
    for arg_4 in arg_0:
        arg_5 = manifest_deployers.get(arg_4, [])
        for arg_6 in arg_5:

            #TODO:remove this after burlap.* naming prefix bug fixed
            if arg_6.startswith('burlap.'):
                print('skipping %s' % arg_6)
                continue

            arg_7 = manifest_deployers_takes_diff.get(arg_6, False)

            arg_8 = resolve_deployer(arg_6)
            arg_9 = arg_1.get(arg_4)
            arg_10 = arg_2.get(arg_4)
            if arg_7:
                yield arg_6, partial(arg_8, arg_10=arg_10, arg_9=arg_9)
            else:
                yield arg_6, partial(arg_8)

Returns a generator yielding the named functions needed for a deployment .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . data = [ gate . Func ( arg_1 , arg_2 ) for gate in arg_0 . data ] return arg_0

def Func(arg_0, arg_1, arg_2):
        """Add classical control register."""
        arg_0.data = [gate.Func(arg_1, arg_2) for gate in arg_0.data]
        return arg_0


def Func ( arg_0 , arg_1 ) : arg_0 . _lock . acquire ( ) try : arg_2 = arg_0 . _caches . get ( arg_1 ) if not arg_2 : return arg_2 . set_fetcher ( None ) finally : arg_0 . _lock . release ( )

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

        :Parameters:
            - `object_class`: class retrieved by the fetcher.
        :Types:
            - `object_class`: `classobj`
        """
        arg_0._lock.acquire()
        try:
            arg_2 = arg_0._caches.get(arg_1)
            if not arg_2:
                return
            arg_2.set_fetcher(None)
        finally:
            arg_0._lock.release()

Unregister a fetcher class for an object class .


def Func ( arg_0 ) : arg_0 . music . Func ( ) if not arg_0 . Func_paused : arg_0 . rocket . Func ( )

def Func(arg_0):
        """Start the timer"""
        arg_0.music.Func()
        if not arg_0.Func_paused:
            arg_0.rocket.Func()


(self, window_name, object_name, row_text_list, partial_match=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
False
)
:
arg_5
=
arg_0
.
_get_object_handle
(
arg_1
,
arg_2
)
if
not
arg_5
.
AXEnabled
:
raise
LdtpServerException
(
u"Object %s state disabled"
%
arg_2
)
arg_5
.
activate
(
)
arg_6
=
False
try
:
arg_7
=
arg_0
.
_get_front_most_window
(
)
except
(
IndexError
,
)
:
arg_7
=
arg_0
.
_get_any_window
(
)
for
arg_8
in
arg_3
:
arg_6
=
False
for
arg_9
in
arg_5
.
AXRows
:
arg_10
=
arg_9
arg_9
=
arg_0
.
_getfirstmatchingchild
(
arg_9
,
"(AXTextField|AXStaticText)"
)
if
not
arg_9
:
continue
if
re
.
match
(
arg_8
,
arg_9
.
AXValue
)
:
arg_6
=
True
if
not
arg_10
.
AXSelected
:
arg_11
,
arg_12
,
arg_13
,
arg_14
=
arg_0
.
_getobjectsize
(
arg_10
)
arg_7
.
clickMouseButtonLeftWithMods
(
(
arg_11
+
arg_13
/
2
,
arg_12
+
arg_14
/
2
)
,
[
'<command_l>'
]
)
arg_0
.
wait
(
0.5
)
else
:
pass
break
if
not
arg_6
:
raise
LdtpServerException
(
u"Unable to select row: %s"
%
arg_8
)
if
not
arg_6
:
raise
LdtpServerException
(
u"Unable to select any row"
)
return
1

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=False):
        """
        Select multiple row

        @param window_name: Window name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string
        @param row_text_list: Row list with matching text to select
        @type row_text: string

        @return: 1 on success.
        @rtype: integer
        """
        arg_5 = arg_0._get_object_handle(arg_1, arg_2)
        if not arg_5.AXEnabled:
            raise LdtpServerException(u"Object %s state disabled" % arg_2)

        arg_5.activate()
        arg_6 = False
        try:
            arg_7 = arg_0._get_front_most_window()
        except (IndexError,):
            arg_7 = arg_0._get_any_window()
        for arg_8 in arg_3:
            arg_6 = False
            for arg_9 in arg_5.AXRows:
                arg_10 = arg_9
                arg_9 = arg_0._getfirstmatchingchild(arg_9, "(AXTextField|AXStaticText)")
                if not arg_9:
                    continue
                if re.match(arg_8, arg_9.AXValue):
                    arg_6 = True
                    if not arg_10.AXSelected:
                        arg_11, arg_12, arg_13, arg_14 = arg_0._getobjectsize(arg_10)
                        arg_7.clickMouseButtonLeftWithMods((arg_11 + arg_13 / 2,
                                                             arg_12 + arg_14 / 2),
                                                            ['<command_l>'])
                        # Following selection doesn't work
                        # parent_cell.AXSelected=True
                        arg_0.wait(0.5)
                    else:
                        # Selected
                        pass
                    break
            if not arg_6:
                raise LdtpServerException(u"Unable to select row: %s" % arg_8)
        if not arg_6:
            raise LdtpServerException(u"Unable to select any row")
        return 1


(string, encoding='utf-8', strings_only=False, errors='strict')

def
Func
(
arg_0
,
arg_1
=
'utf-8'
,
arg_2
=
False
,
arg_3
=
'strict'
)
:
if
arg_2
and
isinstance
(
arg_0
,
(
type
(
)
,
int
)
)
:
return
arg_0
if
isinstance
(
arg_0
,
str
)
:
try
:
return
arg_0
.
encode
(
arg_1
,
arg_3
)
except
UnicodeEncodeError
:
return
arg_0
.
encode
(
'utf-8'
,
arg_3
)
elif
not
isinstance
(
arg_0
,
bytes
)
:
try
:
return
str
(
arg_0
)
.
encode
(
arg_1
,
arg_3
)
except
UnicodeEncodeError
:
if
isinstance
(
arg_0
,
Exception
)
:
return
' '
.
join
(
[
Func
(
arg_4
,
arg_1
,
arg_2
,
arg_3
)
for
arg_4
in
arg_0
]
)
return
str
(
arg_0
)
.
encode
(
arg_1
,
arg_3
)
else
:
return
arg_0

def Func(arg_0, arg_1='utf-8', arg_2=False, arg_3='strict'):
    """
    Returns a bytestring version of 's', encoded as specified in 'encoding'.

    If strings_only is True, don't convert (some) non-string-like objects.
    """
    if arg_2 and isinstance(arg_0, (type(None), int)):
        return arg_0
    # if isinstance(s, Promise):
    #     return unicode(s).encode(encoding, errors)
    if isinstance(arg_0, str):
        try:
            return arg_0.encode(arg_1, arg_3)
        except UnicodeEncodeError:
            return arg_0.encode('utf-8', arg_3)
    elif not isinstance(arg_0, bytes):
        try:
            return str(arg_0).encode(arg_1, arg_3)
        except UnicodeEncodeError:
            if isinstance(arg_0, Exception):
                # An Exception subclass containing non-ASCII data that doesn't
                # know how to print itself properly. We shouldn't raise a
                # further exception.
                return ' '.join([Func(arg_4, arg_1, arg_2,
                                           arg_3) for arg_4 in arg_0])
            return str(arg_0).encode(arg_1, arg_3)
    else:
        return arg_0

Returns a bytestring version of s encoded as specified in encoding .


def Func ( arg_0 ) : arg_1 = OrderedDict ( [ ( 'EXAC' , 'Unknown' ) , ( 'ESP' , 'Unknown' ) , ( 'TGP' , 'Unknown' ) ] ) arg_2 = 'Unknown' for arg_3 in arg_1 . keys ( ) : arg_4 = 'AF_' + arg_3 if arg_4 in arg_0 . info : arg_1 [ arg_3 ] = arg_0 . info [ arg_4 ] if arg_2 == 'Unknown' : arg_2 = arg_1 [ arg_3 ] return arg_2 , arg_1

def Func(arg_0):
        """Parse frequency data in ClinVar VCF"""
        arg_1 = OrderedDict([
            ('EXAC', 'Unknown'),
            ('ESP', 'Unknown'),
            ('TGP', 'Unknown')])
        arg_2 = 'Unknown'
        for arg_3 in arg_1.keys():
            arg_4 = 'AF_' + arg_3
            if arg_4 in arg_0.info:
                arg_1[arg_3] = arg_0.info[arg_4]
                if arg_2 == 'Unknown':
                    arg_2 = arg_1[arg_3]
        return arg_2, arg_1


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_0
:
if
not
arg_1
:
print
(
"Found no contacts"
)
sys
.
exit
(
1
)
elif
arg_1
:
arg_2
=
[
]
for
arg_3
in
arg_0
:
if
config
.
display_by_name
(
)
==
"first_name"
:
arg_4
=
arg_3
.
get_first_name_last_name
(
)
else
:
arg_4
=
arg_3
.
get_last_name_first_name
(
)
arg_2
.
append
(
'\t'
.
join
(
[
arg_3
.
get_uid
(
)
,
arg_4
,
arg_3
.
address_book
.
name
]
)
)
print
(
'\n'
.
join
(
arg_2
)
)
else
:
list_contacts
(
arg_0
)

def Func(arg_0, arg_1):
    """Print a user friendly contacts table.

    :param vcard_list: the vcards to print
    :type vcard_list: list of carddav_object.CarddavObject
    :param parsable: machine readable output: columns devided by tabulator (\t)
    :type parsable: bool
    :returns: None
    :rtype: None

    """
    if not arg_0:
        if not arg_1:
            print("Found no contacts")
        sys.exit(1)
    elif arg_1:
        arg_2 = []
        for arg_3 in arg_0:
            if config.display_by_name() == "first_name":
                arg_4 = arg_3.get_first_name_last_name()
            else:
                arg_4 = arg_3.get_last_name_first_name()
            arg_2.append('\t'.join([arg_3.get_uid(), arg_4,
                                                arg_3.address_book.name]))
        print('\n'.join(arg_2))
    else:
        list_contacts(arg_0)


def Func ( arg_0 , arg_1 ) : arg_2 = None if isinstance ( arg_1 , basestring ) : if arg_1 == 'sum' : arg_3 = _aggr_sum elif arg_1 == 'first' : arg_3 = _aggr_first elif arg_1 == 'last' : arg_3 = _aggr_last elif arg_1 == 'mean' : arg_3 = _aggr_mean elif arg_1 == 'max' : arg_3 = max elif arg_1 == 'min' : arg_3 = min elif arg_1 == 'mode' : arg_3 = _aggr_mode elif arg_1 . startswith ( 'wmean:' ) : arg_3 = _aggr_weighted_mean arg_4 = arg_1 [ 6 : ] arg_2 = [ f [ 0 ] for f in arg_0 . _inputFields ] . index ( arg_4 ) else : arg_3 = arg_1 return ( arg_3 , arg_2 )

def Func(arg_0, arg_1):
    """ Given the name of an aggregation function, returns the function pointer
    and param.

    Parameters:
    ------------------------------------------------------------------------
    funcName:  a string (name of function) or funcPtr
    retval:   (funcPtr, param)
    """

    arg_2 = None
    if isinstance(arg_1, basestring):
      if arg_1 == 'sum':
        arg_3 = _aggr_sum
      elif arg_1 == 'first':
        arg_3 = _aggr_first
      elif arg_1 == 'last':
        arg_3 = _aggr_last
      elif arg_1 == 'mean':
        arg_3 = _aggr_mean
      elif arg_1 == 'max':
        arg_3 = max
      elif arg_1 == 'min':
        arg_3 = min
      elif arg_1 == 'mode':
        arg_3 = _aggr_mode
      elif arg_1.startswith('wmean:'):
        arg_3 = _aggr_weighted_mean
        arg_4 = arg_1[6:]
        arg_2 = [f[0] for f in arg_0._inputFields].index(arg_4)
    else:
      arg_3 = arg_1

    return (arg_3, arg_2)

Given the name of an aggregation function returns the function pointer and param .


def Func(arg_0):
        """Returns the Slack argument parser."""

        arg_1 = BackendCommandArgumentParser(arg_0.BACKEND.CATEGORIES,
                                              from_date=True,
                                              token_auth=True,
                                              archive=True)

        # Backend token is required
        arg_2 = arg_1.parser._option_string_actions['--api-token']
        arg_2.required = True

        # Slack options
        arg_4 = arg_1.parser.add_argument_group('Slack arguments')
        arg_4.add_argument('--max-items', dest='max_items',
                           type=int, default=MAX_ITEMS,
                           help="Maximum number of items requested on the same query")

        # Required arguments
        arg_1.parser.add_argument('channel',
                                   help="Slack channel identifier")

        return arg_1


def Func(arg_0, arg_1, arg_2=None):
    """LEVUP  One step forward Levinson recursion

    :param acur:
    :param knxt:
    :return:
        * anxt the P+1'th order prediction polynomial based on the P'th order prediction polynomial, acur, and the
          P+1'th order reflection coefficient, Knxt.
        * enxt the P+1'th order prediction  prediction error, based on the P'th order prediction error, ecur.

    :References:  P. Stoica R. Moses, Introduction to Spectral Analysis  Prentice Hall, N.J., 1997, Chapter 3.
    """
    if arg_0[0] != 1:
        raise ValueError('At least one of the reflection coefficients is equal to one.')
    arg_0 = arg_0[1:] #  Drop the leading 1, it is not needed

    # Matrix formulation from Stoica is used to avoid looping
    arg_3 = numpy.concatenate((arg_0, [0])) + arg_1 * numpy.concatenate((numpy.conj(arg_0[-1::-1]), [1]))

    arg_4 = None
    if arg_2 is not None:
        # matlab version enxt = (1-knxt'.*knxt)*ecur
        arg_4 = (1. - numpy.dot(numpy.conj(arg_1), arg_1)) * arg_2

    arg_3 = numpy.insert(arg_3, 0, 1)

    return arg_3, arg_4