return OEmbedNode(nodelist, width, height, template_dir, var_name)

def Func(arg_0, arg_1):
    """
    A node which parses everything between its two nodes, and replaces any links
    with OEmbed-provided objects, if possible.

    Supports two optional argument, which is the maximum width and height,
    specified like so:

    {% oembed 640x480 %}http://www.viddler.com/explore/SYSTM/videos/49/{% endoembed %}

    and or the name of a sub tempalte directory to render templates from:

    {% oembed 320x240 in "comments" %}http://www.viddler.com/explore/SYSTM/videos/49/{% endoembed %}

    or:

    {% oembed in "comments" %}http://www.viddler.com/explore/SYSTM/videos/49/{% endoembed %}

    either of those will render templates in oembed/comments/oembedtype.html

    Additionally, you can specify a context variable to drop the rendered text in:

    {% oembed 600x400 in "comments" as var_name %}...{% endoembed %}
    {% oembed as var_name %}...{% endoembed %}
    """
    arg_2 = arg_1.split_contents()
    arg_3 = None
    arg_4 = None
    if len(arg_2) > 2:
        if len(arg_2) == 3 and arg_2[1] == 'in':
            arg_3 = arg_2[2]
        elif len(arg_2) == 3 and arg_2[1] == 'as':
            arg_4 = arg_2[2]
        elif len(arg_2) == 4 and arg_2[2] == 'in':
            arg_3 = arg_2[3]
        elif len(arg_2) == 4 and arg_2[2] == 'as':
            arg_4 = arg_2[3]
        elif len(arg_2) == 6 and arg_2[4] == 'as':
            arg_3 = arg_2[3]
            arg_4 = arg_2[5]
        else:
            raise template.TemplateSyntaxError("OEmbed either takes a single " \
                "(optional) argument: WIDTHxHEIGHT, where WIDTH and HEIGHT " \
                "are positive integers, and or an optional 'in " \
                " \"template_dir\"' argument set.")
        if arg_3:
            if not (arg_3[0] == arg_3[-1] and arg_3[0] in ('"', "'")):
                raise template.TemplateSyntaxError("template_dir must be quoted")
            arg_3 = arg_3[1:-1]

    if len(arg_2) >= 2 and 'x' in arg_2[1]:
        arg_5, arg_6 = arg_2[1].lower().split('x')
        if not arg_5 and arg_6:
            raise template.TemplateSyntaxError("OEmbed's optional WIDTHxHEIGH" \
                "T argument requires WIDTH and HEIGHT to be positive integers.")
    else:
        arg_5, arg_6 = None, None
    arg_7 = arg_0.parse(('endoembed',))
    arg_0.delete_first_token()
    return OEmbedNode(arg_7, arg_5, arg_6, arg_3, arg_4)

A node which parses everything between its two nodes and replaces any links with OEmbed - provided objects if possible .


(W=None, second=10, saveable=True, shape=None, name='mnist', fig_idx=2396512)

def Func ( arg_0 = None , arg_1 = 10 , arg_2 = True , arg_3 = None , arg_4 = 'mnist' , arg_5 = 2396512 ) : if arg_3 is None : arg_3 = [ 28 , 28 ] import matplotlib . pyplot as plt if arg_2 is False : plt . ion ( ) arg_6 = plt . figure ( arg_5 ) arg_7 = arg_0 . shape [ 1 ] arg_8 = int ( np . sqrt ( arg_7 ) ) arg_9 = int ( np . ceil ( arg_7 / arg_8 ) ) arg_10 = int ( 1 ) for arg_11 in range ( 1 , arg_8 + 1 ) : for arg_12 in range ( 1 , arg_9 + 1 ) : if arg_10 > arg_7 : break arg_6 . add_subplot ( arg_8 , arg_9 , arg_10 ) arg_13 = arg_0 [ : , arg_10 - 1 ] / np . sqrt ( ( arg_0 [ : , arg_10 - 1 ] ** 2 ) . sum ( ) ) plt . imshow ( np . reshape ( arg_13 , ( arg_3 [ 0 ] , arg_3 [ 1 ] ) ) , cmap = 'gray' , interpolation = "nearest" ) plt . gca ( ) . xaxis . set_major_locator ( plt . NullLocator ( ) ) plt . gca ( ) . yaxis . set_major_locator ( plt . NullLocator ( ) ) arg_10 = arg_10 + 1 if arg_2 : plt . savefig ( arg_4 + '.pdf' , format = 'pdf' ) else : plt . draw ( ) plt . pause ( arg_1 )

def Func(arg_0=None, arg_1=10, arg_2=True, arg_3=None, arg_4='mnist', arg_5=2396512):
    """Visualize every columns of the weight matrix to a group of Greyscale img.

    Parameters
    ----------
    W : numpy.array
        The weight matrix
    second : int
        The display second(s) for the image(s), if saveable is False.
    saveable : boolean
        Save or plot the figure.
    shape : a list with 2 int or None
        The shape of feature image, MNIST is [28, 80].
    name : a string
        A name to save the image, if saveable is True.
    fig_idx : int
        matplotlib figure index.

    Examples
    --------
    >>> tl.visualize.Func(network.all_params[0].eval(), second=10, saveable=True, name='weight_of_1st_layer', fig_idx=2012)

    """
    if arg_3 is None:
        arg_3 = [28, 28]

    import matplotlib.pyplot as plt
    if arg_2 is False:
        plt.ion()
    arg_6 = plt.figure(arg_5)  # show all feature images
    arg_7 = arg_0.shape[1]

    arg_8 = int(np.sqrt(arg_7))  # 每行显示的个数   若25个hidden unit -> 每行显示5个
    arg_9 = int(np.ceil(arg_7 / arg_8))
    arg_10 = int(1)
    for arg_11 in range(1, arg_8 + 1):
        for arg_12 in range(1, arg_9 + 1):
            if arg_10 > arg_7:
                break
            arg_6.add_subplot(arg_8, arg_9, arg_10)
            # ------------------------------------------------------------
            # plt.imshow(np.reshape(W[:,count-1],(28,28)), cmap='gray')
            # ------------------------------------------------------------
            arg_13 = arg_0[:, arg_10 - 1] / np.sqrt((arg_0[:, arg_10 - 1]**2).sum())
            # feature[feature<0.0001] = 0   # value threshold
            # if count == 1 or count == 2:
            #     print(np.mean(feature))
            # if np.std(feature) < 0.03:      # condition threshold
            #     feature = np.zeros_like(feature)
            # if np.mean(feature) < -0.015:      # condition threshold
            #     feature = np.zeros_like(feature)
            plt.imshow(
                np.reshape(arg_13, (arg_3[0], arg_3[1])), cmap='gray', interpolation="nearest"
            )  # , vmin=np.min(feature), vmax=np.max(feature))
            # plt.title(name)
            # ------------------------------------------------------------
            # plt.imshow(np.reshape(W[:,count-1] ,(np.sqrt(size),np.sqrt(size))), cmap='gray', interpolation="nearest")
            plt.gca().xaxis.set_major_locator(plt.NullLocator())  # distable tick
            plt.gca().yaxis.set_major_locator(plt.NullLocator())
            arg_10 = arg_10 + 1
    if arg_2:
        plt.savefig(arg_4 + '.pdf', format='pdf')
    else:
        plt.draw()
        plt.pause(arg_1)

Visualize every columns of the weight matrix to a group of Greyscale img.

    Parameters
    ----------
    W : numpy.array
        The weight matrix
    second : int
        The display second(s) for the image(s), if saveable is False.
    saveable : boolean
        Save or plot the figure.
    shape : a list with 2 int or None
        The shape of feature image, MNIST is [28, 80].
    name : a string
        A name to save the image, if saveable is True.
    fig_idx : int
        matplotlib figure index.

    Examples
    --------
    >>> tl.visualize.draw_weights(network.all_params[0].eval(), second=10, saveable=True, name='weight_of_1st_layer', fig_idx=2012)

Visualize every columns of the weight matrix to a group of Greyscale img .


def Func ( arg_0 , arg_1 , arg_2 ) : assert arg_2 is not None arg_0 . outputs . append ( arg_2 ) arg_0 . cond_task_specs . append ( ( arg_1 , arg_2 . name ) ) arg_2 . _connect_notify ( arg_0 )

def Func(arg_0, arg_1, arg_2):
        """
        Connects a taskspec that is executed if the condition DOES match.

        condition -- a condition (Condition)
        taskspec -- the conditional task spec
        """
        assert arg_2 is not None
        arg_0.outputs.append(arg_2)
        arg_0.cond_task_specs.append((arg_1, arg_2.name))
        arg_2._connect_notify(arg_0)

