(cls, serializer, wf_spec, s_state, **kwargs)

return serializer.deserialize_trigger(wf_spec,
                                              s_state,
                                              **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, **arg_4):
        """
        Deserializes the trigger using the provided serializer.
        """
        return arg_1.Func_trigger(arg_2,
                                              arg_3,
                                              **arg_4)

Deserializes the trigger using the provided serializer .


def Func ( arg_0 , arg_1 = None ) : arg_2 = { } arg_3 = symbol_pos_int ( 'global_iterator' ) arg_4 = implemented_function ( sympy . Function ( str ( 'idiv' ) ) , lambda x , y : x // y ) arg_5 = 1 arg_6 = 1 for arg_7 , arg_8 , arg_9 , arg_10 in reversed ( arg_0 . _loop_stack ) : arg_11 = symbol_pos_int ( arg_7 ) arg_12 = arg_9 - arg_8 arg_13 = arg_8 + ( arg_4 ( arg_3 * arg_6 , arg_5 ) * arg_10 ) % arg_12 arg_5 = arg_5 * arg_12 arg_6 = arg_10 arg_2 [ arg_11 ] = sympy . lambdify ( arg_3 , arg_0 . subs_consts ( arg_13 ) , modules = [ numpy , { 'Mod' : numpy . mod } ] ) if arg_1 is not None : try : arg_2 [ arg_11 ] = sympy . Integer ( arg_0 . subs_consts ( arg_13 ) ) continue except ( ValueError , TypeError ) : arg_2 [ arg_11 ] = arg_2 [ arg_11 ] ( arg_1 ) return arg_2

def Func(arg_0, arg_1=None):
        """
        Return sympy expressions translating global_iterator to loop indices.

        If global_iterator is given, an integer is returned
        """
        # unwind global iteration count into loop counters:
        arg_2 = {}
        arg_3 = symbol_pos_int('global_iterator')
        arg_4 = implemented_function(sympy.Function(str('idiv')), lambda x, y: x//y)
        arg_5 = 1
        arg_6 = 1
        for arg_7, arg_8, arg_9, arg_10 in reversed(arg_0._loop_stack):
            arg_11 = symbol_pos_int(arg_7)

            # This unspools the iterations:
            arg_12 = arg_9-arg_8  # FIXME is incr handled correct here?
            arg_13 = arg_8+(arg_4(arg_3*arg_6, arg_5)*arg_10) % arg_12
            arg_5 = arg_5*arg_12
            arg_6 = arg_10

            arg_2[arg_11] = sympy.lambdify(
                arg_3,
                arg_0.subs_consts(arg_13), modules=[numpy, {'Mod': numpy.mod}])

            if arg_1 is not None:
                try:  # Try to resolve to integer if global_iterator was given
                    arg_2[arg_11] = sympy.Integer(arg_0.subs_consts(arg_13))
                    continue
                except (ValueError, TypeError):
                    arg_2[arg_11] = arg_2[arg_11](arg_1)

        return arg_2

Return sympy expressions translating global_iterator to loop indices .


def Func(arg_0, **arg_1):
        """Injects data into the context to replicate CBV ListView."""
        arg_2 = super(DocumentListView, arg_0).Func(**arg_1)
        arg_2 = arg_0.set_permissions_in_context(arg_2)

        if not arg_2['has_view_permission']:
            return HttpResponseForbidden("You do not have permissions to view this content.")

        arg_2['object_list'] = arg_0.get_queryset()

        arg_2['document'] = arg_0.document
        arg_2['app_label'] = arg_0.app_label
        arg_2['document_name'] = arg_0.document_name
        arg_2['request'] = arg_0.request

        # pagination bits
        arg_2['page'] = arg_0.page
        arg_2['documents_per_page'] = arg_0.documents_per_page

        if arg_0.page > 1:
            arg_3 = arg_0.page - 1
        else:
            arg_3 = None

        if arg_0.page < arg_0.total_pages:
            arg_4 = arg_0.page + 1
        else:
            arg_4 = None

        arg_2['previous_page_number'] = arg_3
        arg_2['has_previous_page'] = arg_3 is not None
        arg_2['next_page_number'] = arg_4
        arg_2['has_next_page'] = arg_4 is not None
        arg_2['total_pages'] = arg_0.total_pages

        # Part of upcoming list view form functionality
        if arg_0.queryset.count():
            arg_2['keys'] = ['id', ]

            # Show those items for which we've got list_fields on the mongoadmin
            for arg_5 in [x for x in arg_0.mongoadmin.list_fields if x != 'id' and x in arg_0.document._fields.keys()]:

                # TODO - Figure out why this EmbeddedDocumentField and ListField breaks this view
                # Note - This is the challenge part, right? :)
                if isinstance(arg_0.document._fields[arg_5], EmbeddedDocumentField):
                    continue
                if isinstance(arg_0.document._fields[arg_5], ListField):
                    continue
                arg_2['keys'].append(arg_5)

        if arg_0.mongoadmin.search_fields:
            arg_2['search_field'] = True

        return arg_2

Injects data into the context to replicate CBV ListView .


(graph: BELGraph, percentage: Optional[float] = None)

def Func(arg_0: arg_1, arg_2: arg_3[arg_4] = None) -> arg_1:
    """Get a random graph by inducing over a percentage of the original nodes.

    :param graph: A BEL graph
    :param percentage: The percentage of edges to keep
    """
    arg_2 = arg_2 or 0.9

    assert 0 < arg_2 <= 1

    arg_5 = arg_0.nodes()
    arg_6 = int(len(arg_5) * arg_2)

    arg_7 = random.sample(arg_5, arg_6)

    arg_8 = arg_0.subgraph(arg_7)

    update_node_helper(arg_0, arg_8)

    return arg_8

Get a random graph by inducing over a percentage of the original nodes .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
in
arg_0
.
namespace
:
if
arg_1
in
arg_0
.
cells
:
arg_0
.
del_cells
(
arg_1
)
elif
arg_1
in
arg_0
.
spaces
:
arg_0
.
del_space
(
arg_1
)
elif
arg_1
in
arg_0
.
refs
:
arg_0
.
del_ref
(
arg_1
)
else
:
raise
RuntimeError
(
"Must not happen"
)
else
:
raise
KeyError
(
"'%s' not found in Space '%s'"
%
(
arg_1
,
arg_0
.
name
)
)

def Func(arg_0, arg_1):
        """Implementation of attribute deletion

        ``del space.name`` by user script
        Called from ``StaticSpace.__delattr__``
        """
        if arg_1 in arg_0.namespace:
            if arg_1 in arg_0.cells:
                arg_0.del_cells(arg_1)
            elif arg_1 in arg_0.spaces:
                arg_0.del_space(arg_1)
            elif arg_1 in arg_0.refs:
                arg_0.del_ref(arg_1)
            else:
                raise RuntimeError("Must not happen")
        else:
            raise KeyError("'%s' not found in Space '%s'" % (arg_1, arg_0.name))


def Func(arg_0, arg_1, arg_2=None):
        '''Download file content.

        Args:
            file_id (str): The UUID of the file whose content is requested
            etag (str): If the content is not changed since the provided ETag,
                the content won't be downloaded. If the content is changed, it
                will be downloaded and returned with its new ETag.

        Note:
            ETags should be enclosed in double quotes::

                my_etag = '"71e1ed9ee52e565a56aec66bc648a32c"'

        Returns:
            A tuple of ETag and content (etag, content) if the content was
            retrieved. If an etag was provided, and content didn't change
            returns (None, None)::

                ('"71e1ed9ee52e565a56aec66bc648a32c"', 'Hello world!')

        Raises:
            StorageArgumentException: Invalid arguments
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes
        '''
        if not is_valid_uuid(arg_1):
            raise StorageArgumentException(
                'Invalid UUID for file_id: {0}'.format(arg_1))

        arg_3 = {'Accept': '*/*'}
        if arg_2:
            arg_3['If-None-Match'] = arg_2

        arg_4 = arg_0._authenticated_request \
            .to_endpoint('file/{}/content/'.format(arg_1)) \
            .with_headers(arg_3) \
            .get()

        if arg_4.status_code == 304:
            return (None, None)

        if 'ETag' not in arg_4.headers:
            raise StorageException('No ETag received from the service with the download')

        return (arg_4.headers['ETag'], arg_4.content)


def Func ( arg_0 , arg_1 ) : arg_2 = list ( range ( arg_0 . _number_of_qubits ) ) arg_2 . remove ( arg_0 . _number_of_qubits - 1 - arg_1 ) arg_3 = np . sum ( np . abs ( arg_0 . _statevector ) ** 2 , arg_2 = tuple ( arg_2 ) ) arg_4 = arg_0 . _local_random . rand ( ) if arg_4 < arg_3 [ 0 ] : return '0' , arg_3 [ 0 ] return '1' , arg_3 [ 1 ]

def Func(arg_0, arg_1):
        """Simulate the outcome of measurement of a qubit.

        Args:
            qubit (int): the qubit to measure

        Return:
            tuple: pair (outcome, probability) where outcome is '0' or '1' and
            probability is the probability of the returned outcome.
        """
        # Axis for numpy.sum to compute probabilities
        arg_2 = list(range(arg_0._number_of_qubits))
        arg_2.remove(arg_0._number_of_qubits - 1 - arg_1)
        arg_3 = np.sum(np.abs(arg_0._statevector) ** 2, arg_2=tuple(arg_2))
        # Compute einsum index string for 1-qubit matrix multiplication
        arg_4 = arg_0._local_random.rand()
        if arg_4 < arg_3[0]:
            return '0', arg_3[0]
        # Else outcome was '1'
        return '1', arg_3[1]

Simulate the outcome of measurement of a qubit .


def Func(arg_0, arg_1=arg_2):
  """Convenience function simplifies construction of the logging uri."""
  if not arg_0:
    return job_model.LoggingParam(None, None)
  arg_3 = not arg_0.endswith('.log')
  arg_4 = arg_1('')
  arg_5, arg_6, arg_7 = arg_4.parse_uri(arg_0, arg_3)
  if '*' in arg_6.basename:
    raise ValueError('Wildcards not allowed in logging URI: %s' % arg_6)
  return job_model.LoggingParam(arg_6, arg_7)

Convenience function simplifies construction of the logging uri .


def Func(arg_0):
        """Reads the annotated beats if available.

        Returns
        -------
        times: np.array
            Times of annotated beats in seconds.
        frames: np.array
            Frame indeces of annotated beats.
        """
        arg_1, arg_2 = (None, None)

        # Read annotations if they exist in correct folder
        if os.path.isfile(arg_0.file_struct.ref_file):
            try:
                arg_3 = jams.load(arg_0.file_struct.ref_file)
            except TypeError:
                logging.warning(
                    "Can't read JAMS file %s. Maybe it's not "
                    "compatible with current JAMS version?" %
                    arg_0.file_struct.ref_file)
                return arg_1, arg_2
            arg_4 = arg_3.search(namespace="beat.*")

            # If beat annotations exist, get times and frames
            if len(arg_4) > 0:
                arg_5, arg_6 = arg_4[0].to_interval_values()
                arg_1 = arg_5[:, 0]
                arg_2 = librosa.time_to_frames(arg_1, sr=arg_0.sr,
                                                hop_length=arg_0.hop_length)
        return arg_1, arg_2

Reads the annotated beats if available .


return np.array(rauli).reshape(4 ** num_qubits, 4 ** num_qubits)

def Func ( arg_0 , arg_1 = 1 ) : if arg_1 == 0 : arg_1 = 'weight' elif arg_1 == 1 : arg_1 = 'tensor' arg_2 = int ( np . log2 ( np . sqrt ( len ( arg_0 ) ) ) ) arg_3 = pauli_group ( arg_2 , case = arg_1 ) arg_4 = [ ] for arg_5 in arg_3 : for arg_6 in arg_3 : arg_7 = np . kron ( arg_6 . to_matrix ( ) . T , arg_5 . to_matrix ( ) ) arg_4 += [ np . trace ( np . dot ( arg_0 , arg_7 ) ) ] return np . array ( arg_4 ) . reshape ( 4 ** arg_2 , 4 ** arg_2 )

def Func(arg_0, arg_1=1):
    """
    Convert a Choi-matrix to a Pauli-basis superoperator.

    Note that this function assumes that the Choi-matrix
    is defined in the standard column-stacking convention
    and is normalized to have trace 1. For a channel E this
    is defined as: choi = (I \\otimes E)(bell_state).

    The resulting 'rauli' R acts on input states as
    |rho_out>_p = R.|rho_in>_p
    where |rho> = vectorize(rho, method='pauli') for order=1
    and |rho> = vectorize(rho, method='pauli_weights') for order=0.

    Args:
        choi (matrix): the input Choi-matrix.
        order (int): ordering of the Pauli group vector.
            order=1 (default) is standard lexicographic ordering.
                Eg: [II, IX, IY, IZ, XI, XX, XY,...]
            order=0 is ordered by weights.
                Eg. [II, IX, IY, IZ, XI, XY, XZ, XX, XY,...]

    Returns:
        np.array: A superoperator in the Pauli basis.
    """
    if arg_1 == 0:
        arg_1 = 'weight'
    elif arg_1 == 1:
        arg_1 = 'tensor'

    # get number of qubits'
    arg_2 = int(np.log2(np.sqrt(len(arg_0))))
    arg_3 = pauli_group(arg_2, case=arg_1)
    arg_4 = []
    for arg_5 in arg_3:
        for arg_6 in arg_3:
            arg_7 = np.kron(arg_6.to_matrix().T, arg_5.to_matrix())
            arg_4 += [np.trace(np.dot(arg_0, arg_7))]
    return np.array(arg_4).reshape(4 ** arg_2, 4 ** arg_2)

Convert a Choi - matrix to a Pauli - basis superoperator .


def Func(arg_0, arg_1):
        """ Handles the open action. """

        if not arg_1.initialized: return # Escape.

#        retval = self.edit_traits(parent=info.ui.control, view="file_view")

        arg_2 = FileDialog( action = "open",
            wildcard = "Graphviz Files (*.dot, *.xdot, *.txt)|"
                "*.dot;*.xdot;*.txt|Dot Files (*.dot)|*.dot|"
                "All Files (*.*)|*.*|")

        if arg_2.open() == OK:
            arg_3 = GodotDataParser()
            arg_4 = arg_3.parse_dot_file(arg_2.path)
            if arg_4 is not None:
                arg_0.model = arg_4
            else:
                print "error parsing: %s" % arg_2.path

            arg_0.save_file = arg_2.path

        del arg_2


return {k: np.copy(v) for k, v in obs.items()}

def Func ( arg_0 ) : return { arg_1 : np . copy ( arg_2 ) for arg_1 , arg_2 in arg_0 . items ( ) }

def Func(arg_0):
    """
    Deep-copy an observation dict.
    """
    return {arg_1: np.copy(arg_2) for arg_1, arg_2 in arg_0.items()}


(
        pfpkl_dir,
        lcbasedir,
        outdir,
        pfpkl_glob='periodfinding-*.pkl*',
        starfeaturesdir=None,
        fourierorder=5,
        # these are depth, duration, ingress duration
        transitparams=(-0.01,0.1,0.1),
        # these are depth, duration, depth ratio, secphase
        ebparams=(-0.2,0.3,0.7,0.5),
        pdiff_threshold=1.0e-4,
        sidereal_threshold=1.0e-4,
        sampling_peak_multiplier=5.0,
        sampling_startp=None,
        sampling_endp=None,
        timecols=None,
        magcols=None,
        errcols=None,
        lcformat='hat-sql',
        lcformatdir=None,
        sigclip=10.0,
        verbose=False,
        maxobjects=None,
        nworkers=NCPUS,
        recursive=True,
)

def Func(
        arg_0,
        arg_1,
        arg_2,
        arg_3='periodfinding-*.pkl*',
        arg_4=None,
        arg_5=5,
        # these are depth, duration, ingress duration
        arg_6=(-0.01,0.1,0.1),
        # these are depth, duration, depth ratio, secphase
        arg_7=(-0.2,0.3,0.7,0.5),
        arg_8=1.0e-4,
        arg_9=1.0e-4,
        arg_10=5.0,
        arg_11=None,
        arg_12=None,
        arg_13=None,
        arg_14=None,
        arg_15=None,
        arg_16='hat-sql',
        arg_17=None,
        arg_18=10.0,
        arg_19=False,
        arg_20=None,
        arg_21=arg_22,
        arg_23=True,
):
    '''This runs parallel periodicfeature extraction for a directory of
    periodfinding result pickles.

    Parameters
    ----------

    pfpkl_dir : str
        The directory containing the pickles to process.

    lcbasedir : str
        The directory where all of the associated light curve files are located.

    outdir : str
        The directory where all the output will be written.

    pfpkl_glob : str
        The UNIX file glob to use to search for period-finder result pickles in
        `pfpkl_dir`.

    starfeaturesdir : str or None
        The directory containing the `starfeatures-<objectid>.pkl` files for
        each object to use calculate neighbor proximity light curve features.

    fourierorder : int
        The Fourier order to use to generate sinusoidal function and fit that to
        the phased light curve.

    transitparams : list of floats
        The transit depth, duration, and ingress duration to use to generate a
        trapezoid planet transit model fit to the phased light curve. The period
        used is the one provided in `period`, while the epoch is automatically
        obtained from a spline fit to the phased light curve.

    ebparams : list of floats
        The primary eclipse depth, eclipse duration, the primary-secondary depth
        ratio, and the phase of the secondary eclipse to use to generate an
        eclipsing binary model fit to the phased light curve. The period used is
        the one provided in `period`, while the epoch is automatically obtained
        from a spline fit to the phased light curve.

    pdiff_threshold : float
        This is the max difference between periods to consider them the same.

    sidereal_threshold : float
        This is the max difference between any of the 'best' periods and the
        sidereal day periods to consider them the same.

    sampling_peak_multiplier : float
        This is the minimum multiplicative factor of a 'best' period's
        normalized periodogram peak over the sampling periodogram peak at the
        same period required to accept the 'best' period as possibly real.

    sampling_startp, sampling_endp : float
        If the `pgramlist` doesn't have a time-sampling Lomb-Scargle
        periodogram, it will be obtained automatically. Use these kwargs to
        control the minimum and maximum period interval to be searched when
        generating this periodogram.

    timecols : list of str or None
        The timecol keys to use from the lcdict in calculating the features.

    magcols : list of str or None
        The magcol keys to use from the lcdict in calculating the features.

    errcols : list of str or None
        The errcol keys to use from the lcdict in calculating the features.

    lcformat : str
        This is the `formatkey` associated with your light curve format, which
        you previously passed in to the `lcproc.register_lcformat`
        function. This will be used to look up how to find and read the light
        curves specified in `basedir` or `use_list_of_filenames`.

    lcformatdir : str or None
        If this is provided, gives the path to a directory when you've stored
        your lcformat description JSONs, other than the usual directories lcproc
        knows to search for them in. Use this along with `lcformat` to specify
        an LC format JSON file that's not currently registered with lcproc.

    sigclip : float or int or sequence of two floats/ints or None
        If a single float or int, a symmetric sigma-clip will be performed using
        the number provided as the sigma-multiplier to cut out from the input
        time-series.

        If a list of two ints/floats is provided, the function will perform an
        'asymmetric' sigma-clip. The first element in this list is the sigma
        value to use for fainter flux/mag values; the second element in this
        list is the sigma value to use for brighter flux/mag values. For
        example, `sigclip=[10., 3.]`, will sigclip out greater than 10-sigma
        dimmings and greater than 3-sigma brightenings. Here the meaning of
        "dimming" and "brightening" is set by *physics* (not the magnitude
        system), which is why the `magsarefluxes` kwarg must be correctly set.

        If `sigclip` is None, no sigma-clipping will be performed, and the
        time-series (with non-finite elems removed) will be passed through to
        the output.

    verbose : bool
        If True, will indicate progress while working.

    maxobjects : int
        The total number of objects to process from `pfpkl_list`.

    nworkers : int
        The number of parallel workers to launch to process the input.

    Returns
    -------

    dict
        A dict containing key: val pairs of the input period-finder result and
        the output periodic feature result pickles for each input pickle is
        returned.

    '''

    try:
        arg_24 = get_lcformat(arg_16,
                                  use_lcformat_dir=arg_17)
        if arg_24:
            (arg_25, arg_26,
             arg_27, arg_28, arg_29,
             arg_30, arg_31) = arg_24
        else:
            LOGERROR("can't figure out the light curve format")
            return None
    except Exception as e:
        LOGEXCEPTION("can't figure out the light curve format")
        return None

    arg_32 = arg_3

    # now find the files
    LOGINFO('searching for periodfinding pickles in %s ...' % arg_0)

    if arg_23 is False:
        arg_33 = glob.glob(os.path.join(arg_0, arg_32))

    else:
        # use recursive glob for Python 3.5+
        if sys.version_info[:2] > (3,4):

            arg_33 = glob.glob(os.path.join(arg_0,
                                              '**',
                                              arg_32),arg_23=True)

        # otherwise, use os.walk and glob
        else:

            # use os.walk to go through the directories
            arg_34 = os.walk(arg_0)
            arg_33 = []

            for arg_35, arg_36, arg_37 in arg_34:
                for arg_38 in arg_36:
                    arg_39 = os.path.join(arg_35,
                                              arg_38,
                                              arg_32)
                    arg_40 = glob.glob(arg_39)

                    if arg_40:
                        arg_33.extend(arg_40)

    # now that we have all the files, process them
    if arg_33 and len(arg_33) > 0:

        LOGINFO('found %s periodfinding pickles, getting periodicfeatures...' %
                len(arg_33))

        return parallel_periodicfeatures(
            arg_33,
            arg_1,
            arg_2,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=arg_6,
            arg_7=arg_7,
            arg_8=arg_8,
            arg_9=arg_9,
            arg_10=arg_10,
            arg_11=arg_11,
            arg_12=arg_12,
            arg_13=arg_13,
            arg_14=arg_14,
            arg_15=arg_15,
            arg_16=arg_16,
            arg_17=arg_17,
            arg_18=arg_18,
            arg_19=arg_19,
            arg_20=arg_20,
            arg_21=arg_21,
        )

    else:

        LOGERROR('no periodfinding pickles found in %s' % (arg_0))
        return None

This runs parallel periodicfeature extraction for a directory of periodfinding result pickles .


def Func ( arg_0 ) : arg_1 = obtain_licenses ( ) try : arg_2 = arg_0 . metadata [ 'license_url' ] except KeyError : raise exceptions . MissingRequiredMetadata ( 'license_url' ) try : arg_3 = arg_1 [ arg_2 ] except KeyError : raise exceptions . InvalidLicense ( arg_2 ) if not arg_3 [ 'is_valid_for_publication' ] : raise exceptions . InvalidLicense ( arg_2 )

def Func(arg_0):
    """Given the model, check the license is one valid for publication."""
    arg_1 = obtain_licenses()
    try:
        arg_2 = arg_0.metadata['license_url']
    except KeyError:
        raise exceptions.MissingRequiredMetadata('license_url')
    try:
        arg_3 = arg_1[arg_2]
    except KeyError:
        raise exceptions.InvalidLicense(arg_2)
    if not arg_3['is_valid_for_publication']:
        raise exceptions.InvalidLicense(arg_2)

Given the model check the license is one valid for publication .


def Func ( arg_0 , arg_1 ) : arg_2 = tempfile . mktemp ( prefix = 'perceval_' ) with arg_1 . container as f_in : with open ( arg_2 , mode = 'wb' ) as f_out : for arg_3 in f_in : f_out . write ( arg_3 ) return arg_2

def Func(arg_0, arg_1):
        """Copy the contents of a mbox to a temporary file"""

        arg_2 = tempfile.mktemp(prefix='perceval_')

        with arg_1.container as f_in:
            with open(arg_2, mode='wb') as f_out:
                for arg_3 in f_in:
                    f_out.write(arg_3)
        return arg_2


def Func(arg_0, arg_1):
        """
        Return a Node representing the package.
        Files must have been added to the graph before this method is called.
        """
        arg_2 = BNode()
        arg_3 = (arg_2, RDF.type, arg_0.spdx_namespace.Package)
        arg_0.graph.add(arg_3)
        # Handle optional fields:
        arg_0.handle_pkg_optional_fields(arg_1, arg_2)
        # package name
        arg_4 = (arg_2, arg_0.spdx_namespace.name, Literal(arg_1.name))
        arg_0.graph.add(arg_4)
        # Package download location
        arg_5 = (arg_2, arg_0.spdx_namespace.downloadLocation, arg_0.to_special_value(arg_1.download_location))
        arg_0.graph.add(arg_5)
        # Handle package verification
        arg_6 = arg_0.package_verif_node(arg_1)
        arg_7 = (arg_2, arg_0.spdx_namespace.packageVerificationCode, arg_6)
        arg_0.graph.add(arg_7)
        # Handle concluded license
        arg_8 = arg_0.license_or_special(arg_1.conc_lics)
        arg_9 = (arg_2, arg_0.spdx_namespace.licenseConcluded, arg_8)
        arg_0.graph.add(arg_9)
        # Handle declared license
        arg_10 = arg_0.license_or_special(arg_1.license_declared)
        arg_11 = (arg_2, arg_0.spdx_namespace.licenseDeclared, arg_10)
        arg_0.graph.add(arg_11)
        # Package licenses from files
        arg_12 = map(lambda el: arg_0.license_or_special(el), arg_1.licenses_from_files)
        arg_13 = arg_0.spdx_namespace.licenseInfoFromFiles
        arg_14 = [(arg_2, arg_13, node) for node in arg_12]
        for arg_15 in arg_14:
            arg_0.graph.add(arg_15)
        # Copyright Text
        arg_16 = arg_0.to_special_value(arg_1.cr_text)
        arg_17 = (arg_2, arg_0.spdx_namespace.copyrightText, arg_16)
        arg_0.graph.add(arg_17)
        # Handle files
        arg_0.handle_package_has_file(arg_1, arg_2)
        return arg_2

Return a Node representing the package . Files must have been added to the graph before this method is called .


def Func(arg_0, arg_1, arg_2, arg_3):
        r'''Method to calculate pressure-dependent liquid thermal conductivity
        at temperature `T` and pressure `P` with a given method.

        This method has no exception handling; see `TP_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate liquid thermal conductivity, [K]
        P : float
            Pressure at which to calculate liquid thermal conductivity, [K]
        method : str
            Name of the method to use

        Returns
        -------
        kl : float
            Thermal conductivity of the liquid at T and P, [W/m/K]
        '''
        if arg_3 == DIPPR_9G:
            arg_4 = arg_0.T_dependent_property(arg_1)
            arg_4 = DIPPR9G(arg_1, arg_2, arg_0.Tc, arg_0.Pc, arg_4)
        elif arg_3 == MISSENARD:
            arg_4 = arg_0.T_dependent_property(arg_1)
            arg_4 = Missenard(arg_1, arg_2, arg_0.Tc, arg_0.Pc, arg_4)
        elif arg_3 == COOLPROP:
            arg_4 = PropsSI('L', 'T', arg_1, 'P', arg_2, arg_0.CASRN)
        elif arg_3 in arg_0.tabular_data:
            arg_4 = arg_0.interpolate_P(arg_1, arg_2, arg_3)
        return arg_4

r Method to calculate pressure - dependent liquid thermal conductivity at temperature T and pressure P with a given method .


return [
            lst for arg in self.arguments for lst in arg.lists(pattern) if lst]

def Func ( arg_0 , arg_1 : arg_2 = None ) -> List [ WikiList ] : return [ arg_4 for arg_3 in arg_0 . arguments for arg_4 in arg_3 . Func ( arg_1 ) if arg_4 ]

def Func(arg_0, arg_1: arg_2 = None) -> List[WikiList]:
        """Return the Func in all arguments.

        For performance reasons it is usually preferred to get a specific
        Argument and use the `Func` method of that argument instead.
        """
        return [
            arg_4 for arg_3 in arg_0.arguments for arg_4 in arg_3.Func(arg_1) if arg_4]

Return the lists in all arguments.

        For performance reasons it is usually preferred to get a specific
        Argument and use the `lists` method of that argument instead.


def Func ( arg_0 , arg_1 : arg_1 . Symbol , arg_3 : arg_4 ) -> None : if not arg_3 . is_private : arg_0 . _refers . swap ( lambda s : s . assoc ( arg_1 , arg_3 ) )

def Func(arg_0, arg_1: arg_1.Symbol, arg_3: arg_4) -> None:
        """Refer var in this namespace under the name sym."""
        if not arg_3.is_private:
            arg_0._refers.swap(lambda s: s.assoc(arg_1, arg_3))

Refer var in this namespace under the name sym .


def Func(arg_0: arg_1, arg_2: arg_1, arg_3: arg_1) -> arg_1:
    """
    Calculate the Funcerwood number.

    :param L: [m] mass transfer surface characteristic length.
    :param h: [m/s] mass transfer coefficient.
    :param D: [m2/s] fluid mass diffusivity.

    :returns: float
    """

    return arg_2 * arg_0 / arg_3

Calculate the Sherwood number.

    :param L: [m] mass transfer surface characteristic length.
    :param h: [m/s] mass transfer coefficient.
    :param D: [m2/s] fluid mass diffusivity.

    :returns: float


def Func ( arg_0 , arg_1 , arg_2 = arg_3 ) : def checker ( arg_4 ) : if arg_2 ( arg_4 ) < arg_0 or arg_2 ( arg_4 ) > arg_1 : raise ValueError ( arg_4 ) return checker

def Func(arg_0, arg_1, arg_2=arg_3):
    """
    Return a value check function which raises a ValueError if the supplied
    value when cast as `type` is less than `min` or greater than `max`.

    """

    def checker(arg_4):
        if arg_2(arg_4) < arg_0 or arg_2(arg_4) > arg_1:
            raise ValueError(arg_4)
    return checker

Return a value check function which raises a ValueError if the supplied value when cast as type is less than min or greater than max .


def Func ( arg_0 ) : @ wraps ( arg_0 ) def inner ( * arg_1 , ** arg_2 ) : arg_3 = Course . get_selected ( ) return arg_0 ( arg_3 , * arg_1 , ** arg_2 ) return inner

def Func(arg_0):
    """
    Passes the selected course as the first argument to func.
    """
    @wraps(arg_0)
    def inner(*arg_1, **arg_2):
        arg_3 = Course.get_selected()
        return arg_0(arg_3, *arg_1, **arg_2)
    return inner

Passes the selected course as the first argument to func .


def Func(arg_0, arg_1, arg_2):
        """ remove decoded instruction from instruction cache """
        arg_3 = arg_0.instruction_cache
        for arg_4 in range(arg_2):
            if arg_1 + arg_4 in arg_3:
                del arg_3[arg_1 + arg_4]


def Func(arg_0, arg_1, arg_2=True):
    r"""Create variants metadata file.

    Variants metadata file helps speed up subsequent reads of the associated
    bgen file.

    Parameters
    ----------
    bgen_filepath : str
        Bgen file path.
    metafile_file : str
        Metafile file path.
    verbose : bool
        ``True`` to show progress; ``False`` otherwise.

    Examples
    --------
    .. doctest::

        >>> import os
        >>> from bgen_reader import Func, example_files
        >>>
        >>> with example_files("example.32bits.bgen") as filepath:
        ...     folder = os.path.dirname(filepath)
        ...     metafile_filepath = os.path.join(folder, filepath + ".metadata")
        ...
        ...     try:
        ...         Func(filepath, metafile_filepath, verbose=False)
        ...     finally:
        ...         if os.path.exists(metafile_filepath):
        ...             os.remove(metafile_filepath)
    """
    if arg_2:
        arg_2 = 1
    else:
        arg_2 = 0

    arg_0 = make_sure_bytes(arg_0)
    arg_1 = make_sure_bytes(arg_1)

    assert_file_exist(arg_0)
    assert_file_readable(arg_0)

    if exists(arg_1):
        raise ValueError(f"The file {metafile_filepath} already exists.")

    with bgen_file(arg_0) as bgen:
        arg_3 = _estimate_best_npartitions(lib.bgen_nvariants(bgen))
        arg_4 = lib.bgen_Func(bgen, arg_1, arg_3, arg_2)
        if arg_4 == ffi.NULL:
            raise RuntimeError(f"Error while creating metafile: {metafile_filepath}.")

        if lib.bgen_close_metafile(arg_4) != 0:
            raise RuntimeError(f"Error while closing metafile: {metafile_filepath}.")

r"""Create variants metadata file.

    Variants metadata file helps speed up subsequent reads of the associated
    bgen file.

    Parameters
    ----------
    bgen_filepath : str
        Bgen file path.
    metafile_file : str
        Metafile file path.
    verbose : bool
        ``True`` to show progress; ``False`` otherwise.

    Examples
    --------
    .. doctest::

        >>> import os
        >>> from bgen_reader import create_metafile, example_files
        >>>
        >>> with example_files("example.32bits.bgen") as filepath:
        ...     folder = os.path.dirname(filepath)
        ...     metafile_filepath = os.path.join(folder, filepath + ".metadata")
        ...
        ...     try:
        ...         create_metafile(filepath, metafile_filepath, verbose=False)
        ...     finally:
        ...         if os.path.exists(metafile_filepath):
        ...             os.remove(metafile_filepath)


return self._waitFor(timeout, notification, **kwargs)

def Func(arg_0, arg_1, arg_2, **arg_3):
        """Generic wait for a UI event that matches the specified
        criteria to occur.

        For customization of the callback, use keyword args labeled
        'callback', 'args', and 'kwargs' for the callback fn, callback args,
        and callback kwargs, respectively.  Also note that on return,
        the observer-returned UI element will be included in the first
        argument if 'args' are given.  Note also that if the UI element is
        destroyed, callback should not use it, otherwise the function will
        hang.
        """
        return arg_0._Func(arg_1, arg_2, **arg_3)

Generic wait for a UI event that matches the specified criteria to occur .


(cobra_model, filename, f_replace=F_REPLACE, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = arg_3 , ** arg_4 ) : arg_5 = _model_to_sbml ( arg_0 , arg_2 = arg_2 , ** arg_4 ) if isinstance ( arg_1 , string_types ) : libsbml . writeSBMLToFile ( arg_5 , arg_1 ) elif hasattr ( arg_1 , "write" ) : arg_6 = libsbml . writeSBMLToString ( arg_5 ) arg_1 . write ( arg_6 )

def Func(arg_0, arg_1, arg_2=arg_3, **arg_4):
    """Writes cobra model to filename.

    The created model is SBML level 3 version 1 (L1V3) with
    fbc package v2 (fbc-v2).

    If the given filename ends with the suffix ".gz" (for example,
    "myfile.xml.gz"), libSBML assumes the caller wants the file to be
    written compressed in gzip format. Similarly, if the given filename
    ends with ".zip" or ".bz2", libSBML assumes the caller wants the
    file to be compressed in zip or bzip2 format (respectively). Files
    whose names lack these suffixes will be written uncompressed. Special
    considerations for the zip format: If the given filename ends with
    ".zip", the file placed in the zip archive will have the suffix
    ".xml" or ".sbml".  For example, the file in the zip archive will
    be named "test.xml" if the given filename is "test.xml.zip" or
    "test.zip". Similarly, the filename in the archive will be
    "test.sbml" if the given filename is "test.sbml.zip".

    Parameters
    ----------
    cobra_model : cobra.core.Model
        Model instance which is written to SBML
    filename : string
        path to which the model is written
    use_fbc_package : boolean {True, False}
        should the fbc package be used
    f_replace: dict of replacement functions for id replacement
    """
    arg_5 = _model_to_sbml(arg_0, arg_2=arg_2, **arg_4)

    if isinstance(arg_1, string_types):
        # write to path
        libsbml.writeSBMLToFile(arg_5, arg_1)

    elif hasattr(arg_1, "write"):
        # write to file handle
        arg_6 = libsbml.writeSBMLToString(arg_5)
        arg_1.write(arg_6)


def Func ( arg_0 ) : arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 = arg_0 arg_10 = [ arg_6 , arg_6 + arg_2 ] arg_11 = h5py . File ( arg_1 . database , 'r' ) arg_12 = arg_11 [ "filters" ] [ arg_10 [ 0 ] : arg_10 [ 1 ] , ] arg_13 = arg_11 [ "edges" ] [ arg_10 [ 0 ] : arg_10 [ 1 ] , ] arg_14 = arg_11 [ "snps" ] [ arg_10 [ 0 ] : arg_10 [ 1 ] , ] arg_15 = h5py . File ( arg_1 . clust_database , 'r' ) if arg_9 : arg_16 = np . char . upper ( arg_15 [ "seqs" ] [ arg_10 [ 0 ] : arg_10 [ 1 ] , ] ) else : arg_16 = arg_15 [ "seqs" ] [ arg_10 [ 0 ] : arg_10 [ 1 ] , ] arg_17 = np . where ( np . sum ( arg_12 , axis = 1 ) == 0 ) [ 0 ] arg_18 = [ ] for arg_19 in arg_17 : arg_20 = arg_13 [ arg_19 ] arg_0 = [ arg_19 , arg_3 , arg_4 , arg_20 , arg_16 , arg_14 , arg_5 , arg_7 , arg_8 , arg_6 ] if arg_20 [ 4 ] : arg_21 , arg_7 , arg_8 = enter_pairs ( * arg_0 ) arg_18 . append ( arg_21 ) else : arg_21 , arg_7 , arg_8 = enter_singles ( * arg_0 ) arg_18 . append ( arg_21 ) arg_22 = os . path . join ( arg_1 . dirs . outfiles , arg_1 . name + ".loci.{}" . format ( arg_6 ) ) with open ( arg_22 , 'w' ) as tmpout : tmpout . write ( "\n" . join ( arg_18 ) + "\n" ) arg_15 . close ( ) arg_11 . close ( ) return arg_7 , arg_8 , arg_6

def Func(arg_0):
    """
    Function from make_loci to apply to chunks. smask is sample mask.
    """
    ## parse args
    arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9 = arg_0

    ## this slice
    arg_10 = [arg_6, arg_6+arg_2]

    ## get filter db info
    arg_11 = h5py.File(arg_1.database, 'r')
    arg_12 = arg_11["filters"][arg_10[0]:arg_10[1], ]
    arg_13 = arg_11["edges"][arg_10[0]:arg_10[1], ]
    arg_14 = arg_11["snps"][arg_10[0]:arg_10[1], ]

    ## get seqs db
    arg_15 = h5py.File(arg_1.clust_database, 'r')
    if arg_9:
        arg_16 = np.char.upper(arg_15["seqs"][arg_10[0]:arg_10[1], ])
    else:
        arg_16 = arg_15["seqs"][arg_10[0]:arg_10[1], ]

    ## which loci passed all filters
    arg_17 = np.where(np.sum(arg_12, axis=1) == 0)[0]
    arg_18 = []

    ## write loci that passed after trimming edges, then write snp string
    for arg_19 in arg_17:
        arg_20 = arg_13[arg_19]
        #LOGGER.info("!!!!!! iloc edg %s, %s", iloc, edg)
        arg_0 = [arg_19, arg_3, arg_4, arg_20, arg_16, arg_14, arg_5, arg_7, arg_8, arg_6]
        if arg_20[4]:
            arg_21, arg_7, arg_8 = enter_pairs(*arg_0)
            arg_18.append(arg_21)
        else:
            arg_21, arg_7, arg_8 = enter_singles(*arg_0)
            arg_18.append(arg_21)

    ## write to file and clear store
    arg_22 = os.path.join(arg_1.dirs.outfiles, arg_1.name+".loci.{}".format(arg_6))
    with open(arg_22, 'w') as tmpout:
        tmpout.write("\n".join(arg_18) + "\n")

    ## close handles
    arg_15.close()
    arg_11.close()

    ## return sample counter
    return arg_7, arg_8, arg_6

Function from make_loci to apply to chunks . smask is sample mask .


return os.path.splitext(self.outfile)[0] + os.path.extsep + ending

def Func ( arg_0 , arg_1 = 'rst' ) : return os . path . splitext ( arg_0 . outfile ) [ 0 ] + os . path . extsep + arg_1

def Func(arg_0, arg_1='rst'):
        """get the output file with the specified `ending`"""
        return os.path.splitext(arg_0.outfile)[0] + os.path.extsep + arg_1

get the output file with the specified ending


def Func ( arg_0 ) : arg_1 = json . loads ( arg_0 ) arg_2 = arg_1 [ 'issues' ] for arg_3 in arg_2 : yield arg_3

def Func(arg_0):
        """Parse a Redmine issues JSON stream.

        The method parses a JSON stream and returns a list iterator.
        Each item is a dictionary that contains the issue parsed data.

        :param raw_json: JSON string to parse

        :returns: a generator of parsed issues
        """
        arg_1 = json.loads(arg_0)

        arg_2 = arg_1['issues']
        for arg_3 in arg_2:
            yield arg_3


def Func ( arg_0 , arg_1 : arg_2 . Seq ) -> [ ast . stmt ] or ast . expr : arg_4 , arg_5 = [ ] , [ ] for arg_6 in arg_1 . ptlist : arg_7 = arg_0 . visit ( arg_6 ) if isinstance ( arg_7 , ast . expr ) : arg_4 . append ( arg_7 ) else : if arg_4 : arg_5 . extend ( arg_0 . combine_exprs_for_clauses ( arg_4 ) ) arg_4 = [ ] arg_5 . extend ( arg_0 . _clause ( arg_7 ) ) if not arg_5 : return ast . BoolOp ( ast . And ( ) , arg_4 ) if arg_4 : arg_5 . extend ( arg_0 . combine_exprs_for_clauses ( arg_4 ) ) return arg_5

def Func(arg_0, arg_1: arg_2.Seq) -> [ast.stmt] or ast.expr:
        """Generates python code for clauses.

        #Continuous clauses which can can be inlined are combined with and
        clause and clause

        if not clause:
            return False
        if not clause:
            return False
        """
        arg_4, arg_5 = [], []
        for arg_6 in arg_1.ptlist:
            arg_7 = arg_0.visit(arg_6)
            if isinstance(arg_7, ast.expr):
                arg_4.append(arg_7)
            else:
                if arg_4:
                    arg_5.extend(arg_0.combine_exprs_for_clauses(arg_4))
                    arg_4 = []
                arg_5.extend(arg_0._clause(arg_7))
        if not arg_5:
            return ast.BoolOp(ast.And(), arg_4)
        if arg_4:
            arg_5.extend(arg_0.combine_exprs_for_clauses(arg_4))
        return arg_5


def Func(arg_0, arg_1, arg_2):
        """
        Sets the current storage service to service_name and runs the connect method on the service.

        :param str service_name: Name of the storage service
        :param str custom_path: Custom path where to download tracks for local storage (optional, and must already exist, use absolute paths only)
        """

        try:
            arg_0.current_storage = arg_0.storage_services[arg_1]
        except KeyError:
            if arg_1 == 'google drive':
                arg_0.storage_services['google drive'] = GoogleDrive()
                arg_0.current_storage = arg_0.storage_services['google drive']
                arg_0.current_storage.connect()
            elif arg_1 == 'dropbox':
                log.error('Dropbox is not supported yet.')
            elif arg_1 == 'local':
                arg_0.storage_services['local'] = LocalStorage(arg_2=arg_2)
                arg_0.current_storage = arg_0.storage_services['local']
                arg_0.current_storage.connect()
            else:
                log.error('Storage service name is not recognized.')

Sets the current storage service to service_name and runs the connect method on the service .


def Func ( arg_0 ) : with open ( os . path . join ( arg_0 . template_dir , 'manage.py' ) , 'r' ) as fd : arg_1 = fd . read ( ) . format ( project_name = arg_0 . project_name ) with open ( 'manage.py' , 'w' ) as fd : fd . write ( arg_1 ) os . chmod ( 'manage.py' , 0o777 )

def Func(arg_0):
        """Write manage.py in the current directory"""
        with open(os.path.join(arg_0.template_dir, 'manage.py'), 'r') as fd:
            arg_1 = fd.read().format(project_name=arg_0.project_name)

        with open('manage.py', 'w') as fd:
            fd.write(arg_1)

        os.chmod('manage.py', 0o777)

Write manage . py in the current directory


def
Func
(
arg_0
,
arg_1
)
:
if
len
(
arg_1
)
==
1
:
raise
InvalidArgument
(
'No s3 bucketname provided'
)
arg_0
.
validate
(
'cmd|s3'
,
arg_1
)
arg_0
.
s3handler
(
)
.
create_bucket
(
arg_1
[
1
]
)

def Func(arg_0, arg_1):
    '''Handler for mb command'''
    if len(arg_1) == 1:
      raise InvalidArgument('No s3 bucketname provided')

    arg_0.validate('cmd|s3', arg_1)
    arg_0.s3handler().create_bucket(arg_1[1])


def Func ( arg_0 ) : global arg_3 global arg_4 global arg_5 global arg_6 global arg_7 if len ( arg_0 ) < 2 : usage ( ) arg_1 = 1 while ( arg_1 < len ( arg_0 ) ) : arg_2 = arg_0 [ arg_1 ] if ( arg_2 == "--inputfileadd" ) : arg_1 += 1 if ( arg_1 > len ( arg_0 ) ) : usage ( ) arg_3 = arg_0 [ arg_1 ] elif ( arg_2 == "--inputfilerm" ) : arg_1 += 1 if ( arg_1 > len ( arg_0 ) ) : usage ( ) arg_4 = arg_0 [ arg_1 ] elif ( arg_2 == "--loadjavamessage" ) : arg_1 += 1 if arg_1 > len ( arg_0 ) : usage ( ) arg_5 = arg_0 [ arg_1 ] elif ( arg_2 == "--savejavamessage" ) : arg_1 += 1 if ( arg_1 > len ( arg_0 ) ) : usage ( ) arg_6 = arg_0 [ arg_1 ] elif ( arg_2 == '--printjavamessage' ) : arg_1 += 1 arg_7 = True arg_5 = arg_0 [ arg_1 ] elif ( arg_2 == '--help' ) : usage ( ) else : unknown_arg ( arg_2 ) arg_1 += 1

def Func(arg_0):
    """
    Parse user inputs and set the corresponing global variables to perform the
    necessary tasks.

    Parameters
    ----------

    argv : string array
        contains flags and input options from users

    :return:
    """
    global arg_3
    global arg_4
    global arg_5
    global arg_6
    global arg_7

    if len(arg_0) < 2:   # print out help menu if user did not enter any arguments.
        usage()

    arg_1 = 1
    while (arg_1 < len(arg_0)):
        arg_2 = arg_0[arg_1]

        if (arg_2 == "--inputfileadd"):         # input text file where new java messages are stored
            arg_1 += 1
            if (arg_1 > len(arg_0)):
                usage()
            arg_3 = arg_0[arg_1]
        elif (arg_2 == "--inputfilerm"):        # input text file containing java messages to be removed from the ignored list
            arg_1 += 1
            if (arg_1 > len(arg_0)):
                usage()
            arg_4 = arg_0[arg_1]
        elif (arg_2 == "--loadjavamessage"):    # load previously saved java message pickle file from file other than
            arg_1 += 1                          # the default one before performing update
            if arg_1 > len(arg_0):
                usage()
            arg_5 = arg_0[arg_1]
        elif (arg_2 == "--savejavamessage"):    # save updated java message in this file instead of default file
            arg_1 += 1
            if (arg_1 > len(arg_0)):
                usage()
            arg_6 = arg_0[arg_1]
        elif (arg_2 == '--printjavamessage'):   # will print java message out to console and save in a text file
            arg_1 += 1
            arg_7 = True
            arg_5 = arg_0[arg_1]
        elif (arg_2 == '--help'):               # print help menu and exit
            usage()
        else:
            unknown_arg(arg_2)

        arg_1 += 1

Parse user inputs and set the corresponing global variables to perform the necessary tasks .


(command, data=None, env=None, cwd=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_4 = expand_args ( arg_0 ) . pop ( ) arg_5 = dict ( os . environ ) arg_5 . update ( arg_2 or { } ) arg_6 = subprocess . Popen ( arg_4 , universal_newlines = True , shell = False , arg_2 = arg_5 , stdin = subprocess . PIPE , stdout = subprocess . PIPE , stderr = subprocess . PIPE , bufsize = 0 , arg_3 = arg_3 , ) return ConnectedCommand ( arg_6 = arg_6 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
    """Spawns a new process from the given command."""

    # TODO: support piped commands
    arg_4 = expand_args(arg_0).pop()
    arg_5 = dict(os.environ)
    arg_5.update(arg_2 or {})

    arg_6 = subprocess.Popen(arg_4,
        universal_newlines=True,
        shell=False,
        arg_2=arg_5,
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        bufsize=0,
        arg_3=arg_3,
    )

    return ConnectedCommand(arg_6=arg_6)

Spawns a new process from the given command .


(
    state,
    name,
    same_as=False,
    not_imported_msg="Did you import `{{pkg}}`?",
    incorrect_as_msg="Did you import `{{pkg}}` as `{{alias}}`?",
)

def Func(
    arg_0,
    arg_1,
    arg_2=False,
    arg_3="Did you import `{{pkg}}`?",
    arg_4="Did you import `{{pkg}}` as `{{alias}}`?",
):
    """Checks whether student imported a package or function correctly.

    Python features many ways to import packages.
    All of these different methods revolve around the ``import``, ``from`` and ``as`` keywords.
    ``Func()`` provides a robust way to check whether a student correctly imported a certain package.

    By default, ``Func()`` allows for different ways of aliasing the imported package or function.
    If you want to make sure the correct alias was used to refer to the package or function that was imported,
    set ``same_as=True``.

    Args:
        name (str): the name of the package that has to be checked.
        same_as (bool): if True, the alias of the package or function has to be the same. Defaults to False.
        not_imported_msg (str): feedback message when the package is not imported.
        incorrect_as_msg (str): feedback message if the alias is wrong.

    :Example:

        Example 1, where aliases don't matter (defaut): ::

            # solution
            import matplotlib.pyplot as plt

            # sct
            Ex().Func("matplotlib.pyplot")

            # passing submissions
            import matplotlib.pyplot as plt
            from matplotlib import pyplot as plt
            import matplotlib.pyplot as pltttt

            # failing submissions
            import matplotlib as mpl

        Example 2, where the SCT is coded so aliases do matter: ::

            # solution
            import matplotlib.pyplot as plt

            # sct
            Ex().Func("matplotlib.pyplot", same_as=True)

            # passing submissions
            import matplotlib.pyplot as plt
            from matplotlib import pyplot as plt

            # failing submissions
            import matplotlib.pyplot as pltttt

    """
    arg_5 = arg_0.ast_dispatcher("imports", arg_0.student_ast)
    arg_6 = arg_0.ast_dispatcher("imports", arg_0.solution_ast)

    if arg_1 not in arg_6:
        raise InstructorError(
            "`Func()` couldn't find an import of the package %s in your solution code."
            % arg_1
        )

    arg_7 = {"pkg": arg_1, "alias": arg_6[arg_1]}

    arg_8 = arg_0.build_message(arg_3, arg_7)
    arg_0.do_test(DefinedCollTest(arg_1, arg_5, arg_8))

    if arg_2:
        arg_8 = arg_0.build_message(arg_4, arg_7)
        arg_0.do_test(EqualTest(arg_6[arg_1], arg_5[arg_1], arg_8))

    return arg_0

Checks whether student imported a package or function correctly.

    Python features many ways to import packages.
    All of these different methods revolve around the ``import``, ``from`` and ``as`` keywords.
    ``has_import()`` provides a robust way to check whether a student correctly imported a certain package.

    By default, ``has_import()`` allows for different ways of aliasing the imported package or function.
    If you want to make sure the correct alias was used to refer to the package or function that was imported,
    set ``same_as=True``.

    Args:
        name (str): the name of the package that has to be checked.
        same_as (bool): if True, the alias of the package or function has to be the same. Defaults to False.
        not_imported_msg (str): feedback message when the package is not imported.
        incorrect_as_msg (str): feedback message if the alias is wrong.

    :Example:

        Example 1, where aliases don't matter (defaut): ::

            # solution
            import matplotlib.pyplot as plt

            # sct
            Ex().has_import("matplotlib.pyplot")

            # passing submissions
            import matplotlib.pyplot as plt
            from matplotlib import pyplot as plt
            import matplotlib.pyplot as pltttt

            # failing submissions
            import matplotlib as mpl

        Example 2, where the SCT is coded so aliases do matter: ::

            # solution
            import matplotlib.pyplot as plt

            # sct
            Ex().has_import("matplotlib.pyplot", same_as=True)

            # passing submissions
            import matplotlib.pyplot as plt
            from matplotlib import pyplot as plt

            # failing submissions
            import matplotlib.pyplot as pltttt

Checks whether student imported a package or function correctly .


def
Func
(
)
:
arg_0
=
'.'
arg_1
=
DATA_URL
.
split
(
'/'
)
[
1
]
arg_2
=
os
.
path
.
join
(
arg_0
,
arg_1
)
if
not
os
.
path
.
exists
(
arg_2
)
:
def
_progress
(
arg_3
,
arg_4
,
arg_5
)
:
sys
.
stdout
.
write
(
'\r>> Downloading %s %.1f%%'
%
(
arg_1
,
float
(
arg_3
*
arg_4
)
/
float
(
arg_5
)
*
100.0
)
)
sys
.
stdout
.
flush
(
)
arg_2
,
arg_6
=
urllib
.
request
.
urlretrieve
(
DATA_URL
,
arg_2
,
_progress
)
print
(
)
arg_7
=
os
.
stat
(
arg_2
)
print
(
'Successfully downloaded'
,
arg_1
,
arg_7
.
st_size
,
'bytes.'
)
arg_8
=
os
.
path
.
join
(
arg_0
,
'trees'
)
if
not
os
.
path
.
exists
(
arg_8
)
:
arg_9
=
zipfile
.
ZipFile
(
arg_2
,
'r'
)
arg_9
.
extractall
(
arg_0
)
arg_9
.
close
(
)

def Func():
  """Download and extract processed data and embeddings."""
  arg_0 = '.'
  arg_1 = DATA_URL.split('/')[-1]
  arg_2 = os.path.join(arg_0, arg_1)
  if not os.path.exists(arg_2):
    def _progress(arg_3, arg_4, arg_5):
      sys.stdout.write('\r>> Downloading %s %.1f%%' % (arg_1,
          float(arg_3 * arg_4) / float(arg_5) * 100.0))
      sys.stdout.flush()
    arg_2, arg_6 = urllib.request.urlretrieve(DATA_URL, arg_2, _progress)
    print()
    arg_7 = os.stat(arg_2)
    print('Successfully downloaded', arg_1, arg_7.st_size, 'bytes.')
  arg_8 = os.path.join(arg_0, 'trees')
  if not os.path.exists(arg_8):
    arg_9 = zipfile.ZipFile(arg_2, 'r')
    arg_9.extractall(arg_0)
    arg_9.close()

Download and extract processed data and embeddings .


def Func(arg_0, arg_1):
        """Schedule a task.

        :param task_id: identifier of the task to schedule

        :raises NotFoundError: raised when the requested task is not
            found in the registry
        """
        arg_2 = arg_0.registry.get(arg_1)

        arg_3 = arg_0._build_job_arguments(arg_2)

        arg_4 = arg_2.archiving_cfg

        arg_5 = False if not arg_4 else arg_4.fetch_from_archive
        # Schedule the job as soon as possible
        arg_6 = Q_ARCHIVE_JOBS if arg_5 else Q_CREATION_JOBS
        arg_7 = arg_0._scheduler.schedule_job_task(arg_6,
                                                   arg_2.task_id, arg_3,
                                                   delay=0)

        logger.info("Job #%s (task: %s) scheduled", arg_7, arg_2.task_id)

        return arg_7


def Func ( arg_0 ) : arg_1 = linspace ( - arg_0 / 2. , ( arg_0 ) / 2. , arg_0 ) arg_2 = sin ( arg_1 / float ( arg_0 ) * 2. * pi ) / ( arg_1 / float ( arg_0 ) * 2. * pi ) return arg_2

def Func(arg_0):
    r"""Riemann tapering window

    :param int N: window length

    .. math:: w(n) = 1 - \left| \frac{n}{N/2}  \right|^2

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

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

        from spectrum import window_visu
        window_visu(64, 'riesz')

    .. seealso:: :func:`create_window`, :class:`Window`
    """
    arg_1 = linspace(-arg_0/2., (arg_0)/2., arg_0)
    arg_2 = sin(arg_1/float(arg_0)*2.*pi) / (arg_1 / float(arg_0)*2.*pi)
    return arg_2


(L: float, Ts: float, Tf: float, beta: float, nu: float, g: float)

return g * beta * (Ts - Tf) * L**3.0 / nu**2.0

def Func(arg_0: arg_1, arg_2: arg_1, arg_3: arg_1, arg_4: arg_1, arg_5: arg_1, arg_6: arg_1):
    """
    Calculate the Funcashof number.

    :param L: [m] heat transfer surface characteristic length.
    :param Ts: [K] heat transfer surface temperature.
    :param Tf: [K] bulk fluid temperature.
    :param beta: [1/K] fluid coefficient of thermal expansion.
    :param nu: [m2/s] fluid kinematic viscosity.

    :returns: float

    .. math::
        \\mathrm{Func} = \\frac{g \\beta (Ts - Tinf ) L^3}{\\nu ^2}

    Characteristic dimensions:
        * vertical plate: vertical length
        * pipe: diameter
        * bluff body: diameter
    """

    return arg_6 * arg_4 * (arg_2 - arg_3) * arg_0**3.0 / arg_5**2.0

Calculate the Grashof number.

    :param L: [m] heat transfer surface characteristic length.
    :param Ts: [K] heat transfer surface temperature.
    :param Tf: [K] bulk fluid temperature.
    :param beta: [1/K] fluid coefficient of thermal expansion.
    :param nu: [m2/s] fluid kinematic viscosity.

    :returns: float

    .. math::
        \\mathrm{Gr} = \\frac{g \\beta (Ts - Tinf ) L^3}{\\nu ^2}

    Characteristic dimensions:
        * vertical plate: vertical length
        * pipe: diameter
        * bluff body: diameter


def Func ( arg_0 ) : try : import zipline . assets except ImportError : return arg_0 if isinstance ( arg_0 , zipline . assets . Asset ) : return arg_0 . symbol else : return arg_0

def Func(arg_0):
    """
    If zipline asset objects are used, we want to print them out prettily
    within the tear sheet. This function should only be applied directly
    before displaying.
    """

    try:
        import zipline.assets
    except ImportError:
        return arg_0

    if isinstance(arg_0, zipline.assets.Asset):
        return arg_0.symbol
    else:
        return arg_0

If zipline asset objects are used we want to print them out prettily within the tear sheet . This function should only be applied directly before displaying .


def Func ( arg_0 , Func ) : arg_0 . _T = Func arg_0 . _Hfr = arg_0 . _calculate_Hfr ( Func )

def Func(arg_0, Func):
        """
        Set the temperature of the stream to the specified value, and
        recalculate it's enthalpy.

        :param T: Temperature. [°C]
        """

        arg_0._T = Func
        arg_0._Hfr = arg_0._calculate_Hfr(Func)

Set the temperature of the stream to the specified value and recalculate it s enthalpy .


def
Func
(
arg_0
,
arg_1
=
True
)
:
arg_2
=
os
.
path
.
abspath
(
arg_0
)
Log
.
debug
(
"Add a pex to the path: %s"
%
arg_2
)
if
arg_2
not
in
sys
.
path
:
sys
.
path
.
insert
(
0
,
os
.
path
.
dirname
(
arg_2
)
)
if
arg_1
:
for
arg_3
in
_get_deps_list
(
arg_2
)
:
arg_4
=
os
.
path
.
join
(
os
.
path
.
dirname
(
arg_2
)
,
arg_3
)
if
arg_4
not
in
sys
.
path
:
Log
.
debug
(
"Add a new dependency to the path: %s"
%
arg_3
)
sys
.
path
.
insert
(
0
,
arg_4
)
Log
.
debug
(
"Python path: %s"
%
str
(
sys
.
path
)
)

def Func(arg_0, arg_1=True):
  """Loads pex file and its dependencies to the current python path"""
  arg_2 = os.path.abspath(arg_0)
  Log.debug("Add a pex to the path: %s" % arg_2)
  if arg_2 not in sys.path:
    sys.path.insert(0, os.path.dirname(arg_2))

  # add dependencies to path
  if arg_1:
    for arg_3 in _get_deps_list(arg_2):
      arg_4 = os.path.join(os.path.dirname(arg_2), arg_3)
      if arg_4 not in sys.path:
        Log.debug("Add a new dependency to the path: %s" % arg_3)
        sys.path.insert(0, arg_4)

  Log.debug("Python path: %s" % str(sys.path))


def Func(arg_0, arg_1):
  """Helper which interpolates between two locs."""
  if len(arg_1) != 2:
    raise NotImplementedError("Currently only bimixtures are supported; "
                              "len(scale)={} is not 2.".format(len(arg_1)))
  arg_2 = tf.compat.dimension_value(
      tensorshape_util.with_rank_at_least(arg_0.shape, 1)[-1])
  if arg_2 is None:
    raise ValueError("Num quadrature grid points must be known prior "
                     "to graph execution.")
  with tf.name_scope("Func"):
    if arg_1 is None or arg_1[0] is None and arg_1[1] is None:
      return [None]*arg_2
    # shape: [B, 1, k, deg]
    arg_3 = arg_0[..., tf.newaxis, :, :]
    arg_1 = [
        arg_4[..., tf.newaxis]  # shape: [B, e, 1]
        if arg_4 is not None else None for arg_4 in arg_1
    ]
    if arg_1[0] is None:
      arg_4 = arg_3[..., 1, :] * arg_1[1]                        # shape: [B, e, deg]
    elif arg_1[1] is None:
      arg_4 = arg_3[..., 0, :] * arg_1[0]                        # shape: [B, e, deg]
    else:
      arg_5 = arg_1[0] - arg_1[1]
      arg_4 = arg_3[..., 0, :] * arg_5 + arg_1[1]                # shape: [B, e, deg]
    return [arg_4[..., arg_6] for arg_6 in range(arg_2)]

Helper which interpolates between two locs .


(self, emails, displayName=None, firstName=None, lastName=None,
               avatar=None, orgId=None, roles=None, licenses=None,
               **request_parameters)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None,
               arg_5=None, arg_6=None, arg_7=None, arg_8=None,
               **arg_9):
        """Create a new user account for a given organization

        Only an admin can Func a new user account.

        Args:
            emails(`list`): Email address(es) of the person (list of strings).
            displayName(basestring): Full name of the person.
            firstName(basestring): First name of the person.
            lastName(basestring): Last name of the person.
            avatar(basestring): URL to the person's avatar in PNG format.
            orgId(basestring): ID of the organization to which this
                person belongs.
            roles(`list`): Roles of the person (list of strings containing
                the role IDs to be assigned to the person).
            licenses(`list`): Licenses allocated to the person (list of
                strings - containing the license IDs to be allocated to the
                person).
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            Person: A Person object with the details of the Funcd person.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.

        """
        check_type(arg_1, list, may_be_none=False)
        check_type(arg_2, basestring)
        check_type(arg_3, basestring)
        check_type(arg_4, basestring)
        check_type(arg_5, basestring)
        check_type(arg_6, basestring)
        check_type(arg_7, list)
        check_type(arg_8, list)

        arg_10 = dict_from_items_with_values(
            arg_9,
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=arg_6,
            arg_7=arg_7,
            arg_8=arg_8,
        )

        # API request
        arg_11 = arg_0._session.post(API_ENDPOINT, json=arg_10)

        # Return a person object Funcd from the returned JSON object
        return arg_0._object_factory(OBJECT_TYPE, arg_11)

Create a new user account for a given organization

        Only an admin can create a new user account.

        Args:
            emails(`list`): Email address(es) of the person (list of strings).
            displayName(basestring): Full name of the person.
            firstName(basestring): First name of the person.
            lastName(basestring): Last name of the person.
            avatar(basestring): URL to the person's avatar in PNG format.
            orgId(basestring): ID of the organization to which this
                person belongs.
            roles(`list`): Roles of the person (list of strings containing
                the role IDs to be assigned to the person).
            licenses(`list`): Licenses allocated to the person (list of
                strings - containing the license IDs to be allocated to the
                person).
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            Person: A Person object with the details of the created person.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


return _jwt.pack(payload={'jwks': jwks}, owner=iss, kid=kid)

def Func ( arg_0 , arg_1 , arg_2 = '' , arg_3 = 3600 ) : arg_4 = JWT ( arg_0 , arg_1 = arg_1 , arg_3 = arg_3 ) arg_5 = arg_0 . export_jwks ( issuer = arg_1 ) return arg_4 . pack ( payload = { 'jwks' : arg_5 } , owner = arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2='', arg_3=3600):
    """
    Create a signed JWT containing a JWKS. The JWT is signed by one of the
    keys in the JWKS.

    :param keyjar: A KeyJar instance with at least one private signing key
    :param iss: issuer of the JWT, should be the owner of the keys
    :param kid: A key ID if a special key should be used otherwise one
        is picked at random.
    :param lifetime: The lifetime of the signed JWT
    :return: A signed JWT
    """

    # _json = json.dumps(jwks)
    arg_4 = JWT(arg_0, arg_1=arg_1, arg_3=arg_3)

    arg_5 = arg_0.export_jwks(issuer=arg_1)

    return arg_4.pack(payload={'jwks': arg_5}, owner=arg_1, arg_2=arg_2)

Create a signed JWT containing a JWKS . The JWT is signed by one of the keys in the JWKS .


def Func(arg_0, arg_1, arg_2):
        '''Download a file from storage service to local disk.

        Existing files on the target path will be overwritten.
        The download is not recursive, as it only works on files.

        Args:
            path (str): The path of the entity to be downloaded. Must start with a '/'.

        Returns:
            None

        Raises:
            StorageArgumentException: Invalid arguments
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes
        '''

        arg_0.__validate_storage_path(arg_1)
        arg_3 = arg_0.api_client.get_entity_by_query(arg_1=arg_1)
        if arg_3['entity_type'] != 'file':
            raise StorageArgumentException('Only file entities can be downloaded')

        arg_4 = arg_0.api_client.get_signed_url(arg_3['uuid'])
        arg_5 = arg_0.api_client.download_signed_url(arg_4)

        with open(arg_2, "wb") as output:
            for arg_6 in arg_5.iter_content(chunk_size=1024):
                output.write(arg_6)

Download a file from storage service to local disk .


def Func ( arg_0 , arg_1 ) : arg_2 = logging . getLogger ( __name__ ) arg_2 . exception ( arg_1 )

def Func(arg_0, arg_1):
        """Handle an internal exception that was caught and suppressed.

        :param exc: Exception to process.
        :type exc: Exception
        """
        arg_2 = logging.getLogger(__name__)
        arg_2.exception(arg_1)

Handle an internal exception that was caught and suppressed .


def Func ( arg_0 ) : arg_1 = arg_0 [ 'code' ] arg_2 = arg_0 [ 'line' ] + 1 arg_3 = arg_0 [ 'column' ] arg_4 = arg_0 [ 'path' ] arg_5 = 'utf-8' arg_6 = jedi . Script ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) try : arg_7 = arg_6 . Func ( ) except jedi . NotFoundError : pass else : arg_8 = [ ( d . module_path , d . line - 1 if d . line else None , d . column , d . full_name ) for d in arg_7 ] return arg_8

def Func(arg_0):
    """
    Go to assignements worker.
    """
    arg_1 = arg_0['code']
    arg_2 = arg_0['line'] + 1
    arg_3 = arg_0['column']
    arg_4 = arg_0['path']
    # encoding = request_data['encoding']
    arg_5 = 'utf-8'
    arg_6 = jedi.Script(arg_1, arg_2, arg_3, arg_4, arg_5)
    try:
        arg_7 = arg_6.Func()
    except jedi.NotFoundError:
        pass
    else:
        arg_8 = [(d.module_path, d.line - 1 if d.line else None,
                    d.column, d.full_name)
                   for d in arg_7]
        return arg_8


(name, rawtext, text, lineno, inliner, options={}, content=[])

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = { } , arg_6 = [ ] ) : arg_7 = 'https://www.github.com/' + arg_2 arg_8 = nodes . reference ( arg_1 , arg_2 , refuri = arg_7 , ** arg_5 ) return [ arg_8 ] , [ ]

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5={}, arg_6=[]):
    """Link to a GitHub user.

    Returns 2 part tuple containing list of nodes to insert into the
    document and a list of system messages.  Both are allowed to be
    empty.

    :param name: The role name used in the document.
    :param rawtext: The entire markup snippet, with role.
    :param text: The text marked with the role.
    :param lineno: The line number where rawtext appears in the input.
    :param inliner: The inliner instance that called us.
    :param options: Directive options for customization.
    :param content: The directive content for customization.
    """
    # app = inliner.document.settings.env.app
    #app.info('user link %r' % text)
    arg_7 = 'https://www.github.com/' + arg_2
    arg_8 = nodes.reference(arg_1, arg_2, refuri=arg_7, **arg_5)
    return [arg_8], []


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 . tags : if arg_0 . is_tag ( arg_2 ) : arg_3 = arg_0 . deserialize ( arg_2 ) try : arg_0 . validate ( arg_3 ) return arg_3 except TagValidationError : continue return None

def Func(arg_0, arg_1):
        """Get a matching valid tag off the model."""
        for arg_2 in arg_1.tags:
            if arg_0.is_tag(arg_2):
                arg_3 = arg_0.deserialize(arg_2)
                try:
                    arg_0.validate(arg_3)
                    return arg_3
                except TagValidationError:
                    continue
        return None

Get a matching valid tag off the model .


(img,
                  bboxes,
                  colors='green',
                  top_k=-1,
                  thickness=1,
                  show=True,
                  win_name='',
                  wait_time=0,
                  out_file=None)

def Func ( arg_0 , arg_1 , arg_2 = 'green' , arg_3 = - 1 , arg_4 = 1 , arg_5 = True , arg_6 = '' , arg_7 = 0 , arg_8 = None ) : arg_0 = imread ( arg_0 ) if isinstance ( arg_1 , np . ndarray ) : arg_1 = [ arg_1 ] if not isinstance ( arg_2 , list ) : arg_2 = [ arg_2 for _ in range ( len ( arg_1 ) ) ] arg_2 = [ color_val ( c ) for c in arg_2 ] assert len ( arg_1 ) == len ( arg_2 ) for arg_9 , arg_10 in enumerate ( arg_1 ) : arg_10 = arg_10 . astype ( np . int32 ) if arg_3 <= 0 : arg_11 = arg_10 . shape [ 0 ] else : arg_11 = min ( arg_3 , arg_10 . shape [ 0 ] ) for arg_12 in range ( arg_11 ) : arg_13 = ( arg_10 [ arg_12 , 0 ] , arg_10 [ arg_12 , 1 ] ) arg_14 = ( arg_10 [ arg_12 , 2 ] , arg_10 [ arg_12 , 3 ] ) cv2 . rectangle ( arg_0 , arg_13 , arg_14 , arg_2 [ arg_9 ] , arg_4 = arg_4 ) if arg_5 : imshow ( arg_0 , arg_6 , arg_7 ) if arg_8 is not None : imwrite ( arg_0 , arg_8 )

def Func(arg_0,
                  arg_1,
                  arg_2='green',
                  arg_3=-1,
                  arg_4=1,
                  arg_5=True,
                  arg_6='',
                  arg_7=0,
                  arg_8=None):
    """Draw bboxes on an image.

    Args:
        img (str or ndarray): The image to be displayed.
        bboxes (list or ndarray): A list of ndarray of shape (k, 4).
        colors (list[str or tuple or Color]): A list of colors.
        top_k (int): Plot the first k bboxes only if set positive.
        thickness (int): Thickness of lines.
        show (bool): Whether to show the image.
        win_name (str): The window name.
        wait_time (int): Value of waitKey param.
        out_file (str, optional): The filename to write the image.
    """
    arg_0 = imread(arg_0)

    if isinstance(arg_1, np.ndarray):
        arg_1 = [arg_1]
    if not isinstance(arg_2, list):
        arg_2 = [arg_2 for _ in range(len(arg_1))]
    arg_2 = [color_val(c) for c in arg_2]
    assert len(arg_1) == len(arg_2)

    for arg_9, arg_10 in enumerate(arg_1):
        arg_10 = arg_10.astype(np.int32)
        if arg_3 <= 0:
            arg_11 = arg_10.shape[0]
        else:
            arg_11 = min(arg_3, arg_10.shape[0])
        for arg_12 in range(arg_11):
            arg_13 = (arg_10[arg_12, 0], arg_10[arg_12, 1])
            arg_14 = (arg_10[arg_12, 2], arg_10[arg_12, 3])
            cv2.rectangle(
                arg_0, arg_13, arg_14, arg_2[arg_9], arg_4=arg_4)

    if arg_5:
        imshow(arg_0, arg_6, arg_7)
    if arg_8 is not None:
        imwrite(arg_0, arg_8)


def Func(arg_0):
    '''given a list of files, copy them to a temporary folder,
       compress into a .tar.gz, and rename based on the file hash.
       Return the full path to the .tar.gz in the temporary folder.

       Parameters
       ==========
       package_files: a list of files to include in the tar.gz

    '''
    # Ensure package files all exist
    for arg_1 in arg_0:
        if not os.path.exists(arg_1):
            bot.exit('Cannot find %s.' % arg_1)

    bot.log('Generating build package for %s files...' % len(arg_0))
    arg_2 = get_tmpdir(prefix="sregistry-build")
    arg_3 = '%s/build.tar.gz' % arg_2
    arg_4 = tarfile.open(arg_3, "w:gz")

    # Create the tar.gz
    for arg_1 in arg_0:
        arg_4.add(arg_1)
    arg_4.close()

    # Get hash (sha256), and rename file
    arg_5 = get_file_hash(arg_3)
    arg_6 =  "%s/%s.tar.gz" %(arg_2, arg_5)
    shutil.move(arg_3, arg_6)
    return arg_6

given a list of files copy them to a temporary folder compress into a . tar . gz and rename based on the file hash . Return the full path to the . tar . gz in the temporary folder .


def Func ( arg_0 ) : def substr_after ( arg_1 , arg_2 ) : return arg_1 . partition ( arg_2 ) [ 2 ] with open ( arg_0 , 'rb' ) as f : arg_3 = ELFFile ( f ) for arg_4 in arg_3 . iter_sections ( ) : if not isinstance ( arg_4 , SymbolTableSection ) : continue arg_5 = [ sym . name for sym in arg_4 . iter_symbols ( ) if sym ] return [ substr_after ( arg_6 , PREPEND_SYM ) for arg_6 in arg_5 if arg_6 . startswith ( PREPEND_SYM ) ]

def Func(arg_0):
    """
    helper method for getting all binary symbols with SANDSHREW_ prepended.
    We do this in order to provide the symbols Manticore should hook on to
    perform main analysis.

    :param binary: str for binary to instrospect.
    :rtype list: list of symbols from binary
    """

    def substr_after(arg_1, arg_2):
        return arg_1.partition(arg_2)[2]

    with open(arg_0, 'rb') as f:
        arg_3 = ELFFile(f)

        for arg_4 in arg_3.iter_sections():
            if not isinstance(arg_4, SymbolTableSection):
                continue

            arg_5 = [sym.name for sym in arg_4.iter_symbols() if sym]
            return [substr_after(arg_6, PREPEND_SYM) for arg_6 in arg_5
                    if arg_6.startswith(PREPEND_SYM)]

helper method for getting all binary symbols with SANDSHREW_ prepended . We do this in order to provide the symbols Manticore should hook on to perform main analysis .


def Func ( arg_0 , arg_1 ) : import zipimport arg_2 = [ '.zip' + os . sep , '.egg' + os . sep ] for arg_3 in arg_2 : if arg_3 in arg_1 : arg_4 = arg_1 . split ( arg_3 ) try : arg_5 = zipimport . zipimporter ( arg_4 [ 0 ] + arg_3 [ : - 1 ] ) except zipimport . ZipImportError : continue try : arg_6 = arg_5 . get_data ( arg_4 [ 1 ] ) except IOError : continue return to_string ( arg_6 ) return None

def Func(arg_0, arg_1):
        """Get data from `filename` if it is a zip file path.

        Returns the string data read from the zip file, or None if no zip file
        could be found or `filename` isn't in it.  The data returned will be
        an empty string if the file is empty.

        """
        import zipimport
        arg_2 = ['.zip'+os.sep, '.egg'+os.sep]
        for arg_3 in arg_2:
            if arg_3 in arg_1:
                arg_4 = arg_1.split(arg_3)
                try:
                    arg_5 = zipimport.zipimporter(arg_4[0]+arg_3[:-1])
                except zipimport.ZipImportError:
                    continue
                try:
                    arg_6 = arg_5.get_data(arg_4[1])
                except IOError:
                    continue
                return to_string(arg_6)
        return None

Get data from filename if it is a zip file path .


return _crop_img_to(img, slices, copy=copy)

def Func ( arg_0 , arg_1 = 1e-8 , arg_2 = True ) : arg_3 = check_img ( arg_0 ) arg_4 = arg_3 . get_data ( ) arg_5 = max ( - arg_4 . min ( ) , arg_4 . max ( ) ) arg_6 = np . logical_or ( arg_4 < - arg_1 * arg_5 , arg_4 > arg_1 * arg_5 ) if arg_4 . ndim == 4 : arg_6 = np . any ( arg_6 , axis = - 1 ) arg_7 = np . array ( np . where ( arg_6 ) ) arg_8 = arg_7 . min ( axis = 1 ) arg_9 = arg_7 . max ( axis = 1 ) + 1 arg_8 = np . maximum ( arg_8 - 1 , 0 ) arg_9 = np . minimum ( arg_9 + 1 , arg_4 . shape [ : 3 ] ) arg_10 = [ slice ( s , e ) for s , e in zip ( arg_8 , arg_9 ) ] return _Func_to ( arg_3 , arg_10 , arg_2 = arg_2 )

def Func(arg_0, arg_1=1e-8, arg_2=True):
    """Crops img as much as possible

    Will crop img, removing as many zero entries as possible
    without touching non-zero entries. Will leave one voxel of
    zero padding around the obtained non-zero area in order to
    avoid sampling issues later on.

    Parameters
    ----------
    image: img-like object or str
        Can either be:
        - a file path to a Nifti image
        - any object with get_data() and get_affine() methods, e.g., nibabel.Nifti1Image.
        If niimg is a string, consider it as a path to Nifti image and
        call nibabel.load on it. If it is an object, check if get_data()
        and get_affine() methods are present, raise TypeError otherwise.

        Image to be cropped.

    rtol: float
        relative tolerance (with respect to maximal absolute
        value of the image), under which values are considered
        negligeable and thus croppable.

    copy: boolean
        Specifies whether cropped data is copied or not.

    Returns
    -------
    cropped_img: image
        Cropped version of the input image
    """

    arg_3              = check_img(arg_0)
    arg_4             = arg_3.get_data()
    arg_5    = max(-arg_4.min(), arg_4.max())
    arg_6 = np.logical_or(arg_4 < -arg_1 * arg_5,
                                     arg_4 >  arg_1 * arg_5)

    if arg_4.ndim == 4:
        arg_6 = np.any(arg_6, axis=-1)

    arg_7 = np.array(np.where(arg_6))
    arg_8  = arg_7.min(axis=1)
    arg_9    = arg_7.max(axis=1) + 1

    # pad with one voxel to avoid resampling problems
    arg_8 = np.maximum(arg_8 - 1, 0)
    arg_9   = np.minimum(arg_9   + 1, arg_4.shape[:3])

    arg_10 = [slice(s, e) for s, e in zip(arg_8, arg_9)]

    return _Func_to(arg_3, arg_10, arg_2=arg_2)


def Func ( arg_0 ) : arg_1 = V4Meter ( ) arg_1 . makeAB ( ) arg_2 = arg_1 . getReadBuffer ( ) arg_3 = V3Meter ( ) arg_3 . makeReturnFormat ( ) arg_4 = arg_3 . getReadBuffer ( ) for arg_5 in arg_4 : if arg_5 not in arg_0 . m_all_fields : arg_6 = arg_5 . upper ( ) if not "RESERVED" in arg_6 and not "CRC" in arg_6 : arg_0 . m_all_fields [ arg_5 ] = arg_4 [ arg_5 ] for arg_5 in arg_2 : if arg_5 not in arg_0 . m_all_fields : arg_6 = arg_5 . upper ( ) if not "RESERVED" in arg_6 and not "CRC" in arg_6 : arg_0 . m_all_fields [ arg_5 ] = arg_2 [ arg_5 ] pass

def Func(arg_0):
        """ Use the serial block definitions in V3 and V4 to create one field list. """
        arg_1 = V4Meter()
        arg_1.makeAB()
        arg_2 = arg_1.getReadBuffer()

        arg_3 = V3Meter()
        arg_3.makeReturnFormat()
        arg_4 = arg_3.getReadBuffer()

        for arg_5 in arg_4:
            if arg_5 not in arg_0.m_all_fields:
                arg_6 = arg_5.upper()
                if not "RESERVED" in arg_6 and not "CRC" in arg_6:
                    arg_0.m_all_fields[arg_5] = arg_4[arg_5]

        for arg_5 in arg_2:
            if arg_5 not in arg_0.m_all_fields:
                arg_6 = arg_5.upper()
                if not "RESERVED" in arg_6 and not "CRC" in arg_6:
                    arg_0.m_all_fields[arg_5] = arg_2[arg_5]
        pass

Use the serial block definitions in V3 and V4 to create one field list .


def Func(arg_0):
    """create a bqm for a constraint with two variables.

    bqm will have exactly classical gap 2.
    """
    arg_1 = arg_0.configurations
    arg_2 = arg_0.variables
    arg_3 = arg_0.vartype
    arg_4, arg_5 = arg_0.variables

    # if all configurations are present, then nothing is infeasible and the bqm is just all
    # 0.0s
    if len(arg_1) == 4:
        return dimod.BinaryQuadraticModel.empty(arg_0.vartype)

    # check if the constraint is irreducible, and if so, build the bqm for its two
    # components
    arg_6 = irreducible_components(arg_0)
    if len(arg_6) > 1:
        arg_7 = Constraint.from_configurations(((arg_10[0],) for arg_10 in arg_1),
                                                (arg_4,), arg_3)
        arg_8 = Constraint.from_configurations(((arg_10[1],) for arg_10 in arg_1),
                                                (arg_5,), arg_3)
        arg_9 = _bqm_from_1sat(arg_7)
        arg_9.update(_bqm_from_1sat(arg_8))
        return arg_9

    assert len(arg_1) > 1, "single configurations should be irreducible"

    # if it is not irreducible, and there are infeasible configurations, then it is time to
    # start building a bqm
    arg_9 = dimod.BinaryQuadraticModel.empty(arg_3)

    # if the constraint is not irreducible and has two configurations, then it is either eq or ne
    if all(operator.eq(*arg_10) for arg_10 in arg_1):
        arg_9.add_interaction(arg_4, arg_5, -1, arg_3=dimod.SPIN)  # equality
    elif all(operator.ne(*arg_10) for arg_10 in arg_1):
        arg_9.add_interaction(arg_4, arg_5, +1, arg_3=dimod.SPIN)  # inequality
    elif (1, 1) not in arg_1:
        arg_9.add_interaction(arg_4, arg_5, 2, arg_3=dimod.BINARY)  # penalize (1, 1)
    elif (-1, +1) not in arg_1 and (0, 1) not in arg_1:
        arg_9.add_interaction(arg_4, arg_5, -2, arg_3=dimod.BINARY)
        arg_9.add_variable(arg_5, 2, arg_3=dimod.BINARY)
    elif (+1, -1) not in arg_1 and (1, 0) not in arg_1:
        arg_9.add_interaction(arg_4, arg_5, -2, arg_3=dimod.BINARY)
        arg_9.add_variable(arg_4, 2, arg_3=dimod.BINARY)
    else:
        # (0, 0) not in configurations
        arg_9.add_interaction(arg_4, arg_5, 2, arg_3=dimod.BINARY)
        arg_9.add_variable(arg_4, -2, arg_3=dimod.BINARY)
        arg_9.add_variable(arg_5, -2, arg_3=dimod.BINARY)

    return arg_9

create a bqm for a constraint with two variables .


(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[COMBINED])

def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
,
arg_3
=
[
arg_4
]
)
:
def
list_methods
(
)
:
arg_5
=
[
]
if
arg_0
in
_crit_IUPAC
.
index
and
not
np
.
isnan
(
_crit_IUPAC
.
at
[
arg_0
,
'Func'
]
)
:
arg_5
.
append
(
IUPAC
)
if
arg_0
in
_crit_Matthews
.
index
and
not
np
.
isnan
(
_crit_Matthews
.
at
[
arg_0
,
'Func'
]
)
:
arg_5
.
append
(
MATTHEWS
)
if
arg_0
in
_crit_CRC
.
index
and
not
np
.
isnan
(
_crit_CRC
.
at
[
arg_0
,
'Func'
]
)
:
arg_5
.
append
(
CRC
)
if
arg_0
in
_crit_PSRKR4
.
index
and
not
np
.
isnan
(
_crit_PSRKR4
.
at
[
arg_0
,
'Func'
]
)
:
arg_5
.
append
(
PSRK
)
if
arg_0
in
_crit_Yaws
.
index
and
not
np
.
isnan
(
_crit_Yaws
.
at
[
arg_0
,
'Func'
]
)
:
arg_5
.
append
(
YAWS
)
if
Tc
(
arg_0
)
and
Vc
(
arg_0
)
and
Pc
(
arg_0
)
:
arg_5
.
append
(
arg_4
)
if
arg_3
:
for
arg_2
in
arg_3
:
if
arg_2
in
arg_5
:
arg_5
.
remove
(
arg_2
)
arg_5
.
append
(
)
return
arg_5
if
arg_1
:
return
list_methods
(
)
if
not
arg_2
:
arg_2
=
list_methods
(
)
[
0
]
if
arg_2
==
IUPAC
:
arg_6
=
float
(
_crit_IUPAC
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
PSRK
:
arg_6
=
float
(
_crit_PSRKR4
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
MATTHEWS
:
arg_6
=
float
(
_crit_Matthews
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
CRC
:
arg_6
=
float
(
_crit_CRC
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
YAWS
:
arg_6
=
float
(
_crit_Yaws
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
arg_4
:
arg_6
=
Vc
(
arg_0
)
*
Pc
(
arg_0
)
/
Tc
(
arg_0
)
/
R
elif
arg_2
==
:
return
else
:
raise
Exception
(
'Failure in in function'
)
return
arg_6

def Func(arg_0, arg_1=False, arg_2=None, arg_3=[arg_4]):
    r'''This function handles the retrieval of a chemical's critical
    compressibility. Lookup is based on CASRNs. Will automatically select a
    data source to use if no Method is provided; returns None if the data is
    not available.

    Prefered sources are 'IUPAC' for organic chemicals, and 'MATTHEWS' for
    inorganic chemicals. Function has data for approximately 1000 chemicals.

    Examples
    --------
    >>> Func(CASRN='64-17-5')
    0.24100000000000002

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Func : float
        Critical compressibility, [-]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Vc with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Accepted methods are 'IUPAC', 'MATTHEWS',
        'CRC', 'PSRK', 'YAWS', and 'COMBINED'. All valid values are also held
        in `Func_methods`.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Func for the desired chemical, and will return methods instead of Func
    IgnoreMethods : list, optional
        A list of methods to ignore in obtaining the full list of methods,
        useful for for performance reasons and ignoring inaccurate methods

    Notes
    -----
    A total of five sources are available for this function. They are:

        * 'IUPAC', a series of critically evaluated
          experimental datum for organic compounds in [1]_, [2]_, [3]_, [4]_,
          [5]_, [6]_, [7]_, [8]_, [9]_, [10]_, [11]_, and [12]_.
        * 'MATTHEWS', a series of critically
          evaluated data for inorganic compounds in [13]_.
        * 'CRC', a compillation of critically
          evaluated data by the TRC as published in [14]_.
        * 'PSRK', a compillation of experimental and
          estimated data published in [15]_.
        * 'YAWS', a large compillation of data from a
          variety of sources; no data points are sourced in the work of [16]_.

    References
    ----------
    .. [1] Ambrose, Douglas, and Colin L. Young. "Vapor-Liquid Critical
       Properties of Elements and Compounds. 1. An Introductory Survey."
       Journal of Chemical & Engineering Data 41, no. 1 (January 1, 1996):
       154-154. doi:10.1021/je950378q.
    .. [2] Ambrose, Douglas, and Constantine Tsonopoulos. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 2. Normal Alkanes."
       Journal of Chemical & Engineering Data 40, no. 3 (May 1, 1995): 531-46.
       doi:10.1021/je00019a001.
    .. [3] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 3. Aromatic
       Hydrocarbons." Journal of Chemical & Engineering Data 40, no. 3
       (May 1, 1995): 547-58. doi:10.1021/je00019a002.
    .. [4] Gude, Michael, and Amyn S. Teja. "Vapor-Liquid Critical Properties
       of Elements and Compounds. 4. Aliphatic Alkanols." Journal of Chemical
       & Engineering Data 40, no. 5 (September 1, 1995): 1025-36.
       doi:10.1021/je00021a001.
    .. [5] Daubert, Thomas E. "Vapor-Liquid Critical Properties of Elements
       and Compounds. 5. Branched Alkanes and Cycloalkanes." Journal of
       Chemical & Engineering Data 41, no. 3 (January 1, 1996): 365-72.
       doi:10.1021/je9501548.
    .. [6] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 6. Unsaturated Aliphatic
       Hydrocarbons." Journal of Chemical & Engineering Data 41, no. 4
       (January 1, 1996): 645-56. doi:10.1021/je9501999.
    .. [7] Kudchadker, Arvind P., Douglas Ambrose, and Constantine Tsonopoulos.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 7. Oxygen
       Compounds Other Than Alkanols and Cycloalkanols." Journal of Chemical &
       Engineering Data 46, no. 3 (May 1, 2001): 457-79. doi:10.1021/je0001680.
    .. [8] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 8. Organic Sulfur,
       Silicon, and Tin Compounds (C + H + S, Si, and Sn)." Journal of Chemical
       & Engineering Data 46, no. 3 (May 1, 2001): 480-85.
       doi:10.1021/je000210r.
    .. [9] Marsh, Kenneth N., Colin L. Young, David W. Morton, Douglas Ambrose,
       and Constantine Tsonopoulos. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 9. Organic Compounds Containing Nitrogen."
       Journal of Chemical & Engineering Data 51, no. 2 (March 1, 2006):
       305-14. doi:10.1021/je050221q.
    .. [10] Marsh, Kenneth N., Alan Abramson, Douglas Ambrose, David W. Morton,
       Eugene Nikitin, Constantine Tsonopoulos, and Colin L. Young.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 10. Organic
       Compounds Containing Halogens." Journal of Chemical & Engineering Data
       52, no. 5 (September 1, 2007): 1509-38. doi:10.1021/je700336g.
    .. [11] Ambrose, Douglas, Constantine Tsonopoulos, and Eugene D. Nikitin.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 11. Organic
       Compounds Containing B + O; Halogens + N, + O, + O + S, + S, + Si;
       N + O; and O + S, + Si." Journal of Chemical & Engineering Data 54,
       no. 3 (March 12, 2009): 669-89. doi:10.1021/je800580z.
    .. [12] Ambrose, Douglas, Constantine Tsonopoulos, Eugene D. Nikitin, David
       W. Morton, and Kenneth N. Marsh. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 12. Review of Recent Data for Hydrocarbons and
       Non-Hydrocarbons." Journal of Chemical & Engineering Data, October 5,
       2015, 151005081500002. doi:10.1021/acs.jced.5b00571.
    .. [13] Mathews, Joseph F. "Critical Constants of Inorganic Substances."
       Chemical Reviews 72, no. 1 (February 1, 1972): 71-100.
       doi:10.1021/cr60275a004.
    .. [14] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    .. [15] Horstmann, Sven, Anna Jabłoniec, Jörg Krafczyk, Kai Fischer, and
       Jürgen Gmehling. "PSRK Group Contribution Equation of State:
       Comprehensive Revision and Extension IV, Including Critical Constants
       and Α-Function Parameters for 1000 Components." Fluid Phase Equilibria
       227, no. 2 (January 25, 2005): 157-64. doi:10.1016/j.fluid.2004.11.002.
    .. [16] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.
    '''
    def list_methods():
        arg_5 = []
        if arg_0 in _crit_IUPAC.index and not np.isnan(_crit_IUPAC.at[arg_0, 'Func']):
            arg_5.append(IUPAC)
        if arg_0 in _crit_Matthews.index and not np.isnan(_crit_Matthews.at[arg_0, 'Func']):
            arg_5.append(MATTHEWS)
        if arg_0 in _crit_CRC.index and not np.isnan(_crit_CRC.at[arg_0, 'Func']):
            arg_5.append(CRC)
        if arg_0 in _crit_PSRKR4.index and not np.isnan(_crit_PSRKR4.at[arg_0, 'Func']):
            arg_5.append(PSRK)
        if arg_0 in _crit_Yaws.index and not np.isnan(_crit_Yaws.at[arg_0, 'Func']):
            arg_5.append(YAWS)
        if Tc(arg_0) and Vc(arg_0) and Pc(arg_0):
            arg_5.append(arg_4)
        if arg_3:
            for arg_2 in arg_3:
                if arg_2 in arg_5:
                    arg_5.remove(arg_2)
        arg_5.append(NONE)
        return arg_5
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]
    # This is the calculate, given the method section
    if arg_2 == IUPAC:
        arg_6 = float(_crit_IUPAC.at[arg_0, 'Func'])
    elif arg_2 == PSRK:
        arg_6 = float(_crit_PSRKR4.at[arg_0, 'Func'])
    elif arg_2 == MATTHEWS:
        arg_6 = float(_crit_Matthews.at[arg_0, 'Func'])
    elif arg_2 == CRC:
        arg_6 = float(_crit_CRC.at[arg_0, 'Func'])
    elif arg_2 == YAWS:
        arg_6 = float(_crit_Yaws.at[arg_0, 'Func'])
    elif arg_2 == arg_4:
        arg_6 = Vc(arg_0)*Pc(arg_0)/Tc(arg_0)/R
    elif arg_2 == NONE:
        return None
    else:
        raise Exception('Failure in in function')
    return arg_6

r'''This function handles the retrieval of a chemical's critical
    compressibility. Lookup is based on CASRNs. Will automatically select a
    data source to use if no Method is provided; returns None if the data is
    not available.

    Prefered sources are 'IUPAC' for organic chemicals, and 'MATTHEWS' for
    inorganic chemicals. Function has data for approximately 1000 chemicals.

    Examples
    --------
    >>> Zc(CASRN='64-17-5')
    0.24100000000000002

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Zc : float
        Critical compressibility, [-]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Vc with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Accepted methods are 'IUPAC', 'MATTHEWS',
        'CRC', 'PSRK', 'YAWS', and 'COMBINED'. All valid values are also held
        in `Zc_methods`.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Zc for the desired chemical, and will return methods instead of Zc
    IgnoreMethods : list, optional
        A list of methods to ignore in obtaining the full list of methods,
        useful for for performance reasons and ignoring inaccurate methods

    Notes
    -----
    A total of five sources are available for this function. They are:

        * 'IUPAC', a series of critically evaluated
          experimental datum for organic compounds in [1]_, [2]_, [3]_, [4]_,
          [5]_, [6]_, [7]_, [8]_, [9]_, [10]_, [11]_, and [12]_.
        * 'MATTHEWS', a series of critically
          evaluated data for inorganic compounds in [13]_.
        * 'CRC', a compillation of critically
          evaluated data by the TRC as published in [14]_.
        * 'PSRK', a compillation of experimental and
          estimated data published in [15]_.
        * 'YAWS', a large compillation of data from a
          variety of sources; no data points are sourced in the work of [16]_.

    References
    ----------
    .. [1] Ambrose, Douglas, and Colin L. Young. "Vapor-Liquid Critical
       Properties of Elements and Compounds. 1. An Introductory Survey."
       Journal of Chemical & Engineering Data 41, no. 1 (January 1, 1996):
       154-154. doi:10.1021/je950378q.
    .. [2] Ambrose, Douglas, and Constantine Tsonopoulos. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 2. Normal Alkanes."
       Journal of Chemical & Engineering Data 40, no. 3 (May 1, 1995): 531-46.
       doi:10.1021/je00019a001.
    .. [3] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 3. Aromatic
       Hydrocarbons." Journal of Chemical & Engineering Data 40, no. 3
       (May 1, 1995): 547-58. doi:10.1021/je00019a002.
    .. [4] Gude, Michael, and Amyn S. Teja. "Vapor-Liquid Critical Properties
       of Elements and Compounds. 4. Aliphatic Alkanols." Journal of Chemical
       & Engineering Data 40, no. 5 (September 1, 1995): 1025-36.
       doi:10.1021/je00021a001.
    .. [5] Daubert, Thomas E. "Vapor-Liquid Critical Properties of Elements
       and Compounds. 5. Branched Alkanes and Cycloalkanes." Journal of
       Chemical & Engineering Data 41, no. 3 (January 1, 1996): 365-72.
       doi:10.1021/je9501548.
    .. [6] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 6. Unsaturated Aliphatic
       Hydrocarbons." Journal of Chemical & Engineering Data 41, no. 4
       (January 1, 1996): 645-56. doi:10.1021/je9501999.
    .. [7] Kudchadker, Arvind P., Douglas Ambrose, and Constantine Tsonopoulos.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 7. Oxygen
       Compounds Other Than Alkanols and Cycloalkanols." Journal of Chemical &
       Engineering Data 46, no. 3 (May 1, 2001): 457-79. doi:10.1021/je0001680.
    .. [8] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 8. Organic Sulfur,
       Silicon, and Tin Compounds (C + H + S, Si, and Sn)." Journal of Chemical
       & Engineering Data 46, no. 3 (May 1, 2001): 480-85.
       doi:10.1021/je000210r.
    .. [9] Marsh, Kenneth N., Colin L. Young, David W. Morton, Douglas Ambrose,
       and Constantine Tsonopoulos. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 9. Organic Compounds Containing Nitrogen."
       Journal of Chemical & Engineering Data 51, no. 2 (March 1, 2006):
       305-14. doi:10.1021/je050221q.
    .. [10] Marsh, Kenneth N., Alan Abramson, Douglas Ambrose, David W. Morton,
       Eugene Nikitin, Constantine Tsonopoulos, and Colin L. Young.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 10. Organic
       Compounds Containing Halogens." Journal of Chemical & Engineering Data
       52, no. 5 (September 1, 2007): 1509-38. doi:10.1021/je700336g.
    .. [11] Ambrose, Douglas, Constantine Tsonopoulos, and Eugene D. Nikitin.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 11. Organic
       Compounds Containing B + O; Halogens + N, + O, + O + S, + S, + Si;
       N + O; and O + S, + Si." Journal of Chemical & Engineering Data 54,
       no. 3 (March 12, 2009): 669-89. doi:10.1021/je800580z.
    .. [12] Ambrose, Douglas, Constantine Tsonopoulos, Eugene D. Nikitin, David
       W. Morton, and Kenneth N. Marsh. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 12. Review of Recent Data for Hydrocarbons and
       Non-Hydrocarbons." Journal of Chemical & Engineering Data, October 5,
       2015, 151005081500002. doi:10.1021/acs.jced.5b00571.
    .. [13] Mathews, Joseph F. "Critical Constants of Inorganic Substances."
       Chemical Reviews 72, no. 1 (February 1, 1972): 71-100.
       doi:10.1021/cr60275a004.
    .. [14] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    .. [15] Horstmann, Sven, Anna Jabłoniec, Jörg Krafczyk, Kai Fischer, and
       Jürgen Gmehling. "PSRK Group Contribution Equation of State:
       Comprehensive Revision and Extension IV, Including Critical Constants
       and Α-Function Parameters for 1000 Components." Fluid Phase Equilibria
       227, no. 2 (January 25, 2005): 157-64. doi:10.1016/j.fluid.2004.11.002.
    .. [16] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.

r This function handles the retrieval of a chemical s critical compressibility . Lookup is based on CASRNs . Will automatically select a data source to use if no Method is provided ; returns None if the data is not available .


def Func ( arg_0 , arg_1 ) : etree . SubElement ( arg_1 , 'filter' , id = 'dropshadow' , width = '1.2' , height = '1.2' , ) etree . SubElement ( arg_1 , 'feGaussianBlur' , stdDeviation = '4' , result = 'blur' , )

def Func(arg_0, arg_1):
		"Add svg definitions"
		etree.SubElement(
			arg_1,
			'filter',
			id='dropshadow',
			width='1.2',
			height='1.2',
		)
		etree.SubElement(
			arg_1,
			'feGaussianBlur',
			stdDeviation='4',
			result='blur',
		)