def Func ( arg_0 , arg_1 ) : arg_2 = images . Func ( arg_0 . source_image . name , arg_1 , arg_0 . metadata_backend , arg_0 . storage ) return arg_2

def Func(arg_0, arg_1):
        """
        Creates and return a thumbnail of a given size.
        """
        arg_2 = images.Func(arg_0.source_image.name, arg_1,
                                  arg_0.metadata_backend, arg_0.storage)
        return arg_2

Creates and return a thumbnail of a given size .


(self, bucket_name, object_name, filename=None)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Get a file from Google Cloud Storage.

        :param bucket_name: The bucket to fetch from.
        :type bucket_name: str
        :param object_name: The object to fetch.
        :type object_name: str
        :param filename: If set, a local file path where the file should be written to.
        :type filename: str
        """
        arg_4 = arg_0.get_conn()
        arg_5 = arg_4.get_bucket(arg_1)
        arg_6 = arg_5.blob(blob_name=arg_2)

        if arg_3:
            arg_6.Func_to_filename(arg_3)
            arg_0.log.info('File Funced to %s', arg_3)

        return arg_6.Func_as_string()


def Func ( arg_0 , arg_1 ) : if not arg_0 . _registered : arg_0 . logger . info ( 'Registered' ) arg_0 . _registered = True for arg_3 in arg_0 . _out_buffer : arg_0 . send ( arg_3 ) arg_0 . _out_buffer = [ ]

def Func(arg_0, arg_1):
        """\
        When the connection to the server is registered, send all pending
        data.
        """
        if not arg_0._registered:
            arg_0.logger.info('Registered')
            arg_0._registered = True
            for arg_3 in arg_0._out_buffer:
                arg_0.send(arg_3)
            arg_0._out_buffer = []

\ When the connection to the server is registered send all pending data .


def Func ( arg_0 , arg_1 ) : if not os . path . splitext ( arg_1 ) [ 1 ] [ 1 : ] in arg_0 . suffixes_to_compress : return False arg_2 = None arg_3 = None arg_4 = '{}.{}' . format ( arg_1 , arg_0 . suffix ) try : arg_2 = os . stat ( arg_1 ) arg_3 = os . stat ( arg_4 ) except OSError : pass if arg_2 and arg_3 : return ( arg_4 if arg_2 . st_mtime > arg_3 . st_mtime else False ) else : return arg_4

def Func(arg_0, arg_1):
        """If the given filename should be compressed, returns the
        compressed filename.

        A file can be compressed if:

        - It is a whitelisted extension
        - The compressed file does not exist
        - The compressed file exists by is older than the file itself

        Otherwise, it returns False.

        """
        if not os.path.splitext(arg_1)[1][1:] in arg_0.suffixes_to_compress:
            return False

        arg_2 = None
        arg_3 = None
        arg_4 = '{}.{}'.format(arg_1, arg_0.suffix)
        try:
            arg_2 = os.stat(arg_1)
            arg_3 = os.stat(arg_4)
        except OSError:  # FileNotFoundError is for Python3 only
            pass

        if arg_2 and arg_3:
            return (arg_4
                    if arg_2.st_mtime > arg_3.st_mtime
                    else False)
        else:
            return arg_4

If the given filename should be compressed returns the compressed filename .


def Func(arg_0, arg_1, arg_2):
    """
    Parses a nextflow trace file, searches for processes with a specific tag
    and sends a JSON report with the relevant information

    The expected fields for the trace file are::

        0. task_id
        1. process
        2. tag
        3. status
        4. exit code
        5. start timestamp
        6. container
        7. cpus
        8. duration
        9. realtime
        10. queue
        11. cpu percentage
        12. memory percentage
        13. real memory size of the process
        14. virtual memory size of the process

    Parameters
    ----------
    trace_file : str
        Path to the nextflow trace file
    """

    # Determine the path of the stored JSON for the sample_id
    arg_3 = ".stats.json"
    arg_4 = join(arg_2, arg_0 + arg_3)
    arg_5 = join(arg_2, arg_1)

    logger.info("Starting pipeline status routine")

    logger.debug("Checking for previous pipeline status data")
    arg_6 = get_previous_stats(arg_4)
    logger.info("Stats JSON object set to : {}".format(arg_6))

    # Search for this substring in the tags field. Only lines with this
    # tag will be processed for the reports
    arg_7 = " getStats"
    logger.debug("Tag variable set to: {}".format(arg_7))

    logger.info("Starting parsing of trace file: {}".format(arg_5))
    with open(arg_5) as fh:

        arg_8 = next(fh).strip().split()
        logger.debug("Header set to: {}".format(arg_8))

        for arg_9 in fh:
            arg_10 = arg_9.strip().split("\t")
            # Check if tag substring is in the tag field of the nextflow trace
            if arg_7 in arg_10[2] and arg_10[3] == "COMPLETED":
                logger.debug(
                    "Parsing trace line with COMPLETED status: {}".format(
                        arg_9))
                arg_11 = get_json_info(arg_10, arg_8)

                arg_6[arg_10[0]] = arg_11
            else:
                logger.debug(
                    "Ignoring trace line without COMPLETED status"
                    " or stats specific tag: {}".format(
                        arg_9))

    with open(join(arg_4), "w") as fh, open(".report.json", "w") as rfh:
        fh.write(json.dumps(arg_6, separators=(",", ":")))
        rfh.write(json.dumps(arg_6, separators=(",", ":")))

Parses a nextflow trace file searches for processes with a specific tag and sends a JSON report with the relevant information


def Func(arg_0, arg_1):
        """Clean MARCXML harvested from OAI.

        Allows the xml to be used with BibUpload or BibRecord.

        :param xml: either XML as a string or path to an XML file

        :return: ElementTree of clean data
        """
        try:
            if os.path.isfile(arg_1):
                arg_2 = ET.parse(arg_1)
                arg_3 = arg_2.getroot()
            else:
                arg_3 = ET.fromstring(arg_1)
        except Exception, e:
            arg_0.logger.error("Could not read OAI XML, aborting filter!")
            raise e
        strip_xml_namespace(arg_3)
        return arg_3


def Func(arg_0, arg_1, arg_2, arg_3):
        """Do a pass and its "requires".

        Args:
            pass_ (BasePass): Pass to do.
            dag (DAGCircuit): The dag on which the pass is ran.
            options (dict): PassManager options.
        Returns:
            DAGCircuit: The transformed dag in case of a transformation pass.
            The same input dag in case of an analysis pass.
        Raises:
            TranspilerError: If the pass is not a proper pass instance.
        """

        # First, do the requires of pass_
        if not arg_3["ignore_requires"]:
            for arg_4 in arg_1.requires:
                arg_2 = arg_0.Func(arg_4, arg_2, arg_3)

        # Run the pass itself, if not already run
        if arg_1 not in arg_0.valid_passes:
            if arg_1.is_transformation_pass:
                arg_1.property_set = arg_0.fenced_property_set
                arg_6 = arg_1.run(arg_2)
                if not isinstance(arg_6, DAGCircuit):
                    raise TranspilerError("Transformation passes should return a transformed dag."
                                          "The pass %s is returning a %s" % (type(arg_1).__name__,
                                                                             type(arg_6)))
                arg_2 = arg_6
            elif arg_1.is_analysis_pass:
                arg_1.property_set = arg_0.property_set
                arg_1.run(FencedDAGCircuit(arg_2))
            else:
                raise TranspilerError("I dont know how to handle this type of pass")

            # update the valid_passes property
            arg_0._update_valid_passes(arg_1, arg_3['ignore_preserves'])

        return arg_2


def Func ( arg_0 , arg_1 ) : arg_2 = '' if arg_1 : arg_2 = arg_1 . pop ( 0 ) if len ( arg_2 ) > arg_0 . right_panel_width : arg_3 = arg_0 . markup . clean_markup ( arg_2 ) if len ( arg_3 ) > arg_0 . right_panel_width : arg_2 = arg_2 [ : arg_0 . right_panel_width ] + arg_0 . markup . RESET return arg_2

def Func(arg_0, arg_1):
        '''        Gets next line for right panel        '''
        arg_2 = ''
        if arg_1:
            arg_2 = arg_1.pop(0)
            if len(arg_2) > arg_0.right_panel_width:
                arg_3 = arg_0.markup.clean_markup(arg_2)
                if len(arg_3) > arg_0.right_panel_width:
                    arg_2 = arg_2[:arg_0.right_panel_width] + arg_0.markup.RESET
        return arg_2


def Func(arg_0, arg_1):
    "Chop list_ into n chunks. Returns a list."
    # could look into itertools also, might be implemented there
    arg_2 = len(arg_0)
    arg_3 = arg_2 // arg_1
    if arg_3 == 0:
        return [arg_0]
    arg_4 = []
    for arg_5 in range(arg_1):
        arg_6 = arg_5 * arg_3
        arg_7 = (arg_5+1) * arg_3
        if arg_5 == (arg_1 - 1):
        # make sure we get all items, let last worker do a litte more
            arg_7 = arg_2
        arg_4.append(arg_0[arg_6:arg_7])
    return arg_4

Chop list_ into n chunks . Returns a list .


def Func ( arg_0 , arg_1 ) : if arg_0 . is_excluded ( arg_1 ) : return True return matches_masks ( arg_1 . name , ALWAYS_EXCLUDED_DIRS )

def Func(arg_0, arg_1):
        """
        Determines whether or not the specified directory is excluded by the
        project's configuration.

        :param path: the path to check
        :type path: pathlib.Path
        :rtype: bool
        """

        if arg_0.is_excluded(arg_1):
            return True
        return matches_masks(arg_1.name, ALWAYS_EXCLUDED_DIRS)

Determines whether or not the specified directory is excluded by the project s configuration .


(fmin, fmax, sr=22050, length=None, duration=None, linear=False, phi=None)

return scipy.signal.chirp(
        np.arange(duration, step=period),
        fmin,
        duration,
        fmax,
        method=method,
        phi=phi / np.pi * 180,  # scipy.signal.chirp uses degrees for phase offset
    )

def Func(arg_0, arg_1, arg_2=22050, arg_3=None, arg_4=None, arg_5=False, arg_6=None):
    """Returns a Func signal that goes from frequency `fmin` to frequency `fmax`

    Parameters
    ----------
    fmin : float > 0
        initial frequency

    fmax : float > 0
        final frequency

    sr : number > 0
        desired sampling rate of the output signal

    length : int > 0
        desired number of samples in the output signal.
        When both `duration` and `length` are defined, `length` would take priority.

    duration : float > 0
        desired duration in seconds.
        When both `duration` and `length` are defined, `length` would take priority.

    linear : boolean
        - If `True`, use a linear sweep, i.e., frequency changes linearly with time
        - If `False`, use a exponential sweep.
        Default is `False`.

    phi : float or None
        phase offset, in radians.
        If unspecified, defaults to `-np.pi * 0.5`.

    Returns
    -------
    Func_signal : np.ndarray [shape=(length,), dtype=float64]
        Synthesized Func signal

    Raises
    ------
    ParameterError
        - If either `fmin` or `fmax` are not provided.
        - If neither `length` nor `duration` are provided.

    See Also
    --------
    scipy.signal.Func

    Examples
    --------
    >>> # Generate a exponential Func from A4 to A5
    >>> exponential_Func = librosa.Func(440, 880, duration=1)

    >>> # Or generate the same signal using `length`
    >>> exponential_Func = librosa.Func(440, 880, sr=22050, length=22050)

    >>> # Or generate a linear Func instead
    >>> linear_Func = librosa.Func(440, 880, duration=1, linear=True)

    Display spectrogram for both exponential and linear Funcs

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> S_exponential = librosa.feature.melspectrogram(y=exponential_Func)
    >>> ax = plt.subplot(2,1,1)
    >>> librosa.display.specshow(librosa.power_to_db(S_exponential, ref=np.max),
    ...                          x_axis='time', y_axis='mel')
    >>> plt.subplot(2,1,2, sharex=ax)
    >>> S_linear = librosa.feature.melspectrogram(y=linear_Func)
    >>> librosa.display.specshow(librosa.power_to_db(S_linear, ref=np.max),
    ...                          x_axis='time', y_axis='mel')
    >>> plt.tight_layout()
    """

    if arg_0 is None or arg_1 is None:
        raise ParameterError('both "fmin" and "fmax" must be provided')

    # Compute signal duration
    arg_7 = 1.0 / arg_2
    if arg_3 is None:
        if arg_4 is None:
            raise ParameterError('either "length" or "duration" must be provided')
    else:
        arg_4 = arg_7 * arg_3

    if arg_6 is None:
        arg_6 = -np.pi * 0.5

    arg_8 = 'linear' if arg_5 else 'logarithmic'
    return scipy.signal.Func(
        np.arange(arg_4, step=arg_7),
        arg_0,
        arg_4,
        arg_1,
        arg_8=arg_8,
        arg_6=arg_6 / np.pi * 180,  # scipy.signal.Func uses degrees for phase offset
    )

Returns a chirp signal that goes from frequency `fmin` to frequency `fmax`

    Parameters
    ----------
    fmin : float > 0
        initial frequency

    fmax : float > 0
        final frequency

    sr : number > 0
        desired sampling rate of the output signal

    length : int > 0
        desired number of samples in the output signal.
        When both `duration` and `length` are defined, `length` would take priority.

    duration : float > 0
        desired duration in seconds.
        When both `duration` and `length` are defined, `length` would take priority.

    linear : boolean
        - If `True`, use a linear sweep, i.e., frequency changes linearly with time
        - If `False`, use a exponential sweep.
        Default is `False`.

    phi : float or None
        phase offset, in radians.
        If unspecified, defaults to `-np.pi * 0.5`.

    Returns
    -------
    chirp_signal : np.ndarray [shape=(length,), dtype=float64]
        Synthesized chirp signal

    Raises
    ------
    ParameterError
        - If either `fmin` or `fmax` are not provided.
        - If neither `length` nor `duration` are provided.

    See Also
    --------
    scipy.signal.chirp

    Examples
    --------
    >>> # Generate a exponential chirp from A4 to A5
    >>> exponential_chirp = librosa.chirp(440, 880, duration=1)

    >>> # Or generate the same signal using `length`
    >>> exponential_chirp = librosa.chirp(440, 880, sr=22050, length=22050)

    >>> # Or generate a linear chirp instead
    >>> linear_chirp = librosa.chirp(440, 880, duration=1, linear=True)

    Display spectrogram for both exponential and linear chirps

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> S_exponential = librosa.feature.melspectrogram(y=exponential_chirp)
    >>> ax = plt.subplot(2,1,1)
    >>> librosa.display.specshow(librosa.power_to_db(S_exponential, ref=np.max),
    ...                          x_axis='time', y_axis='mel')
    >>> plt.subplot(2,1,2, sharex=ax)
    >>> S_linear = librosa.feature.melspectrogram(y=linear_chirp)
    >>> librosa.display.specshow(librosa.power_to_db(S_linear, ref=np.max),
    ...                          x_axis='time', y_axis='mel')
    >>> plt.tight_layout()

Returns a chirp signal that goes from frequency fmin to frequency fmax


def Func(arg_0, arg_1):
        """
        This function will extract a single file from the remote zip without downloading
        the entire zip file. The filename argument should match whatever is in the 'filename'
        key of the tableOfContents.
        """
        arg_2 = [x for x in arg_0.tableOfContents if x['filename'] == arg_1]
        if len(arg_2) == 0:
            raise FileNotFoundException()

        arg_3 = arg_2[0]

        # got here? need to fetch the file size
        arg_4 = 1024  # should be enough
        arg_5 = urllib2.Request(arg_0.zipURI)
        arg_6 = arg_3['filestart']
        arg_7 = arg_3['filestart'] + arg_3['compressedsize'] + arg_4
        arg_5.headers['Range'] = "bytes=%s-%s" % (arg_6, arg_7)
        arg_9 = urllib2.urlopen(arg_5)

        # make sure the response is ranged
        arg_10 = arg_9.headers.get('Content-Range')
        if arg_10 != "bytes %d-%d/%s" % (arg_6, arg_7, arg_0.filesize):
            raise Exception("Ranged requests are not supported for this URI")

        arg_11 = arg_9.read()

        # find start of raw file data
        arg_12 = unpack("H", arg_11[26:28])[0]
        arg_13 = unpack("H", arg_11[28:30])[0]

        # check compressed size
        arg_14 = bool(unpack("H", arg_11[6:8])[0] & 8)
        arg_15 = unpack("I", arg_11[18:22])[0]
        if arg_15 == 0 and arg_14:
            # assume compressed size in the Central Directory is correct
            arg_15 = arg_3['compressedsize']
        elif arg_15 != arg_3['compressedsize']:
            raise Exception("Something went wrong. Directory and file header disagree of compressed file size")

        arg_16 = arg_11[30 + arg_12 + arg_13: 30 + arg_12 + arg_13 + arg_15]
        arg_17 = ""

        # can't decompress if stored without compression
        arg_18 = unpack("H", arg_11[8:10])[0]
        if arg_18 == 0:
          return arg_16

        arg_19 = zlib.decompressobj(-zlib.MAX_WBITS)
        for arg_20 in arg_16:
            arg_21 = arg_19.decompress(arg_20)
            if arg_21:
                arg_17 = arg_17 + arg_21

        return arg_17

This function will extract a single file from the remote zip without downloading the entire zip file . The filename argument should match whatever is in the filename key of the tableOfContents .


(self, sql, params, raw=True, output=False)

def Func(arg_0, arg_1, arg_2, arg_3=True, arg_4=False):
        """Prepares and runs an SQL query for the history database.

        Parameters
        ----------
        sql : str
          Any filtering expressions to go after SELECT ... FROM ...
        params : tuple
          Parameters passed to the SQL query (to replace "?")
        raw, output : bool
          See :meth:`get_range`

        Returns
        -------
        Tuples as :meth:`get_range`
        """
        arg_5 = 'source_raw' if arg_3 else 'source'
        arg_6 = "history"
        if arg_4:
            arg_6 = "history LEFT JOIN output_history USING (session, line)"
            arg_5 = "history.%s, output_history.output" % arg_5
        arg_7 = arg_0.db.execute("SELECT session, line, %s FROM %s " %\
                                (arg_5, arg_6) + arg_1, arg_2)
        if arg_4:    # Regroup into 3-tuples, and parse JSON
            return ((arg_8, arg_9, (arg_10, arg_11)) for arg_8, arg_9, arg_10, arg_11 in arg_7)
        return arg_7

Prepares and runs an SQL query for the history database .


Input text, short or long. Writes in order, within the defined page boundaries. Sequential add_text commands will print without
            additional whitespace.

(self, text, cursor=None, justification=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
)
:
if
arg_2
is
:
arg_2
=
arg_0
.
page
.
cursor
arg_1
=
re
.
sub
(
"\s\s+"
,
" "
,
arg_1
)
if
arg_3
is
:
arg_3
=
arg_0
.
justification
if
'\n'
in
arg_1
:
arg_4
=
arg_1
.
split
(
'\n'
)
for
arg_1
in
arg_4
:
PDFText
(
arg_0
.
session
,
arg_0
.
page
,
arg_1
,
arg_0
.
font
,
arg_0
.
text_color
,
arg_2
,
arg_3
,
arg_0
.
double_spacing
)
arg_0
.
add_newline
(
)
else
:
PDFText
(
arg_0
.
session
,
arg_0
.
page
,
arg_1
,
arg_0
.
font
,
arg_0
.
text_color
,
arg_2
,
arg_3
,
arg_0
.
double_spacing
)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """ Input text, short or long. Writes in order, within the defined page boundaries. Sequential Func commands will print without
            additional whitespace. """
        if arg_2 is None:
            arg_2 = arg_0.page.cursor

        arg_1 = re.sub("\s\s+" , " ", arg_1)

        if arg_3 is None:
            arg_3 = arg_0.justification

        if '\n' in arg_1:
            arg_4 = arg_1.split('\n')
            for arg_1 in arg_4:
                PDFText(arg_0.session, arg_0.page, arg_1, arg_0.font, arg_0.text_color, arg_2, arg_3, arg_0.double_spacing)
                arg_0.add_newline()
        else:
            PDFText(arg_0.session, arg_0.page, arg_1, arg_0.font, arg_0.text_color, arg_2, arg_3, arg_0.double_spacing)

Input text short or long . Writes in order within the defined page boundaries . Sequential add_text commands will print without additional whitespace .


Run a function, catch, report and discard exceptions

def Func ( arg_0 , * arg_1 , ** arg_2 ) : try : arg_0 ( * arg_1 , ** arg_2 ) except Exception : traceback . print_exc ( )

def Func(arg_0, *arg_1, **arg_2):
    """Run a function, catch, Func and discard exceptions"""
    try:
        arg_0(*arg_1, **arg_2)
    except Exception:
        traceback.print_exc()

Run a function catch report and discard exceptions


def Func ( arg_0 , arg_1 = None ) : arg_2 = { } for arg_3 , arg_4 in arg_0 . _meta . specs . items ( ) : arg_5 = getattr ( arg_0 , arg_3 ) if isinstance ( arg_5 , Color ) : print "COLOR" , arg_5 , arg_5 . default if arg_5 . default : arg_5 = None if arg_5 is not None : arg_2 [ arg_3 ] = arg_5 del arg_2 [ 'parent' ] arg_6 = wx . NewId ( ) arg_2 [ 'id' ] = arg_6 arg_2 [ 'name' ] = "%s_%s" % ( arg_2 [ 'name' ] , arg_6 ) arg_7 = arg_0 . __class__ ( arg_1 or arg_0 . get_parent ( ) , ** arg_2 ) for arg_8 in arg_0 : arg_8 . Func ( arg_7 ) return arg_7

def Func(arg_0, arg_1=None):
        "Create a new object exactly similar to self"
        arg_2 = {}
        for arg_3, arg_4 in arg_0._meta.specs.items():
            arg_5 = getattr(arg_0, arg_3)
            if isinstance(arg_5, Color):
                print "COLOR", arg_5, arg_5.default
                if arg_5.default:
                    arg_5 = None
            if arg_5 is not None:
                arg_2[arg_3] = arg_5
        del arg_2['parent']
        arg_6 = wx.NewId()
        arg_2['id'] = arg_6
        arg_2['name'] = "%s_%s" % (arg_2['name'], arg_6)
        arg_7 = arg_0.__class__(arg_1 or arg_0.get_parent(), **arg_2)
        # recursively create a copy of each child (in the new parent!)
        for arg_8 in arg_0:
            arg_8.Func(arg_7)
        return arg_7


def Func(arg_0, arg_1, arg_2):
        """
        Add Func to command line.
        """
        super(Coverage, arg_0).Func(arg_1, arg_2)
        arg_1.add_option("--cover-package", action="append",
                          default=arg_2.get('NOSE_COVER_PACKAGE'),
                          metavar="PACKAGE",
                          dest="cover_packages",
                          help="Restrict coverage output to selected packages "
                          "[NOSE_COVER_PACKAGE]")
        arg_1.add_option("--cover-erase", action="store_true",
                          default=arg_2.get('NOSE_COVER_ERASE'),
                          dest="cover_erase",
                          help="Erase previously collected coverage "
                          "statistics before run")
        arg_1.add_option("--cover-tests", action="store_true",
                          dest="cover_tests",
                          default=arg_2.get('NOSE_COVER_TESTS'),
                          help="Include test modules in coverage report "
                          "[NOSE_COVER_TESTS]")
        arg_1.add_option("--cover-min-percentage", action="store",
                          dest="cover_min_percentage",
                          default=arg_2.get('NOSE_COVER_MIN_PERCENTAGE'),
                          help="Minimum percentage of coverage for tests"
                          "to pass [NOSE_COVER_MIN_PERCENTAGE]")
        arg_1.add_option("--cover-inclusive", action="store_true",
                          dest="cover_inclusive",
                          default=arg_2.get('NOSE_COVER_INCLUSIVE'),
                          help="Include all python files under working "
                          "directory in coverage report.  Useful for "
                          "discovering holes in test coverage if not all "
                          "files are imported by the test suite. "
                          "[NOSE_COVER_INCLUSIVE]")
        arg_1.add_option("--cover-html", action="store_true",
                          default=arg_2.get('NOSE_COVER_HTML'),
                          dest='cover_html',
                          help="Produce HTML coverage information")
        arg_1.add_option('--cover-html-dir', action='store',
                          default=arg_2.get('NOSE_COVER_HTML_DIR', 'cover'),
                          dest='cover_html_dir',
                          metavar='DIR',
                          help='Produce HTML coverage information in dir')
        arg_1.add_option("--cover-branches", action="store_true",
                          default=arg_2.get('NOSE_COVER_BRANCHES'),
                          dest="cover_branches",
                          help="Include branch coverage in coverage report "
                          "[NOSE_COVER_BRANCHES]")
        arg_1.add_option("--cover-xml", action="store_true",
                          default=arg_2.get('NOSE_COVER_XML'),
                          dest="cover_xml",
                          help="Produce XML coverage information")
        arg_1.add_option("--cover-xml-file", action="store",
                          default=arg_2.get('NOSE_COVER_XML_FILE', 'coverage.xml'),
                          dest="cover_xml_file",
                          metavar="FILE",
                          help="Produce XML coverage information in file")


def Func ( arg_0 ) : arg_0 . trace_info = defaultdict ( list ) arg_0 . process_tags = { } arg_0 . process_stats = { } arg_0 . samples = [ ] arg_0 . stored_ids = [ ] arg_0 . stored_log_ids = [ ] arg_0 . time_start = None arg_0 . time_stop = None arg_0 . execution_command = None arg_0 . nextflow_version = None arg_0 . abort_cause = None arg_0 . _c = 0 for arg_13 in arg_0 . processes . values ( ) : arg_13 [ "barrier" ] = "W" for arg_14 in [ "submitted" , "finished" , "failed" , "retry" ] : arg_13 [ arg_14 ] = set ( )

def Func(arg_0):
        """Clears inspect attributes when re-executing a pipeline"""

        arg_0.trace_info = defaultdict(list)
        arg_0.process_tags = {}
        arg_0.process_stats = {}
        arg_0.samples = []
        arg_0.stored_ids = []
        arg_0.stored_log_ids = []
        arg_0.time_start = None
        arg_0.time_stop = None
        arg_0.execution_command = None
        arg_0.nextflow_version = None
        arg_0.abort_cause = None
        arg_0._c = 0
        # Clean up of tag running status
        for arg_13 in arg_0.processes.values():
            arg_13["barrier"] = "W"
            for arg_14 in ["submitted", "finished", "failed", "retry"]:
                arg_13[arg_14] = set()

Clears inspect attributes when re - executing a pipeline


def Func ( arg_0 ) : arg_0 . history_manager = HistoryManager ( shell = arg_0 , config = arg_0 . config ) arg_0 . configurables . append ( arg_0 . history_manager )

def Func(arg_0):
        """Sets up the command history, and starts regular autosaves."""
        arg_0.history_manager = HistoryManager(shell=arg_0, config=arg_0.config)
        arg_0.configurables.append(arg_0.history_manager)

Sets up the command history and starts regular autosaves .


def Func(arg_0, arg_1=None, arg_2=False):
        """
        A generator yielding Func of this node.

        :param name: If specified, only consider elements with this tag name
        :param reverse: If ``True``, Func will be yielded in reverse declaration order
        """
        arg_3 = arg_0._Func
        if arg_2:
            arg_3 = reversed(arg_3)
        for arg_4 in arg_3:
            if arg_1 is None or arg_4.tagname == arg_1:
                yield arg_4

A generator yielding children of this node.

        :param name: If specified, only consider elements with this tag name
        :param reverse: If ``True``, children will be yielded in reverse declaration order

A generator yielding children of this node .


def Func ( arg_0 ) : arg_1 = arg_0 . _meta . get_fields ( ) arg_2 = [ ] for arg_3 in arg_1 : if hasattr ( arg_3 , "verbose_name" ) : arg_2 . append ( ( arg_3 . name , arg_3 . verbose_name ) ) class ModelFieldsForm ( forms . Form ) : arg_1 = forms . MultipleChoiceField ( arg_2 = arg_2 , required = False , ) return ModelFieldsForm

def Func(arg_0):
    ''' Creates a form for specifying fields from a model to display. '''

    arg_1 = arg_0._meta.get_fields()

    arg_2 = []
    for arg_3 in arg_1:
        if hasattr(arg_3, "verbose_name"):
            arg_2.append((arg_3.name, arg_3.verbose_name))

    class ModelFieldsForm(forms.Form):
        arg_1 = forms.MultipleChoiceField(
            arg_2=arg_2,
            required=False,
        )

    return ModelFieldsForm

Creates a form for specifying fields from a model to display .


return self.is_attacked_by(self.turn, self.king_squares[self.turn ^ 1])

def Func ( arg_0 ) : return arg_0 . is_attacked_by ( arg_0 . turn , arg_0 . king_squares [ arg_0 . turn ^ 1 ] )

def Func(arg_0):
        '''
        Checks if the king of the other side is attacked. Such a position is not
        valid and could only be reached by an illegal move.
        '''
        return arg_0.is_attacked_by(arg_0.turn, arg_0.king_squares[arg_0.turn ^ 1])

Checks if the king of the other side is attacked . Such a position is not valid and could only be reached by an illegal move .


def Func ( arg_0 , arg_1 ) : arg_2 = BNode ( ) arg_3 = ( arg_2 , RDF . type , arg_0 . spdx_namespace . Checksum ) arg_0 . graph . add ( arg_3 ) arg_4 = ( arg_2 , arg_0 . spdx_namespace . algorithm , Literal ( arg_1 . identifier ) ) arg_0 . graph . add ( arg_4 ) arg_5 = ( arg_2 , arg_0 . spdx_namespace . checksumValue , Literal ( arg_1 . value ) ) arg_0 . graph . add ( arg_5 ) return arg_2

def Func(arg_0, arg_1):
        """
        Return a node representing spdx.checksum.
        """
        arg_2 = BNode()
        arg_3 = (arg_2, RDF.type, arg_0.spdx_namespace.Checksum)
        arg_0.graph.add(arg_3)
        arg_4 = (arg_2, arg_0.spdx_namespace.algorithm, Literal(arg_1.identifier))
        arg_0.graph.add(arg_4)
        arg_5 = (arg_2, arg_0.spdx_namespace.checksumValue, Literal(arg_1.value))
        arg_0.graph.add(arg_5)
        return arg_2

Return a node representing spdx . checksum .


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

def Func(arg_0, arg_1):
        """Get a spotify Func by their ID.

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