Connects a taskspec that is executed if the condition DOES match .


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Running on remote Engine. Refmaps, then merges, then dereplicates,
    then denovo clusters reads.
    """

    ## report location for debugging
    LOGGER.info("INSIDE derep %s", arg_1.name)

    ## MERGED ASSEMBIES ONLY:
    ## concatenate edits files within Samples. Returns a new sample.files.edits
    ## with the concat file. No change if not merged Assembly.
    arg_4 = os.path.join(arg_0.dirs.edits, arg_1.name+"_merged_.fastq")
    if not arg_3:
        if not os.path.exists(arg_4):
            arg_1.files.edits = concat_multiple_edits(arg_0, arg_1)
        else:
            LOGGER.info("skipped concat_multiple_edits: {} exists"\
                        .format(arg_4))
    else:
        arg_1.files.edits = concat_multiple_edits(arg_0, arg_1)

    ## PAIRED DATA ONLY:
    ## Denovo: merge or concat fastq pairs [sample.files.pairs]
    ## Reference: only concat fastq pairs  []
    ## Denovo + Reference: ...
    if 'pair' in arg_0.paramsdict['datatype']:
        ## the output file handle for merged reads

        ## modify behavior of merging vs concating if reference
        if "reference" in arg_0.paramsdict["assembly_method"]:
            arg_7 = merge_pairs(arg_0, arg_1.files.edits, arg_4, 0, 0)
        else:
            arg_7 = merge_pairs(arg_0, arg_1.files.edits, arg_4, 1, 1)

        ## store results
        arg_1.files.edits = [(arg_4, )]
        arg_1.stats.reads_merged = arg_7

    ## 3rad uses random adapters to identify pcr duplicates. We will
    ## remove pcr dupes here. Basically append the radom adapter to
    ## each sequence, do a regular old vsearch derep, then trim
    ## off the adapter, and push it down the pipeline. This will
    ## remove all identical seqs with identical random i5 adapters.
    if "3rad" in arg_0.paramsdict["datatype"]:
        declone_3rad(arg_0, arg_1)
        derep_and_sort(arg_0,
                os.path.join(arg_0.dirs.edits, arg_1.name+"_declone.fastq"),
                os.path.join(arg_0.dirs.edits, arg_1.name+"_derep.fastq"),
                arg_2)
    else:
        ## convert fastq to fasta, then derep and sort reads by their size.
        ## we pass in only one file b/c paired should be merged by now.
        derep_and_sort(arg_0,
                arg_1.files.edits[0][0],
                os.path.join(arg_0.dirs.edits, arg_1.name+"_derep.fastq"),
                arg_2)

Running on remote Engine . Refmaps then merges then dereplicates then denovo clusters reads .


def Func ( arg_0 , arg_1 ) : arg_2 = 0 arg_3 = [ ] for arg_4 in arg_0 . pop ( arg_1 ) : arg_2 = arg_4 . timestamp arg_3 . append ( arg_4 . data . data ) return '' . join ( arg_3 ) , arg_2

def Func(arg_0, arg_1):
        """ similar to pop, but returns payload + last timestamp """
        arg_2 = 0
        arg_3 = []
        for arg_4 in arg_0.pop(arg_1):
            arg_2 = arg_4.timestamp
            arg_3.append(arg_4.data.data)

        return ''.join(arg_3), arg_2

similar to pop but returns payload + last timestamp


def Func(arg_0, arg_1):
    """
    Performs inhibition. This method calculates the necessary values needed to
    actually perform inhibition and then delegates the task of picking the
    active columns to helper functions.

    Parameters:
    ----------------------------
    :param overlaps: an array containing the overlap score for each  column.
                    The overlap score for a column is defined as the number
                    of synapses in a "connected state" (connected synapses)
                    that are connected to input bits which are turned on.
    """
    # determine how many columns should be selected in the inhibition phase.
    # This can be specified by either setting the 'numActiveColumnsPerInhArea'
    # parameter or the 'localAreaDensity' parameter when initializing the class
    if (arg_0._localAreaDensity > 0):
      arg_2 = arg_0._localAreaDensity
    else:
      arg_3 = ((2*arg_0._inhibitionRadius + 1)
                                    ** arg_0._columnDimensions.size)
      arg_3 = min(arg_0._numColumns, arg_3)
      arg_2 = float(arg_0._numActiveColumnsPerInhArea) / arg_3
      arg_2 = min(arg_2, 0.5)

    if arg_0._globalInhibition or \
      arg_0._inhibitionRadius > max(arg_0._columnDimensions):
      return arg_0.FuncGlobal(arg_1, arg_2)
    else:
      return arg_0.FuncLocal(arg_1, arg_2)

Performs inhibition . This method calculates the necessary values needed to actually perform inhibition and then delegates the task of picking the active columns to helper functions .


def Func ( ) : from airflow . plugins_manager import executors_modules for arg_0 in executors_modules : arg_1 . modules [ arg_0 . __name__ ] = arg_0 arg_4 ( ) [ arg_0 . _name ] = arg_0

def Func():
    """Integrate plugins to the context."""
    from airflow.plugins_manager import executors_modules
    for arg_0 in executors_modules:
        arg_1.modules[arg_0.__name__] = arg_0
        arg_4()[arg_0._name] = arg_0


return tf.placeholder(shape=(batch_size,) + ob_space.shape, dtype=dtype, name=name)

def Func(arg_0, arg_1=None, arg_2='Ob'):
    '''
    Create placeholder to feed observations into of the size appropriate to the observation space

    Parameters:
    ----------

    ob_space: gym.Space     observation space

    batch_size: int         size of the batch to be fed into input. Can be left None in most cases.

    name: str               name of the placeholder

    Returns:
    -------

    tensorflow placeholder tensor
    '''

    assert isinstance(arg_0, Discrete) or isinstance(arg_0, Box) or isinstance(arg_0, MultiDiscrete), \
        'Can only deal with Discrete and Box observation spaces for now'

    arg_3 = arg_0.dtype
    if arg_3 == np.int8:
        arg_3 = np.uint8

    return tf.placeholder(shape=(arg_1,) + arg_0.shape, arg_3=arg_3, arg_2=arg_2)


def Func ( arg_0 , arg_1 = 0.035 ) : arg_2 = sum ( [ w for arg_4 , arg_5 , w in arg_0 . ranges ] ) arg_3 = random ( ) for arg_4 , arg_5 , arg_6 in arg_0 . ranges : if arg_6 / arg_2 >= arg_3 : break arg_3 -= arg_6 / arg_2 return arg_5 ( arg_4 , arg_1 )

def Func(arg_0, arg_1=0.035):
        """
        Returns a random Func within the theme.

        Fetches a random range (the weight is taken into account,
        so ranges with a bigger weight have a higher chance of propagating)
        and hues it with the associated Func.
        """
        arg_2 = sum([w for arg_4, arg_5, w in arg_0.ranges])
        arg_3 = random()
        for arg_4, arg_5, arg_6 in arg_0.ranges:
            if arg_6 / arg_2 >= arg_3: break
            arg_3 -= arg_6 / arg_2

        return arg_5(arg_4, arg_1)

Returns a random color within the theme.

        Fetches a random range (the weight is taken into account,
        so ranges with a bigger weight have a higher chance of propagating)
        and hues it with the associated color.

Returns a random color within the theme .


(
    message,
    get_certificate=lambda url: urlopen(url).read(),
    certificate_url_regex=DEFAULT_CERTIFICATE_URL_REGEX,
    max_age=DEFAULT_MAX_AGE
)

def Func(
    arg_0,
    arg_1=lambda arg_2: arg_3(arg_2).read(),
    arg_5=arg_6,
    arg_7=arg_8
):
    """
    Validate a decoded SNS message.

    Parameters:
        message:
            Decoded SNS message.

        get_certificate:
            Function that receives a URL, and returns the certificate from that
            URL as a string. The default doesn't implement caching.

        certificate_url_regex:
            Regex that Funcs the signing certificate URL. Default value
            checks it's hosted on an AWS-controlled domain, in the format
            "https://sns.<data-center>.amazonaws.com/"

        max_age:
            Maximum age of an SNS message before it fails validation, expressed
            as a `datetime.timedelta`. Defaults to one hour, the max. lifetime
            of an SNS message.
    """

    # Check the signing certicate URL.
    SigningCertURLValidator(arg_5).Func(arg_0)

    # Check the message age.
    if not isinstance(arg_7, datetime.timedelta):
        raise ValueError("max_age must be None or a timedelta object")
    MessageAgeValidator(arg_7).Func(arg_0)

    # Passed the basic checks, let's download the cert.
    # We've Funcd the URL, so aren't worried about a malicious server.
    arg_9 = arg_1(arg_0["SigningCertURL"])

    # Check the cryptographic signature.
    SignatureValidator(arg_9).Func(arg_0)

Validate a decoded SNS message.

    Parameters:
        message:
            Decoded SNS message.

        get_certificate:
            Function that receives a URL, and returns the certificate from that
            URL as a string. The default doesn't implement caching.

        certificate_url_regex:
            Regex that validates the signing certificate URL. Default value
            checks it's hosted on an AWS-controlled domain, in the format
            "https://sns.<data-center>.amazonaws.com/"

        max_age:
            Maximum age of an SNS message before it fails validation, expressed
            as a `datetime.timedelta`. Defaults to one hour, the max. lifetime
            of an SNS message.


def Func ( arg_0 ) : arg_1 = zipfile . ZipFile ( arg_0 , mode = 'r' ) arg_2 = list ( set ( [ re . match ( egg_regex , i ) . group ( 1 ) for i in arg_1 . namelist ( ) if re . match ( egg_regex , i ) is not None ] ) ) return arg_2

def Func(arg_0):
  """Get a list of paths to included dependencies in the specified pex file

  Note that dependencies are located under `.deps` directory
  """
  arg_1 = zipfile.ZipFile(arg_0, mode='r')
  arg_2 = list(set([re.match(egg_regex, i).group(1) for i in arg_1.namelist()
                   if re.match(egg_regex, i) is not None]))
  return arg_2


def Func ( arg_0 , arg_1 = 'push' ) : def decorator ( arg_2 ) : arg_0 . _Funcs [ arg_1 ] . append ( arg_2 ) return arg_2 return decorator

def Func(arg_0, arg_1='push'):
        """
        Registers a function as a Func. Multiple Funcs can be registered for a given type, but the
        order in which they are invoke is unspecified.

        :param event_type: The event type this Func will be invoked for.
        """

        def decorator(arg_2):
            arg_0._Funcs[arg_1].append(arg_2)
            return arg_2

        return decorator

Registers a function as a hook. Multiple hooks can be registered for a given type, but the
        order in which they are invoke is unspecified.

        :param event_type: The event type this hook will be invoked for.

Registers a function as a hook . Multiple hooks can be registered for a given type but the order in which they are invoke is unspecified .


def Func ( arg_0 ) : if isinstance ( arg_0 , base . BaseGeometry ) : if hasattr ( arg_0 , "geoms" ) : for arg_1 in arg_0 : yield arg_1 else : yield arg_0

def Func(arg_0):
    """
    Yield single part geometries if geom is multipart, otherwise yield geom.

    Parameters:
    -----------
    geom : shapely geometry

    Returns:
    --------
    shapely single part geometries
    """
    if isinstance(arg_0, base.BaseGeometry):
        if hasattr(arg_0, "geoms"):
            for arg_1 in arg_0:
                yield arg_1
        else:
            yield arg_0

Yield single part geometries if geom is multipart otherwise yield geom .


def Func ( arg_0 , arg_1 , ** arg_2 ) : if arg_0 . host == 'github.com' : arg_3 = "https://api.github.com" else : arg_3 = "https://{}/api/v3" . format ( arg_0 . host ) return arg_3 + arg_1 . format ( ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        """ Build the full url to the API endpoint """
        if arg_0.host == 'github.com':
            arg_3 = "https://api.github.com"
        else:
            arg_3 = "https://{}/api/v3".format(arg_0.host)
        return arg_3 + arg_1.format(**arg_2)


def Func(arg_0, arg_1):
    """Custom grouping from a given implementation of ICustomGrouping

    :param Funcgrouper: The ICustomGrouping implemention to use
    """
    if arg_1 is None:
      raise TypeError("Argument to Func() must be ICustomGrouping instance or classpath")
    if not isinstance(arg_1, ICustomGrouping) and not isinstance(arg_1, str):
      raise TypeError("Argument to Func() must be ICustomGrouping instance or classpath")
    arg_2 = default_serializer.serialize(arg_1)
    return arg_0.Func_serialized(arg_2, is_java=False)

Custom grouping from a given implementation of ICustomGrouping

    :param customgrouper: The ICustomGrouping implemention to use


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
common_names
=
[
]
arg_3
=
[
]
for
arg_4
in
arg_1
:
for
arg_5
in
arg_4
:
arg_6
=
[
]
for
arg_7
in
arg_5
:
arg_8
=
arg_7
.
getComponentByName
(
'type'
)
arg_9
=
arg_7
.
getComponentByName
(
'value'
)
if
arg_8
not
in
DN_OIDS
:
logger
.
debug
(
"OID {0} not supported"
.
format
(
arg_8
)
)
continue
arg_8
=
DN_OIDS
[
arg_8
]
arg_9
=
der_decoder
.
decode
(
arg_9
,
asn1Spec
=
DirectoryString
(
)
)
[
0
]
arg_9
=
arg_9
.
getComponent
(
)
try
:
arg_9
=
_decode_asn1_string
(
arg_9
)
except
UnicodeError
:
logger
.
debug
(
"Cannot decode value: {0!r}"
.
format
(
arg_9
)
)
continue
if
arg_8
==
u"commonName"
:
arg_0
.
common_names
.
append
(
arg_9
)
arg_6
.
append
(
(
arg_8
,
arg_9
)
)
arg_3
.
append
(
tuple
(
arg_6
)
)
arg_0
.
subject_name
=
tuple
(
arg_3
)

def Func(arg_0, arg_1):
        """Load data from a ASN.1 subject.
        """
        arg_0.common_names = []
        arg_3 = []
        for arg_4 in arg_1:
            for arg_5 in arg_4:
                arg_6 = []
                for arg_7 in arg_5:
                    arg_8 = arg_7.getComponentByName('type')
                    arg_9 = arg_7.getComponentByName('value')
                    if arg_8 not in DN_OIDS:
                        logger.debug("OID {0} not supported".format(arg_8))
                        continue
                    arg_8 = DN_OIDS[arg_8]
                    arg_9 = der_decoder.decode(arg_9,
                                            asn1Spec = DirectoryString())[0]
                    arg_9 = arg_9.getComponent()
                    try:
                        arg_9 = _decode_asn1_string(arg_9)
                    except UnicodeError:
                        logger.debug("Cannot decode value: {0!r}".format(arg_9))
                        continue
                    if arg_8 == u"commonName":
                        arg_0.common_names.append(arg_9)
                    arg_6.append((arg_8, arg_9))
                arg_3.append(tuple(arg_6))
        arg_0.subject_name = tuple(arg_3)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 in object_iter ( arg_2 ) : if all ( [ arg_5 ( arg_4 ) for arg_5 in arg_1 ] ) : arg_3 . append ( arg_4 ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """Apply each validator in validators to each node in obj.

        Return each node in obj which matches all validators.
        """

        arg_3 = []
        for arg_4 in object_iter(arg_2):
            if all([arg_5(arg_4) for arg_5 in arg_1]):
                arg_3.append(arg_4)
        return arg_3

Apply each validator in validators to each node in obj .


return any((isregex_expr(value), isinstance(value, retype)))

def Func ( arg_0 ) : if not arg_0 : return False return any ( ( Func_expr ( arg_0 ) , isinstance ( arg_0 , retype ) ) )

def Func(arg_0):
    """
    Returns ``True`` if the input argument object is a native
    regular expression object, otherwise ``False``.

    Arguments:
        value (mixed): input value to test.

    Returns:
        bool
    """
    if not arg_0:
        return False
    return any((Func_expr(arg_0), isinstance(arg_0, retype)))

Returns True if the input argument object is a native regular expression object otherwise False .


def Func ( arg_0 ) : def run ( * arg_1 , ** arg_2 ) : arg_3 = mp . Process ( target = arg_0 , arg_1 = arg_1 , arg_2 = arg_2 ) arg_3 . start ( ) return arg_3 return run

def Func(arg_0):
    """ Decorator function to launch a function as a separate process """

    def run(*arg_1, **arg_2):
        arg_3 = mp.Process(target=arg_0, arg_1=arg_1, arg_2=arg_2)
        arg_3.start()
        return arg_3

    return run


return self.deepcopy(
            coords=np.concatenate([self.coords, other.coords], axis=0))

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , LineString ) : arg_1 = LineString ( arg_1 ) return arg_0 . deepcopy ( coords = np . Func ( [ arg_0 . coords , arg_1 . coords ] , axis = 0 ) )

def Func(arg_0, arg_1):
        """
        Concatenate this line string with another one.

        This will add a line segment between the end point of this line string
        and the start point of `other`.

        Parameters
        ----------
        other : imgaug.augmentables.lines.LineString or ndarray \
                or iterable of tuple of number
            The points to add to this line string.

        Returns
        -------
        imgaug.augmentables.lines.LineString
            New line string with Funcd points.
            The `label` of this line string will be kept.

        """
        if not isinstance(arg_1, LineString):
            arg_1 = LineString(arg_1)
        return arg_0.deepcopy(
            coords=np.Func([arg_0.coords, arg_1.coords], axis=0))

Concatenate this line string with another one.

        This will add a line segment between the end point of this line string
        and the start point of `other`.

        Parameters
        ----------
        other : imgaug.augmentables.lines.LineString or ndarray \
                or iterable of tuple of number
            The points to add to this line string.

        Returns
        -------
        imgaug.augmentables.lines.LineString
            New line string with concatenated points.
            The `label` of this line string will be kept.

Concatenate this line string with another one .


def Func ( arg_0 , arg_1 ) : arg_2 = yield from arg_0 . handle_get ( arg_1 ) if arg_2 is None : return None return int ( arg_2 . value . u32 . text ) or None

def Func(arg_0, arg_1):
        """Helper method for fetching a long value. Result is integer."""
        arg_2 = yield from arg_0.handle_get(arg_1)
        if arg_2 is None:
            return None

        return int(arg_2.value.u32.text) or None

Helper method for fetching a long value . Result is integer .


(self,
                                  name,
                                  mail_folder='INBOX',
                                  check_regex=False,
                                  latest_only=False,
                                  not_found_mode='raise')

def Func(arg_0,
                                  arg_1,
                                  arg_2='INBOX',
                                  arg_3=False,
                                  arg_4=False,
                                  arg_5='raise'):
        """
        Retrieves mail's attachments in the mail folder by its name.

        :param name: The name of the attachment that will be downloaded.
        :type name: str
        :param mail_folder: The mail folder where to look at.
        :type mail_folder: str
        :param check_regex: Checks the name for a regular expression.
        :type check_regex: bool
        :param latest_only: If set to True it will only retrieve
                            the first matched attachment.
        :type latest_only: bool
        :param not_found_mode: Specify what should happen if no attachment has been found.
                               Supported values are 'raise', 'warn' and 'ignore'.
                               If it is set to 'raise' it will raise an exception,
                               if set to 'warn' it will only print a warning and
                               if set to 'ignore' it won't notify you at all.
        :type not_found_mode: str
        :returns: a list of tuple each containing the attachment filename and its payload.
        :rtype: a list of tuple
        """
        arg_6 = arg_0._retrieve_mails_attachments_by_name(arg_1,
                                                                    arg_2,
                                                                    arg_3,
                                                                    arg_4)
        if not arg_6:
            arg_0._handle_not_found_mode(arg_5)

        return arg_6

Retrieves mail s attachments in the mail folder by its name .


return sorted(headers, key=lambda ch: ch.index)

def Func ( arg_0 ) : arg_1 = [ ctrl for ctrl in arg_0 if isinstance ( ctrl , GridColumn ) ] return sorted ( arg_1 , key = lambda ch : ch . index )

def Func(arg_0):
        "Return a list of children sub-components that are column headings"
        # return it in the same order as inserted in the Grid
        arg_1 = [ctrl for ctrl in arg_0 if isinstance(ctrl, GridColumn)]
        return sorted(arg_1, key=lambda ch: ch.index)

Return a list of children sub - components that are column headings


def Func(arg_0, arg_1):
        """Predict the distances for X to center of the training set.

        Parameters
        ----------
        X : array-like or sparse matrix, shape (n_samples, n_features)
            The input samples. Internally, it will be converted to
            ``dtype=np.float32`` and if a sparse matrix is provided
            to a sparse ``csr_matrix``.

        Returns
        -------
        leverages: array of shape = [n_samples]
                   The objects distances to center of the training set.
        """
        # Check is fit had been called
        check_is_fitted(arg_0, ['inverse_influence_matrix'])
        # Check that X have correct shape
        arg_1 = check_array(arg_1)
        return arg_0.__find_leverages(arg_1, arg_0.inverse_influence_matrix)

Predict the distances for X to center of the training set .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : from burlap . common import run_or_dryrun , sudo_or_dryrun if env . user == 'root' : arg_3 = run_or_dryrun else : arg_3 = sudo_or_dryrun return arg_3 ( arg_0 , * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
    """
    Run a remote command as the root user.

    When connecting as root to the remote system, this will use Fabric's
    ``run`` function. In other cases, it will use ``sudo``.
    """
    from burlap.common import run_or_dryrun, sudo_or_dryrun
    if env.user == 'root':
        arg_3 = run_or_dryrun
    else:
        arg_3 = sudo_or_dryrun
    return arg_3(arg_0, *arg_1, **arg_2)


(lcdict,
                           columns=('sap.sap_flux',
                                    'sap.sap_flux_err',
                                    'sap.sap_bkg',
                                    'sap.sap_bkg_err',
                                    'pdc.pdcsap_flux',
                                    'pdc.pdcsap_flux_err'))

def Func ( arg_0 , arg_1 = ( 'sap.sap_flux' , 'sap.sap_flux_err' , 'sap.sap_bkg' , 'sap.sap_bkg_err' , 'pdc.pdcsap_flux' , 'pdc.pdcsap_flux_err' ) ) : arg_2 = arg_0 [ 'objectinfo' ] [ 'tessmag' ] for arg_3 in arg_1 : arg_4 , arg_5 = arg_3 . split ( '.' ) if 'err' not in arg_5 : arg_0 [ arg_4 ] [ arg_5 . replace ( 'flux' , 'mag' ) ] = ( arg_2 - 2.5 * np . log10 ( arg_0 [ arg_4 ] [ arg_5 ] ) ) else : arg_0 [ arg_4 ] [ arg_5 . replace ( 'flux' , 'mag' ) ] = ( - 2.5 * np . log10 ( 1.0 - arg_0 [ arg_4 ] [ arg_5 ] ) ) return arg_0

def Func(arg_0,
                           arg_1=('sap.sap_flux',
                                    'sap.sap_flux_err',
                                    'sap.sap_bkg',
                                    'sap.sap_bkg_err',
                                    'pdc.pdcsap_flux',
                                    'pdc.pdcsap_flux_err')):
    '''This converts the normalized fluxes in the TESS lcdicts to TESS mags.

    Uses the object's TESS mag stored in lcdict['objectinfo']['tessmag']::

        mag - object_tess_mag = -2.5 log (flux/median_flux)

    Parameters
    ----------

    lcdict : lcdict
        An `lcdict` produced by `read_tess_fitslc` or
        `consolidate_tess_fitslc`. This must have normalized fluxes in its
        measurement columns (use the `normalize` kwarg for these functions).

    columns : sequence of str
        The column keys of the normalized flux and background measurements in
        the `lcdict` to operate on and convert to magnitudes in TESS band (T).

    Returns
    -------

    lcdict
        The returned `lcdict` will contain extra columns corresponding to
        magnitudes for each input normalized flux/background column.

    '''

    arg_2 = arg_0['objectinfo']['tessmag']

    for arg_3 in arg_1:

        arg_4, arg_5 = arg_3.split('.')

        if 'err' not in arg_5:

            arg_0[arg_4][arg_5.replace('flux','mag')] = (
                arg_2 - 2.5*np.log10(arg_0[arg_4][arg_5])
            )

        else:

            arg_0[arg_4][arg_5.replace('flux','mag')] = (
                - 2.5*np.log10(1.0 - arg_0[arg_4][arg_5])
            )

    return arg_0

This converts the normalized fluxes in the TESS lcdicts to TESS mags .


return compile(transformed, source_path, "exec", dont_inherit=True)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = ast . parse ( arg_1 ) arg_4 = ExampleTransformer ( ) . transform ( arg_3 ) return compile ( arg_4 , arg_2 , "exec" , dont_inherit = True )

def Func(arg_0, arg_1, arg_2):
        """
        Transform the source code, then return the code object.

        """

        arg_3 = ast.parse(arg_1)
        arg_4 = ExampleTransformer().transform(arg_3)
        return compile(arg_4, arg_2, "exec", dont_inherit=True)

Transform the source code then return the code object .


(returns, positions,
                             legend_loc='upper left', ax=None, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
'upper left'
,
arg_3
=
,
**
arg_4
)
:
if
arg_3
is
:
arg_3
=
plt
.
gca
(
)
arg_1
=
arg_1
.
drop
(
'cash'
,
axis
=
'columns'
)
arg_1
=
arg_1
.
replace
(
0
,
np
.
)
arg_5
=
arg_1
[
arg_1
>
0
]
.
count
(
axis
=
1
)
arg_6
=
arg_1
[
arg_1
<
0
]
.
count
(
axis
=
1
)
arg_7
=
arg_3
.
fill_between
(
arg_5
.
index
,
0
,
arg_5
.
values
,
color
=
'g'
,
alpha
=
0.5
,
lw
=
2.0
)
arg_8
=
arg_3
.
fill_between
(
arg_6
.
index
,
0
,
arg_6
.
values
,
color
=
'r'
,
alpha
=
0.5
,
lw
=
2.0
)
arg_9
=
patches
.
Rectangle
(
[
0
,
0
]
,
1
,
1
,
color
=
'darkgoldenrod'
)
arg_10
=
arg_3
.
legend
(
[
arg_7
,
arg_8
,
arg_9
]
,
[
'Long (max: %s, min: %s)'
%
(
arg_5
.
max
(
)
,
arg_5
.
min
(
)
)
,
'Short (max: %s, min: %s)'
%
(
arg_6
.
max
(
)
,
arg_6
.
min
(
)
)
,
'Overlap'
]
,
loc
=
arg_2
,
frameon
=
True
,
framealpha
=
0.5
)
arg_10
.
get_frame
(
)
.
set_edgecolor
(
'black'
)
arg_3
.
set_xlim
(
(
arg_0
.
index
[
0
]
,
arg_0
.
index
[
1
]
)
)
arg_3
.
set_title
(
'Long and short holdings'
)
arg_3
.
set_ylabel
(
'Holdings'
)
arg_3
.
set_xlabel
(
''
)
return
arg_3

def Func(arg_0, arg_1,
                             arg_2='upper left', arg_3=None, **arg_4):
    """
    Plots total amount of stocks with an active position, breaking out
    short and long into transparent filled regions.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    positions : pd.DataFrame, optional
        Daily net position values.
         - See full explanation in tears.create_full_tear_sheet.
    legend_loc : matplotlib.loc, optional
        The location of the legend on the plot.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to plotting function.

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

    """

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

    arg_1 = arg_1.drop('cash', axis='columns')
    arg_1 = arg_1.replace(0, np.nan)
    arg_5 = arg_1[arg_1 > 0].count(axis=1)
    arg_6 = arg_1[arg_1 < 0].count(axis=1)
    arg_7 = arg_3.fill_between(arg_5.index, 0, arg_5.values,
                         color='g', alpha=0.5, lw=2.0)
    arg_8 = arg_3.fill_between(arg_6.index, 0, arg_6.values,
                         color='r', alpha=0.5, lw=2.0)

    arg_9 = patches.Rectangle([0, 0], 1, 1, color='darkgoldenrod')
    arg_10 = arg_3.legend([arg_7, arg_8, arg_9],
                    ['Long (max: %s, min: %s)' % (arg_5.max(),
                                                  arg_5.min()),
                     'Short (max: %s, min: %s)' % (arg_6.max(),
                                                   arg_6.min()),
                     'Overlap'], loc=arg_2, frameon=True,
                    framealpha=0.5)
    arg_10.get_frame().set_edgecolor('black')

    arg_3.set_xlim((arg_0.index[0], arg_0.index[-1]))
    arg_3.set_title('Long and short holdings')
    arg_3.set_ylabel('Holdings')
    arg_3.set_xlabel('')
    return arg_3

Plots total amount of stocks with an active position breaking out short and long into transparent filled regions .


def Func ( arg_0 , arg_1 ) : try : arg_2 = commerce . Cart . objects . get ( arg_1 = arg_1 , status = commerce . Cart . STATUS_ACTIVE , ) except ObjectDoesNotExist : arg_2 = commerce . Cart . objects . create ( arg_1 = arg_1 , time_last_updated = timezone . now ( ) , reservation_duration = datetime . timedelta ( ) , ) return arg_0 ( arg_2 )

def Func(arg_0, arg_1):
        ''' Returns the user's current cart, or creates a new cart
        if there isn't one ready yet. '''

        try:
            arg_2 = commerce.Cart.objects.get(
                arg_1=arg_1,
                status=commerce.Cart.STATUS_ACTIVE,
            )
        except ObjectDoesNotExist:
            arg_2 = commerce.Cart.objects.create(
                arg_1=arg_1,
                time_last_updated=timezone.now(),
                reservation_duration=datetime.timedelta(),
            )
        return arg_0(arg_2)

Returns the user s current cart or creates a new cart if there isn t one ready yet .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = arg_2 . shape [ 0 ] arg_0 = np . asarray ( arg_0 ) arg_5 = ( arg_0 - 1 ) / np . pi ** ( arg_1 / 2 ) * gamma ( arg_1 / 2 + 1 ) arg_6 = arg_5 / ( arg_4 - 1 ) * np . mean ( arg_2 ** ( - arg_1 ) , axis = 0 ) return arg_6

def Func(arg_0, arg_1, arg_2, arg_3=None):
    r'''
    Estimates \int p^2 based on kNN distances.

    In here because it's used in the l2 distance, above.

    Returns array of shape (num_Ks,).
    '''
    # Estimated with alpha=1, beta=0:
    #   B_{k,d,1,0} is the same as B_{k,d,0,1} in linear()
    # and the full estimator is
    #   B / (n - 1) * mean(rho ^ -dim)
    arg_4 = arg_2.shape[0]
    arg_0 = np.asarray(arg_0)
    arg_5 = (arg_0 - 1) / np.pi ** (arg_1 / 2) * gamma(arg_1 / 2 + 1)  # shape (num_Ks,)
    arg_6 = arg_5 / (arg_4 - 1) * np.mean(arg_2 ** (-arg_1), axis=0)
    return arg_6

r Estimates \ int p^2 based on kNN distances .


(Tc=None, Pc=None, omega=None, CASRN='', Method=None,
               AvailableMethods=False)

def
Func
(
arg_0
=
,
arg_1
=
,
arg_2
=
,
arg_3
=
''
,
arg_4
=
,
arg_5
=
False
)
:
def
list_methods
(
)
:
arg_6
=
[
]
if
arg_0
and
arg_1
and
arg_2
:
arg_6
.
append
(
'DEFINITION'
)
arg_6
.
append
(
'NONE'
)
return
arg_6
if
arg_5
:
return
list_methods
(
)
if
not
arg_4
:
arg_4
=
list_methods
(
)
[
0
]
if
arg_4
==
'DEFINITION'
:
arg_7
=
VaporPressure
(
arg_3
=
arg_3
)
.
T_dependent_property
(
arg_0
*
0.6
)
if
not
arg_7
:
arg_8
=
else
:
arg_9
=
arg_7
/
arg_1
arg_8
=
log10
(
arg_9
)
+
1.70
*
arg_2
+
1.552
elif
arg_4
==
'NONE'
:
arg_8
=
else
:
raise
Exception
(
'Failure in in function'
)
return
arg_8

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3='', arg_4=None,
               arg_5=False):
    r'''This function handles the calculation of a chemical's Stiel Polar
    factor, directly through the definition of Stiel-polar factor if possible.
    Requires Tc, Pc, acentric factor, and a vapor pressure datum at Tr=0.6.

    Will automatically select a method to use if no Method is provided;
    returns None if the data is not available and cannot be calculated.

    .. math::
        x = \log P_r|_{T_r=0.6} + 1.70 \omega + 1.552

    Parameters
    ----------
    Tc : float
        Critical temperature of fluid [K]
    Pc : float
        Critical pressure of fluid [Pa]
    omega : float
        Acentric factor of the fluid [-]
    CASRN : string
        CASRN [-]

    Returns
    -------
    factor : float
        Stiel polar factor of compound
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Stiel polar factor with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Only 'DEFINITION' is accepted so far.
        All valid values are also held in the list Stiel_polar_methods.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Stiel-polar factor for the desired chemical, and will return methods
        instead of stiel-polar factor

    Notes
    -----
    Only one source is available for this function. It is:

        * 'DEFINITION', based on the definition of
          Stiel Polar Factor presented in [1]_, using vapor pressure data.

    A few points have also been published in [2]_, which may be used for
    comparison. Currently this is only used for a surface tension correlation.

    Examples
    --------
    >>> Func(647.3, 22048321.0, 0.344, CASRN='7732-18-5')
    0.024581140348734376

    References
    ----------
    .. [1] Halm, Roland L., and Leonard I. Stiel. "A Fourth Parameter for the
       Vapor Pressure and Entropy of Vaporization of Polar Fluids." AIChE
       Journal 13, no. 2 (1967): 351-355. doi:10.1002/aic.690130228.
    .. [2] D, Kukoljac Miloš, and Grozdanić Dušan K. "New Values of the
       Polarity Factor." Journal of the Serbian Chemical Society 65, no. 12
       (January 1, 2000). http://www.shd.org.rs/JSCS/Vol65/No12-Pdf/JSCS12-07.pdf
    '''
    def list_methods():
        arg_6 = []
        if arg_0 and arg_1 and arg_2:
            arg_6.append('DEFINITION')
        arg_6.append('NONE')
        return arg_6
    if arg_5:
        return list_methods()
    if not arg_4:
        arg_4 = list_methods()[0]
    if arg_4 == 'DEFINITION':
        arg_7 = VaporPressure(arg_3=arg_3).T_dependent_property(arg_0*0.6)
        if not arg_7:
            arg_8 = None
        else:
            arg_9 = arg_7/arg_1
            arg_8 = log10(arg_9) + 1.70*arg_2 + 1.552
    elif arg_4 == 'NONE':
        arg_8 = None
    else:
        raise Exception('Failure in in function')
    return arg_8

r'''This function handles the calculation of a chemical's Stiel Polar
    factor, directly through the definition of Stiel-polar factor if possible.
    Requires Tc, Pc, acentric factor, and a vapor pressure datum at Tr=0.6.

    Will automatically select a method to use if no Method is provided;
    returns None if the data is not available and cannot be calculated.

    .. math::
        x = \log P_r|_{T_r=0.6} + 1.70 \omega + 1.552

    Parameters
    ----------
    Tc : float
        Critical temperature of fluid [K]
    Pc : float
        Critical pressure of fluid [Pa]
    omega : float
        Acentric factor of the fluid [-]
    CASRN : string
        CASRN [-]

    Returns
    -------
    factor : float
        Stiel polar factor of compound
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Stiel polar factor with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Only 'DEFINITION' is accepted so far.
        All valid values are also held in the list Stiel_polar_methods.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Stiel-polar factor for the desired chemical, and will return methods
        instead of stiel-polar factor

    Notes
    -----
    Only one source is available for this function. It is:

        * 'DEFINITION', based on the definition of
          Stiel Polar Factor presented in [1]_, using vapor pressure data.

    A few points have also been published in [2]_, which may be used for
    comparison. Currently this is only used for a surface tension correlation.

    Examples
    --------
    >>> StielPolar(647.3, 22048321.0, 0.344, CASRN='7732-18-5')
    0.024581140348734376

    References
    ----------
    .. [1] Halm, Roland L., and Leonard I. Stiel. "A Fourth Parameter for the
       Vapor Pressure and Entropy of Vaporization of Polar Fluids." AIChE
       Journal 13, no. 2 (1967): 351-355. doi:10.1002/aic.690130228.
    .. [2] D, Kukoljac Miloš, and Grozdanić Dušan K. "New Values of the
       Polarity Factor." Journal of the Serbian Chemical Society 65, no. 12
       (January 1, 2000). http://www.shd.org.rs/JSCS/Vol65/No12-Pdf/JSCS12-07.pdf

r This function handles the calculation of a chemical s Stiel Polar factor directly through the definition of Stiel - polar factor if possible . Requires Tc Pc acentric factor and a vapor pressure datum at Tr = 0 . 6 .


def
Func
(
arg_0
,
arg_1
)
:
arg_1
=
arg_1
.
decode
(
'ascii'
)
arg_0
.
log
.
debug
(
'received data: %s'
,
arg_1
)
arg_0
.
telegram_buffer
.
append
(
arg_1
)
for
arg_2
in
arg_0
.
telegram_buffer
.
get_all
(
)
:
arg_0
.
handle_telegram
(
arg_2
)

def Func(arg_0, arg_1):
        """Add incoming data to buffer."""
        arg_1 = arg_1.decode('ascii')
        arg_0.log.debug('received data: %s', arg_1)
        arg_0.telegram_buffer.append(arg_1)

        for arg_2 in arg_0.telegram_buffer.get_all():
            arg_0.handle_telegram(arg_2)


(outcomes, logits, probs, validate_args)

def Func(arg_0, arg_1, arg_2, arg_3):
  """Validate `outcomes`, `logits` and `probs`'s shapes."""
  arg_4 = []

  def validate_equal_last_dim(arg_5, arg_6, arg_7):
    if arg_5.shape.is_fully_defined() and arg_6.shape.is_fully_defined():
      if arg_5.shape[-1] != arg_6.shape[-1]:
        raise ValueError(arg_7)
    elif arg_3:
      arg_4.append(
          tf.compat.v1.assert_equal(
              tf.shape(input=arg_5)[-1],
              tf.shape(input=arg_6)[-1],
              arg_7=arg_7))

  if arg_1 is not None:
    validate_equal_last_dim(
        arg_0,
        arg_1,
        arg_7='Last dimension of outcomes and logits must be equal size.')
  if arg_2 is not None:
    validate_equal_last_dim(
        arg_0,
        arg_2,
        arg_7='Last dimension of outcomes and probs must be equal size.')

  arg_7 = 'Rank of outcomes must be 1.'
  if arg_0.shape.ndims is not None:
    if arg_0.shape.ndims != 1:
      raise ValueError(arg_7)
  elif arg_3:
    arg_4.append(tf.compat.v1.assert_rank(arg_0, 1, arg_7=arg_7))

  arg_7 = 'Size of outcomes must be greater than 0.'
  if arg_0.shape.num_elements() is not None:
    if arg_0.shape.num_elements() == 0:
      raise ValueError(arg_7)
  elif arg_3:
    arg_4.append(
        tf.compat.v1.assert_greater(
            tf.size(input=arg_0), 0, arg_7=arg_7))

  if arg_3:
    arg_4.append(
        tf.compat.v1.assert_equal(
            tf.math.is_strictly_increasing(arg_0),
            True,
            arg_7='outcomes is not strictly increasing.'))

  return arg_4

