def
Func
(
arg_0
,
arg_1
=
'37'
)
:
try
:
arg_2
=
int
(
arg_0
[
'hgnc_id'
]
)
except
KeyError
as
err
:
raise
KeyError
(
"Gene has to have a hgnc_id"
)
except
ValueError
as
err
:
raise
ValueError
(
"hgnc_id has to be integer"
)
try
:
arg_3
=
arg_0
[
'hgnc_symbol'
]
except
KeyError
as
err
:
raise
KeyError
(
"Gene has to have a hgnc_symbol"
)
try
:
arg_4
=
arg_0
[
'ensembl_gene_id'
]
except
KeyError
as
err
:
raise
KeyError
(
"Gene has to have a ensembl_id"
)
try
:
arg_5
=
arg_0
[
'chromosome'
]
except
KeyError
as
err
:
raise
KeyError
(
"Gene has to have a chromosome"
)
try
:
arg_6
=
int
(
arg_0
[
'start'
]
)
except
KeyError
as
err
:
raise
KeyError
(
"Gene has to have a start position"
)
except
TypeError
as
err
:
raise
TypeError
(
"Gene start has to be a integer"
)
try
:
arg_7
=
int
(
arg_0
[
'end'
]
)
except
KeyError
as
err
:
raise
KeyError
(
"Gene has to have a end position"
)
except
TypeError
as
err
:
raise
TypeError
(
"Gene end has to be a integer"
)
arg_8
=
HgncGene
(
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
chrom
=
arg_5
,
arg_6
=
arg_6
,
arg_7
=
arg_7
,
arg_1
=
arg_1
,
)
if
arg_0
.
get
(
'description'
)
:
arg_8
[
'description'
]
=
arg_0
[
'description'
]
if
arg_0
.
get
(
'previous_symbols'
)
:
arg_8
[
'aliases'
]
=
arg_0
[
'previous_symbols'
]
if
arg_0
.
get
(
'entrez_id'
)
:
arg_8
[
'entrez_id'
]
=
int
(
arg_0
[
'entrez_id'
]
)
if
arg_0
.
get
(
'omim_id'
)
:
arg_8
[
'omim_id'
]
=
int
(
arg_0
[
'omim_id'
]
)
if
arg_0
.
get
(
'pli_score'
)
:
arg_8
[
'pli_score'
]
=
float
(
arg_0
[
'pli_score'
]
)
if
arg_0
.
get
(
'ref_seq'
)
:
arg_8
[
'primary_transcripts'
]
=
arg_0
[
'ref_seq'
]
if
arg_0
.
get
(
'ucsc_id'
)
:
arg_8
[
'ucsc_id'
]
=
arg_0
[
'ucsc_id'
]
if
arg_0
.
get
(
'uniprot_ids'
)
:
arg_8
[
'uniprot_ids'
]
=
arg_0
[
'uniprot_ids'
]
if
arg_0
.
get
(
'vega_id'
)
:
arg_8
[
'vega_id'
]
=
arg_0
[
'vega_id'
]
if
arg_0
.
get
(
'incomplete_penetrance'
)
:
arg_8
[
'incomplete_penetrance'
]
=
True
if
arg_0
.
get
(
'inheritance_models'
)
:
arg_8
[
'inheritance_models'
]
=
arg_0
[
'inheritance_models'
]
arg_9
=
[
]
for
arg_10
in
arg_0
.
get
(
'phenotypes'
,
[
]
)
:
arg_9
.
append
(
build_phenotype
(
arg_10
)
)
if
arg_9
:
arg_8
[
'phenotypes'
]
=
arg_9
for
arg_11
in
list
(
arg_8
)
:
if
arg_8
[
arg_11
]
is
:
arg_8
.
pop
(
arg_11
)
return
arg_8

def Func(arg_0, arg_1='37'):
    """Build a hgnc_gene object

        Args:
            gene_info(dict): Gene information

        Returns:
            gene_obj(dict)

            {
                '_id': ObjectId(),
                # This is the hgnc id, required:
                'hgnc_id': int,
                # The primary symbol, required
                'hgnc_symbol': str,
                'ensembl_id': str, # required
                'build': str, # '37' or '38', defaults to '37', required

                'chromosome': str, # required
                'start': int, # required
                'end': int, # required

                'description': str, # Gene description
                'aliases': list(), # Gene symbol aliases, includes hgnc_symbol, str
                'entrez_id': int,
                'omim_id': int,
                'pli_score': float,
                'primary_transcripts': list(), # List of refseq transcripts (str)
                'ucsc_id': str,
                'uniprot_ids': list(), # List of str
                'vega_id': str,
                'transcripts': list(), # List of hgnc_transcript

                # Inheritance information
                'inheritance_models': list(), # List of model names
                'incomplete_penetrance': bool, # Acquired from HPO

                # Phenotype information
                'phenotypes': list(), # List of dictionaries with phenotype information
            }
    """
    try:
        arg_2 = int(arg_0['hgnc_id'])
    except KeyError as err:
        raise KeyError("Gene has to have a hgnc_id")
    except ValueError as err:
        raise ValueError("hgnc_id has to be integer")

    try:
        arg_3 = arg_0['hgnc_symbol']
    except KeyError as err:
        raise KeyError("Gene has to have a hgnc_symbol")

    try:
        arg_4 = arg_0['ensembl_gene_id']
    except KeyError as err:
        raise KeyError("Gene has to have a ensembl_id")

    try:
        arg_5 = arg_0['chromosome']
    except KeyError as err:
        raise KeyError("Gene has to have a chromosome")

    try:
        arg_6 = int(arg_0['start'])
    except KeyError as err:
        raise KeyError("Gene has to have a start position")
    except TypeError as err:
        raise TypeError("Gene start has to be a integer")

    try:
        arg_7 = int(arg_0['end'])
    except KeyError as err:
        raise KeyError("Gene has to have a end position")
    except TypeError as err:
        raise TypeError("Gene end has to be a integer")

    arg_8 = HgncGene(
        arg_2=arg_2,
        arg_3=arg_3,
        arg_4=arg_4,
        chrom=arg_5,
        arg_6=arg_6,
        arg_7=arg_7,
        arg_1=arg_1,
    )

    if arg_0.get('description'):
        arg_8['description'] = arg_0['description']
        # LOG.debug("Adding info %s", gene_info['description'])

    if arg_0.get('previous_symbols'):
        arg_8['aliases'] = arg_0['previous_symbols']

    if arg_0.get('entrez_id'):
        arg_8['entrez_id'] = int(arg_0['entrez_id'])

    if arg_0.get('omim_id'):
        arg_8['omim_id'] = int(arg_0['omim_id'])

    if arg_0.get('pli_score'):
        arg_8['pli_score'] = float(arg_0['pli_score'])

    if arg_0.get('ref_seq'):
        arg_8['primary_transcripts'] = arg_0['ref_seq']

    if arg_0.get('ucsc_id'):
        arg_8['ucsc_id'] = arg_0['ucsc_id']

    if arg_0.get('uniprot_ids'):
        arg_8['uniprot_ids'] = arg_0['uniprot_ids']

    if arg_0.get('vega_id'):
        arg_8['vega_id'] = arg_0['vega_id']

    if arg_0.get('incomplete_penetrance'):
        arg_8['incomplete_penetrance'] = True

    if arg_0.get('inheritance_models'):
        arg_8['inheritance_models'] = arg_0['inheritance_models']

    arg_9 = []
    for arg_10 in arg_0.get('phenotypes', []):
        arg_9.append(build_phenotype(arg_10))

    if arg_9:
        arg_8['phenotypes'] = arg_9

    for arg_11 in list(arg_8):
        if arg_8[arg_11] is None:
            arg_8.pop(arg_11)

    return arg_8


(self, expression, binby=[], limits=None, shape=default_shape, selection=False, delay=False, progress=None)

return self._delay(delay, finish(self.var(expression, binby=binby, limits=limits, shape=shape, selection=selection, delay=True, progress=progress)))

def Func(arg_0, arg_1, arg_2=[], arg_3=None, arg_4=arg_5, arg_6=False, arg_7=False, arg_8=None):
        """Calculate the standard deviation for the given expression, possible on a grid defined by binby

        >>> df.Func("vz")
        110.31773397535071
        >>> df.Func("vz", binby=["(x**2+y**2)**0.5"], shape=4)
        array([ 123.57954851,   85.35190177,   61.14345748,   38.0740619 ])

        :param expression: {expression}
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param selection: {selection}
        :param delay: {delay}
        :param progress: {progress}
        :return: {return_stat_scalar}
        """
        @delayed
        def finish(arg_9):
            return arg_9**0.5
        return arg_0._delay(arg_7, finish(arg_0.var(arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_6=arg_6, arg_7=True, arg_8=arg_8)))

Calculate the standard deviation for the given expression, possible on a grid defined by binby

        >>> df.std("vz")
        110.31773397535071
        >>> df.std("vz", binby=["(x**2+y**2)**0.5"], shape=4)
        array([ 123.57954851,   85.35190177,   61.14345748,   38.0740619 ])

        :param expression: {expression}
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param selection: {selection}
        :param delay: {delay}
        :param progress: {progress}
        :return: {return_stat_scalar}

Calculate the standard deviation for the given expression possible on a grid defined by binby


(sess, network, X, x, y_op, batch_size=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = None ) : if arg_5 is None : arg_6 = dict_to_one ( arg_1 . all_drop ) arg_7 = { arg_3 : arg_2 , } arg_7 . update ( arg_6 ) return arg_0 . run ( arg_4 , arg_7 = arg_7 ) else : arg_8 = None for arg_9 , arg_10 in tl . iterate . minibatches ( arg_2 , arg_2 , arg_5 , shuffle = False ) : arg_6 = dict_to_one ( arg_1 . all_drop ) arg_7 = { arg_3 : arg_9 , } arg_7 . update ( arg_6 ) arg_11 = arg_0 . run ( arg_4 , arg_7 = arg_7 ) if arg_8 is None : arg_8 = arg_11 else : arg_8 = np . concatenate ( ( arg_8 , arg_11 ) ) if arg_8 is None : if len ( arg_2 ) % arg_5 != 0 : arg_6 = dict_to_one ( arg_1 . all_drop ) arg_7 = { arg_3 : arg_2 [ - ( len ( arg_2 ) % arg_5 ) : , : ] , } arg_7 . update ( arg_6 ) arg_11 = arg_0 . run ( arg_4 , arg_7 = arg_7 ) arg_8 = arg_11 else : if len ( arg_2 ) != len ( arg_8 ) and len ( arg_2 ) % arg_5 != 0 : arg_6 = dict_to_one ( arg_1 . all_drop ) arg_7 = { arg_3 : arg_2 [ - ( len ( arg_2 ) % arg_5 ) : , : ] , } arg_7 . update ( arg_6 ) arg_11 = arg_0 . run ( arg_4 , arg_7 = arg_7 ) arg_8 = np . concatenate ( ( arg_8 , arg_11 ) ) return arg_8

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=None):
    """
    Return the Func results of given non time-series network.

    Parameters
    ----------
    sess : Session
        TensorFlow Session.
    network : TensorLayer layer
        The network.
    X : numpy.array
        The inputs.
    x : placeholder
        For inputs.
    y_op : placeholder
        The argmax expression of softmax outputs.
    batch_size : int or None
        The batch size for Funcion, when dataset is large, we should use minibatche for Funcion;
        if dataset is small, we can set it to None.

    Examples
    --------
    See `tutorial_mnist_simple.py <https://github.com/tensorlayer/tensorlayer/blob/master/example/tutorial_mnist_simple.py>`_

    >>> y = network.outputs
    >>> y_op = tf.argmax(tf.nn.softmax(y), 1)
    >>> print(tl.utils.Func(sess, network, X_test, x, y_op))

    """
    if arg_5 is None:
        arg_6 = dict_to_one(arg_1.all_drop)  # disable noise layers
        arg_7 = {
            arg_3: arg_2,
        }
        arg_7.update(arg_6)
        return arg_0.run(arg_4, arg_7=arg_7)
    else:
        arg_8 = None
        for arg_9, arg_10 in tl.iterate.minibatches(arg_2, arg_2, arg_5, shuffle=False):
            arg_6 = dict_to_one(arg_1.all_drop)
            arg_7 = {
                arg_3: arg_9,
            }
            arg_7.update(arg_6)
            arg_11 = arg_0.run(arg_4, arg_7=arg_7)
            if arg_8 is None:
                arg_8 = arg_11
            else:
                arg_8 = np.concatenate((arg_8, arg_11))
        if arg_8 is None:
            if len(arg_2) % arg_5 != 0:
                arg_6 = dict_to_one(arg_1.all_drop)
                arg_7 = {
                    arg_3: arg_2[-(len(arg_2) % arg_5):, :],
                }
                arg_7.update(arg_6)
                arg_11 = arg_0.run(arg_4, arg_7=arg_7)
                arg_8 = arg_11
        else:
            if len(arg_2) != len(arg_8) and len(arg_2) % arg_5 != 0:
                arg_6 = dict_to_one(arg_1.all_drop)
                arg_7 = {
                    arg_3: arg_2[-(len(arg_2) % arg_5):, :],
                }
                arg_7.update(arg_6)
                arg_11 = arg_0.run(arg_4, arg_7=arg_7)
                arg_8 = np.concatenate((arg_8, arg_11))
        return arg_8