Get a spotify artist by their ID.

        Parameters
        ----------
        spotify_id : str
            The spotify_id to search by.


def Func ( arg_0 , arg_1 ) : arg_2 = 0 for arg_3 in arg_0 . joints : arg_3 . Func ( list ( arg_1 [ arg_2 : arg_2 + arg_3 . ADOF ] ) + [ 0 ] * ( 3 - arg_3 . ADOF ) ) arg_2 += arg_3 . ADOF

def Func(arg_0, arg_1):
        '''Add torques for each degree of freedom in the skeleton.

        Parameters
        ----------
        torques : list of float
            A list of the torques to add to each degree of freedom in the
            skeleton.
        '''
        arg_2 = 0
        for arg_3 in arg_0.joints:
            arg_3.Func(
                list(arg_1[arg_2:arg_2+arg_3.ADOF]) + [0] * (3 - arg_3.ADOF))
            arg_2 += arg_3.ADOF

Add torques for each degree of freedom in the skeleton .


def Func():
    """
    Compares the local version against the latest official version on PyPI and displays a warning message if a newer release is available.

    This check can be disabled by setting the environment variable BURLAP_CHECK_VERSION=0.
    """
    global arg_0
    if not arg_0:
        return
    # Ensure we only check once in this process.
    arg_0 = 0
    # Lookup most recent remote version.
    from six.moves.urllib.request import urlopen
    try:
        arg_1 = urlopen("https://pypi.org/pypi/burlap/json")
        arg_2 = json.loads(arg_1.read().decode())
        arg_3 = sorted(tuple(map(int, _.split('.'))) for _ in arg_2['releases'].keys())[-1]
        arg_4 = '.'.join(map(str, arg_3))
        arg_5 = VERSION
        arg_6 = '.'.join(map(str, arg_5))
        # Display warning.
        if arg_3 > arg_5:
            print('\033[93m')
            print("You are using burlap version %s, however version %s is available." % (arg_6, arg_4))
            print("You should consider upgrading via the 'pip install --upgrade burlap' command.")
            print('\033[0m')
    except Exception as exc:
        print('\033[93m')
        print("Unable to check for updated burlap version: %s" % exc)
        print('\033[0m')