Validate outcomes logits and probs s shapes .


def Func ( arg_0 ) : if arg_0 . outstream_class : arg_1 = import_item ( str ( arg_0 . outstream_class ) ) arg_2 . stdout = arg_1 ( arg_0 . session , arg_0 . iopub_socket , u'stdout' ) arg_2 . stderr = arg_1 ( arg_0 . session , arg_0 . iopub_socket , u'stderr' ) if arg_0 . displayhook_class : arg_5 = import_item ( str ( arg_0 . displayhook_class ) ) arg_2 . displayhook = arg_5 ( arg_0 . session , arg_0 . iopub_socket )

def Func(arg_0):
        """Redirect input streams and set a display hook."""
        if arg_0.outstream_class:
            arg_1 = import_item(str(arg_0.outstream_class))
            arg_2.stdout = arg_1(arg_0.session, arg_0.iopub_socket, u'stdout')
            arg_2.stderr = arg_1(arg_0.session, arg_0.iopub_socket, u'stderr')
        if arg_0.displayhook_class:
            arg_5 = import_item(str(arg_0.displayhook_class))
            arg_2.displayhook = arg_5(arg_0.session, arg_0.iopub_socket)

Redirect input streams and set a display hook .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = COURSES_API . format ( arg_1 ) arg_4 = { "course" : { "sis_course_id" : arg_2 } } return CanvasCourse ( data = arg_0 . _put_resource ( arg_3 , arg_4 ) )