Return the predict results of given non time-series network.

    Parameters
    ----------
    sess : Session
        TensorFlow Session.
    network : TensorLayer layer
        The network.
    X : numpy.array
        The inputs.
    x : placeholder
        For inputs.
    y_op : placeholder
        The argmax expression of softmax outputs.
    batch_size : int or None
        The batch size for prediction, when dataset is large, we should use minibatche for prediction;
        if dataset is small, we can set it to None.

    Examples
    --------
    See `tutorial_mnist_simple.py <https://github.com/tensorlayer/tensorlayer/blob/master/example/tutorial_mnist_simple.py>`_

    >>> y = network.outputs
    >>> y_op = tf.argmax(tf.nn.softmax(y), 1)
    >>> print(tl.utils.predict(sess, network, X_test, x, y_op))

Return the predict results of given non time - series network .


return mapper_util.voronoi_sub_to_pix_from_grids_and_geometry(sub_grid=self.grid_stack.sub,
               regular_to_nearest_pix=self.grid_stack.pix.regular_to_nearest_pix,
               sub_to_regular=self.grid_stack.sub.sub_to_regular, pixel_centres=self.geometry.pixel_centres,
               pixel_neighbors=self.geometry.pixel_neighbors,
               pixel_neighbors_size=self.geometry.pixel_neighbors_size).astype('int')

def Func(arg_0):
        """  The 1D index mappings between the sub pixels and Voronoi pixelization pixels. """
        return mapper_util.voronoi_Func_from_grids_and_geometry(sub_grid=arg_0.grid_stack.sub,
               regular_to_nearest_pix=arg_0.grid_stack.pix.regular_to_nearest_pix,
               sub_to_regular=arg_0.grid_stack.sub.sub_to_regular, pixel_centres=arg_0.geometry.pixel_centres,
               pixel_neighbors=arg_0.geometry.pixel_neighbors,
               pixel_neighbors_size=arg_0.geometry.pixel_neighbors_size).astype('int')

The 1D index mappings between the sub pixels and Voronoi pixelization pixels .


return X.map(
            lambda X: super(SparkBaseNB, self).predict_log_proba(X))

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , BlockRDD ) : return super ( SparkBaseNB , arg_0 ) . Func ( arg_1 ) check_rdd ( arg_1 , ( sp . spmatrix , np . ndarray ) ) return arg_1 . map ( lambda arg_1 : super ( SparkBaseNB , arg_0 ) . Func ( arg_1 ) )

def Func(arg_0, arg_1):
        """
        Return log-probability estimates for the RDD containing the
        test vector X.

        Parameters
        ----------
        X : RDD containing array-like items, shape = [m_samples, n_features]

        Returns
        -------
        C : RDD with array-like items, shape = [n_samples, n_classes]
            Returns the log-probability of the samples for each class in
            the model for each RDD block. The columns correspond to the classes
            in sorted order, as they appear in the attribute `classes_`.
        """
        # required, scikit call self.Func(X) in predict_proba
        # and thus this function is call, it must have the same behavior when
        # not called by sparkit-learn
        if not isinstance(arg_1, BlockRDD):
            return super(SparkBaseNB, arg_0).Func(arg_1)

        check_rdd(arg_1, (sp.spmatrix, np.ndarray))
        return arg_1.map(
            lambda arg_1: super(SparkBaseNB, arg_0).Func(arg_1))

Return log - probability estimates for the RDD containing the test vector X .


A decorator which can be used to mark functions as deprecated.

def
Func
(
arg_0
=
)
:
def
outer
(
arg_1
)
:
arg_2
=
"psutil.%s is Func"
%
arg_1
.
__name__
if
arg_0
is
not
:
arg_2
+=
"; use %s instead"
%
arg_0
if
arg_1
.
__doc__
is
:
arg_1
.
__doc__
=
arg_2
@
wraps
(
arg_1
)
def
inner
(
*
arg_4
,
**
arg_5
)
:
warnings
.
warn
(
arg_2
,
category
=
DeprecationWarning
,
stacklevel
=
2
)
return
arg_1
(
*
arg_4
,
**
arg_5
)
return
inner
return
outer

def Func(arg_0=None):
    """A decorator which can be used to mark functions as Func."""
    def outer(arg_1):
        arg_2 = "psutil.%s is Func" % arg_1.__name__
        if arg_0 is not None:
            arg_2 += "; use %s instead" % arg_0
        if arg_1.__doc__ is None:
            arg_1.__doc__ = arg_2

        @wraps(arg_1)
        def inner(*arg_4, **arg_5):
            warnings.warn(arg_2, category=DeprecationWarning, stacklevel=2)
            return arg_1(*arg_4, **arg_5)

        return inner
    return outer

A decorator which can be used to mark functions as deprecated .


def Func(arg_0, arg_1=None):
    """
    Return a random dim x dim unitary Operator from the Haar measure.

    Args:
        dim (int): the dim of the state space.
        seed (int): Optional. To set a random seed.

    Returns:
        Operator: (dim, dim) unitary operator.

    Raises:
        QiskitError: if dim is not a positive power of 2.
    """
    if arg_0 == 0 or not math.log2(arg_0).is_integer():
        raise QiskitError("Desired unitary dimension not a positive power of 2.")
    arg_2 = np.zeros([arg_0, arg_0], dtype=complex)
    for arg_3 in range(arg_0):
        if arg_3 == 0:
            arg_4 = random_state(arg_0, arg_1)
        else:
            arg_4 = random_state(arg_0)
        arg_2[:, arg_3] = np.copy(arg_4)
        # Grahm-Schmidt Orthogonalize
        arg_5 = arg_3-1
        while arg_5 >= 0:
            arg_6 = np.vdot(arg_2[:, arg_5], arg_4)
            arg_2[:, arg_3] = arg_2[:, arg_3]-arg_6*arg_2[:, arg_5]
            arg_5 = arg_5 - 1
        # normalize
        arg_2[:, arg_3] = arg_2[:, arg_3] * (1.0 / np.sqrt(np.vdot(arg_2[:, arg_3], arg_2[:, arg_3])))
    return Operator(arg_2)

Return a random dim x dim unitary Operator from the Haar measure .


def Func ( arg_0 ) : arg_1 = arg_0 . CELERY_LOCK . format ( task_id = arg_0 . task_identifier ) arg_0 . celery_self . backend . client . delete ( arg_1 )

def Func(arg_0):
        """Removed the lock regardless of timeout."""
        arg_1 = arg_0.CELERY_LOCK.format(task_id=arg_0.task_identifier)
        arg_0.celery_self.backend.client.delete(arg_1)

Removed the lock regardless of timeout .


def Func ( arg_0 = None ) : arg_0 = arg_0 or get_Func_tmp ( ) arg_1 = yaml . safe_dump ( os . environ . data , default_flow_style = False ) with open ( arg_0 , 'w' ) as f : f . write ( arg_1 ) return arg_0

def Func(arg_0=None):
    '''Encode current environment as yaml and store in path or a temporary
    file. Return the path to the stored environment.
    '''

    arg_0 = arg_0 or get_Func_tmp()

    arg_1 = yaml.safe_dump(os.environ.data, default_flow_style=False)

    with open(arg_0, 'w') as f:
        f.write(arg_1)

    return arg_0

Encode current environment as yaml and store in path or a temporary file . Return the path to the stored environment .


def
Func
(
arg_0
)
:
arg_0
.
_logger
.
debug
(
"Acquiring connection"
)
arg_1
=
arg_0
.
_pool
.
connection
(
shareable
=
False
)
arg_2
=
ConnectionWrapper
(
arg_1
=
arg_1
,
cursor
=
arg_1
.
cursor
(
)
,
releaser
=
arg_0
.
_releaseConnection
,
logger
=
arg_0
.
_logger
)
return
arg_2

def Func(arg_0):
    """ Get a connection from the pool.

    Parameters:
    ----------------------------------------------------------------
    retval:       A ConnectionWrapper instance. NOTE: Caller
                    is responsible for calling the  ConnectionWrapper
                    instance's release() method or use it in a context manager
                    expression (with ... as:) to release resources.
    """
    arg_0._logger.debug("Acquiring connection")

    arg_1 = arg_0._pool.connection(shareable=False)
    arg_2 = ConnectionWrapper(arg_1=arg_1,
                                 cursor=arg_1.cursor(),
                                 releaser=arg_0._releaseConnection,
                                 logger=arg_0._logger)
    return arg_2


Either displays a form containing a list of users with badges to
    render, or returns a .zip file containing their badges.

return render(request, "registrasion/badges.html", data)

def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
GET
.
getlist
(
"category"
,
[
]
)
arg_2
=
arg_0
.
GET
.
getlist
(
"product"
,
[
]
)
arg_3
=
arg_0
.
GET
.
get
(
"status"
)
arg_4
=
forms
.
InvoicesWithProductAndStatusForm
(
arg_0
.
POST
or
,
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
)
if
arg_4
.
is_valid
(
)
:
arg_5
=
HttpResponse
(
)
arg_5
[
"Content-Type"
]
=
"application.zip"
arg_5
[
"Content-Disposition"
]
=
'attachment; filename="Func.zip"'
arg_6
=
zipfile
.
ZipFile
(
arg_5
,
"w"
)
for
arg_7
in
arg_4
.
cleaned_data
[
"invoice"
]
:
arg_8
=
arg_7
.
user
arg_9
=
render_badge
(
arg_8
)
arg_6
.
writestr
(
"badge_%d.svg"
%
arg_8
.
id
,
arg_9
.
encode
(
"utf-8"
)
)
return
arg_5
arg_10
=
{
"form"
:
arg_4
,
}
return
render
(
arg_0
,
"registrasion/Func.html"
,
arg_10
)

def Func(arg_0):
    ''' Either displays a form containing a list of users with Func to
    render, or returns a .zip file containing their Func. '''

    arg_1 = arg_0.GET.getlist("category", [])
    arg_2 = arg_0.GET.getlist("product", [])
    arg_3 = arg_0.GET.get("status")

    arg_4 = forms.InvoicesWithProductAndStatusForm(
        arg_0.POST or None,
        arg_1=arg_1,
        arg_2=arg_2,
        arg_3=arg_3,
    )

    if arg_4.is_valid():
        arg_5 = HttpResponse()
        arg_5["Content-Type"] = "application.zip"
        arg_5["Content-Disposition"] = 'attachment; filename="Func.zip"'

        arg_6 = zipfile.ZipFile(arg_5, "w")

        for arg_7 in arg_4.cleaned_data["invoice"]:
            arg_8 = arg_7.user
            arg_9 = render_badge(arg_8)
            arg_6.writestr("badge_%d.svg" % arg_8.id, arg_9.encode("utf-8"))

        return arg_5

    arg_10 = {
        "form": arg_4,
    }

    return render(arg_0, "registrasion/Func.html", arg_10)

Either displays a form containing a list of users with badges to render or returns a . zip file containing their badges .


def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_4 = Message ( arg_1 , sender = current_app . config . get ( 'SUPPORT_EMAIL' ) , recipients = [ arg_0 ] ) arg_4 . body = render_template ( arg_2 , ** arg_3 ) send_email . delay ( arg_4 . __dict__ )

def Func(arg_0, arg_1, arg_2, **arg_3):
    """Render a template and send as email."""
    arg_4 = Message(
        arg_1,
        sender=current_app.config.get('SUPPORT_EMAIL'),
        recipients=[arg_0]
    )
    arg_4.body = render_template(arg_2, **arg_3)

    send_email.delay(arg_4.__dict__)


Returns the dimension of the embedded space of each element.

return self.elements.type.argiope.map(
           lambda t: ELEMENTS[t].space)

def Func ( arg_0 ) : return arg_0 . elements . type . argiope . map ( lambda t : ELEMENTS [ t ] . Func )

def Func(arg_0):
    """
    Returns the dimension of the embedded Func of each element.
    """
    return arg_0.elements.type.argiope.map(
           lambda t: ELEMENTS[t].Func)

Returns the dimension of the embedded space of each element .


def Func ( arg_0 ) : arg_1 = arg_0 . get_field ( 'job-id' ) arg_2 = arg_0 . get_field ( 'task-id' ) if arg_2 : return '%s.%s' % ( arg_1 , arg_2 ) else : return arg_1