Compares the local version against the latest official version on PyPI and displays a warning message if a newer release is available .


(s, tile, data_vmin='calc', data_vmax='calc',
         res_vmin=-0.1, res_vmax=0.1, edgepts='calc', do_imshow=True,
         data_cmap=plt.cm.bone, res_cmap=plt.cm.RdBu)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
'calc'
,
arg_3
=
'calc'
,
arg_4
=
0.1
,
arg_5
=
0.1
,
arg_6
=
'calc'
,
arg_7
=
True
,
arg_8
=
arg_9
.
cm
.
bone
,
arg_12
=
arg_9
.
cm
.
RdBu
)
:
arg_14
=
arg_0
.
residuals
[
arg_1
.
slicer
]
.
squeeze
(
)
arg_15
=
arg_0
.
data
[
arg_1
.
slicer
]
.
squeeze
(
)
arg_16
=
arg_0
.
model
[
arg_1
.
slicer
]
.
squeeze
(
)
if
arg_15
.
ndim
!=
2
:
raise
ValueError
(
'tile does not give a 2D slice'
)
arg_17
=
np
.
zeros
(
[
arg_15
.
shape
[
0
]
,
arg_15
.
shape
[
1
]
,
4
]
)
if
arg_2
==
'calc'
:
arg_2
=
0.5
*
(
arg_15
.
min
(
)
+
arg_16
.
min
(
)
)
if
arg_3
==
'calc'
:
arg_3
=
0.5
*
(
arg_15
.
max
(
)
+
arg_16
.
max
(
)
)
arg_18
,
arg_19
,
arg_20
=
trisect_image
(
arg_17
.
shape
,
arg_6
)
arg_21
=
arg_8
(
center_data
(
arg_16
,
arg_2
,
arg_3
)
)
arg_22
=
arg_8
(
center_data
(
arg_15
,
arg_2
,
arg_3
)
)
arg_23
=
arg_12
(
center_data
(
arg_14
,
arg_4
,
arg_5
)
)
for
arg_24
in
range
(
4
)
:
arg_17
[
:
,
:
,
arg_24
]
[
arg_18
]
=
arg_23
[
:
,
:
,
arg_24
]
[
arg_18
]
arg_17
[
:
,
:
,
arg_24
]
[
arg_19
]
=
arg_21
[
:
,
:
,
arg_24
]
[
arg_19
]
arg_17
[
:
,
:
,
arg_24
]
[
arg_20
]
=
arg_22
[
:
,
:
,
arg_24
]
[
arg_20
]
if
arg_7
:
return
arg_9
.
imshow
(
arg_17
)
else
:
return
arg_17

def Func(arg_0, arg_1, arg_2='calc', arg_3='calc',
         arg_4=-0.1, arg_5=0.1, arg_6='calc', arg_7=True,
         arg_8=arg_9.cm.bone, arg_12=arg_9.cm.RdBu):
    """
    Compare the data, model, and residuals of a state.

    Makes an image of any 2D slice of a state that compares the data,
    model, and residuals. The upper left portion of the image is the raw
    data, the central portion the model, and the lower right portion the
    image. Either plots the image using plt.imshow() or returns a
    np.ndarray of the image pixels for later use.

    Parameters
    ----------
        st : peri.ImageState object
            The state to plot.
        tile : peri.util.Tile object
            The slice of the image to plot. Can be any xy, xz, or yz
            projection, but it must return a valid 2D slice (the slice is
            squeezed internally).

        data_vmin : {Float, `calc`}, optional
            vmin for the imshow for the data and generative model (shared).
            Default is 'calc' = 0.5(data.min() + model.min())
        data_vmax : {Float, `calc`}, optional
            vmax for the imshow for the data and generative model (shared).
            Default is 'calc' = 0.5(data.max() + model.max())
        res_vmin : Float, optional
            vmin for the imshow for the residuals. Default is -0.1
            Default is 'calc' = 0.5(data.min() + model.min())
        res_vmax : Float, optional
            vmax for the imshow for the residuals. Default is +0.1
        edgepts : {Nested list-like, Float, 'calc'}, optional.
            The vertices of the triangles which determine the splitting of
            the image. The vertices are at (image corner, (edge, y), and
            (x,edge), where edge is the appropriate edge of the image.
                edgepts[0] : (x,y) points for the upper edge
                edgepts[1] : (x,y) points for the lower edge
            where `x` is the coordinate along the image's 0th axis and `y`
            along the images 1st axis. Default is 'calc,' which calculates
            edge points by splitting the image into 3 regions of equal
            area. If edgepts is a float scalar, calculates the edge points
            based on a constant fraction of distance from the edge.
        do_imshow : Bool
            If True, imshow's and returns the returned handle.
            If False, returns the array as a [M,N,4] array.
        data_cmap : matplotlib colormap instance
            The colormap to use for the data and model.
        res_cmap : matplotlib colormap instance
            The colormap to use for the residuals.

    Returns
    -------
        image : {matplotlib.pyplot.AxesImage, numpy.ndarray}
            If `do_imshow` == True, the returned handle from imshow.
            If `do_imshow` == False, an [M,N,4] np.ndarray of the image
            pixels.
    """
    # This could be modified to alpha the borderline... or to embiggen
    # the image and slice it more finely
    arg_14 = arg_0.residuals[arg_1.slicer].squeeze()
    arg_15 = arg_0.data[arg_1.slicer].squeeze()
    arg_16 = arg_0.model[arg_1.slicer].squeeze()
    if arg_15.ndim != 2:
        raise ValueError('tile does not give a 2D slice')

    arg_17 = np.zeros([arg_15.shape[0], arg_15.shape[1], 4])
    if arg_2 == 'calc':
        arg_2 = 0.5*(arg_15.min() + arg_16.min())
    if arg_3 == 'calc':
        arg_3 = 0.5*(arg_15.max() + arg_16.max())

    #1. Get masks:
    arg_18, arg_19, arg_20 = trisect_image(arg_17.shape, arg_6)

    #2. Get colorbar'd images
    arg_21 = arg_8(center_data(arg_16, arg_2, arg_3))
    arg_22 = arg_8(center_data(arg_15, arg_2, arg_3))
    arg_23 = arg_12(center_data(arg_14, arg_4, arg_5))

    for arg_24 in range(4):
        arg_17[:,:,arg_24][arg_18] = arg_23[:,:,arg_24][arg_18]
        arg_17[:,:,arg_24][arg_19] = arg_21[:,:,arg_24][arg_19]
        arg_17[:,:,arg_24][arg_20] = arg_22[:,:,arg_24][arg_20]
    if arg_7:
        return arg_9.imshow(arg_17)
    else:
        return arg_17