def Func(arg_0, arg_1, arg_2):
        """
        Updates the SIS ID for the course identified by the passed course ID.

        https://canvas.instructure.com/doc/api/courses.html#method.courses.update
        """
        arg_3 = COURSES_API.format(arg_1)
        arg_4 = {"course": {"sis_course_id": arg_2}}
        return CanvasCourse(data=arg_0._put_resource(arg_3, arg_4))

Updates the SIS ID for the course identified by the passed course ID .


def Func ( arg_0 ) : arg_1 = max ( arg_0 . _columnDimensions . size , arg_0 . _inputDimensions . size ) arg_2 = numpy . ones ( arg_1 ) arg_2 [ : arg_0 . _columnDimensions . size ] = arg_0 . _columnDimensions arg_5 = numpy . ones ( arg_1 ) arg_5 [ : arg_0 . _inputDimensions . size ] = arg_0 . _inputDimensions arg_7 = arg_2 . astype ( realDType ) / arg_5 return numpy . average ( arg_7 )

def Func(arg_0):
    """
    The average number of columns per input, taking into account the topology
    of the inputs and columns. This value is used to calculate the inhibition
    radius. This function supports an arbitrary number of dimensions. If the
    number of column dimensions does not match the number of input dimensions,
    we treat the missing, or phantom dimensions as 'ones'.
    """
    #TODO: extend to support different number of dimensions for inputs and
    # columns
    arg_1 = max(arg_0._columnDimensions.size, arg_0._inputDimensions.size)
    arg_2 = numpy.ones(arg_1)
    arg_2[:arg_0._columnDimensions.size] = arg_0._columnDimensions

    arg_5 = numpy.ones(arg_1)
    arg_5[:arg_0._inputDimensions.size] = arg_0._inputDimensions

    arg_7 = arg_2.astype(realDType) / arg_5
    return numpy.average(arg_7)

The average number of columns per input taking into account the topology of the inputs and columns . This value is used to calculate the inhibition radius . This function supports an arbitrary number of dimensions . If the number of column dimensions does not match the number of input dimensions we treat the missing or phantom dimensions as ones .


def Func ( arg_0 , arg_1 = ( 0 , 1 , 0 ) , arg_2 = 0.1 ) : arg_3 = [ ( 'root' , 0 , arg_0 . root [ 'position' ] + arg_1 ) ] while arg_3 : arg_4 , arg_5 , arg_6 = arg_3 . pop ( ) for arg_7 in arg_0 . hierarchy . get ( arg_4 , ( ) ) : arg_3 . append ( ( arg_7 , arg_5 + 1 , arg_6 + arg_0 . bones [ arg_7 ] . end ) ) if arg_4 not in arg_0 . bones : continue arg_8 = arg_0 . bones [ arg_4 ] arg_9 = arg_0 . world . create_body ( 'box' , arg_4 = arg_8 . name , density = arg_0 . density , lengths = ( arg_2 , arg_2 , arg_8 . length ) ) arg_9 . color = arg_0 . color arg_11 , arg_12 , arg_13 = arg_6 - arg_8 . direction * arg_8 . length / 2 arg_9 . position = arg_11 , arg_13 , arg_12 arg_15 = arg_8 . direction arg_16 = np . cross ( arg_15 , [ 0 , 1 , 0 ] ) arg_17 = np . linalg . norm ( arg_16 ) if arg_17 > 0 : arg_16 /= arg_17 arg_18 = np . vstack ( [ np . cross ( arg_15 , arg_16 ) , arg_16 , arg_15 ] ) . T arg_19 = [ [ 1 , 0 , 0 ] , [ 0 , 0 , 1 ] , [ 0 , - 1 , 0 ] ] arg_9 . rotation = np . dot ( arg_19 , arg_18 ) arg_0 . bodies . append ( arg_9 )