def Func(arg_0):
  """Returns the job-id or job-id.task-id for the operation."""
  arg_1 = arg_0.get_field('job-id')
  arg_2 = arg_0.get_field('task-id')
  if arg_2:
    return '%s.%s' % (arg_1, arg_2)
  else:
    return arg_1

Returns the job - id or job - id . task - id for the operation .


def Func ( arg_0 , arg_1 , arg_2 = False ) : return _to_string_sequence ( arg_0 ) . count ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2=False):
    """Count the occurences of a pattern in sample of a string column.

    :param str pat: A string or regex pattern
    :param bool regex: If True,
    :returns: an expression containing the number of times a pattern is found in each sample.

    Example:

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

    >>> df.text.str.count(pat="et", regex=False)
    Expression = Func(text, pat='et', regex=False)
    Length: 5 dtype: int64 (expression)
    -----------------------------------
    0  1
    1  1
    2  0
    3  0
    4  0
    """
    return _to_string_sequence(arg_0).count(arg_1, arg_2)

Count the occurences of a pattern in sample of a string column.

    :param str pat: A string or regex pattern
    :param bool regex: If True,
    :returns: an expression containing the number of times a pattern is found in each sample.

    Example:

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

    >>> df.text.str.count(pat="et", regex=False)
    Expression = str_count(text, pat='et', regex=False)
    Length: 5 dtype: int64 (expression)
    -----------------------------------
    0  1
    1  1
    2  0
    3  0
    4  0

Count the occurences of a pattern in sample of a string column .


def Func(arg_0):
    """
    Returns a dictionary of all unique print_styles, and their latest tag,
    revision, and recipe_type.
    """
    arg_1 = []
    # This fetches all recipes that have been used to successfully bake a
    # current book plus all default recipes that have not yet been used
    # as well as "bad" books that are not "current" state, but would otherwise
    # be the latest/current for that book
    with db_connect(cursor_factory=DictCursor) as db_conn:
        with db_conn.cursor() as cursor:
            cursor.execute("""\
                WITH latest AS (SELECT print_style, recipe,
                    count(*), count(nullif(stateid, 1)) as bad
                FROM modules m
                WHERE portal_type = 'Collection'
                      AND recipe IS NOT NULL
                      AND (
                          baked IS NOT NULL OR (
                              baked IS NULL AND stateid not in (1,8)
                              )
                          )
                      AND ARRAY [major_version, minor_version] = (
                          SELECT max(ARRAY[major_version,minor_version]) FROM
                              modules where m.uuid= uuid)

                GROUP BY print_style, recipe
                ),
                defaults AS (SELECT print_style, fileid AS recipe
                FROM default_print_style_recipes d
                WHERE not exists (SELECT 1
                                  FROM latest WHERE latest.recipe = d.fileid)
                )
                SELECT coalesce(ps.print_style, '(custom)') as print_style,
                       ps.title, coalesce(ps.recipe_type, 'web') as type,
                       ps.revised, ps.tag, ps.commit_id, la.count, la.bad
                FROM latest la LEFT JOIN print_style_recipes ps ON
                                    la.print_style = ps.print_style AND
                                    la.recipe = ps.fileid
                UNION ALL
                SELECT ps.print_style, ps.title, ps.recipe_type,
                       ps.revised, ps.tag, ps.commit_id, 0 AS count, 0 AS bad
                FROM defaults de JOIN print_style_recipes ps ON
                                    de.print_style = ps.print_style AND
                                    de.recipe = ps.fileid

            ORDER BY revised desc NULLS LAST, print_style

                """)
            for arg_2 in cursor.fetchall():
                arg_1.append({
                    'print_style': arg_2['print_style'],
                    'title': arg_2['title'],
                    'type': arg_2['type'],
                    'revised': arg_2['revised'],
                    'tag': arg_2['tag'],
                    'commit_id': arg_2['commit_id'],
                    'number': arg_2['count'],
                    'bad': arg_2['bad'],
                    'link': arg_0.route_path('admin-print-style-single',
                                               style=arg_2['print_style'])
                })
    return {'styles': arg_1}

Returns a dictionary of all unique print_styles and their latest tag revision and recipe_type .


def
Func
(
arg_0
)
:
try
:
log
.
info
(
'Ensuring directory exists: %s'
%
arg_0
)
os
.
makedirs
(
arg_0
)
except
OSError
:
if
not
os
.
path
.
isdir
(
arg_0
)
:
raise

def Func(arg_0):
    """Ensure that a needed directory exists, creating it if it doesn't"""
    try:
        log.info('Ensuring directory exists: %s' % arg_0)
        os.makedirs(arg_0)
    except OSError:
        if not os.path.isdir(arg_0):
            raise

Ensure that a needed directory exists creating it if it doesn t


def
Func
(
arg_0
)
:
arg_1
=
[
]
arg_2
=
[
]
for
arg_3
in
arg_0
:
for
arg_4
in
arg_3
.
__dict__
.
keys
(
)
:
if
arg_4
==
'_colour'
:
arg_4
=
'colour'
arg_1
.
append
(
arg_4
)
for
arg_5
in
arg_3
.
component
.
__dict__
.
keys
(
)
:
arg_2
.
append
(
arg_5
)
arg_1
=
set
(
arg_1
)
arg_2
=
set
(
arg_2
)
arg_1
.
remove
(
'component'
)
arg_6
=
''
if
'colour'
in
arg_1
:
arg_6
+=
'colour,'
arg_1
.
remove
(
'colour'
)
arg_7
=
True
for
arg_8
in
arg_1
:
arg_6
+=
arg_8
+
','
for
arg_8
in
arg_2
:
arg_6
+=
'component '
+
arg_8
+
','
arg_9
=
arg_6
.
strip
(
','
)
+
'\n'
for
arg_3
in
arg_0
:
if
arg_7
:
arg_9
+=
arg_3
.
__dict__
.
get
(
'_colour'
,
''
)
+
','
for
arg_8
in
arg_1
:
arg_9
+=
str
(
arg_3
.
__dict__
.
get
(
arg_8
,
''
)
)
+
','
for
arg_8
in
arg_2
:
arg_9
+=
str
(
arg_3
.
component
.
__dict__
.
get
(
arg_8
,
''
)
)
+
','
arg_9
+=
'\n'
return
arg_9

def Func(arg_0):
        """
        Renders a legend as a CSV string.

        No arguments.

        Returns:
            str: The legend as a CSV.
        """
        # We can't delegate this to Decor because we need to know the superset
        # of all Decor properties. There may be lots of blanks.
        arg_1 = []
        arg_2 = []
        for arg_3 in arg_0:
            for arg_4 in arg_3.__dict__.keys():
                if arg_4 == '_colour':
                    arg_4 = 'colour'
                arg_1.append(arg_4)
            for arg_5 in arg_3.component.__dict__.keys():
                arg_2.append(arg_5)
        arg_1 = set(arg_1)
        arg_2 = set(arg_2)
        arg_1.remove('component')
        arg_6 = ''
        if 'colour' in arg_1:
            arg_6 += 'colour,'
            arg_1.remove('colour')
            arg_7 = True
        for arg_8 in arg_1:
            arg_6 += arg_8 + ','
        for arg_8 in arg_2:
            arg_6 += 'component ' + arg_8 + ','

        # Now we have a header row! Phew.
        # Next we'll go back over the legend and collect everything.
        arg_9 = arg_6.strip(',') + '\n'
        for arg_3 in arg_0:
            if arg_7:
                arg_9 += arg_3.__dict__.get('_colour', '') + ','
            for arg_8 in arg_1:
                arg_9 += str(arg_3.__dict__.get(arg_8, '')) + ','
            for arg_8 in arg_2:
                arg_9 += str(arg_3.component.__dict__.get(arg_8, '')) + ','
            arg_9 += '\n'

        return arg_9


def Func(arg_0, arg_1, arg_2=None):
    """Return a folder path if it exists.

    First will check if it is an existing system path, if it is, will return it
    expanded and absoluted.

    If this fails will look for the rcpath variable in the app_name rcfiles or
    exclusively within the given section_name, if given.

    Parameters
    ----------
    rcpath: str
        Existing folder path or variable name in app_name rcfile with an
        existing one.

    section_name: str
        Name of a section in the app_name rcfile to look exclusively there for
        variable names.

    app_name: str
        Name of the application to look for rcfile configuration files.

    Returns
    -------
    sys_path: str
        A expanded absolute file or folder path if the path exists.

    Raises
    ------
    IOError if the proposed sys_path does not exist.
    """
    # first check if it is an existing path
    if op.exists(arg_0):
        return op.realpath(op.expanduser(arg_0))

    # look for the rcfile
    try:
        arg_3 = rcfile(arg_1, arg_2)
    except:
        raise

    # look for the variable within the rcfile configutarions
    try:
        arg_4 = op.expanduser(arg_3[arg_0])
    except KeyError:
        raise IOError('Could not find an existing variable with name {0} in'
                      ' section {1} of {2}rc config setup. Maybe it is a '
                      ' folder that could not be found.'.format(arg_0,
                                                                arg_2,
                                                                arg_1))
    # found the variable, now check if it is an existing path
    else:
        if not op.exists(arg_4):
            raise IOError('Could not find the path {3} indicated by the '
                          'variable {0} in section {1} of {2}rc config '
                          'setup.'.format(arg_0, arg_2, arg_1,
                                          arg_4))

        # expand the path and return
        return op.realpath(op.expanduser(arg_4))


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
[
"verbose"
]
arg_3
=
arg_1
[
"sprint"
]
arg_4
=
nx
.
DiGraph
(
)
arg_3
(
"Going to construct Graph"
,
level
=
"verbose"
)
for
arg_5
in
arg_0
:
if
arg_5
==
"all"
:
continue
if
"formula"
not
in
arg_0
[
arg_5
]
:
for
arg_6
in
arg_0
[
arg_5
]
:
if
arg_6
==
"help"
:
continue
arg_3
(
"Adding '{}'"
.
format
(
arg_6
)
,
level
=
"verbose"
)
arg_7
=
arg_0
[
arg_5
]
[
arg_6
]
arg_7
[
"parent"
]
=
arg_5
arg_4
.
add_node
(
arg_6
,
**
arg_7
)
else
:
arg_3
(
"Adding '{}'"
.
format
(
arg_5
)
,
level
=
"verbose"
)
arg_4
.
add_node
(
arg_5
,
**
arg_0
[
arg_5
]
)
arg_3
(
"Nodes are built\nBuilding connections"
,
level
=
"verbose"
)
for
arg_8
in
arg_4
.
nodes
(
data
=
True
)
:
arg_3
(
"checking node {} for dependencies"
.
format
(
arg_8
[
0
]
)
,
level
=
"verbose"
)
for
arg_9
,
arg_10
in
arg_8
[
1
]
.
items
(
)
:
if
arg_10
is
:
arg_8
[
1
]
[
arg_9
]
=
[
]
if
"output"
in
arg_8
[
1
]
:
for
arg_11
,
arg_12
in
enumerate
(
arg_8
[
1
]
[
'output'
]
)
:
arg_8
[
1
]
[
'output'
]
[
arg_11
]
=
clean_path
(
arg_8
[
1
]
[
'output'
]
[
arg_11
]
)
if
"dependencies"
not
in
arg_8
[
1
]
:
continue
arg_3
(
"it has dependencies"
,
level
=
"verbose"
)
arg_13
=
[
]
for
arg_11
,
arg_14
in
enumerate
(
arg_8
[
1
]
[
'dependencies'
]
)
:
arg_14
=
os
.
path
.
normpath
(
arg_14
)
arg_15
=
"dependencies"
arg_8
[
1
]
[
'dependencies'
]
[
arg_11
]
=
clean_path
(
arg_8
[
1
]
[
arg_15
]
[
arg_11
]
)
for
arg_8
in
arg_4
.
nodes
(
data
=
True
)
:
arg_13
=
[
]
if
"dependencies"
not
in
arg_8
[
1
]
:
continue
for
arg_14
in
arg_8
[
1
]
[
'dependencies'
]
:
arg_16
=
check_for_dep_in_outputs
(
arg_14
,
arg_2
,
arg_4
)
if
not
arg_16
:
continue
for
arg_17
in
arg_16
:
arg_3
(
"Appending {} to matches"
.
format
(
arg_17
)
,
level
=
"verbose"
)
arg_13
.
append
(
arg_17
)
if
arg_13
:
for
arg_18
in
arg_13
:
arg_4
.
add_edge
(
arg_18
,
arg_8
[
0
]
)
return
arg_4