Compare the data model and residuals of a state .


def Func ( arg_0 , arg_1 = None ) : if arg_1 and arg_1 in genders : arg_0 . gender = arg_1 else : if not arg_0 . chromosomes : arg_0 . set_chromosomes ( ) arg_0 . gender = npchoice ( genders , 1 , p = p_gender [ arg_0 . chromosomes ] ) [ 0 ]

def Func(arg_0, arg_1=None):
        """This model recognizes that sex chromosomes don't always line up with
        gender. Assign M, F, or NB according to the probabilities in p_gender.
        """
        if arg_1 and arg_1 in genders:
            arg_0.gender = arg_1
        else:
            if not arg_0.chromosomes: arg_0.set_chromosomes()
            arg_0.gender = npchoice(genders, 1, p=p_gender[arg_0.chromosomes])[0]

This model recognizes that sex chromosomes don t always line up with gender . Assign M F or NB according to the probabilities in p_gender .


def Func(arg_0):
        """
        Returns the path of the mount point of the current container. If this method is invoked
        outside of a Docker container a NotInsideContainerError is raised. Likewise if the docker
        daemon is unreachable from inside the container a UserError is raised. This method is
        idempotent.
        """
        if arg_0._mount_path is None:
            arg_1 = current_docker_container_id()
            if dockerd_is_reachable():
                # Get name of mounted volume
                arg_2 = json.loads(subprocess.check_output(['docker', 'inspect', arg_1]))
                arg_3 = arg_2[0]['Mounts']
                # Ensure docker.sock is mounted correctly
                arg_4 = [arg_5['Source'] == arg_5['Destination']
                            for arg_5 in arg_3 if 'docker.sock' in arg_5['Source']]
                require(len(arg_4) == 1,
                        'Missing socket mount. Requires the following: '
                         'docker run -v /var/run/docker.sock:/var/run/docker.sock')
                # Ensure formatting of command for 2 mount points
                if len(arg_3) == 2:
                    require(all(arg_5['Source'] == arg_5['Destination'] for arg_5 in arg_3),
                            'Docker Src/Dst mount points, invoked with the -v argument, '
                            'must be the same if only using one mount point aside from the docker '
                            'socket.')
                    arg_6 = [arg_5['Source'] for arg_5 in arg_3 if 'docker.sock' not in arg_5['Source']]
                else:
                    # Ensure only one mirror mount exists aside from docker.sock
                    arg_7 = [arg_5['Source'] for arg_5 in arg_3 if arg_5['Source'] == arg_5['Destination']]
                    arg_6 = [arg_5 for arg_5 in arg_7 if 'docker.sock' not in arg_5]
                    require(len(arg_6) == 1, 'Wrong number of mirror mounts provided, see '
                                                  'documentation.')
                arg_0._mount_path = arg_6[0]
                log.info('The work mount is: %s', arg_0._mount_path)
            else:
                raise UserError('Docker daemon is not reachable, ensure Docker is being run with: '
                                 '"-v /var/run/docker.sock:/var/run/docker.sock" as an argument.')
        return arg_0._mount_path

Returns the path of the mount point of the current container . If this method is invoked outside of a Docker container a NotInsideContainerError is raised . Likewise if the docker daemon is unreachable from inside the container a UserError is raised . This method is idempotent .


(graph: BELGraph, u: BaseEntity, v: BaseEntity)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 , arg_4 : arg_3 ) -> bool : arg_5 = { data [ RELATION ] for data in arg_0 [ arg_2 ] [ arg_4 ] . values ( ) } return relation_set_has_contradictions ( arg_5 )

def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_3) -> bool:
    """Check if a pair of nodes has any contradictions in their causal relationships.

    Assumes both nodes are in the graph.
    """
    arg_5 = {data[RELATION] for data in arg_0[arg_2][arg_4].values()}
    return relation_set_has_contradictions(arg_5)

Check if a pair of nodes has any contradictions in their causal relationships .


def
Func
(
arg_0
=
,
arg_1
=
)
:
if
arg_0
:
arg_1
=
_assert_same_base_type
(
arg_0
,
arg_1
)
if
not
arg_1
:
arg_1
=
tf
.
float32
elif
not
is_floating
(
arg_1
)
:
raise
ValueError
(
'Expected floating point type, got {}.'
.
format
(
arg_1
)
)
return
arg_1

def Func(arg_0=None, arg_1=None):
  """Validate and return float type based on `tensors` and `dtype`.

  For ops such as matrix multiplication, inputs and weights must be of the
  same float type. This function validates that all `tensors` are the same type,
  validates that type is `dtype` (if supplied), and returns the type. Type must
  be a floating point type. If neither `tensors` nor `dtype` is supplied,
  the function will return `dtypes.float32`.

  Args:
    tensors: Tensors of input values. Can include `None` elements, which will
      be ignored.
    dtype: Expected type.

  Returns:
    Validated type.

  Raises:
    ValueError: if neither `tensors` nor `dtype` is supplied, or result is not
      float, or the common type of the inputs is not a floating point type.
  """
  if arg_0:
    arg_1 = _assert_same_base_type(arg_0, arg_1)
  if not arg_1:
    arg_1 = tf.float32
  elif not is_floating(arg_1):
    raise ValueError('Expected floating point type, got {}.'.format(arg_1))
  return arg_1

Validate and return float type based on tensors and dtype .


def Func(arg_0):
        """        Generate phantom tool run config        """
        arg_1 = ''
        arg_2 = ''
        for arg_3 in arg_0.streams:
            arg_1 += arg_3.Func()
            if not arg_3.is_main:
                arg_2 += " " + "benchmark_io%s" % arg_3.sequence_no

        arg_4 = {}
        arg_4['threads'] = arg_0.threads
        arg_4['phantom_log'] = arg_0.phantom_log
        arg_4['stat_log'] = arg_0.stat_log
        arg_4['benchmarks_block'] = arg_1
        arg_4['stat_benchmarks'] = arg_2
        arg_4['additional_libs'] = arg_0.additional_libs
        arg_4['phantom_modules_path'] = arg_0.phantom_modules_path
        arg_5 = arg_0.core.mkstemp(".conf", "phantom_")
        arg_0.core.add_artifact_file(arg_5)
        logger.debug("Generating phantom config: %s", arg_5)
        arg_6 = resource_string(__name__, "config/phantom.conf.tpl")
        arg_7 = string.Template(arg_6)
        arg_8 = arg_7.substitute(arg_4)

        with open(arg_5, 'w') as conffile:
            conffile.write(arg_8)
        return arg_5


def Func ( arg_0 ) : arg_1 = arg_0 . get_argument ( 'filename' , 'dump.prof' ) CProfileWrapper . profiler . dump_stats ( arg_1 ) arg_0 . finish ( )

def Func(arg_0):
        """Dump current profiler statistics into a file."""
        arg_1 = arg_0.get_argument('filename', 'dump.prof')
        CProfileWrapper.profiler.dump_stats(arg_1)
        arg_0.finish()

Dump current profiler statistics into a file .


def Func(arg_0, arg_1, arg_2):
    "Yield every way of extending e with values for all vars."
    if not arg_0:
        yield arg_2
    else:
        arg_3, arg_4 = arg_0[0], arg_0[1:]
        for arg_5 in Func(arg_4, arg_1, arg_2):
            for arg_6 in arg_1.variable_values(arg_3):
                yield extend(arg_5, arg_3, arg_6)

Yield every way of extending e with values for all vars .


def Func ( arg_0 , arg_1 ) : arg_2 = Range . get ( arg_1 , ignore = 404 ) if not arg_2 : arg_2 = Range ( range = arg_1 ) arg_2 . save ( ) return arg_2

def Func(arg_0, arg_1):
        """
            Resolves an ip adres to a range object, creating it if it doesn't exists.
        """
        arg_2 = Range.get(arg_1, ignore=404)
        if not arg_2:
            arg_2 = Range(range=arg_1)
            arg_2.save()
        return arg_2

Resolves an ip adres to a range object creating it if it doesn t exists .


def Func ( arg_0 ) : with pkg_resources . resource_stream ( __name__ , arg_0 ) as resource : for arg_1 in resource : yield arg_1 . decode ( 'utf-8' )

def Func(arg_0):
    """
    Return a stream for a given resource file in the module.

    The resource file has to be part of the module and its filenane given
    relative to the module.
    """
    with pkg_resources.resource_stream(__name__, arg_0) as resource:
        for arg_1 in resource:
            yield arg_1.decode('utf-8')

Return a stream for a given resource file in the module .


(dataset, masks, threshold=0.08, remove_overlap=True,
                           studies=None, features=None,
                           regularization="scale")

def
Func
(
arg_0
,
arg_1
,
arg_2
=
0.08
,
arg_3
=
True
,
arg_4
=
,
arg_5
=
,
arg_6
=
"scale"
)
:
import
nibabel
as
nib
import
os
try
:
arg_7
=
[
nib
.
load
(
os
.
path
.
relpath
(
m
)
)
for
m
in
arg_1
]
except
OSError
:
print
(
'Error loading masks. Check the path'
)
arg_8
=
[
arg_0
.
get_studies
(
mask
=
m
,
activation_threshold
=
arg_2
)
for
m
in
arg_7
]
arg_9
=
reduce
(
lambda
a
,
b
:
a
+
b
,
arg_8
)
if
arg_3
:
import
collections
arg_9
=
[
id
for
(
id
,
count
)
in
collections
.
Counter
(
arg_9
)
.
items
(
)
if
count
==
1
]
arg_8
=
[
[
x
for
x
in
m
if
x
in
arg_9
]
for
m
in
arg_8
]
arg_10
=
[
[
idx
]
*
len
(
ids
)
for
(
idx
,
ids
)
in
enumerate
(
arg_8
)
]
arg_10
=
reduce
(
lambda
a
,
b
:
a
+
b
,
arg_10
)
arg_10
=
np
.
array
(
arg_10
)
arg_11
=
[
arg_0
.
get_feature_data
(
ids
=
group_ids
,
arg_5
=
arg_5
)
for
group_ids
in
arg_8
]
arg_11
=
np
.
vstack
(
tuple
(
arg_11
)
)
if
arg_6
:
arg_11
=
regularize
(
arg_11
,
method
=
arg_6
)
return
(
arg_11
,
arg_10
)

def Func(arg_0, arg_1, arg_2=0.08, arg_3=True,
                           arg_4=None, arg_5=None,
                           arg_6="scale"):
    """ Set up data for a classification task given a set of masks

        Given a set of masks, this function retrieves studies associated with
        each mask at the specified threshold, optionally removes overlap and
        filters by studies and features, and returns studies by feature matrix
        (X) and class labels (y)

        Args:
            dataset: a Neurosynth dataset
            maks: a list of paths to Nifti masks
            threshold: percentage of voxels active within the mask for study
                to be included
            remove_overlap: A boolean indicating if studies studies that
                appear in more than one mask should be excluded
            studies: An optional list of study names used to constrain the set
                used in classification. If None, will use all features in the
                dataset.
            features: An optional list of feature names used to constrain the
                set used in classification. If None, will use all features in
                the dataset.
            regularize: Optional boolean indicating if X should be regularized

        Returns:
            A tuple (X, y) of np arrays.
            X is a feature by studies matrix and y is a vector of class labels
    """

    import nibabel as nib
    import os

    # Load masks using NiBabel

    try:
        arg_7 = [nib.load(os.path.relpath(m)) for m in arg_1]
    except OSError:
        print('Error loading masks. Check the path')

    # Get a list of studies that activate for each mask file--i.e.,  a list of
    # lists

    arg_8 = [arg_0.get_studies(mask=m, activation_threshold=arg_2)
                   for m in arg_7]

    # Flattened ids

    arg_9 = reduce(lambda a, b: a + b, arg_8)

    # Remove duplicates

    if arg_3:
        import collections
        arg_9 = [id for (id, count) in
                    collections.Counter(arg_9).items() if count == 1]
        arg_8 = [[x for x in m if x in arg_9] for m in
                       arg_8]  # Remove

    # Create class label(y)
    arg_10 = [[idx] * len(ids) for (idx, ids) in enumerate(arg_8)]
    arg_10 = reduce(lambda a, b: a + b, arg_10)  # Flatten
    arg_10 = np.array(arg_10)

    # Extract feature set for each class separately
    arg_11 = [arg_0.get_feature_data(ids=group_ids, arg_5=arg_5)
         for group_ids in arg_8]

    arg_11 = np.vstack(tuple(arg_11))

    if arg_6:
        arg_11 = regularize(arg_11, method=arg_6)

    return (arg_11, arg_10)