def Func(arg_0, arg_1=(0, 1, 0), arg_2=0.1):
        '''Traverse the bone hierarchy and create physics bodies.'''
        arg_3 = [('root', 0, arg_0.root['position'] + arg_1)]
        while arg_3:
            arg_4, arg_5, arg_6 = arg_3.pop()

            for arg_7 in arg_0.hierarchy.get(arg_4, ()):
                arg_3.append((arg_7, arg_5 + 1, arg_6 + arg_0.bones[arg_7].end))

            if arg_4 not in arg_0.bones:
                continue

            arg_8 = arg_0.bones[arg_4]
            arg_9 = arg_0.world.create_body(
                'box', arg_4=arg_8.name, density=arg_0.density,
                lengths=(arg_2, arg_2, arg_8.length))
            arg_9.color = arg_0.color

            # move the center of the body to the halfway point between
            # the parent (joint) and child (joint).
            arg_11, arg_12, arg_13 = arg_6 - arg_8.direction * arg_8.length / 2

            # swizzle y and z -- asf uses y as up, but we use z as up.
            arg_9.position = arg_11, arg_13, arg_12

            # compute an orthonormal (rotation) matrix using the ground and
            # the body. this is mind-bending but seems to work.
            arg_15 = arg_8.direction
            arg_16 = np.cross(arg_15, [0, 1, 0])
            arg_17 = np.linalg.norm(arg_16)
            if arg_17 > 0:
                arg_16 /= arg_17
                arg_18 = np.vstack([np.cross(arg_15, arg_16), arg_16, arg_15]).T
                arg_19 = [[1, 0, 0], [0, 0, 1], [0, -1, 0]]
                arg_9.rotation = np.dot(arg_19, arg_18)

            arg_0.bodies.append(arg_9)

Traverse the bone hierarchy and create physics bodies .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _render_template ( 'install.sh' , arg_1 ) arg_0 . config . setdefault ( 'files' , [ ] ) arg_0 . _add_unique_file ( { "path" : "/install.sh" , "contents" : arg_2 , "mode" : "755" } )

def Func(arg_0, arg_1):
        """
        generates install.sh and adds it to included files
        """
        arg_2 = arg_0._render_template('install.sh', arg_1)
        arg_0.config.setdefault('files', [])  # file list might be empty
        # add install.sh to list of included files
        arg_0._add_unique_file({
            "path": "/install.sh",
            "contents": arg_2,
            "mode": "755"
        })

generates install . sh and adds it to included files


def Func ( arg_0 , arg_1 = arg_2 . curdir ) : arg_4 = arg_2 . listdir ( arg_1 ) arg_5 = re . compile ( arg_0 ) . match return filter_list ( arg_4 , arg_5 )

def Func(arg_0, arg_1=arg_2.curdir):
    """Create a list of regex matches that result from the match_regex
    of all file names within wd.
    The list of files will have wd as path prefix.

    @param regex: string
    @param wd: string
    working directory
    @return:
    """
    arg_4 = arg_2.listdir(arg_1)

    arg_5 = re.compile(arg_0).match
    return filter_list(arg_4, arg_5)

Create a list of regex matches that result from the match_regex of all file names within wd . The list of files will have wd as path prefix .


(annotation, sr=22050, length=None, **kwargs)

def Func ( arg_0 , arg_1 = 22050 , arg_2 = None , ** arg_3 ) : arg_4 = mkclick ( 440 * 2 , arg_1 = arg_1 ) arg_5 = mkclick ( 440 * 3 , arg_1 = arg_1 ) arg_6 , arg_7 = arg_0 . to_interval_values ( ) arg_8 , arg_9 = [ ] , [ ] for arg_10 , arg_11 in zip ( arg_6 [ : , 0 ] , arg_7 ) : if arg_11 [ 'position' ] == 1 : arg_9 . append ( arg_10 ) else : arg_8 . append ( arg_10 ) if arg_2 is None : arg_2 = int ( arg_1 * np . max ( arg_6 ) ) + len ( arg_4 ) + 1 arg_12 = filter_kwargs ( mir_eval . sonify . clicks , np . asarray ( arg_8 ) , fs = arg_1 , arg_2 = arg_2 , click = arg_4 ) arg_12 += filter_kwargs ( mir_eval . sonify . clicks , np . asarray ( arg_9 ) , fs = arg_1 , arg_2 = arg_2 , click = arg_5 ) return arg_12

def Func(arg_0, arg_1=22050, arg_2=None, **arg_3):
    '''Sonify beats and Funcs together.
    '''

    arg_4 = mkclick(440 * 2, arg_1=arg_1)
    arg_5 = mkclick(440 * 3, arg_1=arg_1)

    arg_6, arg_7 = arg_0.to_interval_values()

    arg_8, arg_9 = [], []

    for arg_10, arg_11 in zip(arg_6[:, 0], arg_7):
        if arg_11['position'] == 1:
            arg_9.append(arg_10)
        else:
            arg_8.append(arg_10)

    if arg_2 is None:
        arg_2 = int(arg_1 * np.max(arg_6)) + len(arg_4) + 1

    arg_12 = filter_kwargs(mir_eval.sonify.clicks,
                      np.asarray(arg_8),
                      fs=arg_1, arg_2=arg_2, click=arg_4)

    arg_12 += filter_kwargs(mir_eval.sonify.clicks,
                       np.asarray(arg_9),
                       fs=arg_1, arg_2=arg_2, click=arg_5)

    return arg_12


def Func(arg_0, arg_1):
        """Constructs ``File`` instance from file information.

        For example you have result of
        ``/files/1921953c-5d94-4e47-ba36-c2e1dd165e1a/`` API request::

            >>> file_info = {
                    # ...
                    'uuid': '1921953c-5d94-4e47-ba36-c2e1dd165e1a',
                    # ...
                }
            >>> File.Func(file_info)
            <uploadcare.File 1921953c-5d94-4e47-ba36-c2e1dd165e1a>

        """
        arg_2 = arg_0(arg_1['uuid'])
        arg_2.default_effects = arg_1.get('default_effects')
        arg_2._info_cache = arg_1
        return arg_2

Constructs ``File`` instance from file information.

        For example you have result of
        ``/files/1921953c-5d94-4e47-ba36-c2e1dd165e1a/`` API request::

            >>> file_info = {
                    # ...
                    'uuid': '1921953c-5d94-4e47-ba36-c2e1dd165e1a',
                    # ...
                }
            >>> File.construct_from(file_info)
            <uploadcare.File 1921953c-5d94-4e47-ba36-c2e1dd165e1a>

Constructs File instance from file information .


def Func(arg_0, arg_1, arg_2=2):
    '''This smooths the magseries with a Savitsky-Golay filter.

    Parameters
    ----------

    mags : np.array
        The input mags/flux time-series to smooth.

    windowsize : int
        This is a odd integer containing the smoothing window size.

    polyorder : int
        This is an integer containing the polynomial degree order to use when
        generating the Savitsky-Golay filter.

    Returns
    -------

    np.array
        The smoothed mag/flux time-series array.

    '''

    arg_3 = savgol_filter(arg_0, arg_1, arg_2)
    return arg_3

This smooths the magseries with a Savitsky - Golay filter .


def Func ( arg_0 = 'python' , arg_1 = True ) : arg_2 = package_version ( 'setuptools' , arg_0 ) arg_3 = package_version ( 'distribute' , arg_0 ) if arg_2 is None : _install_from_scratch ( arg_0 , arg_1 ) else : if arg_3 is None : _upgrade_from_setuptools ( arg_0 , arg_1 ) else : _upgrade_from_distribute ( arg_0 , arg_1 )

def Func(arg_0='python', arg_1=True):
    """
    Install the latest version of `setuptools`_.

    ::

        import burlap

        burlap.python_setuptools.Func()

    """

    arg_2 = package_version('setuptools', arg_0)
    arg_3 = package_version('distribute', arg_0)

    if arg_2 is None:
        _install_from_scratch(arg_0, arg_1)
    else:
        if arg_3 is None:
            _upgrade_from_setuptools(arg_0, arg_1)
        else:
            _upgrade_from_distribute(arg_0, arg_1)

Install the latest version of `setuptools`_.

    ::

        import burlap

        burlap.python_setuptools.install_setuptools()

Install the latest version of setuptools _ .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_10 . get ( arg_0 ) if arg_3 is not None : return arg_3 . copy ( ) arg_4 = _get_cached_arg_spec ( arg_0 ) if arg_4 . defaults : arg_5 = arg_4 . args [ - len ( arg_4 . defaults ) : ] arg_3 = dict ( zip ( arg_5 , arg_4 . defaults ) ) else : arg_3 = { } if six . PY3 and arg_4 . kwonlydefaults : arg_3 . update ( arg_4 . kwonlydefaults ) for arg_6 in list ( six . iterkeys ( arg_3 ) ) : arg_7 = arg_1 and arg_6 not in arg_1 arg_8 = arg_2 and arg_6 in arg_2 arg_9 = _is_literally_representable ( arg_3 [ arg_6 ] ) if arg_7 or arg_8 or not arg_9 : del arg_3 [ arg_6 ] arg_10 [ arg_0 ] = arg_3 return arg_3 . copy ( )

def Func(arg_0, arg_1, arg_2):
  """Retrieve all default values for configurable parameters of a function.

  Any parameters included in the supplied blacklist, or not included in the
  supplied whitelist, are excluded.

  Args:
    fn: The function whose parameter values should be retrieved.
    whitelist: The whitelist (or `None`) associated with the function.
    blacklist: The blacklist (or `None`) associated with the function.

  Returns:
    A dictionary mapping configurable parameter names to their default values.
  """
  arg_3 = arg_10.get(arg_0)
  if arg_3 is not None:
    return arg_3.copy()

  # First, grab any default values not captured in the kwargs var.
  arg_4 = _get_cached_arg_spec(arg_0)
  if arg_4.defaults:
    arg_5 = arg_4.args[-len(arg_4.defaults):]
    arg_3 = dict(zip(arg_5, arg_4.defaults))
  else:
    arg_3 = {}

  if six.PY3 and arg_4.kwonlydefaults:
    arg_3.update(arg_4.kwonlydefaults)

  # Now, eliminate keywords that are blacklisted, or aren't whitelisted (if
  # there's a whitelist), or aren't representable as a literal value.
  for arg_6 in list(six.iterkeys(arg_3)):
    arg_7 = arg_1 and arg_6 not in arg_1
    arg_8 = arg_2 and arg_6 in arg_2
    arg_9 = _is_literally_representable(arg_3[arg_6])
    if arg_7 or arg_8 or not arg_9:
      del arg_3[arg_6]

  arg_10[arg_0] = arg_3
  return arg_3.copy()

Retrieve all default values for configurable parameters of a function .


def Func ( ) : arg_0 = glob . glob ( "*" ) + glob . glob ( "*/*" ) + glob . glob ( '*/*/*' ) arg_0 = filter ( lambda f : os . path . isfile ( f ) , arg_0 ) arg_1 = stat . S_IEXEC | stat . S_IXGRP | stat . S_IXOTH arg_2 = [ ] for arg_3 in arg_0 : if os . path . isfile ( arg_3 ) : arg_4 = os . stat ( arg_3 ) arg_5 = arg_4 . st_mode if arg_5 & arg_1 : arg_2 . append ( arg_3 ) if len ( arg_2 ) > 5 : break return arg_2

def Func():
    """
    Find max 5 executables that are responsible for this repo.
    """
    arg_0 = glob.glob("*") + glob.glob("*/*") + glob.glob('*/*/*')
    arg_0 = filter(lambda f: os.path.isfile(f), arg_0)
    arg_1 = stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH
    arg_2 = []
    for arg_3 in arg_0:
        if os.path.isfile(arg_3):
            arg_4 = os.stat(arg_3)
            arg_5 = arg_4.st_mode
            if arg_5 & arg_1:
                arg_2.append(arg_3)
                if len(arg_2) > 5:
                    break
    return arg_2

Find max 5 executables that are responsible for this repo .


return (
                self.address.address
                + self.value_as_trytes
                + self.legacy_tag
                + self.timestamp_as_trytes
                + self.current_index_as_trytes
                + self.last_index_as_trytes
        )

def Func(arg_0):
        # type: () -> TryteString
        """
        Returns the values needed to validate the transaction's
        ``signature_message_fragment`` value.
        """
        return (
                arg_0.address.address
                + arg_0.value_as_trytes
                + arg_0.legacy_tag
                + arg_0.timestamp_as_trytes
                + arg_0.current_index_as_trytes
                + arg_0.last_index_as_trytes
        )

Returns the values needed to validate the transaction s signature_message_fragment value .


(
        df,
        column: str,
        group_cols: Union[str, List[str]] = None,
        new_column: str = None
)