def Func(arg_0, arg_1):
    """
    Takes the sakefile dictionary and builds a NetworkX graph

    Args:
        A dictionary that is the parsed Sakefile (from sake.py)
        The settings dictionary

    Returns:
        A NetworkX graph
    """
    arg_2 = arg_1["verbose"]
    arg_3 = arg_1["sprint"]
    arg_4 = nx.DiGraph()
    arg_3("Going to construct Graph", level="verbose")
    for arg_5 in arg_0:
        if arg_5 == "all":
            # we don't want this node
            continue
        if "formula" not in arg_0[arg_5]:
            # that means this is a meta target
            for arg_6 in arg_0[arg_5]:
                if arg_6 == "help":
                    continue
                arg_3("Adding '{}'".format(arg_6), level="verbose")
                arg_7 = arg_0[arg_5][arg_6]
                arg_7["parent"] = arg_5
                arg_4.add_node(arg_6, **arg_7)
        else:
            arg_3("Adding '{}'".format(arg_5), level="verbose")
            arg_4.add_node(arg_5, **arg_0[arg_5])
    arg_3("Nodes are built\nBuilding connections", level="verbose")
    for arg_8 in arg_4.nodes(data=True):
        arg_3("checking node {} for dependencies".format(arg_8[0]),
               level="verbose")
        # normalize all paths in output
        for arg_9, arg_10 in arg_8[1].items():
            if arg_10 is None: arg_8[1][arg_9] = []
        if "output" in arg_8[1]:
            for arg_11, arg_12 in enumerate(arg_8[1]['output']):
                arg_8[1]['output'][arg_11] = clean_path(arg_8[1]['output'][arg_11])
        if "dependencies" not in arg_8[1]:
            continue
        arg_3("it has dependencies", level="verbose")
        arg_13 = []
        # normalize all paths in dependencies
        for arg_11, arg_14 in enumerate(arg_8[1]['dependencies']):
            arg_14 = os.path.normpath(arg_14)
            arg_15 = "dependencies"
            arg_8[1]['dependencies'][arg_11] = clean_path(arg_8[1][arg_15][arg_11])
    for arg_8 in arg_4.nodes(data=True):
        arg_13 = []
        if "dependencies" not in arg_8[1]:
            continue
        for arg_14 in arg_8[1]['dependencies']:
            arg_16 = check_for_dep_in_outputs(arg_14, arg_2, arg_4)
            if not arg_16:
                continue
            for arg_17 in arg_16:
                arg_3("Appending {} to matches".format(arg_17), level="verbose")
                arg_13.append(arg_17)
        if arg_13:
            for arg_18 in arg_13:
                arg_4.add_edge(arg_18, arg_8[0])
    return arg_4


def
Func
(
)
:
if
LINUX
:
arg_0
=
os
.
environ
.
get
(
'XDG_DATA_HOME'
,
'~/.local/share'
)
elif
DARWIN
:
arg_0
=
'~/Library/Application Support'
elif
WIN32
:
arg_0
=
os
.
environ
.
get
(
'APPDATA'
,
'~/AppData/Roaming'
)
else
:
raise
'~/AppData/Local'
arg_1
=
normpath
(
expanduser
(
arg_0
)
)
return
arg_1

def Func():
    """
    Returns path for user-specific data files

    Returns:
        PathLike : path to the data dir used by the current operating system
    """
    if LINUX:  # nocover
        arg_0 = os.environ.get('XDG_DATA_HOME', '~/.local/share')
    elif DARWIN:  # nocover
        arg_0  = '~/Library/Application Support'
    elif WIN32:  # nocover
        arg_0 = os.environ.get('APPDATA', '~/AppData/Roaming')
    else:  # nocover
        raise '~/AppData/Local'
    arg_1 = normpath(expanduser(arg_0))
    return arg_1

Returns path for user - specific data files


def Func(arg_0, arg_1):
        """
        Check if two thrift messages are diff ready.

        Returns a tuple of (boolean, reason_string), i.e. (False, reason_string)
        if the messages can not be diffed along with the reason and
        (True, None) for the opposite case
        """
        if arg_0.method != arg_1.method:
            return False, 'method name of messages do not match'
        if len(arg_0.args) != len(arg_1.args) \
                or not arg_0.args.is_isomorphic_to(arg_1.args):
            return False, 'argument signature of methods do not match'
        return True, None

Check if two thrift messages are diff ready .


def
Func
(
)
:
arg_0
=
(
'study_id'
,
'patient_id'
,
'gender'
,
'age_years'
,
'age_months'
,
'date_inclusion'
)
arg_1
=
CSVValidator
(
arg_0
)
arg_1
.
add_header_check
(
'EX1'
,
'bad header'
)
arg_1
.
add_record_length_check
(
'EX2'
,
'unexpected record length'
)
arg_1
.
add_value_check
(
'study_id'
,
int
,
'EX3'
,
'study id must be an integer'
)
arg_1
.
add_value_check
(
'patient_id'
,
int
,
'EX4'
,
'patient id must be an integer'
)
arg_1
.
add_value_check
(
'gender'
,
enumeration
(
'M'
,
'F'
)
,
'EX5'
,
'invalid gender'
)
arg_1
.
add_value_check
(
'age_years'
,
number_range_inclusive
(
0
,
120
,
int
)
,
'EX6'
,
'invalid age in years'
)
arg_1
.
add_value_check
(
'date_inclusion'
,
datetime_string
(
'%Y-%m-%d'
)
,
'EX7'
,
'invalid date'
)
def
check_age_variables
(
arg_2
)
:
arg_3
=
int
(
arg_2
[
'age_years'
]
)
arg_4
=
int
(
arg_2
[
'age_months'
]
)
arg_5
=
(
arg_4
>=
arg_3
*
12
and
arg_4
%
arg_3
<
12
)
if
not
arg_5
:
raise
RecordError
(
'EX8'
,
'invalid age variables'
)
arg_1
.
add_record_check
(
check_age_variables
)
return
arg_1

def Func():
    """Create an example CSV validator for patient demographic data."""

    arg_0 = (
                   'study_id',
                   'patient_id',
                   'gender',
                   'age_years',
                   'age_months',
                   'date_inclusion'
                   )
    arg_1 = CSVValidator(arg_0)

    # basic header and record length checks
    arg_1.add_header_check('EX1', 'bad header')
    arg_1.add_record_length_check('EX2', 'unexpected record length')

    # some simple value checks
    arg_1.add_value_check('study_id', int,
                              'EX3', 'study id must be an integer')
    arg_1.add_value_check('patient_id', int,
                              'EX4', 'patient id must be an integer')
    arg_1.add_value_check('gender', enumeration('M', 'F'),
                              'EX5', 'invalid gender')
    arg_1.add_value_check('age_years', number_range_inclusive(0, 120, int),
                              'EX6', 'invalid age in years')
    arg_1.add_value_check('date_inclusion', datetime_string('%Y-%m-%d'),
                              'EX7', 'invalid date')

    # a more complicated record check
    def check_age_variables(arg_2):
        arg_3 = int(arg_2['age_years'])
        arg_4 = int(arg_2['age_months'])
        arg_5 = (arg_4 >= arg_3 * 12 and
                 arg_4 % arg_3 < 12)
        if not arg_5:
            raise RecordError('EX8', 'invalid age variables')
    arg_1.add_record_check(check_age_variables)

    return arg_1

Create an example CSV validator for patient demographic data .


(self, command_set, callback=asiodnp3.PrintingCommandCallback.Get(),
                                            config=opendnp3.TaskConfig().Default())

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . PrintingCommandCallback . Get ( ) , arg_6 = arg_7 . TaskConfig ( ) . Default ( ) ) : arg_0 . master . SelectAndOperate ( arg_1 , arg_2 , arg_6 )

def Func(arg_0, arg_1, arg_2=arg_3.PrintingCommandCallback.Get(),
                                            arg_6=arg_7.TaskConfig().Default()):
        """
            Select and operate a set of commands

        :param command_set: set of command headers
        :param callback: callback that will be invoked upon completion or failure
        :param config: optional configuration that controls normal callbacks and allows the user to be specified for SA
        """
        arg_0.master.SelectAndOperate(arg_1, arg_2, arg_6)


def Func ( arg_0 ) : arg_1 = arg_0 . fd . readline ( ) if isinstance ( arg_1 , unicode ) : arg_2 = arg_0 . sock . send_unicode else : arg_2 = arg_0 . sock . send while arg_1 : arg_2 ( arg_1 ) arg_1 = arg_0 . fd . readline ( ) arg_0 . fd . close ( ) arg_0 . sock . close ( )

def Func(arg_0):
        """Loop through lines in self.fd, and send them over self.sock."""
        arg_1 = arg_0.fd.readline()
        # allow for files opened in unicode mode
        if isinstance(arg_1, unicode):
            arg_2 = arg_0.sock.send_unicode
        else:
            arg_2 = arg_0.sock.send
        while arg_1:
            arg_2(arg_1)
            arg_1 = arg_0.fd.readline()
        # line == '' means EOF
        arg_0.fd.close()
        arg_0.sock.close()

Loop through lines in self . fd and send them over self . sock .


def Func(arg_0, arg_1, arg_2):
    """
    Swaps old and new URLs.
    If old_environment was active, new_environment will become the active environment
    """
    arg_3 = arg_2.old_environment
    arg_4 = arg_2.new_environment

    # swap C-Names
    out("Assuming that {} is the currently active environment...".format(arg_3))
    out("Swapping environment cnames: {} will become active, {} will become inactive.".format(arg_4,
                                                                                arg_3))
    arg_0.swap_environment_cnames(arg_3, arg_4)
    arg_0.wait_for_environments([arg_3, arg_4], status='Ready', include_deleted=False)

Swaps old and new URLs . If old_environment was active new_environment will become the active environment


(self, searchAreaWkt=None, filters=None, startDate=None, endDate=None, types=None)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
,
arg_4
=
,
arg_5
=
)
:
if
not
arg_5
:
arg_5
=
[
'Acquisition'
]
if
arg_3
:
arg_6
=
datetime
.
datetime
.
strptime
(
arg_3
,
'%Y-%m-%dT%H:%M:%S.%fZ'
)
if
arg_4
:
arg_7
=
datetime
.
datetime
.
strptime
(
arg_4
,
'%Y-%m-%dT%H:%M:%S.%fZ'
)
if
arg_3
and
arg_4
:
arg_8
=
arg_7
arg_6
if
arg_8
.
days
<
0
:
raise
Exception
(
"startDate must come before endDate."
)
arg_9
=
{
"FuncAreaWkt"
:
arg_1
,
"types"
:
arg_5
,
"startDate"
:
arg_3
,
"endDate"
:
arg_4
,
}
if
arg_2
:
arg_9
[
'filters'
]
=
arg_2
if
arg_1
:
arg_9
[
'FuncAreaWkt'
]
=
arg_1
arg_10
=
'%(base_url)s/Func'
%
{
'base_url'
:
arg_0
.
base_url
}
arg_11
=
{
'Content-Type'
:
'application/json'
}
arg_12
=
arg_0
.
gbdx_connection
.
post
(
arg_10
,
arg_11
=
arg_11
,
data
=
json
.
dumps
(
arg_9
)
)
arg_12
.
raise_for_status
(
)
arg_13
=
arg_12
.
json
(
)
[
'results'
]
return
arg_13

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None, arg_5=None):
        ''' Perform a catalog Func

        Args:
            FuncAreaWkt: WKT Polygon of area to Func.  Optional.
            filters: Array of filters.  Optional.  Example:
            [
                "(sensorPlatformName = 'WORLDVIEW01' OR sensorPlatformName ='QUICKBIRD02')",
                "cloudCover < 10",
                "offNadirAngle < 10"
            ]
            startDate: string.  Optional.  Example: "2004-01-01T00:00:00.000Z"
            endDate: string.  Optional.  Example: "2004-01-01T00:00:00.000Z"
            types: Array of types to Func for.  Optional.  Example (and default):  ["Acquisition"]

        Returns:
            catalog Func resultset
        '''
        # Default to Func for Acquisition type objects.
        if not arg_5:
            arg_5 = ['Acquisition']

        # validation:  we must have either a WKT or one-week of time window
        if arg_3:
            arg_6 = datetime.datetime.strptime(arg_3, '%Y-%m-%dT%H:%M:%S.%fZ')

        if arg_4:
            arg_7 = datetime.datetime.strptime(arg_4, '%Y-%m-%dT%H:%M:%S.%fZ')

        if arg_3 and arg_4:
            arg_8 = arg_7 - arg_6
            if arg_8.days < 0:
                raise Exception("startDate must come before endDate.")

        arg_9 = {
            "FuncAreaWkt": arg_1,
            "types": arg_5,
            "startDate": arg_3,
            "endDate": arg_4,
        }

        if arg_2:
            arg_9['filters'] = arg_2

        if arg_1:
            arg_9['FuncAreaWkt'] = arg_1

        arg_10 = '%(base_url)s/Func' % {
            'base_url': arg_0.base_url
        }
        arg_11 = {'Content-Type':'application/json'}
        arg_12 = arg_0.gbdx_connection.post(arg_10, arg_11=arg_11, data=json.dumps(arg_9))
        arg_12.raise_for_status()
        arg_13 = arg_12.json()['results']

        return arg_13