def Func ( arg_0 , arg_1 ) : with open ( join ( arg_1 , "resources.config" ) , "w" ) as fh : fh . write ( arg_0 . resources ) with open ( join ( arg_1 , "containers.config" ) , "w" ) as fh : fh . write ( arg_0 . containers ) with open ( join ( arg_1 , "params.config" ) , "w" ) as fh : fh . write ( arg_0 . params ) with open ( join ( arg_1 , "manifest.config" ) , "w" ) as fh : fh . write ( arg_0 . manifest ) if not exists ( join ( arg_1 , "user.config" ) ) : with open ( join ( arg_1 , "user.config" ) , "w" ) as fh : fh . write ( arg_0 . user_config ) arg_2 = join ( arg_1 , "lib" ) if not exists ( arg_2 ) : os . makedirs ( arg_2 ) with open ( join ( arg_2 , "Helper.groovy" ) , "w" ) as fh : fh . write ( arg_0 . help ) arg_3 = arg_0 . render_pipeline ( ) with open ( splitext ( arg_0 . nf_file ) [ 0 ] + ".html" , "w" ) as fh : fh . write ( arg_3 )

def Func(arg_0, arg_1):
        """Wrapper method that writes all configuration files to the pipeline
        directory
        """

        # Write resources config
        with open(join(arg_1, "resources.config"), "w") as fh:
            fh.write(arg_0.resources)

        # Write containers config
        with open(join(arg_1, "containers.config"), "w") as fh:
            fh.write(arg_0.containers)

        # Write containers config
        with open(join(arg_1, "params.config"), "w") as fh:
            fh.write(arg_0.params)

        # Write manifest config
        with open(join(arg_1, "manifest.config"), "w") as fh:
            fh.write(arg_0.manifest)

        # Write user config if not present in the project directory
        if not exists(join(arg_1, "user.config")):
            with open(join(arg_1, "user.config"), "w") as fh:
                fh.write(arg_0.user_config)

        arg_2 = join(arg_1, "lib")
        if not exists(arg_2):
            os.makedirs(arg_2)
        with open(join(arg_2, "Helper.groovy"), "w") as fh:
            fh.write(arg_0.help)

        # Generate the pipeline DAG
        arg_3 = arg_0.render_pipeline()
        with open(splitext(arg_0.nf_file)[0] + ".html", "w") as fh:
            fh.write(arg_3)


(self, df_features, df_target, nh=20, idx=0, dropout=0.,
                         activation_function=th.nn.ReLU, lr=0.01, l1=0.1,  batch_size=-1,
                         train_epochs=1000, test_epochs=1000, device=None,
                         verbose=None, nb_runs=3)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 20 , arg_4 = 0 , arg_5 = 0. , arg_6 = arg_7 . nn . ReLU , arg_10 = 0.01 , arg_11 = 0.1 , arg_12 = - 1 , arg_13 = 1000 , arg_14 = 1000 , arg_15 = None , arg_16 = None , arg_17 = 3 ) : arg_15 , arg_16 = SETTINGS . get_default ( ( 'device' , arg_15 ) , ( 'verbose' , arg_16 ) ) arg_18 = arg_7 . FloatTensor ( scale ( arg_1 . values ) ) . to ( arg_15 ) arg_19 = arg_7 . FloatTensor ( scale ( arg_2 . values ) ) . to ( arg_15 ) arg_20 = [ ] for arg_21 in range ( arg_17 ) : arg_22 = FSGNN_model ( [ arg_18 . size ( ) [ 1 ] + 1 , arg_3 , 1 ] , arg_5 = arg_5 , arg_6 = arg_6 ) . to ( arg_15 ) arg_20 . append ( arg_22 . train ( arg_18 , arg_19 , arg_10 = 0.01 , arg_11 = 0.1 , arg_12 = - 1 , arg_13 = arg_13 , arg_14 = arg_14 , arg_15 = arg_15 , arg_16 = arg_16 ) ) return list ( np . mean ( np . array ( arg_20 ) , axis = 0 ) )

def Func(arg_0, arg_1, arg_2, arg_3=20, arg_4=0, arg_5=0.,
                         arg_6=arg_7.nn.ReLU, arg_10=0.01, arg_11=0.1,  arg_12=-1,
                         arg_13=1000, arg_14=1000, arg_15=None,
                         arg_16=None, arg_17=3):
        """For one variable, predict its neighbours.

        Args:
            df_features (pandas.DataFrame):
            df_target (pandas.Series):
            nh (int): number of hidden units
            idx (int): (optional) for printing purposes
            dropout (float): probability of dropout (between 0 and 1)
            activation_function (torch.nn.Module): activation function of the NN
            lr (float): learning rate of Adam
            l1 (float): L1 penalization coefficient
            batch_size (int): batch size, defaults to full-batch
            train_epochs (int): number of train epochs
            test_epochs (int): number of test epochs
            device (str): cuda or cpu device (defaults to ``cdt.SETTINGS.default_device``)
            verbose (bool): verbosity (defaults to ``cdt.SETTINGS.verbose``)
            nb_runs (int): number of bootstrap runs

        Returns:
            list: scores of each feature relatively to the target

        """
        arg_15, arg_16 = SETTINGS.get_default(('device', arg_15), ('verbose', arg_16))
        arg_18 = arg_7.FloatTensor(scale(arg_1.values)).to(arg_15)
        arg_19 = arg_7.FloatTensor(scale(arg_2.values)).to(arg_15)
        arg_20 = []
        for arg_21 in range(arg_17):
            arg_22 = FSGNN_model([arg_18.size()[1] + 1, arg_3, 1],
                                arg_5=arg_5,
                                arg_6=arg_6).to(arg_15)

            arg_20.append(arg_22.train(arg_18, arg_19, arg_10=0.01, arg_11=0.1, arg_12=-1,
                                   arg_13=arg_13, arg_14=arg_14,
                                   arg_15=arg_15, arg_16=arg_16))
        return list(np.mean(np.array(arg_20), axis=0))

For one variable predict its neighbours .


def Func(arg_0, **arg_1):
        """
        Get the primary Funcrmation about a TV season by its season number.

        Args:
            language: (optional) ISO 639 code.
            append_to_response: (optional) Comma separated, any TV series
                                method.

        Returns:
            A dict respresentation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_series_id_season_number_path('Func')

        arg_3 = arg_0._GET(arg_2, arg_1)
        arg_0._set_attrs_to_values(arg_3)
        return arg_3

Get the primary information about a TV season by its season number.

        Args:
            language: (optional) ISO 639 code.
            append_to_response: (optional) Comma separated, any TV series
                                method.

        Returns:
            A dict respresentation of the JSON returned from the API.

Get the primary information about a TV season by its season number .


(context, command_name, general_parser, command_parsers)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
arg_1
==
'for'
:
arg_1
=
'fordo'
with
arg_0
.
io_manager
.
with_stdout
(
)
as
stdout
:
if
not
arg_1
:
arg_2
.
print_help
(
stdout
)
elif
arg_1
in
arg_3
:
arg_3
[
arg_1
]
.
option_parser
.
print_help
(
stdout
)
else
:
raise
ReturnCode
(
'unknown command %r'
%
arg_1
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Outputs help information.

    See :py:mod:`swiftly.cli.help` for context usage information.

    See :py:class:`CLIHelp` for more information.

    :param context: The :py:class:`swiftly.cli.context.CLIContext` to
        use.
    :param command_name: The command_name to output help information
        for, or set to None or an empty string to output the general
        help information.
    :param general_parser: The
        :py:class:`swiftly.cli.optionparser.OptionParser` for general
        usage.
    :param command_parsers: A dict of (name, :py:class:`CLICommand`)
        for specific command usage.
    """
    if arg_1 == 'for':
        arg_1 = 'fordo'
    with arg_0.io_manager.with_stdout() as stdout:
        if not arg_1:
            arg_2.print_help(stdout)
        elif arg_1 in arg_3:
            arg_3[arg_1].option_parser.print_help(stdout)
        else:
            raise ReturnCode('unknown command %r' % arg_1)


return 100 - np.abs(50 - np.mean(q)) / .5

def Func ( arg_0 , arg_1 ) : arg_2 = cum_returns ( arg_0 , starting_value = 1. ) arg_3 = np . cumprod ( arg_1 + 1 , 1 ) arg_4 = [ sp . stats . percentileofscore ( arg_3 [ : , i ] , arg_2 . iloc [ i ] , kind = 'weak' ) for i in range ( len ( arg_2 ) ) ] return 100 - np . abs ( 50 - np . mean ( arg_4 ) ) / .5

def Func(arg_0, arg_1):
    """
    Compute Bayesian consistency score.

    Parameters
    ----------
    returns_test : pd.Series
        Observed cumulative returns.
    preds : numpy.array
        Multiple (simulated) cumulative returns.

    Returns
    -------
    Consistency score
        Score from 100 (returns_test perfectly on the median line of the
        Bayesian cone spanned by preds) to 0 (returns_test completely
        outside of Bayesian cone.)
    """

    arg_2 = cum_returns(arg_0, starting_value=1.)
    arg_3 = np.cumprod(arg_1 + 1, 1)

    arg_4 = [sp.stats.percentileofscore(arg_3[:, i],
                                    arg_2.iloc[i],
                                    kind='weak')
         for i in range(len(arg_2))]
    # normalize to be from 100 (perfect median line) to 0 (completely outside
    # of cone)
    return 100 - np.abs(50 - np.mean(arg_4)) / .5


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
for
arg_3
in
list
(
arg_0
)
:
arg_4
=
arg_1
[
arg_3
]
if
getattr
(
arg_4
,
'_python2_only'
,
False
)
and
(
3
,
0
)
<=
arg_2
:
arg_0
.
discard
(
arg_3
)
logging
.
info
(
"Skipping Python2-only benchmark %s; "
"not compatible with Python %s"
%
(
arg_3
,
arg_2
)
)
continue
return
arg_0

def Func(arg_0, arg_1, arg_2):
    """Filters out benchmarks not supported by both Pythons.

    Args:
        benchmarks: a set() of benchmark names
        bench_funcs: dict mapping benchmark names to functions
        python: the interpereter commands (as lists)

    Returns:
        The filtered set of benchmark names
    """
    for arg_3 in list(arg_0):
        arg_4 = arg_1[arg_3]
        if getattr(arg_4, '_python2_only', False) and (3, 0) <= arg_2:
            arg_0.discard(arg_3)
            logging.info("Skipping Python2-only benchmark %s; "
                         "not compatible with Python %s" % (arg_3, arg_2))
            continue
    return arg_0

Filters out benchmarks not supported by both Pythons .


def Func(arg_0):
    """Parses a file with coverage information into objects.

    This function parses a TSV file containing coverage results for
    all contigs in a given assembly and will build an ``OrderedDict``
    with the information about their coverage and length.  The length
    information is actually gathered from the contig header using a
    regular expression that assumes the usual header produced by Spades::

        contig_len = int(re.search("length_(.+?)_", line).group(1))

    Parameters
    ----------
    coverage_file : str
        Path to TSV file containing the coverage results.

    Returns
    -------
    coverage_dict : OrderedDict
        Contains the coverage and length information for each contig.
    total_size : int
        Total size of the assembly in base pairs.
    total_cov : int
        Sum of coverage values across all contigs.
    """

    # Stores the correspondence between a contig and the corresponding coverage
    # e.g.: {"contig_1": {"cov": 424} }
    arg_1 = OrderedDict()
    # Stores the total coverage
    arg_2 = 0

    with open(arg_0) as fh:
        for arg_3 in fh:
            # Get contig and coverage
            arg_4, arg_5 = arg_3.strip().split()
            arg_1[arg_4] = {"cov": int(arg_5)}
            # Add total coverage
            arg_2 += int(arg_5)
            logger.debug("Processing contig '{}' with coverage '{}'"
                         "".format(arg_4, arg_5))

    return arg_1, arg_2

Parses a file with coverage information into objects .


def Func ( arg_0 ) : try : arg_1 = pool_api . Func ( arg_0 = arg_0 ) except AirflowException as err : _log . error ( err ) arg_2 = jsonify ( error = "{}" . format ( err ) ) arg_2 . status_code = err . status_code return arg_2 else : return jsonify ( arg_1 . to_json ( ) )

def Func(arg_0):
    """Delete pool."""
    try:
        arg_1 = pool_api.Func(arg_0=arg_0)
    except AirflowException as err:
        _log.error(err)
        arg_2 = jsonify(error="{}".format(err))
        arg_2.status_code = err.status_code
        return arg_2
    else:
        return jsonify(arg_1.to_json())


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Copy an account's code to memory"""
        arg_5 = arg_0.world.get_code(arg_1)
        arg_0._allocate(arg_2 + arg_4)

        for arg_6 in range(arg_4):
            if arg_3 + arg_6 < len(arg_5):
                arg_0._store(arg_2 + arg_6, arg_5[arg_3 + arg_6])
            else:
                arg_0._store(arg_2 + arg_6, 0)