def Func(
        arg_0,
        arg_1: arg_2,
        arg_3: arg_4[arg_2, arg_5[arg_2]] = None,
        arg_6: arg_2 = None
):
    """
    Add a column to the dataframe according to the groupby logic on group_cols

    ---

    ### Parameters

    *mandatory :*
    - `column` (*str*): name of the desired column you need Func on

    *optional :*
    - `group_cols` (*list*): names of columns for the groupby logic
    - `new_column` (*str*): name of the output column. By default `column` will be overwritten.

    ---

    **Input**

    | gender |    sport   | number |
    |:------:|:----------:|:------:|
    |  male  |   bicycle  |   17   |
    | female | basketball |   17   |
    |  male  | basketball |    3   |
    | female |  football  |    7   |
    | female |   running  |   30   |
    |  male  |   running  |   20   |
    |  male  |  football  |   21   |
    | female |   bicycle  |   17   |

    ```cson
    Func:
      new_column: 'number_Func'
      column: 'number'
      group_cols: ['sport']
    ```

    **Output**

    | gender |    sport   | number | number_Func |
    |:------:|:----------:|:------:|:-----------------:|
    |  male  |   bicycle  |   17   |        50.0       |
    | female | basketball |   17   |        85.0       |
    |  male  | basketball |    3   |        15.0       |
    | female |  football  |    7   |        25.0       |
    | female |   running  |   30   |        60.0       |
    |  male  |   running  |   20   |        40.0       |
    |  male  |  football  |   21   |        75.0       |
    | female |   bicycle  |   17   |        50.0       |
    """
    arg_6 = arg_6 or arg_1
    if arg_3 is None:
        arg_0[arg_6] = 100. * arg_0[arg_1] / sum(arg_0[arg_1])
    else:
        arg_0[arg_6] = 100. * arg_0[arg_1] / arg_0.groupby(arg_3)[arg_1].transform(sum)
    return arg_0

Add a column to the dataframe according to the groupby logic on group_cols

    ---

    ### Parameters

    *mandatory :*
    - `column` (*str*): name of the desired column you need percentage on

    *optional :*
    - `group_cols` (*list*): names of columns for the groupby logic
    - `new_column` (*str*): name of the output column. By default `column` will be overwritten.

    ---

    **Input**

    | gender |    sport   | number |
    |:------:|:----------:|:------:|
    |  male  |   bicycle  |   17   |
    | female | basketball |   17   |
    |  male  | basketball |    3   |
    | female |  football  |    7   |
    | female |   running  |   30   |
    |  male  |   running  |   20   |
    |  male  |  football  |   21   |
    | female |   bicycle  |   17   |

    ```cson
    percentage:
      new_column: 'number_percentage'
      column: 'number'
      group_cols: ['sport']
    ```

    **Output**

    | gender |    sport   | number | number_percentage |
    |:------:|:----------:|:------:|:-----------------:|
    |  male  |   bicycle  |   17   |        50.0       |
    | female | basketball |   17   |        85.0       |
    |  male  | basketball |    3   |        15.0       |
    | female |  football  |    7   |        25.0       |
    | female |   running  |   30   |        60.0       |
    |  male  |   running  |   20   |        40.0       |
    |  male  |  football  |   21   |        75.0       |
    | female |   bicycle  |   17   |        50.0       |


(password, salt, iterations, dklen=0, digest=None)

def Func(arg_0, arg_1, arg_2, arg_3=0, arg_4=None):
    """
    Implements PBKDF2 with the same API as Django's existing
    implementation, using cryptography.

    :type password: any
    :type salt: any
    :type iterations: int
    :type dklen: int
    :type digest: cryptography.hazmat.primitives.hashes.HashAlgorithm
    """
    if arg_4 is None:
        arg_4 = settings.CRYPTOGRAPHY_DIGEST
    if not arg_3:
        arg_3 = arg_4.digest_size
    arg_0 = force_bytes(arg_0)
    arg_1 = force_bytes(arg_1)
    arg_5 = PBKDF2HMAC(
        algorithm=arg_4,
        length=arg_3,
        arg_1=arg_1,
        arg_2=arg_2,
        backend=settings.CRYPTOGRAPHY_BACKEND)
    return arg_5.derive(arg_0)

Implements PBKDF2 with the same API as Django s existing implementation using cryptography .


def Func ( arg_0 , arg_1 , arg_2 = '' ) : arg_1 . sort ( ) arg_3 = { "action" : "query" , "list" : "recentchanges" , "rclimit" : arg_0 . limit , "rcnamespace" : "|" . join ( arg_1 ) , "rcprop" : "title|timestamp|ids" , "format" : "json" } if arg_2 : arg_3 [ 'rccontinue' ] = arg_2 return arg_0 . call ( arg_3 )

def Func(arg_0, arg_1, arg_2=''):
        """Retrieve recent pages from all namespaces starting from rccontinue."""

        arg_1.sort()
        arg_3 = {
            "action": "query",
            "list": "recentchanges",
            "rclimit": arg_0.limit,
            "rcnamespace": "|".join(arg_1),
            "rcprop": "title|timestamp|ids",
            "format": "json"
        }
        if arg_2:
            arg_3['rccontinue'] = arg_2

        return arg_0.call(arg_3)

Retrieve recent pages from all namespaces starting from rccontinue .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
0
)
:
arg_3
=
arg_0
.
keys
(
)
if
arg_2
:
arg_4
=
arg_3
arg_5
=
arg_1
else
:
arg_4
=
[
s
.
lower
(
)
for
s
in
arg_3
]
arg_5
=
arg_1
.
lower
(
)
try
:
arg_6
=
arg_4
.
index
(
arg_5
)
except
ValueError
:
raise
ValueError
,
'Unrecognized color scheme: '
+
arg_1
+
'\nValid schemes: '
+
str
(
arg_3
)
.
replace
(
"'', "
,
''
)
else
:
arg_7
=
arg_3
[
arg_6
]
arg_0
.
active_scheme_name
=
arg_7
arg_0
.
active_colors
=
arg_0
[
arg_7
]
.
colors
arg_0
[
''
]
=
arg_0
[
arg_7
]

def Func(arg_0,arg_1,arg_2=0):
        """Set the currently active scheme.

        Names are by default compared in a case-insensitive way, but this can
        be changed by setting the parameter case_sensitive to true."""

        arg_3 = arg_0.keys()
        if arg_2:
            arg_4 = arg_3
            arg_5 = arg_1
        else:
            arg_4 = [s.lower() for s in arg_3]
            arg_5 = arg_1.lower()
        try:
            arg_6 = arg_4.index(arg_5)
        except ValueError:
            raise ValueError,'Unrecognized color scheme: ' + arg_1 + \
                  '\nValid schemes: '+str(arg_3).replace("'', ",'')
        else:
            arg_7 = arg_3[arg_6]
            arg_0.active_scheme_name = arg_7
            arg_0.active_colors = arg_0[arg_7].colors
            # Now allow using '' as an index for the current active scheme
            arg_0[''] = arg_0[arg_7]


def Func ( ) : arg_0 = os . path . expanduser ( '~/.local/share' ) arg_1 = os . environ . get ( 'XDG_DATA_HOME' , None ) or arg_0 return os . path . join ( arg_1 , 'python_keyring' )

def Func():
    """
    Use freedesktop.org Base Dir Specfication to determine storage
    location.
    """
    arg_0 = os.path.expanduser('~/.local/share')
    arg_1 = os.environ.get('XDG_DATA_HOME', None) or arg_0
    return os.path.join(arg_1, 'python_keyring')

Use freedesktop . org Base Dir Specfication to determine storage location .


def Func(arg_0, arg_1, arg_2):
    """ Set the value of the given configuration property.

    :param prop: (string) name of the property
    :param value: (object) value to Func
    """

    if arg_0._properties is None:
      arg_0._readStdConfigFiles()

    arg_0._properties[arg_1] = str(arg_2)

Set the value of the given configuration property.

    :param prop: (string) name of the property
    :param value: (object) value to set

Set the value of the given configuration property .


(self, nbits, label=None, taint=frozenset())

def Func(arg_0, arg_1, arg_2=None, arg_3=arg_4()):
        """Create and return a symbolic value that is `nbits` bits wide. Assign
        the value to a register or write it into the address space to introduce
        it into the program state.

        :param int nbits: The bitwidth of the value returned
        :param str label: The label to assign to the value
        :param taint: Taint identifier of this value
        :type taint: tuple or frozenset
        :return: :class:`~manticore.core.smtlib.expression.Expression` representing the value
        """
        assert arg_1 in (1, 4, 8, 16, 32, 64, 128, 256)
        arg_5 = False
        if arg_2 is None:
            arg_2 = 'val'
            arg_5 = True

        arg_6 = arg_0._constraints.new_bitvec(arg_1, name=arg_2, arg_3=arg_3, arg_5=arg_5)
        arg_0._input_symbols.append(arg_6)
        return arg_6

Create and return a symbolic value that is nbits bits wide . Assign the value to a register or write it into the address space to introduce it into the program state .


copytree that works even if folder already exists

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = None ) : if not os . path . exists ( arg_1 ) : os . makedirs ( arg_1 ) shutil . copystat ( arg_0 , arg_1 ) arg_4 = os . listdir ( arg_0 ) if arg_3 : arg_5 = arg_3 ( arg_0 , arg_4 ) arg_4 = [ x for x in arg_4 if x not in arg_5 ] for arg_6 in arg_4 : arg_7 = os . path . join ( arg_0 , arg_6 ) arg_8 = os . path . join ( arg_1 , arg_6 ) if arg_2 and os . path . islink ( arg_7 ) : if os . path . lexists ( arg_8 ) : os . remove ( arg_8 ) os . symlink ( os . readlink ( arg_7 ) , arg_8 ) try : arg_9 = os . lstat ( arg_7 ) arg_10 = stat . S_IMODE ( arg_9 . st_mode ) os . lchmod ( arg_8 , arg_10 ) except : pass elif os . path . isdir ( arg_7 ) : Func ( arg_7 , arg_8 , arg_2 , arg_3 ) else : shutil . copy2 ( arg_7 , arg_8 )

def Func(arg_0, arg_1, arg_2=False, arg_3=None):
    """
    Func that works even if folder already exists
    """
    # http://stackoverflow.com/questions/1868714/how-do-i-copy-an-entire-directory-of-files-into-an-existing-directory-using-pyth
    if not os.path.exists(arg_1):
        os.makedirs(arg_1)
        shutil.copystat(arg_0, arg_1)
    arg_4 = os.listdir(arg_0)
    if arg_3:
        arg_5 = arg_3(arg_0, arg_4)
        arg_4 = [x for x in arg_4 if x not in arg_5]
    for arg_6 in arg_4:
        arg_7 = os.path.join(arg_0, arg_6)
        arg_8 = os.path.join(arg_1, arg_6)
        if arg_2 and os.path.islink(arg_7):
            if os.path.lexists(arg_8):
                os.remove(arg_8)
            os.symlink(os.readlink(arg_7), arg_8)
            try:
                arg_9 = os.lstat(arg_7)
                arg_10 = stat.S_IMODE(arg_9.st_mode)
                os.lchmod(arg_8, arg_10)
            except:
                pass  # lchmod not available
        elif os.path.isdir(arg_7):
            Func(arg_7, arg_8, arg_2, arg_3)
        else:
            shutil.copy2(arg_7, arg_8)


def Func ( arg_0 ) : arg_1 = True try : arg_0 . __iter . next ( ) except StopIteration : arg_0 . __iter = None arg_1 = False return arg_1

def Func(arg_0):
    """ Advances the iteration;

    Returns:      True if more iterations remain; False if this is the final
                  iteration.
    """
    arg_1 = True
    try:
      arg_0.__iter.next()
    except StopIteration:
      arg_0.__iter = None
      arg_1 = False

    return arg_1


(
        self, elevation, azimuth=315.0, altitude=45.0, z=1.0, scale=1.0
    )

return commons_hillshade.hillshade(
            elevation, self, azimuth, altitude, z, scale)

def Func(
        arg_0, arg_1, arg_2=315.0, arg_3=45.0, arg_4=1.0, arg_5=1.0
    ):
        """
        Calculate hillshading from elevation data.

        Parameters
        ----------
        elevation : array
            input elevation data
        azimuth : float
            horizontal angle of light source (315: North-West)
        altitude : float
            vertical angle of light source (90 would result in slope shading)
        z : float
            vertical exaggeration factor
        scale : float
            scale factor of pixel size units versus height units (insert 112000
            when having elevation values in meters in a geodetic projection)

        Returns
        -------
        Func : array
        """
        return commons_Func.Func(
            arg_1, arg_0, arg_2, arg_3, arg_4, arg_5)

Calculate hillshading from elevation data.

        Parameters
        ----------
        elevation : array
            input elevation data
        azimuth : float
            horizontal angle of light source (315: North-West)
        altitude : float
            vertical angle of light source (90 would result in slope shading)
        z : float
            vertical exaggeration factor
        scale : float
            scale factor of pixel size units versus height units (insert 112000
            when having elevation values in meters in a geodetic projection)

        Returns
        -------
        hillshade : array

Calculate hillshading from elevation data .


(self, imeth: typing.Optional[typing.Callable[..., typing.Any]])