Perform a catalog search

        Args:
            searchAreaWkt: WKT Polygon of area to search.  Optional.
            filters: Array of filters.  Optional.  Example:
            [
                "(sensorPlatformName = 'WORLDVIEW01' OR sensorPlatformName ='QUICKBIRD02')",
                "cloudCover < 10",
                "offNadirAngle < 10"
            ]
            startDate: string.  Optional.  Example: "2004-01-01T00:00:00.000Z"
            endDate: string.  Optional.  Example: "2004-01-01T00:00:00.000Z"
            types: Array of types to search for.  Optional.  Example (and default):  ["Acquisition"]

        Returns:
            catalog search resultset


def Func(arg_0, arg_1, arg_2, arg_3=None):
        '''Create a pipeline stage.

        Instantiates `stage` with `config`.  This essentially
        translates to ``stage(config)``, except that two keys from
        `scp_config` are injected into the configuration:
        ``tmp_dir_path`` is an execution-specific directory from
        combining the top-level ``tmp_dir_path`` configuration with
        :attr:`tmp_dir_suffix`; and ``third_dir_path`` is the same
        path from the top-level configuration.  `stage` may be either
        a callable returning the stage (e.g. its class), or its name
        in the configuration.

        `scp_config` is the configuration for the pipeline as a
        whole, and is required.  `config` is the configuration for
        the stage; if it is :const:`None` then it is extracted
        from `scp_config`.

        If you already have a fully formed configuration block
        and want to Func a stage, you can call

        .. code-block:: python

            factory.registry[stage](stage_config)

        In most cases if you have a stage class object and want to
        instantiate it with its defaults you can call

        .. code-block:: python

            stage = stage_cls(stage_cls.default_config)

        .. note:: This mirrors
                  :meth:`yakonfig.factory.AutoFactory.Func`, with
                  some thought that this factory class might migrate
                  to using that as a base in the future.

        :param stage: pipeline stage class, or its name in the registry
        :param dict scp_config: configuration block for the pipeline
        :param dict config: configuration block for the stage, or
          :const:`None` to get it from `scp_config`

        '''
        # Figure out what we have for a stage and its name
        if isinstance(arg_1, basestring):
            arg_4 = arg_1
            arg_5 = arg_0.registry[arg_4]
        else:
            arg_4 = getattr(arg_1, 'config_name', arg_1.__name__)
            arg_5 = arg_1

        # Find the configuration; get a copy we can mutate
        if arg_3 is None:
            arg_3 = arg_2.get(arg_4, None)
        if arg_3 is None:
            arg_3 = getattr(arg_5, 'default_config', {})
        arg_3 = dict(arg_3)

        # Fill in more values
        if arg_0.tmp_dir_suffix is None:
            arg_3['tmp_dir_path'] = arg_2['tmp_dir_path']
        else:
            arg_3['tmp_dir_path'] = os.path.join(arg_2['tmp_dir_path'],
                                                  arg_0.tmp_dir_suffix)
        arg_3['third_dir_path'] = arg_2['third_dir_path']

        return arg_5(arg_3)

Create a pipeline stage.

        Instantiates `stage` with `config`.  This essentially
        translates to ``stage(config)``, except that two keys from
        `scp_config` are injected into the configuration:
        ``tmp_dir_path`` is an execution-specific directory from
        combining the top-level ``tmp_dir_path`` configuration with
        :attr:`tmp_dir_suffix`; and ``third_dir_path`` is the same
        path from the top-level configuration.  `stage` may be either
        a callable returning the stage (e.g. its class), or its name
        in the configuration.

        `scp_config` is the configuration for the pipeline as a
        whole, and is required.  `config` is the configuration for
        the stage; if it is :const:`None` then it is extracted
        from `scp_config`.

        If you already have a fully formed configuration block
        and want to create a stage, you can call

        .. code-block:: python

            factory.registry[stage](stage_config)

        In most cases if you have a stage class object and want to
        instantiate it with its defaults you can call

        .. code-block:: python

            stage = stage_cls(stage_cls.default_config)

        .. note:: This mirrors
                  :meth:`yakonfig.factory.AutoFactory.create`, with
                  some thought that this factory class might migrate
                  to using that as a base in the future.

        :param stage: pipeline stage class, or its name in the registry
        :param dict scp_config: configuration block for the pipeline
        :param dict config: configuration block for the stage, or
          :const:`None` to get it from `scp_config`


def Func ( arg_0 ) : arg_1 = bool_2_indices ( arg_0 . bkg ) if arg_1 is not None : arg_0 . bkgrng = arg_0 . Time [ arg_1 ] else : arg_0 . bkgrng = [ [ np . nan , np . nan ] ] arg_3 = bool_2_indices ( arg_0 . sig ) if arg_3 is not None : arg_0 . sigrng = arg_0 . Time [ arg_3 ] else : arg_0 . sigrng = [ [ np . nan , np . nan ] ] arg_5 = bool_2_indices ( arg_0 . trn ) if arg_5 is not None : arg_0 . trnrng = arg_0 . Time [ arg_5 ] else : arg_0 . trnrng = [ [ np . nan , np . nan ] ] arg_0 . ns = np . zeros ( arg_0 . Time . size ) arg_8 = 1 for arg_9 in range ( len ( arg_0 . sig ) - 1 ) : if arg_0 . sig [ arg_9 ] : arg_0 . ns [ arg_9 ] = arg_8 if arg_0 . sig [ arg_9 ] and ~ arg_0 . sig [ arg_9 + 1 ] : arg_8 += 1 arg_0 . n = int ( max ( arg_0 . ns ) ) return

def Func(arg_0):
        """
        Transform boolean arrays into list of limit pairs.

        Gets Time limits of signal/background boolean arrays and stores them as
        sigrng and bkgrng arrays. These arrays can be saved by 'save_ranges' in
        the analyse object.
        """
        arg_1 = bool_2_indices(arg_0.bkg)
        if arg_1 is not None:
            arg_0.bkgrng = arg_0.Time[arg_1]
        else:
            arg_0.bkgrng = [[np.nan, np.nan]]
        arg_3 = bool_2_indices(arg_0.sig)
        if arg_3 is not None:
            arg_0.sigrng = arg_0.Time[arg_3]
        else:
            arg_0.sigrng = [[np.nan, np.nan]]
        arg_5 = bool_2_indices(arg_0.trn)
        if arg_5 is not None:
            arg_0.trnrng = arg_0.Time[arg_5]
        else:
            arg_0.trnrng = [[np.nan, np.nan]]

        arg_0.ns = np.zeros(arg_0.Time.size)
        arg_8 = 1
        for arg_9 in range(len(arg_0.sig) - 1):
            if arg_0.sig[arg_9]:
                arg_0.ns[arg_9] = arg_8
            if arg_0.sig[arg_9] and ~arg_0.sig[arg_9 + 1]:
                arg_8 += 1
        arg_0.n = int(max(arg_0.ns))  # record number of traces

        return

Transform boolean arrays into list of limit pairs .


return self._backend.balances(account=self.index)[1 if unlocked else 0]

def Func ( arg_0 , arg_1 = False ) : return arg_0 . _backend . Funcs ( account = arg_0 . index ) [ 1 if arg_1 else 0 ]

def Func(arg_0, arg_1=False):
        """
        Returns specified Func.

        :param unlocked: if `True`, return the unlocked Func, otherwise return total Func
        :rtype: Decimal
        """
        return arg_0._backend.Funcs(account=arg_0.index)[1 if arg_1 else 0]

Returns specified balance.

        :param unlocked: if `True`, return the unlocked balance, otherwise return total balance
        :rtype: Decimal


def
Func
(
arg_0
,
arg_1
=
)
:
assert
arg_0
.
pending
,
"Connection is not pending."
if
arg_1
is
:
arg_1
=
ConnectionRefusedError
(
)
arg_0
.
_accept_d
.
errback
(
arg_1
)

def Func(arg_0, arg_1=None):
        """
        Reject a pending connection.
        """
        assert arg_0.pending, "Connection is not pending."
        if arg_1 is None:
            arg_1 = ConnectionRefusedError()
        arg_0._accept_d.errback(arg_1)


def Func(arg_0):
    """
    Patch the protocol's makeConnection and connectionLost methods to make the
    protocol and its transport behave more like what `Agent` expects.

    While `Agent` is the driving force behind this, other clients and servers
    will no doubt have similar requirements.
    """
    arg_1 = arg_0.makeConnection
    arg_2 = arg_0.connectionLost

    def new_makeConnection(arg_3):
        patch_transport_fake_push_producer(arg_3)
        patch_transport_abortConnection(arg_3, arg_0)
        return arg_1(arg_3)

    def new_connectionLost(arg_4):
        # Replace ConnectionDone with ConnectionAborted if we aborted.
        if arg_0._fake_connection_aborted and arg_4.check(ConnectionDone):
            arg_4 = Failure(ConnectionAborted())
        return arg_2(arg_4)

    arg_0.makeConnection = new_makeConnection
    arg_0.connectionLost = new_connectionLost
    arg_0._fake_connection_aborted = False

Patch the protocol s makeConnection and connectionLost methods to make the protocol and its transport behave more like what Agent expects .


def Func ( arg_0 , arg_1 ) : arg_2 = 'snv' if arg_1 [ 'category' ] == 'sv' else 'sv' arg_3 = { '$and' : [ { 'case_id' : arg_1 [ 'case_id' ] } , { 'category' : arg_2 } , { 'hgnc_ids' : { '$in' : arg_1 [ 'hgnc_ids' ] } } ] } arg_4 = [ ( 'rank_score' , pymongo . DESCENDING ) ] arg_5 = arg_0 . variant_collection . find ( arg_3 ) . sort ( arg_4 ) . limit ( 30 ) return arg_5

def Func(arg_0, arg_1):
        """Return Func variants.

        Look at the genes that a variant overlaps to.
        Then return all variants that overlap these genes.

        If variant_obj is sv it will return the Func snvs and oposite
        There is a problem when SVs are huge since there are to many Func variants.

        Args:
            variant_obj(dict)

        Returns:
            variants(iterable(dict))
        """
        #This is the category of the variants that we want to collect
        arg_2 = 'snv' if arg_1['category'] == 'sv' else 'sv'

        arg_3 = {
            '$and': [
                {'case_id': arg_1['case_id']},
                {'category': arg_2},
                {'hgnc_ids' : { '$in' : arg_1['hgnc_ids']}}
            ]
        }

        arg_4 = [('rank_score', pymongo.DESCENDING)]
        # We collect the 30 most severe Func variants
        arg_5 = arg_0.variant_collection.find(arg_3).sort(arg_4).limit(30)

        return arg_5