(self, lang_id, lang_def=None, lang_label=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_0 . languages [ arg_1 ] = ( arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Add a language.

        :param str lang_id: ID of the language.
        :param str lang_def: Definition of the language(preferably ISO-639-3).
        :param str lang_label: Label of the language.
        """
        arg_0.languages[arg_1] = (arg_2, arg_3)


def Func ( arg_0 , arg_1 = 22050 , arg_2 = 0.1 ) : arg_3 = np . arange ( int ( arg_1 * arg_2 ) ) arg_4 = np . sin ( 2 * np . pi * arg_3 * arg_0 / float ( arg_1 ) ) arg_4 *= np . exp ( - arg_3 / ( 1e-2 * arg_1 ) ) return arg_4

def Func(arg_0, arg_1=22050, arg_2=0.1):
    '''Generate a click sample.

    This replicates functionality from mir_eval.sonify.clicks,
    but exposes the target frequency and duration.
    '''

    arg_3 = np.arange(int(arg_1 * arg_2))
    arg_4 = np.sin(2 * np.pi * arg_3 * arg_0 / float(arg_1))
    arg_4 *= np.exp(- arg_3 / (1e-2 * arg_1))

    return arg_4


def Func ( arg_0 ) : if arg_0 . minversion is not None and arg_0 . minversion > sys . version_info : return False if arg_0 . maxversion is not None and arg_0 . maxversion <= sys . version_info : return False return True

def Func(arg_0):
        """return True if message may be emitted using the current interpreter"""
        if arg_0.minversion is not None and arg_0.minversion > sys.version_info:
            return False
        if arg_0.maxversion is not None and arg_0.maxversion <= sys.version_info:
            return False
        return True


def Func ( arg_0 , arg_1 : arg_2 ) -> None : for arg_3 in reversed ( arg_0 . arguments ) : if arg_3 . name . strip ( WS ) == arg_1 . strip ( WS ) : del arg_3 [ : ]

def Func(arg_0, arg_1: arg_2) -> None:
        """Delete all arguments with the given then."""
        for arg_3 in reversed(arg_0.arguments):
            if arg_3.name.strip(WS) == arg_1.strip(WS):
                del arg_3[:]

Delete all arguments with the given then .


(self, unreported=2, with_status=False, **kwargs)

def
Func
(
arg_0
,
arg_1
=
2
,
arg_2
=
False
,
**
arg_3
)
:
Func
=
arg_0
.
_query
(
'nodes'
,
**
arg_3
)
arg_5
=
datetime
.
datetime
.
utcnow
(
)
if
type
(
Func
)
==
dict
:
Func
=
[
Func
,
]
if
arg_2
:
arg_6
=
arg_0
.
event_counts
(
query
=
EqualsOperator
(
"latest_report?"
,
True
)
,
summarize_by
=
'certname'
)
for
arg_7
in
Func
:
arg_7
[
'status_report'
]
=
arg_7
[
'events'
]
=
if
arg_2
:
arg_8
=
[
s
for
s
in
arg_6
if
s
[
'subject'
]
[
'title'
]
==
arg_7
[
'certname'
]
]
try
:
arg_7
[
'status_report'
]
=
arg_7
[
'latest_report_status'
]
if
arg_8
:
arg_7
[
'events'
]
=
arg_8
[
0
]
except
KeyError
:
if
arg_8
:
arg_7
[
'events'
]
=
arg_8
=
arg_8
[
0
]
if
arg_8
[
'successes'
]
>
0
:
arg_7
[
'status_report'
]
=
'changed'
if
arg_8
[
'noops'
]
>
0
:
arg_7
[
'status_report'
]
=
'noop'
if
arg_8
[
'failures'
]
>
0
:
arg_7
[
'status_report'
]
=
'failed'
else
:
arg_7
[
'status_report'
]
=
'unchanged'
if
arg_7
[
'report_timestamp'
]
is
not
:
try
:
arg_9
=
json_to_datetime
(
arg_7
[
'report_timestamp'
]
)
arg_9
=
arg_9
.
replace
(
tzinfo
=
)
arg_10
=
arg_5
timedelta
(
hours
=
arg_1
)
if
arg_9
<
arg_10
:
arg_11
=
(
arg_5
arg_9
)
arg_7
[
'unreported'
]
=
True
arg_7
[
'unreported_time'
]
=
'{0}d {1}h {2}m'
.
format
(
arg_11
.
days
,
int
(
arg_11
.
seconds
/
3600
)
,
int
(
(
arg_11
.
seconds
%
3600
)
/
60
)
)
except
AttributeError
:
arg_7
[
'unreported'
]
=
True
if
not
arg_7
[
'report_timestamp'
]
:
arg_7
[
'unreported'
]
=
True
yield
Node
(
arg_0
,
name
=
arg_7
[
'certname'
]
,
deactivated
=
arg_7
[
'deactivated'
]
,
expired
=
arg_7
[
'expired'
]
,
report_timestamp
=
arg_7
[
'report_timestamp'
]
,
catalog_timestamp
=
arg_7
[
'catalog_timestamp'
]
,
facts_timestamp
=
arg_7
[
'facts_timestamp'
]
,
status_report
=
arg_7
[
'status_report'
]
,
noop
=
arg_7
.
get
(
'latest_report_noop'
)
,
noop_pending
=
arg_7
.
get
(
'latest_report_noop_pending'
)
,
events
=
arg_7
[
'events'
]
,
arg_1
=
arg_7
.
get
(
'unreported'
)
,
unreported_time
=
arg_7
.
get
(
'unreported_time'
)
,
report_environment
=
arg_7
[
'report_environment'
]
,
catalog_environment
=
arg_7
[
'catalog_environment'
]
,
facts_environment
=
arg_7
[
'facts_environment'
]
,
latest_report_hash
=
arg_7
.
get
(
'latest_report_hash'
)
,
cached_catalog_status
=
arg_7
.
get
(
'cached_catalog_status'
)
)

def Func(arg_0, arg_1=2, arg_2=False, **arg_3):
        """Query for nodes by either name or query. If both aren't
        provided this will return a list of all nodes. This method
        also fetches the nodes status and event counts of the latest
        report from puppetdb.

        :param with_status: (optional) include the node status in the\
                           returned nodes
        :type with_status: :bool:
        :param unreported: (optional) amount of hours when a node gets
                           marked as unreported
        :type unreported: :obj:`None` or integer
        :param \*\*kwargs: The rest of the keyword arguments are passed
                           to the _query function

        :returns: A generator yieling Nodes.
        :rtype: :class:`pypuppetdb.types.Node`
        """
        Func = arg_0._query('nodes', **arg_3)
        arg_5 = datetime.datetime.utcnow()
        # If we happen to only get one node back it
        # won't be inside a list so iterating over it
        # goes boom. Therefor we wrap a list around it.
        if type(Func) == dict:
            Func = [Func, ]

        if arg_2:
            arg_6 = arg_0.event_counts(
                query=EqualsOperator("latest_report?", True),
                summarize_by='certname'
            )

        for arg_7 in Func:
            arg_7['status_report'] = None
            arg_7['events'] = None

            if arg_2:
                arg_8 = [s for s in arg_6
                          if s['subject']['title'] == arg_7['certname']]

                try:
                    arg_7['status_report'] = arg_7['latest_report_status']

                    if arg_8:
                        arg_7['events'] = arg_8[0]
                except KeyError:
                    if arg_8:
                        arg_7['events'] = arg_8 = arg_8[0]
                        if arg_8['successes'] > 0:
                            arg_7['status_report'] = 'changed'
                        if arg_8['noops'] > 0:
                            arg_7['status_report'] = 'noop'
                        if arg_8['failures'] > 0:
                            arg_7['status_report'] = 'failed'
                    else:
                        arg_7['status_report'] = 'unchanged'

                # node report age
                if arg_7['report_timestamp'] is not None:
                    try:
                        arg_9 = json_to_datetime(
                            arg_7['report_timestamp'])
                        arg_9 = arg_9.replace(tzinfo=None)
                        arg_10 = arg_5 - timedelta(hours=arg_1)
                        if arg_9 < arg_10:
                            arg_11 = (arg_5 - arg_9)
                            arg_7['unreported'] = True
                            arg_7['unreported_time'] = '{0}d {1}h {2}m'.format(
                                arg_11.days,
                                int(arg_11.seconds / 3600),
                                int((arg_11.seconds % 3600) / 60)
                            )
                    except AttributeError:
                        arg_7['unreported'] = True

                if not arg_7['report_timestamp']:
                    arg_7['unreported'] = True

            yield Node(arg_0,
                       name=arg_7['certname'],
                       deactivated=arg_7['deactivated'],
                       expired=arg_7['expired'],
                       report_timestamp=arg_7['report_timestamp'],
                       catalog_timestamp=arg_7['catalog_timestamp'],
                       facts_timestamp=arg_7['facts_timestamp'],
                       status_report=arg_7['status_report'],
                       noop=arg_7.get('latest_report_noop'),
                       noop_pending=arg_7.get('latest_report_noop_pending'),
                       events=arg_7['events'],
                       arg_1=arg_7.get('unreported'),
                       unreported_time=arg_7.get('unreported_time'),
                       report_environment=arg_7['report_environment'],
                       catalog_environment=arg_7['catalog_environment'],
                       facts_environment=arg_7['facts_environment'],
                       latest_report_hash=arg_7.get('latest_report_hash'),
                       cached_catalog_status=arg_7.get('cached_catalog_status')
                       )

Query for nodes by either name or query . If both aren t provided this will return a list of all nodes . This method also fetches the nodes status and event counts of the latest report from puppetdb .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
in
(
"from_"
,
"to"
)
:
check_valid
(
"Twilio"
,
arg_0
,
arg_1
,
validus
.
isphone
,
"phone number"
)
elif
arg_0
in
(
"attachments"
)
:
check_valid
(
"Twilio"
,
arg_0
,
arg_1
,
validus
.
isurl
,
"url"
)

def Func(arg_0, arg_1):
    """Twilio input validator function."""
    if arg_0 in ("from_", "to"):
        check_valid("Twilio", arg_0, arg_1, validus.isphone, "phone number")
    elif arg_0 in ("attachments"):
        check_valid("Twilio", arg_0, arg_1, validus.isurl, "url")


(
        search_term,
        user=None,
        size=10,
        from_=0,
        course_id=None)

def Func(
        arg_0,
        arg_1=None,
        arg_2=10,
        arg_3=0,
        arg_4=None):
    """ Call the search engine with the appropriate parameters """
    # field_, filter_ and exclude_dictionary(s) can be overridden by calling application
    # field_dictionary includes course if course_id provided
    (arg_5, arg_6, arg_7) = SearchFilterGenerator.generate_field_filters(
        arg_1=arg_1,
        arg_4=arg_4
    )

    arg_8 = SearchEngine.get_search_engine(getattr(settings, "COURSEWARE_INDEX_NAME", "courseware_index"))
    if not arg_8:
        raise NoSearchEngineError("No search engine specified in settings.SEARCH_ENGINE")

    arg_9 = arg_8.search_string(
        arg_0,
        arg_5=arg_5,
        arg_6=arg_6,
        arg_7=arg_7,
        arg_2=arg_2,
        arg_3=arg_3,
        doc_type="courseware_content",
    )

    # post-process the result
    for arg_10 in arg_9["results"]:
        arg_10["data"] = SearchResultProcessor.process_result(arg_10["data"], arg_0, arg_1)

    arg_9["access_denied_count"] = len([r for r in arg_9["results"] if r["data"] is None])
    arg_9["results"] = [r for r in arg_9["results"] if r["data"] is not None]

    return arg_9


def Func(arg_0):
        """
         Populate frequency axis
        """

        if arg_0.header[b'foff'] < 0:
            arg_1 = arg_0.f_end
        else:
            arg_1 = arg_0.f_begin

        arg_0._setup_chans()

        #create freq array
        arg_2 = np.arange(arg_0.chan_start_idx, arg_0.chan_stop_idx)
        arg_3 = arg_0.header[b'foff'] * arg_2 + arg_1

        return arg_3


def Func ( arg_0 ) : arg_1 = arg_0 . declaration if arg_1 . source : arg_0 . set_source ( arg_1 . source ) else : super ( RawComponent , arg_0 ) . Func ( )

def Func(arg_0):
        """ Initialize the widget with the source. """
        arg_1 = arg_0.declaration
        if arg_1.source:
            arg_0.set_source(arg_1.source)
        else:
            super(RawComponent, arg_0).Func()


def Func(arg_0):
    """
    Register plugin in grappa.

    `plugin` argument can be a function or a object that implement `register`
    method, which should accept one argument: `grappa.Engine` instance.

    Arguments:
        plugin (function|module): grappa plugin object to register.

    Raises:
        ValueError: if `plugin` is not a valid interface.

    Example::

        import grappa

        class MyOperator(grappa.Operator):
            pass

        def my_plugin(engine):
            engine.register(MyOperator)

        grappa.Func(my_plugin)
    """
    log.debug('register new plugin: {}'.format(arg_0))

    if inspect.isfunction(arg_0):
        return arg_0(Engine)

    if arg_0 and hasattr(arg_0, 'register'):
        return arg_0.register(Engine)

    raise ValueError('invalid plugin: must be a function or '
                     'implement register() method')

Register plugin in grappa.

    `plugin` argument can be a function or a object that implement `register`
    method, which should accept one argument: `grappa.Engine` instance.

    Arguments:
        plugin (function|module): grappa plugin object to register.

    Raises:
        ValueError: if `plugin` is not a valid interface.

    Example::

        import grappa

        class MyOperator(grappa.Operator):
            pass

        def my_plugin(engine):
            engine.register(MyOperator)

        grappa.use(my_plugin)


def Func(arg_0):
    """
    Return package author and version as listed in `init.py`.
    """
    arg_1 = open(os.path.join(arg_0, '__init__.py')).read()
    arg_2 = re.search("__author__ = ['\"]([^'\"]+)['\"]", arg_1).group(1)
    arg_3 = re.search("__version__ = ['\"]([^'\"]+)['\"]", arg_1).group(1)
    return arg_2, arg_3

Return package author and version as listed in init . py .


def Func(arg_0, arg_1=arg_2.ERROR):
    """ Create a new model instance, given a description dictionary.

    :param modelConfig: (dict)
           A dictionary describing the current model,
           `described here <../../quick-start/example-model-params.html>`_.

    :param logLevel: (int) The level of logging output that should be generated

    :raises Exception: Unsupported model type

    :returns: :class:`nupic.frameworks.opf.model.Model`
    """
    arg_4 = ModelFactory.__getLogger()
    arg_4.setLevel(arg_1)
    arg_4.debug("ModelFactory returning Model from dict: %s", arg_0)

    arg_5 = None
    if arg_0['model'] == "HTMPrediction":
      arg_5 = HTMPredictionModel
    elif arg_0['model'] == "TwoGram":
      arg_5 = TwoGramModel
    elif arg_0['model'] == "PreviousValue":
      arg_5 = PreviousValueModel
    else:
      raise Exception("ModelFactory received unsupported Model type: %s" % \
                      arg_0['model'])

    return arg_5(**arg_0['modelParams'])

Create a new model instance given a description dictionary .


(session, track_id, track_point_limit=None, track_point_offset=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_4 = { } if arg_2 : arg_4 [ 'track_point_limit' ] = arg_2 if arg_3 : arg_4 [ 'track_point_offset' ] = arg_3 arg_5 = make_get_request ( arg_0 , 'tracks/{}' . format ( arg_1 ) , params_data = arg_4 ) arg_6 = arg_5 . json ( ) if arg_5 . status_code == 200 : return arg_6 [ 'result' ] else : raise TrackNotFoundException ( message = arg_6 [ 'message' ] , error_code = arg_6 [ 'error_code' ] , request_id = arg_6 [ 'request_id' ] )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """
    Gets a specific track
    """

    arg_4 = {}
    if arg_2:
        arg_4['track_point_limit'] = arg_2
    if arg_3:
        arg_4['track_point_offset'] = arg_3

    # GET /api/projects/0.1/tracks/{track_id}/

    arg_5 = make_get_request(arg_0, 'tracks/{}'.format(arg_1),
                                params_data=arg_4)
    arg_6 = arg_5.json()
    if arg_5.status_code == 200:
        return arg_6['result']
    else:
        raise TrackNotFoundException(message=arg_6['message'],
                                     error_code=arg_6['error_code'],
                                     request_id=arg_6['request_id'])


def Func(arg_0, arg_1, arg_2=0):
    """
    Reads the next individual packet from the capture file. Expects
    the file handle to be somewhere after the header, on the next
    per-packet header.
    """
    arg_3 = arg_0.read(16)
    if not arg_3 or len(arg_3) != 16:
        return None

    # in case the capture file is not the same endianness as ours, we have to
    # use the correct byte order for the packet header
    if arg_1[0].byteorder == 'big':
        arg_4 = struct.unpack('>IIII', arg_3)
    else:
        arg_4 = struct.unpack('<IIII', arg_3)
    (arg_5, arg_6, arg_7, arg_8) = arg_4
    arg_9 = arg_0.read(arg_7)

    if not arg_9 or len(arg_9) != arg_7:
        return None

    if arg_2 > 0:
        arg_2 -= 1
        arg_10 = linklayer.clookup(arg_1[0].ll_type)(arg_9,
                                                        arg_2=arg_2)
    else:
        arg_10 = arg_9

    arg_11 = pcap_packet(arg_1, arg_5, arg_6, arg_7,
                         arg_8, arg_10)
    return arg_11

Reads the next individual packet from the capture file . Expects the file handle to be somewhere after the header on the next per - packet header .


def Func ( arg_0 ) : if not os . path . isdir ( arg_0 . fdir ) : os . makedirs ( arg_0 . fdir ) for arg_1 in os . listdir ( arg_0 . fdir ) : arg_2 = os . path . join ( arg_0 . fdir , arg_1 ) if not os . path . isfile ( arg_2 ) : continue if arg_1 in arg_0 . fmtime : if arg_0 . is_changed ( arg_1 ) : arg_0 . db [ arg_1 ] = arg_0 . _read_info ( arg_2 ) else : arg_4 = arg_0 . get_mtime ( arg_2 ) arg_0 . db [ arg_1 ] = arg_0 . _read_info ( arg_2 ) arg_0 . fmtime [ arg_1 ] = arg_4

def Func(arg_0):
        """
        Goes through the directory and builds a local cache based on
        the content of the directory.
        """
        if not os.path.isdir(arg_0.fdir):
            os.makedirs(arg_0.fdir)

        for arg_1 in os.listdir(arg_0.fdir):
            arg_2 = os.path.join(arg_0.fdir, arg_1)
            if not os.path.isfile(arg_2):
                continue
            if arg_1 in arg_0.fmtime:
                if arg_0.is_changed(arg_1):
                    arg_0.db[arg_1] = arg_0._read_info(arg_2)
            else:
                arg_4 = arg_0.get_mtime(arg_2)
                arg_0.db[arg_1] = arg_0._read_info(arg_2)
                arg_0.fmtime[arg_1] = arg_4

Goes through the directory and builds a local cache based on the content of the directory .


def Func ( arg_0 ) : if arg_0 . hot_loop and arg_0 . time_delta >= arg_0 . log_interval : return True return False

def Func(arg_0):
        """Return True if it's time to log"""
        if arg_0.hot_loop and arg_0.time_delta >= arg_0.log_interval:
            return True
        return False


def Func(arg_0):
        """
        Set all the compound mass flow rates in the stream to zero.
        Set the pressure to 1, the temperature to 25 and the enthalpy to zero.
        """

        arg_0._compound_mfrs = arg_0._compound_mfrs * 0.0
        arg_0._P = 1.0
        arg_0._T = 25.0
        arg_0._H = 0.0

Set all the compound mass flow rates in the stream to zero . Set the pressure to 1 the temperature to 25 and the enthalpy to zero .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_0 , mlx . FilterScript ) : arg_0 . filters . append ( arg_1 ) elif isinstance ( arg_0 , str ) : arg_2 = open ( arg_0 , 'a' ) arg_2 . write ( arg_1 ) arg_2 . close ( ) else : print ( arg_1 ) return None

def Func(arg_0, arg_1):
    """ Write filter to FilterScript object or filename

    Args:
        script (FilterScript object or filename str): the FilterScript object
            or script filename to write the filter to.
        filter_xml (str): the xml filter string

    """
    if isinstance(arg_0, mlx.FilterScript):
        arg_0.filters.append(arg_1)
    elif isinstance(arg_0, str):
        arg_2 = open(arg_0, 'a')
        arg_2.write(arg_1)
        arg_2.close()
    else:
        print(arg_1)
    return None


def Func ( arg_0 , arg_1 ) : if arg_0 . type == NUMBER : try : return clamp ( arg_0 . min , arg_0 . max , float ( arg_1 ) ) except ValueError : return 0.0 elif arg_0 . type == TEXT : try : return unicode ( str ( arg_1 ) , "utf_8" , "replace" ) except : return "" elif arg_0 . type == BOOLEAN : if unicode ( arg_1 ) . lower ( ) in ( "true" , "1" , "yes" ) : return True else : return False

def Func(arg_0, arg_1):
        """Given a Variable and a value, cleans it out"""
        if arg_0.type == NUMBER:
            try:
                return clamp(arg_0.min, arg_0.max, float(arg_1))
            except ValueError:
                return 0.0
        elif arg_0.type == TEXT:
            try:
                return unicode(str(arg_1), "utf_8", "replace")
            except:
                return ""
        elif arg_0.type == BOOLEAN:
            if unicode(arg_1).lower() in ("true", "1", "yes"):
                return True
            else:
                return False

Given a Variable and a value cleans it out


def Func ( arg_0 ) : arg_1 = PluginManifest ( arg_0 . file_path ) arg_1 . get ( ) arg_0 . manifest = arg_1 . get_manifest ( )

def Func(arg_0):
        """
        Read the file and parse JSON into dictionary
        """
        arg_1 = PluginManifest(arg_0.file_path)
        arg_1.get()
        arg_0.manifest = arg_1.get_manifest()


def Func ( arg_0 , arg_1 ) : arg_2 = { 'jobs[]' : arg_1 } arg_3 = make_delete_request ( arg_0 , 'self/jobs' , arg_4 = arg_2 ) arg_4 = arg_3 . json ( ) if arg_3 . status_code == 200 : return arg_4 [ 'status' ] else : raise UserJobsNotDeletedException ( message = arg_4 [ 'message' ] , error_code = arg_4 [ 'error_code' ] , request_id = arg_4 [ 'request_id' ] )

def Func(arg_0, arg_1):
    """
    Remove a list of jobs from the currently authenticated user
    """
    arg_2 = {
        'jobs[]': arg_1
    }
    arg_3 = make_delete_request(arg_0, 'self/jobs', arg_4=arg_2)
    arg_4 = arg_3.json()
    if arg_3.status_code == 200:
        return arg_4['status']
    else:
        raise UserJobsNotDeletedException(
            message=arg_4['message'],
            error_code=arg_4['error_code'],
            request_id=arg_4['request_id'])


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
Color
(
)
arg_0
.
logger
.
info
(
arg_3
.
colored
(
"=> [%s] %s"
%
(
arg_1
,
arg_2
)
,
"green"
)
)
try
:
arg_4
=
Repository
(
arg_2
)
arg_4
.
update
(
)
except
RepositoryError
as
e
:
arg_0
.
logger
.
error
(
e
)
pass
print
(
"\n"
)

def Func(arg_0, arg_1, arg_2):
        """Print repository update."""
        arg_3 = Color()
        arg_0.logger.info(arg_3.colored(
            "=> [%s] %s" % (arg_1, arg_2), "green"))
        try:
            arg_4 = Repository(arg_2)
            arg_4.update()
        except RepositoryError as e:
            arg_0.logger.error(e)
            pass
        print("\n")


(
    params, w_name, scope_name, inputs, layers, weights, names
)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
print
(
'Converting elementwise_sub ...'
)
arg_7
=
arg_4
[
arg_3
[
0
]
]
arg_8
=
arg_4
[
arg_3
[
1
]
]
if
arg_6
==
'short'
:
arg_9
=
'S'
+
random_string
(
7
)
elif
arg_6
==
'keep'
:
arg_9
=
arg_1
else
:
arg_9
=
arg_1
+
str
(
random
.
random
(
)
)
arg_10
=
keras
.
layers
.
Subtract
(
name
=
arg_9
)
arg_4
[
arg_2
]
=
arg_10
(
[
arg_7
,
arg_8
]
)

def Func(
    arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6
):
    """
    Convert elementwise subtraction.

    Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """
    print('Converting elementwise_sub ...')
    arg_7 = arg_4[arg_3[0]]
    arg_8 = arg_4[arg_3[1]]

    if arg_6 == 'short':
        arg_9 = 'S' + random_string(7)
    elif arg_6 == 'keep':
        arg_9 = arg_1
    else:
        arg_9 = arg_1 + str(random.random())

    arg_10 = keras.layers.Subtract(name=arg_9)
    arg_4[arg_2] = arg_10([arg_7, arg_8])


return ast.copy_location(
            ast.ExceptHandler(
                type=new_node.type,
                name=new_node.name,
                body=_filter_dead_code(new_node.body),
            ),
            new_node,
        )

def Func ( arg_0 , arg_1 : arg_2 . ExceptHandler ) -> Optional [ arg_2 . AST ] : arg_4 = arg_0 . generic_visit ( arg_1 ) assert isinstance ( arg_4 , arg_2 . ExceptHandler ) return arg_2 . copy_location ( arg_2 . ExceptHandler ( type = arg_4 . type , name = arg_4 . name , body = _filter_dead_code ( arg_4 . body ) , ) , arg_4 , )

def Func(arg_0, arg_1: arg_2.ExceptHandler) -> Optional[arg_2.AST]:
        """Eliminate dead code from except handler bodies."""
        arg_4 = arg_0.generic_visit(arg_1)
        assert isinstance(arg_4, arg_2.ExceptHandler)
        return arg_2.copy_location(
            arg_2.ExceptHandler(
                type=arg_4.type,
                name=arg_4.name,
                body=_filter_dead_code(arg_4.body),
            ),
            arg_4,
        )

Eliminate dead code from except handler bodies .


def Func(arg_0, arg_1):
        """Add an event to the conversation.

        This method is used by :class:`.ConversationList` to maintain this
        instance.

        Args:
            event_: ``Event`` message.

        Returns:
            :class:`.ConversationEvent` representing the event.
        """
        arg_2 = arg_0._wrap_event(arg_1)
        if arg_2.id_ not in arg_0._events_dict:
            arg_0._events.append(arg_2)
            arg_0._events_dict[arg_2.id_] = arg_2
        else:
            # If this happens, there's probably a bug.
            logger.info('Conversation %s ignoring duplicate event %s',
                        arg_0.id_, arg_2.id_)
            return None
        return arg_2


def Func ( arg_0 ) : if isinstance ( arg_0 , _UTF8_TYPES ) : return arg_0 assert isinstance ( arg_0 , unicode ) return arg_0 . encode ( "utf-8" )

def Func(arg_0):
    """Converts a string argument to a byte string.

    If the argument is already a byte string or None, it is returned unchanged.
    Otherwise it must be a unicode string and is encoded as Func.
    """
    if isinstance(arg_0, _UTF8_TYPES):
        return arg_0
    assert isinstance(arg_0, unicode)
    return arg_0.encode("utf-8")

Converts a string argument to a byte string.

    If the argument is already a byte string or None, it is returned unchanged.
    Otherwise it must be a unicode string and is encoded as utf8.

Converts a string argument to a byte string .


def
Func
(
arg_0
,
arg_1
=
'.'
)
:
arg_2
=
WheelFile
(
arg_0
)
arg_3
=
arg_2
.
parsed_filename
.
group
(
'namever'
)
arg_4
=
os
.
path
.
join
(
arg_1
,
arg_3
)
sys
.
stderr
.
write
(
"Unpacking to: %s\n"
%
(
arg_4
)
)
arg_2
.
zipfile
.
extractall
(
arg_4
)
arg_2
.
zipfile
.
close
(
)

def Func(arg_0, arg_1='.'):
    """Unpack a wheel.

    Wheel content will be Funced to {dest}/{name}-{ver}, where {name}
    is the package name and {ver} its version.

    :param wheelfile: The path to the wheel.
    :param dest: Destination directory (default to current directory).
    """
    arg_2 = WheelFile(arg_0)
    arg_3 = arg_2.parsed_filename.group('namever')
    arg_4 = os.path.join(arg_1, arg_3)
    sys.stderr.write("Unpacking to: %s\n" % (arg_4))
    arg_2.zipfile.extractall(arg_4)
    arg_2.zipfile.close()

Unpack a wheel.

    Wheel content will be unpacked to {dest}/{name}-{ver}, where {name}
    is the package name and {ver} its version.

    :param wheelfile: The path to the wheel.
    :param dest: Destination directory (default to current directory).


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . split ( '__' ) if 'x' in arg_2 [ - 1 ] : arg_3 = arg_2 . pop ( - 1 ) else : arg_3 = None arg_4 = reduce ( getattr , arg_2 , arg_0 ) if arg_3 : arg_4 = arg_4 [ arg_3 ] . url return arg_4

def Func(arg_0, arg_1):
    """Build a URL from `image_key`."""
    arg_2 = arg_1.split('__')
    if 'x' in arg_2[-1]:
        arg_3 = arg_2.pop(-1)
    else:
        arg_3 = None
    arg_4 = reduce(getattr, arg_2, arg_0)
    if arg_3:
        arg_4 = arg_4[arg_3].url
    return arg_4


def Func(arg_0):
        """Gets all CDF z-variable information, not data though.

        Maps to calls using var_inquire. Gets information on
        data type, number of elements, number of dimensions, etc.

        """

        arg_0.z_variable_info = {}
        arg_0.z_variable_names_by_num = {}

        # call Fortran that grabs all of the basic stats on all of the
        # zVariables in one go.
        arg_3 = fortran_cdf.z_var_all_inquire(arg_0.fname, arg_0._num_z_vars,
                                             len(arg_0.fname))
        arg_4 = arg_3[0]
        arg_5 = arg_3[1]
        arg_6 = arg_3[2]
        arg_7 = arg_3[3]
        arg_8 = arg_3[4]
        arg_9 = arg_3[5]
        arg_10 = arg_3[6]
        arg_11 = arg_3[7]
        arg_12 = arg_3[8]
        arg_13 = arg_3[9]

        if arg_4 == 0:
            for arg_14 in np.arange(len(arg_5)):
                arg_15 = {}
                arg_15['data_type'] = arg_5[arg_14]
                arg_15['num_elems'] = arg_6[arg_14]
                arg_15['rec_vary'] = arg_7[arg_14]
                arg_15['dim_varys'] = arg_8[arg_14]
                arg_15['num_dims'] = arg_9[arg_14]
                # only looking at first possible extra dimension
                arg_15['dim_sizes'] = arg_10[arg_14, :1]
                if arg_15['dim_sizes'][0] == 0:
                    arg_15['dim_sizes'][0] += 1
                arg_15['rec_num'] = arg_11[arg_14]
                arg_15['var_num'] = arg_12[arg_14]
                arg_16 = ''.join(arg_13[arg_14].astype('U'))
                arg_15['var_name'] = arg_16.rstrip()
                arg_0.z_variable_info[arg_15['var_name']] = arg_15
                arg_0.z_variable_names_by_num[arg_15['var_num']] = arg_16
        else:
            raise IOError(fortran_cdf.statusreporter(arg_4))

Gets all CDF z - variable information not data though .


' r  - retry running %s (probably after'

def Func(arg_0, arg_1, arg_2=None):
    """Subprocess program error handling

    Args:
        program_name (str): name of the subprocess program

    Returns:
        break_now (bool): indicate whether calling program should break out of loop

    """
    print('\nHouston, we have a problem.',
          '\n%s did not finish successfully. Review the log' % arg_0,
          'file and the input file(s) to see what went wrong.')
    print('%s command: "%s"' % (arg_0, arg_1))
    if arg_2 is not None:
        print('log: "%s"' % arg_2)
    print('Where do we go from here?')
    print(' r  - retry running %s (probably after' % arg_0,
          'you\'ve fixed any problems with the input files)')
    print(' c  - continue on with the script (probably after',
          'you\'ve manually re-run and generated the desired',
          'output file(s)')
    print(' x  - exit, keeping the TEMP3D files and log')
    print(' xd - exit, deleting the TEMP3D files and log')
    while True:
        arg_3 = input('Select r, c, x (default), or xd: ')
        if arg_3 not in ('r', 'c', 'x', 'xd'):
            #print('Please enter a valid option.')
            arg_3 = 'x'
        #else:
        break
    if arg_3 == 'x':
        print('Exiting ...')
        sys.exit(1)
    elif arg_3 == 'xd':
        print('Deleting TEMP3D* and log files and exiting ...')
        util.delete_all('TEMP3D*')
        if arg_2 is not None:
            os.remove(arg_2)
        sys.exit(1)
    elif arg_3 == 'c':
        print('Continuing on ...')
        arg_4 = True
    elif arg_3 == 'r':
        print('Retrying %s cmd ...' % arg_0)
        arg_4 = False
    return arg_4


return FetchedPID(
        provider=DepositProvider,
        pid_type=DepositProvider.pid_type,
        pid_value=str(data['_deposit']['id']),
    )

def Func ( arg_0 , arg_1 ) : return FetchedPID ( provider = DepositProvider , pid_type = DepositProvider . pid_type , pid_value = str ( arg_1 [ '_deposit' ] [ 'id' ] ) , )

def Func(arg_0, arg_1):
    """Fetch a deposit identifier.

    :param record_uuid: Record UUID.
    :param data: Record content.
    :returns: A :class:`invenio_pidstore.fetchers.FetchedPID` that contains
        data['_deposit']['id'] as pid_value.
    """
    return FetchedPID(
        provider=DepositProvider,
        pid_type=DepositProvider.pid_type,
        pid_value=str(arg_1['_deposit']['id']),
    )


return is_suicide or is_check_by_dropping_pawn

def Func(arg_0, arg_1):
        '''
        Checks if the given move would move would leave the king in check or
        put it into check.
        '''

        arg_0.push(arg_1)
        arg_2 = arg_0.was_suicide()
        arg_3 = arg_0.was_check_by_dropping_pawn(arg_1)
        arg_0.pop()
        return arg_2 or arg_3

Checks if the given move would move would leave the king in check or put it into check .


return filter(lambda t: t.state_manager_name == name, self.topologies)

def Func ( arg_0 , arg_1 ) : return filter ( lambda t : t . state_manager_name == arg_1 , arg_0 . topologies )

def Func(arg_0, arg_1):
    """
    Returns all the topologies for a given state manager.
    """
    return filter(lambda t: t.state_manager_name == arg_1, arg_0.topologies)

Returns all the topologies for a given state manager .


def Func ( arg_0 , arg_1 ) : if not arg_1 . initialized : return arg_2 = arg_0 . _request_graph ( arg_1 . ui . control ) if arg_2 is not None : arg_3 = Subgraph ( ) arg_4 = arg_3 . edit_traits ( parent = arg_1 . ui . control , kind = "livemodal" ) if arg_4 . result : arg_2 . subgraphs . append ( arg_3 )

def Func(arg_0, arg_1):
        """ Handles adding a Subgraph to the main graph.
        """
        if not arg_1.initialized:
            return

        arg_2 = arg_0._request_graph(arg_1.ui.control)

        if arg_2 is not None:
            arg_3 = Subgraph()#root=graph, parent=graph)
            arg_4 = arg_3.edit_traits(parent = arg_1.ui.control,
                                          kind   = "livemodal")
            if arg_4.result:
                arg_2.subgraphs.append(arg_3)

Handles adding a Subgraph to the main graph .


def Func(arg_0, *arg_1):
        """
        Build transaction data from function signature and arguments
        """
        arg_2 = re.match(r"(?P<name>[a-zA-Z_][a-zA-Z_0-9]*)(?P<type>\(.*\))", arg_0)
        if not arg_2:
            raise EthereumError("Function signature expected")

        ABI._check_and_warn_num_args(arg_0, *arg_1)

        arg_3 = ABI.function_selector(arg_0)  # Funcid
        arg_3 += ABI.serialize(arg_2.group('type'), *arg_1)
        return arg_3


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = PRIORITY [ arg_0 [ arg_1 [ 0 ] ] ] arg_4 = [ i for i in arg_2 if i [ 0 ] == arg_3 ] [ 0 ] for arg_5 , arg_6 in zip ( arg_1 [ 1 : ] , arg_4 [ 1 : ] ) : if PRIORITY [ arg_0 [ arg_5 ] ] != arg_6 : arg_0 [ arg_5 ] = arg_0 [ arg_5 ] . lower ( ) return arg_0

def Func(arg_0, arg_1, arg_2):
    """ store phased allele data for diploids """
    ## find the first hetero site and choose the priority base
    ## example, if W: then priority base in A and not T. PRIORITY=(order: CATG)
    arg_3 = PRIORITY[arg_0[arg_1[0]]]

    ## find which allele has priority based on bigbase
    arg_4 = [i for i in arg_2 if i[0] == arg_3][0]

    ## uplow other bases relative to this one and the priority list
    ## e.g., if there are two hetero sites (WY) and the two alleles are
    ## AT and TC, then since bigbase of (W) is A second hetero site should
    ## be stored as y, since the ordering is swapped in this case; the priority
    ## base (C versus T) is C, but C goes with the minor base at h site 1.
    #consens = list(consens)
    for arg_5, arg_6 in zip(arg_1[1:], arg_4[1:]):
        if PRIORITY[arg_0[arg_5]] != arg_6:
            arg_0[arg_5] = arg_0[arg_5].lower()

    ## return consens
    return arg_0


def Func(arg_0, arg_1):
        "Returns the pyth item data associated with the item"
        arg_2 = arg_0.GetItemData(arg_1)
        arg_3 = arg_0._py_data_map.get(arg_2)
        return arg_3


def Func ( arg_0 ) : arg_1 = False try : with arg_0 . _login ( requests . Session ( ) ) as sess : sess . get ( arg_0 . _logout_url ) except arg_0 . LoginError : pass else : arg_1 = True return arg_1

def Func(arg_0):
        """Check for working login data."""
        arg_1 = False
        try:
            with arg_0._login(requests.Session()) as sess:
                sess.get(arg_0._logout_url)
        except arg_0.LoginError:
            pass
        else:
            arg_1 = True
        return arg_1