def Func ( arg_0 , arg_1 : arg_2 . Optional [ arg_2 . Callable [ ... , arg_2 . Any ] ] ) -> "SeparateClassMethod" : arg_0 . __Func = arg_1 return arg_0

def Func(arg_0, arg_1: arg_2.Optional[arg_2.Callable[..., arg_2.Any]]) -> "SeparateClassMethod":
        """Descriptor to change instance method.

        :param imeth: New instance method.
        :type imeth: typing.Optional[typing.Callable]
        :return: SeparateClassMethod
        :rtype: SeparateClassMethod
        """
        arg_0.__Func = arg_1
        return arg_0


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . dispatch ( arg_1 ) : for arg_3 in arg_2 : yield arg_3 [ 1 ] return

def Func(arg_0, arg_1):
        """ Yield all 'value' targets, without priority """
        for arg_2 in arg_0.dispatch(arg_1):
            for arg_3 in arg_2:
                yield arg_3[1] # only value, no priority
        return

Yield all value targets without priority


def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
=
institute_and_case
(
store
,
arg_0
,
arg_1
)
arg_4
=
url_for
(
'.case'
,
arg_0
=
arg_0
,
arg_1
=
arg_1
)
arg_5
=
request
.
form
[
'action'
]
arg_6
=
request
.
form
.
getlist
(
'hpo_id'
)
arg_7
=
store
.
user
(
current_user
.
email
)
if
arg_5
==
'DELETE'
:
for
arg_8
in
arg_6
:
store
.
remove_phenotype
(
arg_2
,
arg_3
,
arg_7
,
arg_4
,
arg_8
)
elif
arg_5
==
'PHENOMIZER'
:
if
len
(
arg_6
)
==
0
:
arg_6
=
[
term
[
'phenotype_id'
]
for
term
in
arg_3
.
get
(
'phenotype_terms'
,
[
]
)
]
arg_9
=
current_app
.
config
[
'PHENOMIZER_USERNAME'
]
arg_10
=
current_app
.
config
[
'PHENOMIZER_PASSWORD'
]
arg_11
=
controllers
.
hpo_diseases
(
arg_9
,
arg_10
,
arg_6
)
return
render_template
(
'cases/diseases.html'
,
arg_11
=
arg_11
,
institute
=
arg_2
,
case
=
arg_3
)
elif
arg_5
==
'GENES'
:
arg_12
=
set
(
)
for
arg_13
in
request
.
form
.
getlist
(
'genes'
)
:
if
arg_13
:
arg_12
.
update
(
arg_14
.
split
(
' '
,
1
)
[
0
]
for
arg_14
in
arg_13
.
split
(
'|'
)
)
store
.
update_dynamic_gene_list
(
arg_3
,
arg_12
=
arg_12
)
elif
arg_5
==
'GENERATE'
:
if
len
(
arg_6
)
==
0
:
arg_6
=
[
term
[
'phenotype_id'
]
for
term
in
arg_3
.
get
(
'phenotype_terms'
,
[
]
)
]
arg_15
=
store
.
generate_hpo_gene_list
(
*
arg_6
)
arg_16
=
int
(
request
.
form
.
get
(
'min_match'
)
or
1
)
arg_17
=
[
result
[
0
]
for
result
in
arg_15
if
result
[
1
]
>=
arg_16
]
store
.
update_dynamic_gene_list
(
arg_3
,
arg_17
=
arg_17
,
phenotype_ids
=
arg_6
)
return
redirect
(
arg_4
)

def Func(arg_0, arg_1):
    """Perform actions on multiple phenotypes."""
    arg_2, arg_3 = institute_and_case(store, arg_0, arg_1)
    arg_4 = url_for('.case', arg_0=arg_0, arg_1=arg_1)
    arg_5 = request.form['action']
    arg_6 = request.form.getlist('hpo_id')
    arg_7 = store.user(current_user.email)

    if arg_5 == 'DELETE':
        for arg_8 in arg_6:
            # DELETE a phenotype from the list
            store.remove_phenotype(arg_2, arg_3, arg_7, arg_4, arg_8)
    elif arg_5 == 'PHENOMIZER':
        if len(arg_6) == 0:
            arg_6 = [term['phenotype_id'] for term in arg_3.get('phenotype_terms', [])]

        arg_9 = current_app.config['PHENOMIZER_USERNAME']
        arg_10 = current_app.config['PHENOMIZER_PASSWORD']
        arg_11 = controllers.hpo_diseases(arg_9, arg_10, arg_6)
        return render_template('cases/diseases.html', arg_11=arg_11,
                               institute=arg_2, case=arg_3)

    elif arg_5 == 'GENES':
        arg_12 = set()
        for arg_13 in request.form.getlist('genes'):
            # avoid empty lists
            if arg_13:
                arg_12.update(arg_14.split(' ', 1)[0] for arg_14 in
                                    arg_13.split('|'))
        store.update_dynamic_gene_list(arg_3, arg_12=arg_12)

    elif arg_5 == 'GENERATE':
        if len(arg_6) == 0:
            arg_6 = [term['phenotype_id'] for term in arg_3.get('phenotype_terms', [])]
        arg_15 = store.generate_hpo_gene_list(*arg_6)
        # determine how many HPO terms each gene must match
        arg_16 = int(request.form.get('min_match') or 1)
        arg_17 = [result[0] for result in arg_15 if result[1] >= arg_16]
        store.update_dynamic_gene_list(arg_3, arg_17=arg_17, phenotype_ids=arg_6)

    return redirect(arg_4)

Perform actions on multiple phenotypes .


def Func(arg_0, arg_1):
        """
        Returns the database ID for specified hostname.
        The id might be useful as array index. 0 is unknown.

        :arg hostname: Hostname to get ID from.
        """
        arg_2 = arg_0._gethostbyname(arg_1)
        return arg_0.id_by_addr(arg_2)