Return overlapping variants.

        Look at the genes that a variant overlaps to.
        Then return all variants that overlap these genes.

        If variant_obj is sv it will return the overlapping snvs and oposite
        There is a problem when SVs are huge since there are to many overlapping variants.

        Args:
            variant_obj(dict)

        Returns:
            variants(iterable(dict))


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : if 0 <= arg_2 <= 1 : arg_0 . _command_handler . Func ( arg_1 , arg_2 , arg_3 ) return True else : return False

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        This method "arms" a digital pin for its data to be latched and saved in the latching table
        If a callback method is provided, when latching criteria is achieved, the callback function is called
        with latching data notification. In that case, the latching table is not updated.

        :param pin: Digital pin number

        :param threshold_type: DIGITAL_LATCH_HIGH | DIGITAL_LATCH_LOW

        :param cb: callback function

        :return: True if successful, False if parameter data is invalid
        """
        if 0 <= arg_2 <= 1:
            arg_0._command_handler.Func(arg_1, arg_2, arg_3)
            return True
        else:
            return False

This method arms a digital pin for its data to be latched and saved in the latching table If a callback method is provided when latching criteria is achieved the callback function is called with latching data notification . In that case the latching table is not updated .


(self, key, value, prompt=None,
        on_load=lambda a: a, on_save=lambda a: a)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
lambda
arg_5
:
arg_5
,
arg_6
=
lambda
arg_5
:
arg_5
)
:
if
arg_2
==
''
:
arg_2
=
if
arg_1
and
arg_0
.
data
.
has_key
(
arg_1
)
:
del
arg_0
.
data
[
arg_1
]
if
arg_2
is
not
:
arg_2
=
arg_4
(
arg_2
)
if
arg_1
:
arg_0
.
data
[
arg_1
]
=
arg_6
(
arg_2
)
return
arg_2
elif
not
arg_1
or
not
arg_0
.
has_key
(
arg_1
)
:
if
callable
(
arg_3
)
:
arg_2
=
arg_3
(
)
elif
arg_3
is
not
:
arg_2
=
raw_input
(
arg_3
+
": "
)
if
arg_2
is
:
if
arg_0
.
data
.
has_key
(
arg_1
)
:
del
arg_0
.
data
[
arg_1
]
return
arg_0
.
data
[
arg_1
]
=
arg_6
(
arg_2
)
return
arg_2
return
arg_4
(
arg_0
.
data
[
arg_1
]
)

def Func(arg_0, arg_1, arg_2, arg_3=None,
        arg_4=lambda arg_5: arg_5, arg_6=lambda arg_5: arg_5):
        """Applies a setting value to a key, if the value is not `None`.

        Returns without prompting if either of the following:
            * `value` is not `None`
            * already present in the dictionary

        Args:
            prompt:
                May either be a string to prompt via `raw_input` or a
                method (callable) that returns the value.

            on_load:
                lambda. Value is passed through here after loaded.

            on_save:
                lambda. Value is saved as this value.
        """

        # Reset value if flag exists without value
        if arg_2 == '':
            arg_2 = None
            if arg_1 and arg_0.data.has_key(arg_1): del arg_0.data[arg_1]

        # If value is explicitly set from args.
        if arg_2 is not None:
            arg_2 = arg_4(arg_2)
            if arg_1: arg_0.data[arg_1] = arg_6(arg_2)
            return arg_2

        elif not arg_1 or not arg_0.has_key(arg_1):
            if callable(arg_3):
                arg_2 = arg_3()
            elif arg_3 is not None:
                arg_2 = raw_input(arg_3 + ": ")

            if arg_2 is None:
                if arg_0.data.has_key(arg_1): del arg_0.data[arg_1]
                return None

            arg_0.data[arg_1] = arg_6(arg_2)
            return arg_2

        return arg_4(arg_0.data[arg_1])

Applies a setting value to a key if the value is not None .


(self, arg_parser, name, *args, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 , * arg_3 , ** arg_4 ) : arg_1 . add_argument ( '--' + arg_2 , * arg_3 , ** arg_4 )

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """
        Add an argument to the given arg_parser with the given name.

        :param argparse.ArgumentParser arg_parser:
        :param str name: The name of the option.
        """
        arg_1.add_argument('--' + arg_2, *arg_3, **arg_4)

Add an argument to the given arg_parser with the given name .


def Func ( arg_0 , arg_1 ) : arg_2 = { "name" : arg_1 . name } if arg_1 . location : arg_2 [ 'location' ] = arg_1 . location if arg_1 . size : arg_2 [ 'size' ] = str ( arg_1 . size ) arg_3 = { "properties" : arg_2 , } arg_4 = arg_0 . _perform_request ( url = '/ipblocks' , method = 'POST' , data = json . dumps ( arg_3 ) ) return arg_4

def Func(arg_0, arg_1):
        """
        Reserves an IP block within your account.

        """
        arg_2 = {
            "name": arg_1.name
        }

        if arg_1.location:
            arg_2['location'] = arg_1.location

        if arg_1.size:
            arg_2['size'] = str(arg_1.size)

        arg_3 = {
            "properties": arg_2,
        }

        arg_4 = arg_0._perform_request(
            url='/ipblocks', method='POST', data=json.dumps(arg_3))

        return arg_4

Reserves an IP block within your account .


def Func(arg_0, arg_1):
    """Validate that date is in the future."""
    if arg_0.accept.data:
        if not arg_1.data or datetime.utcnow().date() >= arg_1.data:
            raise validators.StopValidation(_(
                "Please provide a future date."
            ))
        if not arg_1.data or \
                datetime.utcnow().date() + timedelta(days=365) < arg_1.data:
            raise validators.StopValidation(_(
                "Please provide a date no more than 1 year into the future."
            ))


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : assert isinstance ( arg_1 , ( str , unicode ) ) arg_1 = arg_1 . decode ( 'utf-8' ) arg_0 . _indexes [ arg_1 ] = { 'create' : arg_2 , 'transform' : arg_3 }

def Func(arg_0, arg_1, arg_2, arg_3):
        '''Add an index to this store instance.

        Adds an index transform to the current FC store. Once an index
        with name ``idx_name`` is added, it will be available in all
        ``index_*`` methods. Additionally, the index will be automatically
        updated on calls to :meth:`~dossier.fc.store.Store.put`.

        If an index with name ``idx_name`` already exists, then it is
        overwritten.

        Note that indexes do *not* persist. They must be re-defined for
        each instance of :class:`Store`.

        For example, to add an index on the ``boNAME`` feature, you can
        use the ``feature_index`` helper function:

        .. code-block:: python

            store.Func('boNAME',
                               feature_index('boNAME'),
                               lambda s: s.encode('utf-8'))

        Another example for creating an index on names:

        .. code-block:: python

            store.Func('NAME',
                               feature_index('canonical_name', 'NAME'),
                               lambda s: s.lower().encode('utf-8'))

        :param idx_name: The name of the index. Must be UTF-8 encodable.
        :type idx_name: unicode
        :param create: A function that accepts the ``transform`` function and
                       a pair of ``(content_id, fc)`` and produces a generator
                       of index values from the pair given using ``transform``.
        :param transform: A function that accepts an arbitrary value and
                          applies a transform to it. This transforms the
                          *stored* value to the *index* value. This *must*
                          produce a value with type `str` (or `bytes`).
        '''
        assert isinstance(arg_1, (str, unicode))
        arg_1 = arg_1.decode('utf-8')
        arg_0._indexes[arg_1] = {'create': arg_2, 'transform': arg_3}

Add an index to this store instance.

        Adds an index transform to the current FC store. Once an index
        with name ``idx_name`` is added, it will be available in all
        ``index_*`` methods. Additionally, the index will be automatically
        updated on calls to :meth:`~dossier.fc.store.Store.put`.

        If an index with name ``idx_name`` already exists, then it is
        overwritten.

        Note that indexes do *not* persist. They must be re-defined for
        each instance of :class:`Store`.

        For example, to add an index on the ``boNAME`` feature, you can
        use the ``feature_index`` helper function:

        .. code-block:: python

            store.define_index('boNAME',
                               feature_index('boNAME'),
                               lambda s: s.encode('utf-8'))

        Another example for creating an index on names:

        .. code-block:: python

            store.define_index('NAME',
                               feature_index('canonical_name', 'NAME'),
                               lambda s: s.lower().encode('utf-8'))

        :param idx_name: The name of the index. Must be UTF-8 encodable.
        :type idx_name: unicode
        :param create: A function that accepts the ``transform`` function and
                       a pair of ``(content_id, fc)`` and produces a generator
                       of index values from the pair given using ``transform``.
        :param transform: A function that accepts an arbitrary value and
                          applies a transform to it. This transforms the
                          *stored* value to the *index* value. This *must*
                          produce a value with type `str` (or `bytes`).


def Func(arg_0):
        """
        Get repository descriptive stats

        :Returns:
            #. numberOfDirectories (integer): Number of diretories in repository
            #. numberOfFiles (integer): Number of files in repository
        """
        if arg_0.__path is None:
            return 0,0
        arg_1 = 0
        arg_2  = 0
        for arg_3 in arg_0.get_repository_state():
            arg_4 = list(arg_3)[0]
            if arg_4 == '':
                continue
            if arg_3[arg_4].get('pyrepfileinfo', False):
                arg_1 += 1
            elif arg_3[arg_4].get('pyrepdirinfo', False):
                arg_2 += 1
            else:
                raise Exception('Not sure what to do next. Please report issue')
        return arg_2,arg_1


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = paramsToValTuple ( arg_0 ) if arg_3 is None : arg_3 = { } if arg_2 : try : arg_5 = arg_3 [ arg_4 ] except KeyError : arg_3 [ arg_4 ] = arg_0 return True , arg_3 prepareEntity ( arg_1 , arg_5 . _entity . name , arg_5 ) return False , arg_3 return arg_3 [ arg_4 ] is arg_0 , arg_3

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Decide to serialize only objs with uniq parameters and class

    :param priv: private data for this function
        ({frozen_params: obj})

    :return: tuple (do serialize this object, next priv)
    """

    arg_4 = paramsToValTuple(arg_0)

    if arg_3 is None:
        arg_3 = {}

    if arg_2:
        try:
            arg_5 = arg_3[arg_4]
        except KeyError:
            arg_3[arg_4] = arg_0
            return True, arg_3

        prepareEntity(arg_1, arg_5._entity.name, arg_5)
        return False, arg_3

    return arg_3[arg_4] is arg_0, arg_3


def Func(arg_0, arg_1, arg_2):
        """Called when a device is connected."""
        logger.debug('centralManager_didConnectPeripheral called')
        # Setup peripheral delegate and kick off service discovery.  For now just
        # assume all services need to be discovered.
        arg_2.setDelegate_(arg_0)
        arg_2.discoverServices_(None)
        # Fire connected event for device.
        arg_3 = device_list().get(arg_2)
        if arg_3 is not None:
            arg_3._set_connected()


(self, report_fn, morfs, directory=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
)
:
arg_0
.
find_code_units
(
arg_2
)
if
not
arg_0
.
code_units
:
raise
CoverageException
(
"No data to report."
)
arg_0
.
directory
=
arg_3
if
arg_0
.
directory
and
not
os
.
path
.
exists
(
arg_0
.
directory
)
:
os
.
makedirs
(
arg_0
.
directory
)
for
arg_4
in
arg_0
.
code_units
:
try
:
arg_1
(
arg_4
,
arg_0
.
coverage
.
_analyze
(
arg_4
)
)
except
NoSource
:
if
not
arg_0
.
config
.
ignore_errors
:
raise
except
NotPython
:
if
arg_4
.
should_be_python
(
)
and
not
arg_0
.
config
.
ignore_errors
:
raise

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Run a reporting function on a number of morfs.

        `report_fn` is called for each relative morf in `morfs`.  It is called
        as::

            report_fn(code_unit, analysis)

        where `code_unit` is the `CodeUnit` for the morf, and `analysis` is
        the `Analysis` for the morf.

        """
        arg_0.find_code_units(arg_2)

        if not arg_0.code_units:
            raise CoverageException("No data to report.")

        arg_0.directory = arg_3
        if arg_0.directory and not os.path.exists(arg_0.directory):
            os.makedirs(arg_0.directory)

        for arg_4 in arg_0.code_units:
            try:
                arg_1(arg_4, arg_0.coverage._analyze(arg_4))
            except NoSource:
                if not arg_0.config.ignore_errors:
                    raise
            except NotPython:
                # Only report errors for .py files, and only if we didn't
                # explicitly suppress those errors.
                if arg_4.should_be_python() and not arg_0.config.ignore_errors:
                    raise

Run a reporting function on a number of morfs .


def Func(arg_0):
        """
        Establishes a connection depending on the security mode set via config or environment variable.

        :return: a hdfscli InsecureClient or KerberosClient object.
        :rtype: hdfs.InsecureClient or hdfs.ext.kerberos.KerberosClient
        """
        arg_1 = arg_0.Funcections(arg_0.webhdfs_conn_id)

        for arg_2 in arg_1:
            try:
                arg_0.log.debug('Trying namenode %s', arg_2.host)
                arg_3 = arg_0._get_client(arg_2)
                arg_3.status('/')
                arg_0.log.debug('Using namenode %s for hook', arg_2.host)
                return arg_3
            except HdfsError as hdfs_error:
                arg_0.log.debug('Read operation on namenode %s failed with error: %s',
                               arg_2.host, hdfs_error)

        arg_4 = [arg_2.host for arg_2 in arg_1]
        arg_5 = 'Read operations failed on the namenodes below:\n{hosts}'.format(
            arg_4='\n'.join(arg_4))
        raise AirflowWebHDFSHookException(arg_5)

Establishes a connection depending on the security mode set via config or environment variable .


Get the width of a bounding box encapsulating the line.

return np.max(self.xx) - np.min(self.xx)

def Func ( arg_0 ) : if len ( arg_0 . coords ) <= 1 : return 0 return np . max ( arg_0 . xx ) - np . min ( arg_0 . xx )

def Func(arg_0):
        """Get the Func of a bounding box encapsulating the line."""
        if len(arg_0.coords) <= 1:
            return 0
        return np.max(arg_0.xx) - np.min(arg_0.xx)

Get the width of a bounding box encapsulating the line .


def Func ( arg_0 ) : if len ( arg_0 . _eol ) > 0 : arg_0 . position = arg_0 . _eol . pop ( )

def Func(arg_0):
        """Sets cursor as end of previous line."""
        #TODO(bps): raise explicit error for unregistered eol
        #assert self._eol[-1].index == self._index
        if len(arg_0._eol) > 0:
            arg_0.position = arg_0._eol.pop()


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = np . zeros ( pow ( 10 , arg_1 ) , dtype = 'i4' ) arg_4 = np . zeros ( arg_1 , dtype = int ) for arg_5 in range ( arg_1 ) : arg_4 [ arg_5 ] = arg_0 . next ( ) for arg_6 in arg_0 : arg_7 = int ( '' . join ( map ( str , arg_4 ) ) ) arg_3 [ arg_7 ] += 1 arg_4 [ 0 : - 1 ] = arg_4 [ 1 : ] arg_4 [ - 1 ] = arg_6 if arg_2 : arg_3 = arg_3 / arg_3 . sum ( ) return arg_3

def Func(arg_0, arg_1, arg_2=False):
    """
    Consume digits of pi and compute n digits freq. counts.

    This should only be used for 1-6 digits.
    """
    arg_3 = np.zeros(pow(10,arg_1), dtype='i4')
    arg_4 = np.zeros(arg_1, dtype=int)
    for arg_5 in range(arg_1):
        arg_4[arg_5] = arg_0.next()
    for arg_6 in arg_0:
        arg_7 = int(''.join(map(str, arg_4)))
        arg_3[arg_7] += 1
        arg_4[0:-1] = arg_4[1:]
        arg_4[-1] = arg_6
    if arg_2:
        arg_3 = arg_3/arg_3.sum()
    return arg_3

Consume digits of pi and compute n digits freq . counts .


(template, arguments, output_function=None,
                    verbose=True, debug=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
True
,
arg_4
=
False
)
:
arg_5
=
str
(
uuid
.
uuid4
(
)
)
os
.
makedirs
(
'/tmp/cdt_R_script_'
+
arg_5
+
'/'
)
try
:
arg_6
=
'/tmp/cdt_R_script_'
+
arg_5
+
'/instance_{}'
.
format
(
os
.
path
.
basename
(
arg_0
)
)
copy
(
arg_0
,
arg_6
)
with
fileinput
.
FileInput
(
arg_6
,
inplace
=
True
)
as
file
:
for
arg_7
in
file
:
arg_8
=
arg_7
for
arg_9
in
arg_1
:
arg_8
=
arg_8
.
replace
(
arg_9
,
arg_1
[
arg_9
]
)
print
(
arg_8
,
end
=
''
)
if
arg_2
is
:
arg_10
=
subprocess
.
call
(
"Rscript --vanilla {}"
.
format
(
arg_6
)
,
shell
=
True
,
stdout
=
subprocess
.
DEVNULL
,
stderr
=
subprocess
.
DEVNULL
)
else
:
if
arg_3
:
arg_11
=
subprocess
.
Popen
(
"Rscript --vanilla {}"
.
format
(
arg_6
)
,
shell
=
True
)
else
:
arg_11
=
subprocess
.
Popen
(
"Rscript --vanilla {}"
.
format
(
arg_6
)
,
shell
=
True
,
stdout
=
subprocess
.
DEVNULL
,
stderr
=
subprocess
.
DEVNULL
)
arg_11
.
wait
(
)
arg_10
=
arg_2
(
)
except
Exception
as
e
:
if
not
arg_4
:
rmtree
(
'/tmp/cdt_R_script_'
+
arg_5
+
'/'
)
raise
e
except
KeyboardInterrupt
:
if
not
arg_4
:
rmtree
(
'/tmp/cdt_R_script_'
+
arg_5
+
'/'
)
raise
KeyboardInterrupt
if
not
arg_4
:
rmtree
(
'/tmp/cdt_R_script_'
+
arg_5
+
'/'
)
return
arg_10

def Func(arg_0, arg_1, arg_2=None,
                    arg_3=True, arg_4=False):
    """Launch an R script, starting from a template and replacing text in file
    before execution.

    Args:
        template (str): path to the template of the R script
        arguments (dict): Arguments that modify the template's placeholders
            with arguments
        output_function (function): Function to execute **after** the execution
            of the R script, and its output is returned by this function. Used
            traditionally as a function to retrieve the results of the
            execution.
        verbose (bool): Sets the verbosity of the R subprocess.
        debug (bool): If True, the generated scripts are not deleted.

    Return:
        Returns the output of the ``output_function`` if not `None`
        else `True` or `False` depending on whether the execution was
        successful.
    """
    arg_5 = str(uuid.uuid4())
    os.makedirs('/tmp/cdt_R_script_' + arg_5 + '/')
    try:
        arg_6 = '/tmp/cdt_R_script_' + arg_5 + '/instance_{}'.format(os.path.basename(arg_0))
        copy(arg_0, arg_6)

        with fileinput.FileInput(arg_6, inplace=True) as file:
            for arg_7 in file:
                arg_8 = arg_7
                for arg_9 in arg_1:
                    arg_8 = arg_8.replace(arg_9, arg_1[arg_9])
                print(arg_8, end='')

        if arg_2 is None:
            arg_10 = subprocess.call("Rscript --vanilla {}".format(arg_6), shell=True,
                                     stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
        else:
            if arg_3:
                arg_11 = subprocess.Popen("Rscript --vanilla {}".format(arg_6), shell=True)
            else:
                arg_11 = subprocess.Popen("Rscript --vanilla {}".format(arg_6), shell=True,
                                           stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
            arg_11.wait()
            arg_10 = arg_2()

    # Cleaning up
    except Exception as e:
        if not arg_4:
            rmtree('/tmp/cdt_R_script_' + arg_5 + '/')
        raise e
    except KeyboardInterrupt:
        if not arg_4:
            rmtree('/tmp/cdt_R_script_' + arg_5 + '/')
        raise KeyboardInterrupt
    if not arg_4:
        rmtree('/tmp/cdt_R_script_' + arg_5 + '/')
    return arg_10

Launch an R script starting from a template and replacing text in file before execution .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : if arg_2 . match ( arg_0 ) : return True return False

def Func(arg_0, arg_1):
    """Determines if the basename is matched in a regex blacklist

    :param str base_name: The basename of the file
    :param list black_list_re: A collection of regex patterns to match against.
        Successful matches are blacklisted.

    :returns: `True` if the basename is blacklisted, `False` otherwise.
    :rtype: bool
    """
    for arg_2 in arg_1:
        if arg_2.match(arg_0):
            return True
    return False


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_1 is not None : arg_0 . _canvas . Funcfile = arg_1 else : return arg_0 . _canvas . Funcfile if arg_2 is not None : arg_0 . _canvas . Funcsize = arg_2

def Func(arg_0, arg_1=None, arg_2=None):
        '''Set the Func to be used with new text instances.

        :param Funcpath: path to truetype or opentype Func.
        :param Funcsize: size of Func

        :return: current current Funcpath (if Funcpath param not set)
        Accepts TrueType and OpenType files. Depends on FreeType being
        installed.'''
        if arg_1 is not None:
            arg_0._canvas.Funcfile = arg_1
        else:
            return arg_0._canvas.Funcfile
        if arg_2 is not None:
            arg_0._canvas.Funcsize = arg_2

Set the font to be used with new text instances.

        :param fontpath: path to truetype or opentype font.
        :param fontsize: size of font

        :return: current current fontpath (if fontpath param not set)
        Accepts TrueType and OpenType files. Depends on FreeType being
        installed.

Set the font to be used with new text instances .


def Func ( arg_0 , arg_1 = None , arg_2 = False ) : def check_perms ( arg_3 ) : if not getattr ( settings , 'DASHBOARD_REQUIRE_LOGIN' , app_settings . REQUIRE_LOGIN ) : return True if arg_3 . has_perm ( arg_0 ) : return True if arg_2 : raise PermissionDenied return False return user_passes_test ( check_perms , arg_1 = arg_1 )

def Func(arg_0, arg_1=None, arg_2=False):
    """
    Re-implementation of the Func decorator, honors settings.

    If ``DASHBOARD_REQUIRE_LOGIN`` is False, this decorator will always return
    ``True``, otherwise it will check for the permission as usual.

    """
    def check_perms(arg_3):
        if not getattr(settings, 'DASHBOARD_REQUIRE_LOGIN',
                       app_settings.REQUIRE_LOGIN):
            return True
        # First check if the user has the permission (even anon users)
        if arg_3.has_perm(arg_0):
            return True
        # In case the 403 handler should be called raise the exception
        if arg_2:  # pragma: no cover
            raise PermissionDenied
        # As the last resort, show the login form
        return False
    return user_passes_test(check_perms, arg_1=arg_1)

Re-implementation of the permission_required decorator, honors settings.

    If ``DASHBOARD_REQUIRE_LOGIN`` is False, this decorator will always return
    ``True``, otherwise it will check for the permission as usual.

Re - implementation of the permission_required decorator honors settings .


(
            self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config)

return LROPoller(self._client, raw_result, get_long_running_output, polling_method)

def Func(
            arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None, arg_6=False, arg_7=True, **arg_8):
        """Updates the policies for the specified container registry.

        :param resource_group_name: The name of the resource group to which
         the container registry belongs.
        :type resource_group_name: str
        :param registry_name: The name of the container registry.
        :type registry_name: str
        :param quarantine_policy: An object that represents quarantine policy
         for a container registry.
        :type quarantine_policy:
         ~azure.mgmt.containerregistry.v2018_02_01_preview.models.QuarantinePolicy
        :param trust_policy: An object that represents content trust policy
         for a container registry.
        :type trust_policy:
         ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicy
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of LROPoller that returns RegistryPolicies or
         ClientRawResponse<RegistryPolicies> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPolicies]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPolicies]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        arg_9 = arg_0._Func_initial(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=True,
            **arg_8
        )

        def get_long_running_output(arg_10):
            arg_11 = arg_0._deserialize('RegistryPolicies', arg_10)

            if arg_6:
                arg_12 = ClientRawResponse(arg_11, arg_10)
                return arg_12

            return arg_11

        arg_13 = arg_8.get(
            'long_running_operation_timeout',
            arg_0.config.long_running_operation_timeout)
        if arg_7 is True: arg_14 = ARMPolling(arg_13, **arg_8)
        elif arg_7 is False: arg_14 = NoPolling()
        else: arg_14 = arg_7
        return LROPoller(arg_0._client, arg_9, get_long_running_output, arg_14)

Updates the policies for the specified container registry .


return self._append_custom(self._insert_html_fetching_plain_text,
                                   html, before_prompt)

def Func(arg_0, arg_1, arg_2=False):
        """ Appends HTML, then returns the plain text version of it.
        """
        return arg_0._append_custom(arg_0._insert_html_fetching_plain_text,
                                   arg_1, arg_2)

Appends HTML then returns the plain text version of it .


return self.get_stream(
            "STOR " + str(destination),
            "1xx",
            offset=offset,
        )

def
Func
(
arg_0
,
arg_1
,
*
,
arg_2
=
0
)
:
return
arg_0
.
get_stream
(
"STOR "
+
str
(
arg_1
)
,
"1xx"
,
arg_2
=
arg_2
,
)

def Func(arg_0, arg_1, *, arg_2=0):
        """
        Create stream for write data to `destination` file.

        :param destination: destination path of file on server side
        :type destination: :py:class:`str` or :py:class:`pathlib.PurePosixPath`

        :param offset: byte offset for stream start position
        :type offset: :py:class:`int`

        :rtype: :py:class:`aioftp.DataConnectionThrottleStreamIO`
        """
        return arg_0.get_stream(
            "STOR " + str(arg_1),
            "1xx",
            arg_2=arg_2,
        )

Create stream for write data to destination file .


def Func(arg_0):
        """Generates a state string to be used in authorizations."""
        try:
            arg_0._state = arg_0.state()
            log.debug("Generated new state %s.", arg_0._state)
        except TypeError:
            arg_0._state = arg_0.state
            log.debug("Re-using previously supplied state %s.", arg_0._state)
        return arg_0._state

Generates a state string to be used in authorizations .


def Func(**arg_0):
    """Parses an URL and validates its attributes."""
    def check_Func(arg_1):
        validate(text, arg_1)
        arg_2 = Funcparse(arg_1)
        if not arg_2.netloc:
            raise ValueError("'{0}' is not a valid URL".format(arg_1))

        for arg_3, arg_4 in arg_0.items():
            if not _hasattr(arg_2, arg_3):
                raise ValueError("Invalid URL attribute '{0}'".format(arg_3))

            try:
                validate(arg_4, _getattr(arg_2, arg_3))
            except ValueError as err:
                raise ValueError(
                    "Unable to validate URL attribute '{0}': {1}".format(
                        arg_3, err
                    )
                )

        return True

    # Convert "http" to be either any("http", "https") for convenience
    if arg_0.get("scheme") == "http":
        arg_0["scheme"] = any("http", "https")

    return check_Func

Parses an URL and validates its attributes .


def Func(arg_0, arg_1):
        """Initialize a new file that starts out with some data. Pass data
        as a list, dict, or JSON string.
        """
        # De-jsonize data if necessary
        if isinstance(arg_1, str):
            arg_1 = json.loads(arg_1)

        # Make sure this is really a new file
        if os.path.exists(arg_0):
            raise ValueError("File exists, not overwriting data. Set the "
                             "'data' attribute on a normally-initialized "
                             "'livejson.File' instance if you really "
                             "want to do this.")
        else:
            arg_2 = File(arg_0)
            arg_2.data = arg_1
            return arg_2