Returns the database ID for specified hostname . The id might be useful as array index . 0 is unknown .


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

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

    Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """
    print('Converting pooling ...')

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

    if 'kernel_shape' in arg_0:
        arg_8, arg_9 = arg_0['kernel_shape']
    else:
        arg_8, arg_9 = arg_0['kernel_size']

    if 'strides' in arg_0:
        arg_10, arg_11 = arg_0['strides']
    else:
        arg_10, arg_11 = arg_0['stride']

    if 'pads' in arg_0:
        arg_12, arg_13, arg_14, arg_14 = arg_0['pads']
    else:
        arg_12, arg_13 = arg_0['padding']

    arg_15 = arg_3[0]
    arg_16 = 'valid'

    if arg_8 % 2 == 1 and arg_9 % 2 == 1 and \
       arg_8 // 2 == arg_12 and arg_9 // 2 == arg_13 and \
       arg_10 == 1 and arg_11 == 1:
        arg_16 = 'same'
    else:
        arg_17 = arg_7 + '_pad'
        arg_18 = keras.layers.ZeroPadding2D(
            padding=(arg_12, arg_13),
            name=arg_17
        )
        arg_4[arg_17] = arg_18(arg_4[arg_3[0]])
        arg_15 = arg_17

    # Pooling type AveragePooling2D
    arg_19 = keras.layers.AveragePooling2D(
        pool_size=(arg_8, arg_9),
        strides=(arg_10, arg_11),
        padding=arg_16,
        name=arg_7,
        data_format='channels_first'
    )

    arg_4[arg_2] = arg_19(arg_4[arg_15])


(inputs=None, targets=None, batch_size=None, allow_dynamic_batch_size=False, shuffle=False)

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=False, arg_4=False):
    """Generate a generator that input a group of example in numpy.array and
    their labels, return the examples and labels by the given batch size.

    Parameters
    ----------
    inputs : numpy.array
        The input features, every row is a example.
    targets : numpy.array
        The labels of inputs, every row is a example.
    batch_size : int
        The batch size.
    allow_dynamic_batch_size: boolean
        Allow the use of the last data batch in case the number of examples is not a multiple of batch_size, this may result in unexpected behaviour if other functions expect a fixed-sized batch-size.
    shuffle : boolean
        Indicating whether to use a shuffling queue, shuffle the dataset before return.

    Examples
    --------
    >>> X = np.asarray([['a','a'], ['b','b'], ['c','c'], ['d','d'], ['e','e'], ['f','f']])
    >>> y = np.asarray([0,1,2,3,4,5])
    >>> for batch in tl.iterate.Func(inputs=X, targets=y, batch_size=2, shuffle=False):
    >>>     print(batch)
    (array([['a', 'a'], ['b', 'b']], dtype='<U1'), array([0, 1]))
    (array([['c', 'c'], ['d', 'd']], dtype='<U1'), array([2, 3]))
    (array([['e', 'e'], ['f', 'f']], dtype='<U1'), array([4, 5]))

    Notes
    -----
    If you have two inputs and one label and want to shuffle them together, e.g. X1 (1000, 100), X2 (1000, 80) and Y (1000, 1), you can stack them together (`np.hstack((X1, X2))`)
    into (1000, 180) and feed to ``inputs``. After getting a batch, you can split it back into X1 and X2.

    """
    if len(arg_0) != len(arg_1):
        raise AssertionError("The length of inputs and targets should be equal")

    if arg_4:
        arg_5 = np.arange(len(arg_0))
        np.random.shuffle(arg_5)

    # for start_idx in range(0, len(inputs) - batch_size + 1, batch_size):
    # chulei: handling the case where the number of samples is not a multiple of batch_size, avoiding wasting samples
    for arg_6 in range(0, len(arg_0), arg_2):
        arg_7 = arg_6 + arg_2
        if arg_7 > len(arg_0):
            if arg_3:
                arg_7 = len(arg_0)
            else:
                break
        if arg_4:
            arg_8 = arg_5[arg_6:arg_7]
        else:
            arg_8 = slice(arg_6, arg_7)
        if (isinstance(arg_0, list) or isinstance(arg_1, list)) and (arg_4 ==True):
            # zsdonghao: for list indexing when shuffle==True
            yield [arg_0[arg_9] for arg_9 in arg_8], [arg_1[arg_9] for arg_9 in arg_8]
        else:
            yield arg_0[arg_8], arg_1[arg_8]

Generate a generator that input a group of example in numpy.array and
    their labels, return the examples and labels by the given batch size.

    Parameters
    ----------
    inputs : numpy.array
        The input features, every row is a example.
    targets : numpy.array
        The labels of inputs, every row is a example.
    batch_size : int
        The batch size.
    allow_dynamic_batch_size: boolean
        Allow the use of the last data batch in case the number of examples is not a multiple of batch_size, this may result in unexpected behaviour if other functions expect a fixed-sized batch-size.
    shuffle : boolean
        Indicating whether to use a shuffling queue, shuffle the dataset before return.

    Examples
    --------
    >>> X = np.asarray([['a','a'], ['b','b'], ['c','c'], ['d','d'], ['e','e'], ['f','f']])
    >>> y = np.asarray([0,1,2,3,4,5])
    >>> for batch in tl.iterate.minibatches(inputs=X, targets=y, batch_size=2, shuffle=False):
    >>>     print(batch)
    (array([['a', 'a'], ['b', 'b']], dtype='<U1'), array([0, 1]))
    (array([['c', 'c'], ['d', 'd']], dtype='<U1'), array([2, 3]))
    (array([['e', 'e'], ['f', 'f']], dtype='<U1'), array([4, 5]))

    Notes
    -----
    If you have two inputs and one label and want to shuffle them together, e.g. X1 (1000, 100), X2 (1000, 80) and Y (1000, 1), you can stack them together (`np.hstack((X1, X2))`)
    into (1000, 180) and feed to ``inputs``. After getting a batch, you can split it back into X1 and X2.

Generate a generator that input a group of example in numpy . array and their labels return the examples and labels by the given batch size .


return self.run_cell_magic(magic_name, line, cell)

def Func(arg_0, arg_1, arg_2):
        """Special method to call a cell magic with the data stored in self.
        """
        arg_3 = arg_0._current_cell_magic_body
        arg_0._current_cell_magic_body = None
        return arg_0.run_cell_magic(arg_1, arg_2, arg_3)

Special method to call a cell magic with the data stored in self .


(self, a, b, nb_runs=6, nb_jobs=None, gpu=None,
                      idx=0, verbose=None, ttest_threshold=0.01,
                      nb_max_runs=16, train_epochs=1000, test_epochs=1000)

return (score_BA - score_AB) / (score_BA + score_AB)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
6
,
arg_4
=
,
arg_5
=
,
arg_6
=
0
,
arg_7
=
,
arg_8
=
0.01
,
arg_9
=
16
,
arg_10
=
1000
,
arg_11
=
1000
)
:
arg_12
,
arg_7
,
arg_5
=
SETTINGS
.
get_default
(
(
'nb_jobs'
,
arg_4
)
,
(
'verbose'
,
arg_7
)
,
(
'gpu'
,
arg_5
)
)
arg_13
=
np
.
stack
(
[
arg_1
.
ravel
(
)
,
arg_2
.
ravel
(
)
]
,
1
)
arg_14
=
TTestCriterion
(
max_iter
=
arg_9
,
runs_per_iter
=
arg_3
,
threshold
=
arg_8
)
arg_15
=
[
]
arg_16
=
[
]
while
arg_14
.
loop
(
arg_15
,
arg_16
)
:
if
arg_4
!=
1
:
arg_17
=
Parallel
(
n_jobs
=
arg_4
)
(
delayed
(
GNN_instance
)
(
arg_13
,
arg_6
=
arg_6
,
device
=
'cuda:{}'
.
format
(
run
%
arg_5
)
if
arg_5
else
'cpu'
,
arg_7
=
arg_7
,
arg_10
=
arg_10
,
arg_11
=
arg_11
)
for
run
in
range
(
arg_14
.
iter
,
arg_14
.
iter
+
arg_3
)
)
else
:
arg_17
=
[
GNN_instance
(
arg_13
,
arg_6
=
arg_6
,
device
=
'cuda:0'
if
arg_5
else
'cpu'
,
arg_7
=
arg_7
,
arg_10
=
arg_10
,
arg_11
=
arg_11
)
for
run
in
range
(
arg_14
.
iter
,
arg_14
.
iter
+
arg_3
)
]
arg_15
.
extend
(
[
arg_18
[
0
]
for
arg_18
in
arg_17
]
)
arg_16
.
extend
(
[
arg_18
[
1
]
for
arg_18
in
arg_17
]
)
if
arg_7
:
print
(
"P-value after {} runs : {}"
.
format
(
arg_14
.
iter
,
arg_14
.
p_value
)
)
arg_19
=
np
.
mean
(
arg_15
)
arg_20
=
np
.
mean
(
arg_16
)
return
(
arg_20
arg_19
)
/
(
arg_20
+
arg_19
)

def Func(arg_0, arg_1, arg_2, arg_3=6, arg_4=None, arg_5=None,
                      arg_6=0, arg_7=None, arg_8=0.01,
                      arg_9=16, arg_10=1000, arg_11=1000):
        """Run multiple times GNN to estimate the causal direction.

        Args:
            a (np.ndarray): Variable 1
            b (np.ndarray): Variable 2
            nb_runs (int): number of runs to execute per batch (before testing for significance with t-test).
            nb_jobs (int): number of runs to execute in parallel. (Initialized with ``cdt.SETTINGS.NB_JOBS``)
            gpu (bool): use gpu (Initialized with ``cdt.SETTINGS.GPU``)
            idx (int): (optional) index of the pair, for printing purposes
            verbose (bool): verbosity (Initialized with ``cdt.SETTINGS.verbose``)
            ttest_threshold (float): threshold to stop the boostraps before ``nb_max_runs`` if the difference is significant
            nb_max_runs (int): Max number of bootstraps
            train_epochs (int): Number of epochs during which the model is going to be trained
            test_epochs (int): Number of epochs during which the model is going to be tested

        Returns:
            float: Causal score of the pair (Value : 1 if a->b and -1 if b->a)
        """
        arg_12, arg_7, arg_5 = SETTINGS.get_default(('nb_jobs', arg_4), ('verbose', arg_7), ('gpu', arg_5))
        arg_13 = np.stack([arg_1.ravel(), arg_2.ravel()], 1)
        arg_14 = TTestCriterion(
            max_iter=arg_9, runs_per_iter=arg_3, threshold=arg_8)

        arg_15 = []
        arg_16 = []

        while arg_14.loop(arg_15, arg_16):
            if arg_4 != 1:
                arg_17 = Parallel(n_jobs=arg_4)(delayed(GNN_instance)(
                    arg_13, arg_6=arg_6, device='cuda:{}'.format(run % arg_5) if arg_5 else 'cpu',
                    arg_7=arg_7, arg_10=arg_10, arg_11=arg_11) for run in range(arg_14.iter, arg_14.iter + arg_3))
            else:
                arg_17 = [GNN_instance(arg_13, arg_6=arg_6,
                                            device='cuda:0' if arg_5 else 'cpu',
                                            arg_7=arg_7,
                                            arg_10=arg_10,
                                            arg_11=arg_11)
                               for run in range(arg_14.iter, arg_14.iter + arg_3)]
            arg_15.extend([arg_18[0] for arg_18 in arg_17])
            arg_16.extend([arg_18[1] for arg_18 in arg_17])

        if arg_7:
            print("P-value after {} runs : {}".format(arg_14.iter,
                                                      arg_14.p_value))

        arg_19 = np.mean(arg_15)
        arg_20 = np.mean(arg_16)

        return (arg_20 - arg_19) / (arg_20 + arg_19)

Run multiple times GNN to estimate the causal direction .


return self._perform_delete(
                path,
            as_async=True)

def Func(arg_0, arg_1, arg_2,arg_3=False):
        '''
        Deletes the specified deployment.

        service_name:
            Name of the hosted service.
        deployment_name:
            The name of the deployment.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        arg_4= arg_0._get_deployment_path_using_name(arg_1, arg_2)
        if arg_3:
            arg_4 += '?comp=media'
        return arg_0._perform_delete(
                arg_4,
            as_async=True)


def Func ( arg_0 ) : if not arg_0 . _fix [ "beta" ] : arg_0 . _update_beta ( ) if not arg_0 . _fix [ "scale" ] : arg_0 . _update_scale ( ) return arg_0 . lml ( )

def Func(arg_0):
        """
        Internal use only.
        """
        if not arg_0._fix["beta"]:
            arg_0._update_beta()

        if not arg_0._fix["scale"]:
            arg_0._update_scale()

        return arg_0.lml()


def Func ( * arg_0 ) : arg_1 = { } for arg_2 in arg_0 : for arg_3 , arg_4 in ( arg_2 or { } ) . items ( ) : if arg_3 not in PROJECT_SECTIONS : raise ValueError ( UNKNOWN_SECTION_ERROR % arg_3 ) if arg_4 is None : arg_1 [ arg_3 ] = type ( arg_1 [ arg_3 ] ) ( ) continue if arg_3 in NOT_MERGEABLE + SPECIAL_CASE : arg_1 [ arg_3 ] = arg_4 continue if arg_4 and not isinstance ( arg_4 , ( dict , str ) ) : arg_5 = arg_4 . __class__ . __name__ raise ValueError ( SECTION_ISNT_DICT_ERROR % ( arg_3 , arg_5 ) ) if arg_3 == 'animation' : arg_6 = load . load_if_filename ( arg_4 ) if arg_6 : arg_4 = arg_6 . get ( 'animation' , { } ) arg_4 [ 'run' ] = arg_6 . get ( 'run' , { } ) arg_7 = arg_1 . setdefault ( arg_3 , { } ) arg_4 = construct . to_type ( arg_4 ) for arg_8 , arg_9 in arg_4 . items ( ) : if arg_9 is None : arg_7 . pop ( arg_8 , None ) else : arg_7 [ arg_8 ] = arg_9 return arg_1

def Func(*arg_0):
    """
    Merge zero or more dictionaries representing projects with the default
    project dictionary and return the result
    """
    arg_1 = {}
    for arg_2 in arg_0:
        for arg_3, arg_4 in (arg_2 or {}).items():
            if arg_3 not in PROJECT_SECTIONS:
                raise ValueError(UNKNOWN_SECTION_ERROR % arg_3)

            if arg_4 is None:
                arg_1[arg_3] = type(arg_1[arg_3])()
                continue

            if arg_3 in NOT_MERGEABLE + SPECIAL_CASE:
                arg_1[arg_3] = arg_4
                continue

            if arg_4 and not isinstance(arg_4, (dict, str)):
                arg_5 = arg_4.__class__.__name__
                raise ValueError(SECTION_ISNT_DICT_ERROR % (arg_3, arg_5))

            if arg_3 == 'animation':
                # Useful hack to allow you to load projects as animations.
                arg_6 = load.load_if_filename(arg_4)
                if arg_6:
                    arg_4 = arg_6.get('animation', {})
                    arg_4['run'] = arg_6.get('run', {})

            arg_7 = arg_1.setdefault(arg_3, {})
            arg_4 = construct.to_type(arg_4)
            for arg_8, arg_9 in arg_4.items():
                if arg_9 is None:
                    arg_7.pop(arg_8, None)
                else:
                    arg_7[arg_8] = arg_9
    return arg_1


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

def Func(arg_0, arg_1, arg_2, arg_3):
    """mono-exponential curve."""
    return arg_1*np.exp(-arg_2*arg_0)+arg_3


def Func ( arg_0 , arg_1 = 'float' ) : if type == 'decimal' : return Decimal ( sum ( arg_0 ) ) / len ( arg_0 ) else : return float ( sum ( arg_0 ) ) / len ( arg_0 )

def Func(arg_0, arg_1='float'):
    """
    Calculates the Func or mean of a list of numbers

    Args:
        numbers: a list of integers or floating point numbers.

        numtype: string, 'decimal' or 'float'; the type of number to return.

    Returns:
        The Func (mean) of the numbers as a floating point number
        or a Decimal object.

    Requires:
        The math module
    """
    if type == 'decimal':
        return Decimal(sum(arg_0)) / len(arg_0)
    else:
        return float(sum(arg_0)) / len(arg_0)

Calculates the average or mean of a list of numbers

    Args:
        numbers: a list of integers or floating point numbers.

        numtype: string, 'decimal' or 'float'; the type of number to return.

    Returns:
        The average (mean) of the numbers as a floating point number
        or a Decimal object.

    Requires:
        The math module


def Func ( arg_0 , arg_1 = None ) : @ wraps ( arg_0 ) def _Func ( arg_2 , * arg_3 , ** arg_4 ) : if arg_2 is None : return arg_1 return arg_0 ( arg_2 , * arg_3 , ** arg_4 ) return _Func

def Func(arg_0, arg_1=None):
    """
    Create a nil-safe callable decorator.

    If the wrapped callable receives ``None`` as its argument, it will return
    ``None`` immediately.
    """
    @wraps(arg_0)
    def _Func(arg_2, *arg_3, **arg_4):
        if arg_2 is None:
            return arg_1
        return arg_0(arg_2, *arg_3, **arg_4)
    return _Func

Create a nil - safe callable decorator .


def Func(arg_0, arg_1, arg_2):
    """Run WsgiDAV using ext_wsgiutils_server from the wsgidav package."""
    from wsgidav.server import ext_wsgiutils_server

    _logger.info(
        "Running WsgiDAV {} on wsgidav.ext_wsgiutils_server...".format(__version__)
    )
    _logger.warning(
        "WARNING: This single threaded server (ext-wsgiutils) is not meant for production."
    )
    try:
        ext_wsgiutils_server.serve(arg_1, arg_0)
    except KeyboardInterrupt:
        _logger.warning("Caught Ctrl-C, shutting down...")
    return

Run WsgiDAV using ext_wsgiutils_server from the wsgidav package .


return self.new_pattern(id_, name, rows)

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _rows ( arg_1 . get ( ROWS , [ ] ) ) arg_0 . _finish_inheritance ( ) arg_0 . _finish_instructions ( ) arg_0 . _connect_rows ( arg_1 . get ( CONNECTIONS , [ ] ) ) arg_3 = arg_0 . _to_id ( arg_1 [ ID ] ) arg_4 = arg_1 [ NAME ] return arg_0 . newFunc ( arg_3 , arg_4 , arg_2 )

def Func(arg_0, arg_1):
        """Parse a pattern."""
        arg_2 = arg_0._rows(arg_1.get(ROWS, []))
        arg_0._finish_inheritance()
        arg_0._finish_instructions()
        arg_0._connect_rows(arg_1.get(CONNECTIONS, []))
        arg_3 = arg_0._to_id(arg_1[ID])
        arg_4 = arg_1[NAME]
        return arg_0.newFunc(arg_3, arg_4, arg_2)


return [
        field for field in model._meta.get_fields()
        if isinstance(field.remote_field, ParentalKey)
    ]

def Func ( arg_0 ) : return [ arg_1 for arg_1 in arg_0 . _meta . get_fields ( ) if isinstance ( arg_1 . remote_field , ParentalKey ) ]

def Func(arg_0):
    """
    Return a list of RelatedObject records for child relations of the given model,
    including ones attached to ancestors of the model
    """
    return [
        arg_1 for arg_1 in arg_0._meta.get_fields()
        if isinstance(arg_1.remote_field, ParentalKey)
    ]

Return a list of RelatedObject records for child relations of the given model including ones attached to ancestors of the model


Mostly used for unit testing. Allow to use a static uuid and reset
        all counter

def Func ( arg_0 , arg_1 = None ) : for arg_2 in arg_0 . instances : if arg_1 : arg_2 . uid = arg_1 arg_2 . generator = arg_2 . get_generator ( )

def Func(arg_0, arg_1=None):
        """Mostly used for unit testing. Allow to use a static uuid and Func
        all counter"""
        for arg_2 in arg_0.instances:
            if arg_1:
                arg_2.uid = arg_1
            arg_2.generator = arg_2.get_generator()

Mostly used for unit testing . Allow to use a static uuid and reset all counter


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = Zupload ( arg_0 , arg_1 , arg_2 ) arg_4 = arg_3 . upload ( ) return arg_4

def Func(arg_0, arg_1, arg_2=None):
        """
        Create attachments
        accepts a list of one or more attachment template dicts
        and an optional parent Item ID. If this is specified,
        attachments are created under this ID
        """
        arg_3 = Zupload(arg_0, arg_1, arg_2)
        arg_4 = arg_3.upload()
        return arg_4

Create attachments accepts a list of one or more attachment template dicts and an optional parent Item ID . If this is specified attachments are created under this ID