Initialize a new file that starts out with some data . Pass data as a list dict or JSON string .


(self, username, course_id, mode, cohort=None)

return self.client.enrollment.post(
            {
                'user': username,
                'course_details': {'course_id': course_id},
                'mode': mode,
                'cohort': cohort,
            }
        )

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None ) : return arg_0 . client . enrollment . post ( { 'user' : arg_1 , 'course_details' : { 'course_id' : arg_2 } , 'mode' : arg_3 , 'cohort' : arg_4 , } )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """
        Call the enrollment API to enroll the user in the course specified by course_id.

        Args:
            username (str): The username by which the user goes on the OpenEdX platform
            course_id (str): The string value of the course's unique identifier
            mode (str): The enrollment mode which should be used for the enrollment
            cohort (str): Add the user to this named cohort

        Returns:
            dict: A dictionary containing details of the enrollment, including course details, mode, username, etc.

        """
        return arg_0.client.enrollment.post(
            {
                'user': arg_1,
                'course_details': {'course_id': arg_2},
                'mode': arg_3,
                'cohort': arg_4,
            }
        )

Call the enrollment API to enroll the user in the course specified by course_id .


def Func ( arg_0 , arg_1 , arg_2 = '' , ** arg_3 ) -> pd . DataFrame : from xbbg . core import intervals arg_4 = bdib ( arg_0 = arg_0 , arg_1 = arg_1 , typ = arg_3 . get ( 'typ' , 'TRADE' ) ) if arg_4 . empty : return pd . DataFrame ( ) arg_5 = '%H:%M:%S' arg_6 = intervals . SessNA arg_7 = arg_3 . get ( 'ref' , None ) arg_8 = pd . Series ( ) if arg_7 is None else const . exch_info ( arg_0 = arg_7 ) if arg_2 : arg_6 = intervals . get_interval ( arg_0 = arg_3 . get ( 'ref' , arg_0 ) , arg_2 = arg_2 ) arg_9 = arg_3 . get ( 'start_time' , None ) arg_10 = arg_3 . get ( 'end_time' , None ) if arg_6 != intervals . SessNA : arg_9 = pd . Timestamp ( arg_6 . start_time ) . strftime ( arg_5 ) arg_10 = pd . Timestamp ( arg_6 . end_time ) . strftime ( arg_5 ) if arg_9 and arg_10 : arg_11 = dict ( arg_9 = arg_9 , arg_10 = arg_10 ) if not arg_8 . empty : arg_12 = arg_4 . index . tz arg_13 = arg_4 . tz_convert ( arg_8 . tz ) . between_time ( ** arg_11 ) if arg_3 . get ( 'keep_tz' , False ) : arg_13 = arg_13 . tz_convert ( arg_12 ) return pd . DataFrame ( arg_13 ) return pd . DataFrame ( arg_4 . between_time ( ** arg_11 ) ) return arg_4

def Func(arg_0, arg_1, arg_2='', **arg_3) -> pd.DataFrame:
    """
    Bloomberg Func bar data within market session

    Args:
        ticker: ticker
        dt: date
        session: examples include
                 day_open_30, am_normal_30_30, day_close_30, allday_exact_0930_1000
        **kwargs:
            ref: reference ticker or exchange for timezone
            keep_tz: if keep tz if reference ticker / exchange is given
            start_time: start time
            end_time: end time
            typ: [TRADE, BID, ASK, BID_BEST, ASK_BEST, BEST_BID, BEST_ASK]

    Returns:
        pd.DataFrame
    """
    from xbbg.core import intervals

    arg_4 = bdib(arg_0=arg_0, arg_1=arg_1, typ=arg_3.get('typ', 'TRADE'))
    if arg_4.empty: return pd.DataFrame()

    arg_5 = '%H:%M:%S'
    arg_6 = intervals.SessNA
    arg_7 = arg_3.get('ref', None)
    arg_8 = pd.Series() if arg_7 is None else const.exch_info(arg_0=arg_7)
    if arg_2: arg_6 = intervals.get_interval(
        arg_0=arg_3.get('ref', arg_0), arg_2=arg_2
    )

    arg_9 = arg_3.get('start_time', None)
    arg_10 = arg_3.get('end_time', None)
    if arg_6 != intervals.SessNA:
        arg_9 = pd.Timestamp(arg_6.start_time).strftime(arg_5)
        arg_10 = pd.Timestamp(arg_6.end_time).strftime(arg_5)

    if arg_9 and arg_10:
        arg_11 = dict(arg_9=arg_9, arg_10=arg_10)
        if not arg_8.empty:
            arg_12 = arg_4.index.tz
            arg_13 = arg_4.tz_convert(arg_8.tz).between_time(**arg_11)
            if arg_3.get('keep_tz', False):
                arg_13 = arg_13.tz_convert(arg_12)
            return pd.DataFrame(arg_13)
        return pd.DataFrame(arg_4.between_time(**arg_11))

    return arg_4

Bloomberg intraday bar data within market session

    Args:
        ticker: ticker
        dt: date
        session: examples include
                 day_open_30, am_normal_30_30, day_close_30, allday_exact_0930_1000
        **kwargs:
            ref: reference ticker or exchange for timezone
            keep_tz: if keep tz if reference ticker / exchange is given
            start_time: start time
            end_time: end time
            typ: [TRADE, BID, ASK, BID_BEST, ASK_BEST, BEST_BID, BEST_ASK]

    Returns:
        pd.DataFrame


def Func(arg_0, arg_1):
        """get callbacks from handler for the visited node"""
        arg_2 = arg_1.__class__
        arg_3 = arg_0._cache.get(arg_2)
        if arg_3 is None:
            arg_4 = arg_0.handler
            arg_5 = arg_2.__name__.lower()
            arg_6 = getattr(
                arg_4, "visit_%s" % arg_5, getattr(arg_4, "visit_default", None)
            )
            arg_7 = getattr(
                arg_4, "leave_%s" % arg_5, getattr(arg_4, "leave_default", None)
            )
            arg_0._cache[arg_2] = (arg_6, arg_7)
        else:
            arg_6, arg_7 = arg_3
        return arg_6, arg_7


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = os . path . splitext ( os . path . basename ( arg_0 ) ) [ 0 ] if arg_1 not in arg_2 : with open ( arg_0 , 'r' ) as schema_file : arg_2 [ arg_1 ] = json . load ( schema_file ) return arg_2 [ arg_1 ]

def Func(arg_0, arg_1=None):
    """Loads the QObj schema for use in future validations.

   Caches schema in _SCHEMAS module attribute.

   Args:
        file_path(str): Path to schema.
        name(str): Given name for schema. Defaults to file_path filename
            without schema.
   Return:
        schema(dict): Loaded schema.
    """
    if arg_1 is None:
        # filename without extension
        arg_1 = os.path.splitext(os.path.basename(arg_0))[0]
    if arg_1 not in arg_2:
        with open(arg_0, 'r') as schema_file:
            arg_2[arg_1] = json.load(schema_file)

    return arg_2[arg_1]

Loads the QObj schema for use in future validations .


def Func ( arg_0 , arg_1 ) : arg_2 = { } for arg_3 in arg_0 : arg_4 = arg_3 . tag . split ( '}' ) [ 1 ] arg_5 = arg_3 . text if arg_4 == 'Config' : arg_6 = arg_3 . find ( './{*}Comment' ) arg_2 [ 'comment' ] = arg_6 . text if arg_6 is not None else None continue elif arg_4 == 'Id' : arg_5 = arg_5 . strip ( '/hostedzone/' ) arg_7 = HOSTED_ZONE_TAG_TO_KWARG_MAP [ arg_4 ] arg_2 [ arg_7 ] = arg_5 return HostedZone ( arg_1 , ** arg_2 )

def Func(arg_0, arg_1):
    """
    This a common parser that allows the passing of any valid HostedZone
    tag. It will spit out the appropriate HostedZone object for the tag.

    :param lxml.etree._Element e_zone: The root node of the etree parsed
        response from the API.
    :param Route53Connection connection: The connection instance used to
        query the API.
    :rtype: HostedZone
    :returns: An instantiated HostedZone object.
    """

    # This dict will be used to instantiate a HostedZone instance to yield.
    arg_2 = {}
    # Within HostedZone tags are a number of sub-tags that include info
    # about the instance.
    for arg_3 in arg_0:
        # Cheesy way to strip off the namespace.
        arg_4 = arg_3.tag.split('}')[1]
        arg_5 = arg_3.text

        if arg_4 == 'Config':
            # Config has the Comment tag beneath it, needing
            # special handling.
            arg_6 = arg_3.find('./{*}Comment')
            arg_2['comment'] = arg_6.text if arg_6 is not None else None
            continue
        elif arg_4 == 'Id':
            # This comes back with a path prepended. Yank that sillyness.
            arg_5 = arg_5.strip('/hostedzone/')

        # Map the XML tag name to a kwarg name.
        arg_7 = HOSTED_ZONE_TAG_TO_KWARG_MAP[arg_4]
        # This will be the key/val pair used to instantiate the
        # HostedZone instance.
        arg_2[arg_7] = arg_5

    return HostedZone(arg_1, **arg_2)

This a common parser that allows the passing of any valid HostedZone tag . It will spit out the appropriate HostedZone object for the tag .


def Func(arg_0):
        """
        This function cancels PlanarRad.
        """

        """
        This function needs to be tested. We don't know if she works.
        """

        if (arg_0.is_running == True) & (arg_0.ui.tabWidget.currentIndex() == TabWidget.NORMAL_MODE):
            arg_1 = QtGui.QMessageBox.question(arg_0.ui.cancel, 'Cancel PlanarRad', "Are you sure to cancel ?",
                                                QtGui.QMessageBox.Yes,
                                                QtGui.QMessageBox.No)

            if arg_1 == QtGui.QMessageBox.Yes:
                arg_0.is_running = False
                os.kill(arg_0.p.pid, signal.SIGTERM)

                print("Necessary to check if Func works well !")
                arg_0.ui.progressBar.reset()
            else:
                pass


(adapter, genes = None, ensembl_lines=None, hgnc_lines=None, exac_lines=None, mim2gene_lines=None,
                    genemap_lines=None, hpo_lines=None, build='37', omim_api_key='')

def Func(arg_0, arg_1 = None, arg_2=None, arg_3=None, arg_4=None, arg_5=None,
                    arg_6=None, arg_7=None, arg_8='37', arg_9=''):
    """Load genes into the database

    link_genes will collect information from all the different sources and
    merge it into a dictionary with hgnc_id as key and gene information as values.

    Args:
        adapter(scout.adapter.MongoAdapter)
        genes(dict): If genes are already parsed
        ensembl_lines(iterable(str)): Lines formated with ensembl gene information
        hgnc_lines(iterable(str)): Lines with gene information from genenames.org
        exac_lines(iterable(str)): Lines with information pLi-scores from ExAC
        mim2gene(iterable(str)): Lines with map from omim id to gene symbol
        genemap_lines(iterable(str)): Lines with information of omim entries
        hpo_lines(iterable(str)): Lines information about map from hpo terms to genes
        build(str): What build to use. Defaults to '37'

    Returns:
        gene_objects(list): A list with all gene_objects that was loaded into database
    """
    arg_10 = list()

    if not arg_1:
        # Fetch the resources if not provided
        if arg_2 is None:
            arg_2 = fetch_ensembl_genes(arg_8=arg_8)
        arg_3 = arg_3 or fetch_hgnc()
        arg_4 = arg_4 or fetch_exac_constraint()
        if not (arg_5 and arg_6):
            if not arg_9:
                raise SyntaxError("Need to provide omim api key")
            arg_11 = fetch_mim_files(arg_9, mim2genes=True, genemap2=True)
            arg_5 = arg_11['mim2genes']
            arg_6 = arg_11['genemap2']
        if not arg_7:
            arg_12 = fetch_hpo_files(hpogenes=True)
            arg_7 = arg_12['hpogenes']

        # Link the resources
        arg_1 = link_genes(
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=arg_6,
            arg_7=arg_7
        )

    arg_13 = 0
    arg_14 = len(arg_1)

    with progressbar(arg_1.values(), label="Building genes", length=arg_14) as bar:
        for arg_15 in bar:
            if not arg_15.get('chromosome'):
                LOG.debug("skipping gene: %s. No coordinates found", arg_15.get('hgnc_symbol', '?'))
                arg_13 += 1
                continue

            arg_16 = build_hgnc_gene(arg_15, arg_8=arg_8)
            arg_10.append(arg_16)

    LOG.info("Loading genes build %s", arg_8)
    arg_0.load_hgnc_bulk(arg_10)

    LOG.info("Loading done. %s genes loaded", len(arg_10))
    LOG.info("Nr of genes without coordinates in build %s: %s", arg_8,arg_13)

    return arg_10

Load genes into the database link_genes will collect information from all the different sources and merge it into a dictionary with hgnc_id as key and gene information as values .