(self, q: str, *, types: Optional[Iterable[str]] = ['track', 'playlist', 'artist', 'album'], limit: Optional[int] = 20, offset: Optional[int] = 0, market: Optional[str] = None)

return {key: [_TYPES[obj['type']](self, obj) for obj in value['items']] for key, value in data.items()}

async
def
Func
(
arg_0
,
arg_1
:
arg_2
,
*
,
arg_3
:
arg_4
[
arg_5
[
arg_2
]
]
=
[
'track'
,
'playlist'
,
'artist'
,
'album'
]
,
arg_6
:
arg_4
[
arg_7
]
=
20
,
arg_8
:
arg_4
[
arg_7
]
=
0
,
arg_9
:
arg_4
[
arg_2
]
=
)
->
Dict
[
arg_2
,
List
[
Union
[
Track
,
Playlist
,
Artist
,
Album
]
]
]
:
if
not
hasattr
(
arg_3
,
'__iter__'
)
:
raise
TypeError
(
'types must be an iterable.'
)
elif
not
isinstance
(
arg_3
,
list
)
:
arg_3
=
list
(
item
for
item
in
arg_3
)
arg_10
=
set
(
arg_3
)
if
not
arg_10
.
issubset
(
_SEARCH_TYPES
)
:
raise
ValueError
(
_SEARCH_TYPE_ERR
%
arg_10
.
difference
(
_SEARCH_TYPES
)
.
pop
(
)
)
arg_11
=
{
'q'
:
arg_1
.
replace
(
' '
,
'+'
)
,
'queary_type'
:
','
.
join
(
tp
.
strip
(
)
for
tp
in
arg_3
)
,
'market'
:
arg_9
,
'limit'
:
arg_6
,
'offset'
:
arg_8
}
arg_12
=
await
arg_0
.
http
.
Func
(
**
arg_11
)
return
{
arg_14
:
[
_TYPES
[
arg_13
[
'type'
]
]
(
arg_0
,
arg_13
)
for
arg_13
in
arg_15
[
'items'
]
]
for
arg_14
,
arg_15
in
arg_12
.
items
(
)
}

async def Func(arg_0, arg_1: arg_2, *, arg_3: arg_4[arg_5[arg_2]] = ['track', 'playlist', 'artist', 'album'], arg_6: arg_4[arg_7] = 20, arg_8: arg_4[arg_7] = 0, arg_9: arg_4[arg_2] = None) -> Dict[arg_2, List[Union[Track, Playlist, Artist, Album]]]:
        """Access the spotify Func functionality.

        Parameters
        ----------
        q : str
            the Func query
        types : Optional[Iterable[str]]
            A sequence of Func types (can be any of `track`, `playlist`, `artist` or `album`) to refine the Func request.
            A `ValueError` may be raised if a Func type is found that is not valid.
        limit : Optional[int]
            The limit of Func results to return when Funcing.
            Maximum limit is 50, any larger may raise a :class:`HTTPException`
        offset : Optional[int]
            The offset from where the api should start from in the Func results.
        market : Optional[str]
            An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking.

        Returns
        -------
        results : Dict[str, List[Union[Track, Playlist, Artist, Album]]]
            The results of the Func.
        """
        if not hasattr(arg_3, '__iter__'):
            raise TypeError('types must be an iterable.')

        elif not isinstance(arg_3, list):
            arg_3 = list(item for item in arg_3)

        arg_10 = set(arg_3)

        if not arg_10.issubset(_SEARCH_TYPES):
            raise ValueError(_SEARCH_TYPE_ERR % arg_10.difference(_SEARCH_TYPES).pop())

        arg_11 = {
            'q': arg_1.replace(' ', '+'),
            'queary_type': ','.join(tp.strip() for tp in arg_3),
            'market': arg_9,
            'limit': arg_6,
            'offset': arg_8
        }

        arg_12 = await arg_0.http.Func(**arg_11)

        return {arg_14: [_TYPES[arg_13['type']](arg_0, arg_13) for arg_13 in arg_15['items']] for arg_14, arg_15 in arg_12.items()}

Access the spotify search functionality.

        Parameters
        ----------
        q : str
            the search query
        types : Optional[Iterable[str]]
            A sequence of search types (can be any of `track`, `playlist`, `artist` or `album`) to refine the search request.
            A `ValueError` may be raised if a search type is found that is not valid.
        limit : Optional[int]
            The limit of search results to return when searching.
            Maximum limit is 50, any larger may raise a :class:`HTTPException`
        offset : Optional[int]
            The offset from where the api should start from in the search results.
        market : Optional[str]
            An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking.

        Returns
        -------
        results : Dict[str, List[Union[Track, Playlist, Artist, Album]]]
            The results of the search.

Access the spotify search functionality .


def Func ( arg_0 , arg_1 = None ) : if hasattr ( arg_0 , 'metadata' ) : if arg_1 is not None : arg_0 . metadata = AnnotatedMetadata ( arg_0 , arg_1 ) return arg_0 arg_0 . metadata = AnnotatedMetadata ( arg_0 , arg_1 ) arg_0 . finalizer = False arg_0 . takes_cmdline = False arg_0 . decorated = False arg_0 . context = False return arg_0

def Func(arg_0, arg_1=None):
    """Mark a function as callable from the command line.

    This function is meant to be called as decorator.  This function
    also initializes metadata about the function's arguments that is
    built up by the param decorator.

    Args:
        func (callable): The function that we wish to mark as callable
            from the command line.
        name (str): Optional string that will override the function's
            built-in name.
    """

    if hasattr(arg_0, 'metadata'):
        if arg_1 is not None:
            arg_0.metadata = AnnotatedMetadata(arg_0, arg_1)
        return arg_0

    arg_0.metadata = AnnotatedMetadata(arg_0, arg_1)

    arg_0.finalizer = False
    arg_0.takes_cmdline = False
    arg_0.decorated = False
    arg_0.context = False

    return arg_0

Mark a function as callable from the command line .


(self,
               shuffled=True,
               cohesion=100,
               separation=10,
               alignment=5,
               goal=20,
               limit=30)

def Func(arg_0,
               arg_1=True,
               arg_2=100,
               arg_3=10,
               arg_4=5,
               arg_5=20,
               arg_6=30):

        """ Calculates the next motion frame for the flock.
        """

        # Shuffling the list of boids ensures fluid movement.
        # If you need the boids to retain their position in the list
        # each Func, set the shuffled parameter to False.
        from random import shuffle
        if arg_1: shuffle(arg_0)

        arg_7 = 1.0 # cohesion
        arg_8 = 1.0 # separation
        arg_9 = 1.0 # alignment
        arg_10 = 1.0 # goal

        # The flock scatters randomly with a Boids.scatter chance.
        # This means their cohesion (m1) is reversed,
        # and their joint alignment (m3) is dimished,
        # causing boids to oscillate in confusion.
        # Setting Boids.scatter(chance=0) ensures they never scatter.
        if not arg_0.scattered and _ctx.random() < arg_0._scatter:
            arg_0.scattered = True
        if arg_0.scattered:
            arg_7 = -arg_7
            arg_9 *= 0.25
            arg_0._scatter_i += 1
        if arg_0._scatter_i >= arg_0._scatter_t:
            arg_0.scattered = False
            arg_0._scatter_i = 0

        # A flock can have a goal defined with Boids.goal(x,y,z),
        # a place of interest to flock around.
        if not arg_0.has_goal:
            arg_10 = 0
        if arg_0.flee:
            arg_10 = -arg_10

        for arg_13 in arg_0:

            # A boid that is perching will continue to do so
            # until Boid._perch_t reaches zero.
            if arg_13.is_perching:
                if arg_13._perch_t > 0:
                    arg_13._perch_t -= 1
                    continue
                else:
                    arg_13.is_perching = False

            arg_15, arg_16, arg_17 = arg_13.cohesion(arg_2)
            arg_18, arg_19, arg_20 = arg_13.separation(arg_3)
            arg_21, arg_22, arg_23 = arg_13.alignment(arg_4)
            arg_24, arg_25, arg_26 = arg_13.goal(arg_0._gx, arg_0._gy, arg_0._gz, arg_5)

            arg_13.vx += arg_7*arg_15 + arg_8*arg_18 + arg_9*arg_21 + arg_10*arg_24
            arg_13.vy += arg_7*arg_16 + arg_8*arg_19 + arg_9*arg_22 + arg_10*arg_25
            arg_13.vz += arg_7*arg_17 + arg_8*arg_20 + arg_9*arg_23 + arg_10*arg_26

            arg_13.limit(arg_6)

            arg_13.x += arg_13.vx
            arg_13.y += arg_13.vy
            arg_13.z += arg_13.vz

        arg_0.constrain()

Calculates the next motion frame for the flock .


return itertools.chain(
        *from_bounds(
            *out_bounds, transform=in_affine, height=in_shape[-2], width=in_shape[-1]
        ).round_lengths(pixel_precision=0).round_offsets(pixel_precision=0).toranges()
    )

def Func ( arg_0 = None , arg_1 = None , arg_2 = None ) : return itertools . chain ( * from_bounds ( * arg_0 , transform = arg_1 , height = arg_2 [ - 2 ] , width = arg_2 [ - 1 ] ) . round_lengths ( pixel_precision = 0 ) . round_offsets ( pixel_precision = 0 ) . toranges ( ) )

def Func(arg_0=None, arg_1=None, arg_2=None):
    """
    Return bounds range values from geolocated input.

    Parameters
    ----------
    out_bounds : tuple
        left, bottom, right, top
    in_affine : Affine
        input geolocation
    in_shape : tuple
        input shape

    Returns
    -------
    minrow, maxrow, mincol, maxcol
    """
    return itertools.chain(
        *from_bounds(
            *arg_0, transform=arg_1, height=arg_2[-2], width=arg_2[-1]
        ).round_lengths(pixel_precision=0).round_offsets(pixel_precision=0).toranges()
    )

Return bounds range values from geolocated input .


Implement a lookup for object level permissions. Basically the same as
        ModelAdmin.has_change_permission, but also passes the obj parameter in.

return r and super(TreeEditor, self).has_change_permission(request, obj)

def Func ( arg_0 , arg_1 , arg_2 = None ) : if settings . TREE_EDITOR_OBJECT_PERMISSIONS : arg_3 = arg_0 . opts arg_4 = arg_1 . user . has_perm ( arg_3 . app_label + '.' + arg_3 . get_change_permission ( ) , arg_2 ) else : arg_4 = True return arg_4 and super ( TreeEditor , arg_0 ) . Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2=None):
        """
        Implement a lookup for object level permissions. Basically the same as
        ModelAdmin.Func, but also passes the obj parameter in.
        """
        if settings.TREE_EDITOR_OBJECT_PERMISSIONS:
            arg_3 = arg_0.opts
            arg_4 = arg_1.user.has_perm(arg_3.app_label + '.' + arg_3.get_change_permission(), arg_2)
        else:
            arg_4 = True

        return arg_4 and super(TreeEditor, arg_0).Func(arg_1, arg_2)

Implement a lookup for object level permissions . Basically the same as ModelAdmin . has_change_permission but also passes the obj parameter in .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , numbers . Number ) : return arg_1 else : return arg_1 . subs ( arg_0 . constants )

def Func(arg_0, arg_1):
        """Substitute constants in expression unless it is already a number."""
        if isinstance(arg_1, numbers.Number):
            return arg_1
        else:
            return arg_1.subs(arg_0.constants)

Substitute constants in expression unless it is already a number .


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

def Func(arg_0, arg_1):
    """
    Determines whether or not the target string matches any of the regular
    expressions specified.

    :param target: the string to check
    :type target: str
    :param masks: the regular expressions to check against
    :type masks: list(regular expression object)
    :returns: bool
    """

    for arg_2 in arg_1:
        if arg_2.search(arg_0):
            return True
    return False

Determines whether or not the target string matches any of the regular expressions specified .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . reset_extr_lics ( ) if validations . validate_extracted_lic_id ( arg_2 ) : arg_1 . add_extr_lic ( document . ExtractedLicense ( arg_2 ) ) return True else : raise SPDXValueError ( 'ExtractedLicense::id' )

def Func(arg_0, arg_1, arg_2):
        """Adds a new extracted license to the document.
        Raises SPDXValueError if data format is incorrect.
        """
        # FIXME: this state does not make sense
        arg_0.reset_extr_lics()
        if validations.validate_extracted_lic_id(arg_2):
            arg_1.add_extr_lic(document.ExtractedLicense(arg_2))
            return True
        else:
            raise SPDXValueError('ExtractedLicense::id')

Adds a new extracted license to the document . Raises SPDXValueError if data format is incorrect .


def
Func
(
arg_0
)
:
arg_1
=
[
'git'
,
'fetch'
,
'origin'
,
'+refs/heads/*:refs/heads/*'
,
'--prune'
]
arg_0
.
_exec
(
arg_1
,
cwd
=
arg_0
.
dirpath
,
env
=
arg_0
.
gitenv
)
logger
.
debug
(
"Git %s repository Funcd into %s"
,
arg_0
.
uri
,
arg_0
.
dirpath
)

def Func(arg_0):
        """Update repository from its remote.

        Calling this method, the repository will be synchronized with
        the remote repository using 'fetch' command for 'heads' refs.
        Any commit stored in the local copy will be removed; refs
        will be overwritten.

        :raises RepositoryError: when an error occurs updating the
            repository
        """
        arg_1 = ['git', 'fetch', 'origin', '+refs/heads/*:refs/heads/*', '--prune']
        arg_0._exec(arg_1, cwd=arg_0.dirpath, env=arg_0.gitenv)

        logger.debug("Git %s repository Funcd into %s",
                     arg_0.uri, arg_0.dirpath)


def Func(arg_0, arg_1, arg_2):
    """
    numba compiled code to get matrix fast.
    arr is a 4 x N seq matrix converted to np.int8
    I convert the numbers for ATGC into their respective index for the MAT
    matrix, and leave all others as high numbers, i.e., -==45, N==78.
    """

    ## get seq alignment and create an empty array for filling
    arg_3 = arg_10.zeros((3, 16, 16), dtype=arg_10.uint32)

    ## replace ints with small ints that index their place in the
    ## 16x16. This no longer checks for big ints to exclude, so resolve=True
    ## is now the default, TODO.
    arg_4 = -1
    for arg_5 in xrange(arg_1.shape[0]):
        if not arg_2[arg_5]:
            if not arg_1[arg_5] == arg_4:
                arg_6 = arg_0[:, arg_5]
                arg_3[0, (4*arg_6[0])+arg_6[1], (4*arg_6[2])+arg_6[3]] += 1
                arg_4 = arg_1[arg_5]

    ## fill the alternates
    arg_7 = arg_10.uint8(0)
    for arg_8 in arg_10.array([0, 4, 8, 12], dtype=arg_10.uint8):
        for arg_9 in arg_10.array([0, 4, 8, 12], dtype=arg_10.uint8):
            arg_3[1, arg_8:arg_8+arg_10.uint8(4), arg_9:arg_9+arg_10.uint8(4)] = arg_3[0, arg_7].reshape(4, 4)
            arg_3[2, arg_8:arg_8+arg_10.uint8(4), arg_9:arg_9+arg_10.uint8(4)] = arg_3[0, arg_7].reshape(4, 4).T
            arg_7 += arg_10.uint8(1)

    return arg_3

numba compiled code to get matrix fast . arr is a 4 x N seq matrix converted to np . int8 I convert the numbers for ATGC into their respective index for the MAT matrix and leave all others as high numbers i . e . - == 45 N == 78 .


def Func(arg_0, arg_1):
        """
        Checks if the executor agrees with the state of task instances
        that are running

        :param running: dict of key, task to verify
        """
        arg_2 = arg_0.executor

        for arg_3, arg_4 in list(arg_2.get_event_buffer().items()):
            if arg_3 not in arg_1:
                arg_0.log.warning(
                    "%s state %s not in running=%s",
                    arg_3, arg_4, arg_1.values()
                )
                continue

            arg_5 = arg_1[arg_3]
            arg_5.refresh_from_db()

            arg_0.log.debug("Executor state: %s task %s", arg_4, arg_5)

            if arg_4 == State.FAILED or arg_4 == State.SUCCESS:
                if arg_5.state == State.RUNNING or arg_5.state == State.QUEUED:
                    arg_6 = ("Executor reports task instance {} finished ({}) "
                           "although the task says its {}. Was the task "
                           "killed externally?".format(arg_5, arg_4, arg_5.state))
                    arg_0.log.error(arg_6)
                    arg_5.handle_failure(arg_6)


def
Func
(
arg_0
)
:
print
(
"%s# %s%s%s"
%
(
PR_EMPH_CC
,
get_time_stamp
(
)
,
arg_0
,
PR_NC
)
)
sys
.
stdout
.
flush
(
)

def Func(arg_0):
    """Print, emphasized 'neutral', the given 'txt' message"""

    print("%s# %s%s%s" % (PR_EMPH_CC, get_time_stamp(), arg_0, PR_NC))
    sys.stdout.flush()

Print emphasized neutral the given txt message


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
)
:
from
argon2
.
low_level
import
hash_secret_raw
,
Type
from
Crypto
.
Cipher
import
AES
arg_4
=
arg_0
.
_get_mode
(
arg_0
.
aesmode
)
if
arg_4
is
:
raise
ValueError
(
'invalid AES mode: %s'
%
arg_0
.
aesmode
)
arg_5
=
hash_secret_raw
(
secret
=
arg_1
.
encode
(
arg_0
.
password_encoding
)
,
arg_2
=
arg_2
,
time_cost
=
arg_0
.
time_cost
,
memory_cost
=
arg_0
.
memory_cost
,
parallelism
=
arg_0
.
parallelism
,
hash_len
=
16
,
type
=
Type
.
ID
)
return
AES
.
new
(
arg_5
,
arg_4
,
arg_3
)

def Func(arg_0, arg_1, arg_2, arg_3 = None):
        """
        Create the cipher object to encrypt or decrypt a payload.
        """
        from argon2.low_level import hash_secret_raw, Type
        from Crypto.Cipher import AES

        arg_4 = arg_0._get_mode(arg_0.aesmode)
        if arg_4 is None:     # pragma: no cover
            raise ValueError('invalid AES mode: %s' % arg_0.aesmode)

        arg_5 = hash_secret_raw(
            secret = arg_1.encode(arg_0.password_encoding),
            arg_2 = arg_2,
            time_cost = arg_0.time_cost,
            memory_cost = arg_0.memory_cost,
            parallelism = arg_0.parallelism,
            hash_len = 16,
            type = Type.ID)

        return AES.new(arg_5, arg_4, arg_3)

Create the cipher object to encrypt or decrypt a payload .


def Func ( arg_0 , arg_1 ) : arg_2 = sequences . file_reader ( arg_0 ) arg_3 = utils . open_file_write ( arg_1 ) for arg_4 in arg_2 : print ( "SEQUENCE_ID=" + arg_4 . id , file = arg_3 ) print ( "SEQUENCE_TEMPLATE=" + arg_4 . seq , file = arg_3 ) print ( "=" , file = arg_3 ) utils . close ( arg_3 )

def Func(arg_0, arg_1):
    '''Converts input sequence file into a "Boulder-IO format", as used by primer3'''
    arg_2 = sequences.file_reader(arg_0)
    arg_3 = utils.open_file_write(arg_1)

    for arg_4 in arg_2:
        print("SEQUENCE_ID=" + arg_4.id, file=arg_3)
        print("SEQUENCE_TEMPLATE=" + arg_4.seq, file=arg_3)
        print("=", file=arg_3)

    utils.close(arg_3)

Converts input sequence file into a Boulder - IO format as used by primer3


def Func ( arg_0 , arg_1 ) : import numpy as np arg_2 = [ ] arg_3 = len ( arg_0 ) for arg_4 in range ( 0 , arg_3 - 1 ) : arg_5 = 1. / ( arg_3 - arg_4 ) * np . sum ( arg_0 [ arg_4 + 1 : ] ) arg_6 = np . prod ( arg_0 [ arg_4 + 1 : ] ** ( 1. / ( arg_3 - arg_4 ) ) ) arg_2 . append ( - 2. * ( arg_3 - arg_4 ) * arg_1 * np . log ( arg_6 / arg_5 ) + 2. * arg_4 * ( 2. * arg_3 - arg_4 ) ) return arg_2

def Func(arg_0, arg_1):
    r"""AIC order-selection using eigen values

    :param s: a list of `p` sorted eigen values
    :param N: the size of the input data. To be defined precisely.

    :return:
        * an array containing the AIC values

    Given :math:`n` sorted eigen values :math:`\lambda_i` with
    :math:`0 <= i < n`, the proposed criterion from Wax and Kailath (1985)
    is:

    .. math:: AIC(k) = -2(n-k)N \ln \frac{g(k)}{a(k)} + 2k(2n-k)

    where the arithmetic sum :math:`a(k)` is:

    .. math:: a(k) = \sum_{i=k+1}^{n}\lambda_i

    and the geometric sum :math:`g(k)` is:

    .. math:: g(k) = \prod_{i=k+1}^{n} \lambda_i^{-(n-k)}

    The number of relevant sinusoids in the signal subspace is determined by
    selecting the minimum of `AIC`.

    .. seealso:: :func:`~spectrum.eigenfreq.eigen`
    .. todo:: define precisely the input parameter N. Should be the input
       data length but when using correlation matrix (SVD), I suspect it
       should be the length of the correlation matrix rather than the
       original data.

    :References:
        * [Marple]_ Chap 13,
        * [Wax]_
    """
    import numpy as np

    arg_2 = []
    arg_3 = len(arg_0)
    for arg_4 in range(0, arg_3-1):
        arg_5 = 1./(arg_3-arg_4) * np.sum(arg_0[arg_4+1:])
        arg_6 = np.prod(arg_0[arg_4+1:]**(1./(arg_3-arg_4)))
        arg_2.append( -2.*(arg_3-arg_4)*arg_1 * np.log(arg_6/arg_5) + 2.*arg_4*(2.*arg_3-arg_4))

    return arg_2

r AIC order - selection using eigen values


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_1
=
check_sequence_dictionary
(
arg_1
)
arg_2
=
arg_0
.
_check_peptide_lengths
(
arg_2
)
arg_3
=
[
]
arg_4
=
set
(
[
]
)
arg_5
=
[
]
for
arg_6
,
arg_7
in
arg_1
.
items
(
)
:
for
arg_8
in
arg_2
:
for
arg_9
in
range
(
len
(
arg_7
)
arg_8
+
1
)
:
arg_4
.
add
(
arg_7
[
arg_9
:
arg_9
+
arg_8
]
)
arg_0
.
_check_peptide_inputs
(
arg_4
)
for
arg_10
in
arg_0
.
alleles
:
arg_10
=
normalize_allele_name
(
arg_10
,
omit_dra1
=
True
)
arg_5
.
append
(
arg_10
)
arg_11
=
arg_0
.
_get_iedb_request_params
(
arg_7
,
arg_10
)
logger
.
info
(
"Calling IEDB (%s) with request %s"
,
arg_0
.
url
,
arg_11
)
arg_12
=
_query_iedb
(
arg_11
,
arg_0
.
url
)
for
arg_13
,
arg_14
in
arg_12
.
iterrows
(
)
:
arg_3
.
append
(
BindingPrediction
(
source_sequence_name
=
arg_6
,
offset
=
arg_14
[
'start'
]
1
,
arg_10
=
arg_14
[
'allele'
]
,
peptide
=
arg_14
[
'peptide'
]
,
affinity
=
arg_14
[
'ic50'
]
,
percentile_rank
=
arg_14
[
'rank'
]
,
prediction_method_name
=
"iedb-"
+
arg_0
.
prediction_method
)
)
arg_0
.
_check_results
(
arg_3
,
alleles
=
arg_5
,
peptides
=
arg_4
)
return
BindingPredictionCollection
(
arg_3
)

def Func(arg_0, arg_1, arg_2=None):
        """Given a dictionary mapping unique keys to amino acid sequences,
        run MHC binding predictions on all candidate epitopes extracted from
        sequences and return a EpitopeCollection.

        Parameters
        ----------
        fasta_dictionary : dict or string
            Mapping of protein identifiers to protein amino acid sequences.
            If string then converted to dictionary.
        """
        arg_1 = check_sequence_dictionary(arg_1)
        arg_2 = arg_0._check_peptide_lengths(arg_2)

        # take each mutated sequence in the dataframe
        # and general MHC binding scores for all k-mer substrings
        arg_3 = []
        arg_4 = set([])

        arg_5 = []
        for arg_6, arg_7 in arg_1.items():
            for arg_8 in arg_2:
                for arg_9 in range(len(arg_7) - arg_8 + 1):
                    arg_4.add(arg_7[arg_9:arg_9 + arg_8])
            arg_0._check_peptide_inputs(arg_4)
            for arg_10 in arg_0.alleles:
                # IEDB MHCII predictor expects DRA1 to be omitted.
                arg_10 = normalize_allele_name(arg_10, omit_dra1=True)
                arg_5.append(arg_10)
                arg_11 = arg_0._get_iedb_request_params(
                    arg_7, arg_10)
                logger.info(
                    "Calling IEDB (%s) with request %s",
                    arg_0.url,
                    arg_11)
                arg_12 = _query_iedb(arg_11, arg_0.url)
                for arg_13, arg_14 in arg_12.iterrows():
                    arg_3.append(
                        BindingPrediction(
                            source_sequence_name=arg_6,
                            offset=arg_14['start'] - 1,
                            arg_10=arg_14['allele'],
                            peptide=arg_14['peptide'],
                            affinity=arg_14['ic50'],
                            percentile_rank=arg_14['rank'],
                            prediction_method_name="iedb-" + arg_0.prediction_method))
        arg_0._check_results(
            arg_3,
            alleles=arg_5,
            peptides=arg_4)
        return BindingPredictionCollection(arg_3)

Given a dictionary mapping unique keys to amino acid sequences run MHC binding predictions on all candidate epitopes extracted from sequences and return a EpitopeCollection .


(context, prefix=None, identity_func=None, user=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : if arg_1 is not None : try : return arg_0 [ '%s_identity' % arg_1 ] except KeyError : pass try : return arg_0 [ 'analytical_identity' ] except KeyError : pass if getattr ( settings , 'ANALYTICAL_AUTO_IDENTIFY' , True ) : try : if arg_3 is None : arg_3 = get_user_from_context ( arg_0 ) if get_user_is_authenticated ( arg_3 ) : if arg_2 is not None : return arg_2 ( arg_3 ) else : return arg_3 . get_username ( ) except ( KeyError , AttributeError ) : pass return None

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
    """
    Get the identity of a logged in user from a template context.

    The `prefix` argument is used to provide different identities to
    different analytics services.  The `identity_func` argument is a
    function that returns the identity of the user; by default the
    identity is the username.
    """
    if arg_1 is not None:
        try:
            return arg_0['%s_identity' % arg_1]
        except KeyError:
            pass
    try:
        return arg_0['analytical_identity']
    except KeyError:
        pass
    if getattr(settings, 'ANALYTICAL_AUTO_IDENTIFY', True):
        try:
            if arg_3 is None:
                arg_3 = get_user_from_context(arg_0)
            if get_user_is_authenticated(arg_3):
                if arg_2 is not None:
                    return arg_2(arg_3)
                else:
                    return arg_3.get_username()
        except (KeyError, AttributeError):
            pass
    return None

Get the identity of a logged in user from a template context .


def Func(arg_0, arg_1):
    """
    Extracts info from the stored proto states and
    convert it into representation that is exposed using
    the API.
    This method is called on any change for the topology.
    For example, when a container moves and its host or some
    port changes. All the information is parsed all over
    again and cache is updated.
    """
    # Execution state is the most basic info.
    # If there is no execution state, just return
    # as the rest of the things don't matter.
    if not arg_1.execution_state:
      Log.info("No execution state found for: " + arg_1.name)
      return

    Log.info("Setting topology info for topology: " + arg_1.name)
    arg_2 = True
    if not arg_1.physical_plan:
      arg_2 = False

    Log.info("Setting topology info for topology: " + arg_1.name)
    arg_3 = True
    if not arg_1.packing_plan:
      arg_3 = False

    arg_4 = True
    if not arg_1.tmaster:
      arg_4 = False

    arg_5 = True
    if not arg_1.scheduler_location:
      arg_5 = False

    arg_6 = {
        "name": arg_1.name,
        "id": arg_1.id,
        "logical_plan": None,
        "physical_plan": None,
        "packing_plan": None,
        "execution_state": None,
        "tmaster_location": None,
        "scheduler_location": None,
    }

    arg_7 = arg_0.extract_execution_state(arg_1)
    arg_7["has_physical_plan"] = arg_2
    arg_7["has_packing_plan"] = arg_3
    arg_7["has_tmaster_location"] = arg_4
    arg_7["has_scheduler_location"] = arg_5
    arg_7["status"] = arg_1.get_status()

    arg_6["metadata"] = arg_0.extract_metadata(arg_1)
    arg_6["runtime_state"] = arg_0.extract_runtime_state(arg_1)

    arg_6["execution_state"] = arg_7
    arg_6["logical_plan"] = arg_0.extract_logical_plan(arg_1)
    arg_6["physical_plan"] = arg_0.extract_physical_plan(arg_1)
    arg_6["packing_plan"] = arg_0.extract_packing_plan(arg_1)
    arg_6["tmaster_location"] = arg_0.extract_tmaster(arg_1)
    arg_6["scheduler_location"] = arg_0.extract_scheduler_location(arg_1)

    arg_0.topologyInfos[(arg_1.name, arg_1.state_manager_name)] = arg_6

Extracts info from the stored proto states and convert it into representation that is exposed using the API . This method is called on any change for the topology . For example when a container moves and its host or some port changes . All the information is parsed all over again and cache is updated .


def Func ( arg_0 ) : arg_1 = urlparse ( arg_0 ) arg_2 = arg_1 . path . rstrip ( '/' ) . split ( '/' ) arg_3 = arg_2 [ - 1 ] arg_3 = unquote ( arg_3 ) return arg_3

def Func(arg_0):
    """Given an archive URI, parse to a split ident-hash."""
    arg_1 = urlparse(arg_0)
    arg_2 = arg_1.path.rstrip('/').split('/')
    arg_3 = arg_2[-1]
    arg_3 = unquote(arg_3)
    return arg_3

Given an archive URI parse to a split ident - hash .


(self, topic_name, subscription_name,
                                    sequence_number, lock_token)

def Func(arg_0, arg_1, arg_2,
                                    arg_3, arg_4):
        '''
        Unlock a message for processing by other receivers on a given
        subscription. This operation deletes the lock object, causing the
        message to be unlocked. A message must have first been locked by a
        receiver before this operation is called.

        topic_name:
            Name of the topic.
        subscription_name:
            Name of the subscription.
        sequence_number:
            The sequence number of the message to be unlocked as returned in
            BrokerProperties['SequenceNumber'] by the Peek Message operation.
        lock_token:
            The ID of the lock as returned by the Peek Message operation in
            BrokerProperties['LockToken']
        '''
        _validate_not_none('topic_name', arg_1)
        _validate_not_none('subscription_name', arg_2)
        _validate_not_none('sequence_number', arg_3)
        _validate_not_none('lock_token', arg_4)
        arg_5 = HTTPRequest()
        arg_5.method = 'PUT'
        arg_5.host = arg_0._get_host()
        arg_5.path = '/' + _str(arg_1) + \
                       '/subscriptions/' + str(arg_2) + \
                       '/messages/' + _str(arg_3) + \
                       '/' + _str(arg_4) + ''
        arg_5.path, arg_5.query = arg_0._httpclient._update_request_uri_query(arg_5)  # pylint: disable=protected-access
        arg_5.headers = arg_0._update_service_bus_header(arg_5)
        arg_0._perform_request(arg_5)

Unlock a message for processing by other receivers on a given subscription . This operation deletes the lock object causing the message to be unlocked . A message must have first been locked by a receiver before this operation is called .


(dates,
                  years=0, months=0, weeks=0, days=0, firstweekday=SATURDAY,
                  now=None)

return set(dt.date() for dt in datetimes)

def Func ( arg_0 , arg_1 = 0 , arg_2 = 0 , arg_3 = 0 , arg_4 = 0 , arg_5 = arg_6 , arg_7 = None ) : arg_8 = to_keep ( ( datetime . combine ( d , time ( ) ) for d in arg_0 ) , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , hours = 0 , minutes = 0 , seconds = 0 , arg_5 = arg_5 , arg_7 = arg_7 ) return set ( arg_9 . date ( ) for arg_9 in arg_8 )

def Func(arg_0,
                  arg_1=0, arg_2=0, arg_3=0, arg_4=0, arg_5=arg_6,
                  arg_7=None):
    """
    Return a set of dates that should be kept, out of ``dates``.

    See ``to_keep`` for a description of arguments.
    """
    arg_8 = to_keep((datetime.combine(d, time()) for d in arg_0),
                        arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4,
                        hours=0, minutes=0, seconds=0,
                        arg_5=arg_5, arg_7=arg_7)
    return set(arg_9.date() for arg_9 in arg_8)

Return a set of dates that should be kept out of dates .


def Func(arg_0, arg_1):
        """ Insert list of patches at the front of the curent patches list """
        arg_2 = []
        for arg_3 in arg_1:
            arg_4 = PatchLine(arg_3)
            arg_5 = arg_4.get_patch()
            if arg_5:
                arg_0.patch2line[arg_5] = arg_4
            arg_2.append(arg_4)
        arg_2.extend(arg_0.patchlines)
        arg_0.patchlines = arg_2


return self._group_issues(self._cleaned_issues, keyfunc, sortby)

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Retrieves the issues in the collection grouped into buckets according
        to the key generated by the keyfunc.

        :param keyfunc:
            a function that will be used to generate the key that identifies
            the group that an issue will be assigned to. This function receives
            a single tidypy.Issue argument and must return a string. If not
            specified, the filename of the issue will be used.
        :type keyfunc: func
        :param sortby: the properties to sort the issues by
        :type sortby: list(str)
        :rtype: OrderedDict
        """

        if not arg_1:
            arg_1 = default_group
        if not arg_2:
            arg_2 = arg_0.DEFAULT_SORT
        arg_0._ensure_cleaned_issues()
        return arg_0._group_issues(arg_0._cleaned_issues, arg_1, arg_2)

Retrieves the issues in the collection grouped into buckets according to the key generated by the keyfunc .


def Func ( arg_0 ) : if not mcmc_util . is_list_like ( arg_0 ) : arg_0 = [ arg_0 ] def fn ( arg_1 ) : return [ arg_2 . forward ( arg_3 ) for arg_2 , arg_3 in zip ( arg_0 , arg_1 ) ] return fn

def Func(arg_0):
  """Makes a function which applies a list of Bijectors' `forward`s."""
  if not mcmc_util.is_list_like(arg_0):
    arg_0 = [arg_0]

  def fn(arg_1):
    return [arg_2.forward(arg_3) for arg_2, arg_3 in zip(arg_0, arg_1)]

  return fn

Makes a function which applies a list of Bijectors forward s .


def Func ( arg_0 , arg_1 ) : inshape ( arg_0 . shape , arg_1 ) arg_2 = [ ( a - arg_0 . split ) for a in arg_1 if a >= arg_0 . split ] arg_3 = [ a for a in range ( arg_0 . split ) if a not in arg_1 ] if arg_2 or arg_3 : return arg_0 . swap ( arg_3 , arg_2 ) else : return arg_0

def Func(arg_0, arg_1):
        """
        Align spark bolt array so that axes for iteration are in the keys.

        This operation is applied before most functional operators.
        It ensures that the specified axes are valid, and swaps
        key/value axes so that functional operators can be applied
        over the correct records.

        Parameters
        ----------
        axis: tuple[int]
            One or more axes that wil be iterated over by a functional operator

        Returns
        -------
        BoltArraySpark
        """
        # ensure that the specified axes are valid
        inshape(arg_0.shape, arg_1)

        # find the value axes that should be moved into the keys (axis >= split)
        arg_2 = [(a - arg_0.split) for a in arg_1 if a >= arg_0.split]

        # find the key axes that should be moved into the values (axis < split)
        arg_3 = [a for a in range(arg_0.split) if a not in arg_1]

        if arg_2 or arg_3:
            return arg_0.swap(arg_3, arg_2)
        else:
            return arg_0

Align spark bolt array so that axes for iteration are in the keys .


def Func(arg_0, arg_1):
    """Sets the module's verbosity, and returns the previous setting."""
    arg_2 = arg_0.verbose_level
    arg_0.verbose_level = arg_1
    return arg_2

Sets the module s verbosity and returns the previous setting .


def Func(arg_0, arg_1):
        '''
        Adds the API key and user auth token to the query parameters
        '''
        arg_1['key'] = arg_0.api_key

        if arg_0.user_auth_token:
            arg_1['token'] = arg_0.user_auth_token

        return arg_1


def Func ( arg_0 , arg_1 , arg_2 = "" ) : return os . path . exists ( arg_0 . resourceNameToPath ( arg_1 , arg_2 ) )

def Func(arg_0,arg_1,arg_2=""):
        """
        Returns whether or not the resource with the given name and extension exists.

        This must not mean that the resource is meaningful, it simply signals that the file exists.
        """
        return os.path.exists(arg_0.resourceNameToPath(arg_1,arg_2))

Returns whether or not the resource with the given name and extension exists . This must not mean that the resource is meaningful it simply signals that the file exists .


Returns uptime in seconds if even remotely possible, or None if not.

return {'amiga': _uptime_amiga,
            'aros12': _uptime_amiga,
            'beos5': _uptime_beos,
            'cygwin': _uptime_linux,
            'darwin': _uptime_osx,
            'haiku1': _uptime_beos,
            'linux': _uptime_linux,
            'linux-armv71': _uptime_linux,
            'linux2': _uptime_linux,
            'mac': _uptime_mac,
            'minix3': _uptime_minix,
            'riscos': _uptime_riscos,
            'sunos5': _uptime_solaris,
            'syllable': _uptime_syllable,
            'win32': _uptime_windows,
            'wince': _uptime_windows}.get(sys.platform, _uptime_bsd)() or \
           _uptime_bsd() or _uptime_plan9() or _uptime_linux() or \
           _uptime_windows() or _uptime_solaris() or _uptime_beos() or \
           _uptime_amiga() or _uptime_riscos() or _uptime_posix() or \
           _uptime_syllable() or _uptime_mac() or _uptime_osx()

def Func ( ) : if __boottime is not None : return time . time ( ) - __boottime return { 'amiga' : _Func_amiga , 'aros12' : _Func_amiga , 'beos5' : _Func_beos , 'cygwin' : _Func_linux , 'darwin' : _Func_osx , 'haiku1' : _Func_beos , 'linux' : _Func_linux , 'linux-armv71' : _Func_linux , 'linux2' : _Func_linux , 'mac' : _Func_mac , 'minix3' : _Func_minix , 'riscos' : _Func_riscos , 'sunos5' : _Func_solaris , 'syllable' : _Func_syllable , 'win32' : _Func_windows , 'wince' : _Func_windows } . get ( sys . platform , _Func_bsd ) ( ) or _Func_bsd ( ) or _Func_plan9 ( ) or _Func_linux ( ) or _Func_windows ( ) or _Func_solaris ( ) or _Func_beos ( ) or _Func_amiga ( ) or _Func_riscos ( ) or _Func_posix ( ) or _Func_syllable ( ) or _Func_mac ( ) or _Func_osx ( )

def Func():
    """Returns Func in seconds if even remotely possible, or None if not."""
    if __boottime is not None:
        return time.time() - __boottime

    return {'amiga': _Func_amiga,
            'aros12': _Func_amiga,
            'beos5': _Func_beos,
            'cygwin': _Func_linux,
            'darwin': _Func_osx,
            'haiku1': _Func_beos,
            'linux': _Func_linux,
            'linux-armv71': _Func_linux,
            'linux2': _Func_linux,
            'mac': _Func_mac,
            'minix3': _Func_minix,
            'riscos': _Func_riscos,
            'sunos5': _Func_solaris,
            'syllable': _Func_syllable,
            'win32': _Func_windows,
            'wince': _Func_windows}.get(sys.platform, _Func_bsd)() or \
           _Func_bsd() or _Func_plan9() or _Func_linux() or \
           _Func_windows() or _Func_solaris() or _Func_beos() or \
           _Func_amiga() or _Func_riscos() or _Func_posix() or \
           _Func_syllable() or _Func_mac() or _Func_osx()

Returns uptime in seconds if even remotely possible or None if not .


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : arg_4 = [ obj_or_import_string ( func ) for func in arg_3 . get ( 'event_builders' , [ ] ) ] arg_5 = obj_or_import_string ( arg_3 [ 'signal' ] ) arg_5 . connect ( EventEmmiter ( arg_2 , arg_4 ) , sender = arg_0 , weak = False )

def Func(arg_0, arg_1):
    """Register signal receivers which send events."""
    for arg_2, arg_3 in arg_1.items():
        arg_4 = [
            obj_or_import_string(func)
            for func in arg_3.get('event_builders', [])
        ]

        arg_5 = obj_or_import_string(arg_3['signal'])
        arg_5.connect(
            EventEmmiter(arg_2, arg_4), sender=arg_0, weak=False
        )

Register signal receivers which send events .


return newdt._frame(rows=nrows, cols=cols, fill_cache=True)

def Func(arg_0, arg_1=10, arg_2=200):
        """
        Return the first ``rows`` and ``cols`` of the frame as a new H2OFrame.

        :param int rows: maximum number of rows to return
        :param int cols: maximum number of columns to return
        :returns: a new H2OFrame cut from the top left corner of the current frame, and having dimensions at
            most ``rows`` x ``cols``.
        """
        assert_is_type(arg_1, int)
        assert_is_type(arg_2, int)
        arg_3 = min(arg_0.nrows, arg_1)
        arg_4 = min(arg_0.ncols, arg_2)
        arg_5 = arg_0[:arg_3, :arg_4]
        return arg_5._frame(arg_1=arg_3, arg_2=arg_2, fill_cache=True)

Return the first rows and cols of the frame as a new H2OFrame .


def Func(arg_0, arg_1, arg_2=False):
        """Return the charge parent of a given molecule.

        The charge parent is the uncharged version of the fragment parent.

        :param mol: The input molecule.
        :type mol: rdkit.Chem.rdchem.Mol
        :param bool skip_standardize: Set to True if mol has already been standardized.
        :returns: The charge parent molecule.
        :rtype: rdkit.Chem.rdchem.Mol
        """
        # TODO: All ionized acids and bases should be neutralised.
        if not arg_2:
            arg_1 = arg_0.standardize(arg_1)
        arg_3 = arg_0.fragment_parent(arg_1, arg_2=True)
        if arg_3:
            arg_4 = arg_0.uncharge(arg_3)
            # During final standardization, the Reionizer ensures any remaining charges are in the right places
            arg_4 = arg_0.standardize(arg_4)
            return arg_4

Return the charge parent of a given molecule .


def Func(arg_0):
        """Initialize the parsing process."""
        arg_0._instruction_library = arg_0._spec.new_default_instructions()
        arg_0._as_instruction = arg_0._instruction_library.as_instruction
        arg_0._id_cache = {}
        arg_0._pattern_set = None
        arg_0._inheritance_todos = []
        arg_0._instruction_todos = []


(self, layout, table_content, cols_width)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_3
=
[
size
+
1
for
size
in
arg_3
]
arg_4
=
" "
.
join
(
[
"%%-%ss"
]
*
len
(
arg_3
)
)
arg_4
=
arg_4
%
tuple
(
arg_3
)
arg_4
=
arg_4
.
split
(
" "
)
arg_5
=
"\n+"
+
"+"
.
join
(
[
"-"
*
w
for
w
in
arg_3
]
)
+
"+\n"
arg_6
=
"\n+"
+
"+"
.
join
(
[
"="
*
w
for
w
in
arg_3
]
)
+
"+\n"
arg_0
.
write
(
arg_5
)
for
arg_7
,
arg_8
in
enumerate
(
arg_2
)
:
arg_0
.
write
(
"|"
)
for
arg_9
,
arg_10
in
enumerate
(
arg_8
)
:
arg_0
.
write
(
arg_4
[
arg_9
]
%
arg_10
)
arg_0
.
write
(
"|"
)
if
arg_7
==
0
and
arg_1
.
rheaders
:
arg_0
.
write
(
arg_6
)
else
:
arg_0
.
write
(
arg_5
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """format a table"""
        arg_3 = [size + 1 for size in arg_3]
        arg_4 = " ".join(["%%-%ss"] * len(arg_3))
        arg_4 = arg_4 % tuple(arg_3)
        arg_4 = arg_4.split(" ")
        arg_5 = "\n+" + "+".join(["-" * w for w in arg_3]) + "+\n"
        arg_6 = "\n+" + "+".join(["=" * w for w in arg_3]) + "+\n"
        # FIXME: layout.cheaders
        arg_0.write(arg_5)
        for arg_7, arg_8 in enumerate(arg_2):
            arg_0.write("|")
            for arg_9, arg_10 in enumerate(arg_8):
                arg_0.write(arg_4[arg_9] % arg_10)
                arg_0.write("|")
            if arg_7 == 0 and arg_1.rheaders:
                arg_0.write(arg_6)
            else:
                arg_0.write(arg_5)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
)
:
if
arg_0
.
roster
is
:
raise
ValueError
(
"No roster"
)
arg_3
=
arg_0
.
roster
.
as_xml
(
)
if
arg_2
:
if
len
(
arg_3
)
:
arg_3
.
text
=
u'\n  '
arg_5
=
for
arg_6
in
arg_3
:
if
arg_5
is
not
:
arg_5
.
tail
=
u'\n  '
if
len
(
arg_6
)
:
arg_6
.
text
=
u'\n    '
arg_8
=
for
arg_9
in
arg_6
:
if
arg_8
is
not
:
arg_8
.
tail
=
u'\n    '
arg_8
=
arg_9
if
arg_8
is
not
:
arg_8
.
tail
=
u'\n  '
arg_5
=
arg_6
if
arg_5
is
not
:
arg_5
.
tail
=
u"\n"
arg_10
=
ElementTree
.
ElementTree
(
arg_3
)
arg_10
.
write
(
arg_1
,
"utf-8"
)

def Func(arg_0, arg_1, arg_2 = True):
        """Save the roster to an XML file.

        Can be used to save the last know roster copy for faster loading
        of a verisoned roster (if server supports that).

        :Parameters:
            - `dest`: file name or a file object
            - `pretty`: pretty-format the roster XML
        :Types:
            - `dest`: `str` or file-like object
            - `pretty`: `bool`
        """
        if arg_0.roster is None:
            raise ValueError("No roster")
        arg_3 = arg_0.roster.as_xml()
        if arg_2:
            if len(arg_3):
                arg_3.text = u'\n  '
            arg_5 = None
            for arg_6 in arg_3:
                if arg_5 is not None:
                    arg_5.tail = u'\n  '
                if len(arg_6):
                    arg_6.text = u'\n    '
                arg_8 = None
                for arg_9 in arg_6:
                    if arg_8 is not None:
                        arg_8.tail = u'\n    '
                    arg_8 = arg_9
                if arg_8 is not None:
                    arg_8.tail = u'\n  '
                arg_5 = arg_6
            if arg_5 is not None:
                arg_5.tail = u"\n"
        arg_10 = ElementTree.ElementTree(arg_3)
        arg_10.write(arg_1, "utf-8")


def Func ( arg_0 , arg_1 = 'utf8' ) : if isinstance ( arg_0 , six . binary_type ) : arg_0 = arg_0 . decode ( arg_1 ) return Query ( arg_0 , split_segments ( arg_0 ) )

def Func(arg_0, arg_1='utf8'):
    """Parse the querystring into a normalized form."""

    # Decode the text if we got bytes.
    if isinstance(arg_0, six.binary_type):
        arg_0 = arg_0.decode(arg_1)

    return Query(arg_0, split_segments(arg_0))

Parse the querystring into a normalized form .


def Func ( arg_0 ) : arg_1 = arg_0 . shape [ 0 ] arg_2 = np . zeros ( arg_0 . shape ) for arg_3 in range ( arg_1 ) : arg_2 [ arg_3 , : ] = np . asarray ( [ arg_0 [ ( arg_3 + j ) % arg_1 , j ] for j in range ( arg_1 ) ] ) return arg_2

def Func(arg_0):
    """Shifts circularly the X squre matrix in order to get a
        time-lag matrix."""
    arg_1 = arg_0.shape[0]
    arg_2 = np.zeros(arg_0.shape)
    for arg_3 in range(arg_1):
        arg_2[arg_3, :] = np.asarray([arg_0[(arg_3 + j) % arg_1, j] for j in range(arg_1)])
    return arg_2

Shifts circularly the X squre matrix in order to get a time - lag matrix .


(
            self, name, include_privacy=None, for_transfer=None, custom_headers=None, raw=False, **operation_config)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
,
arg_5
=
False
,
**
arg_6
)
:
arg_7
=
models
.
TopLevelDomainAgreementOption
(
arg_2
=
arg_2
,
arg_3
=
arg_3
)
def
internal_paging
(
arg_8
=
,
arg_5
=
False
)
:
if
not
arg_8
:
arg_9
=
arg_0
.
Func
.
metadata
[
'url'
]
arg_10
=
{
'name'
:
arg_0
.
_serialize
.
url
(
"name"
,
arg_1
,
'str'
)
,
'subscriptionId'
:
arg_0
.
_serialize
.
url
(
"self.config.subscription_id"
,
arg_0
.
config
.
subscription_id
,
'str'
)
}
arg_9
=
arg_0
.
_client
.
format_url
(
arg_9
,
**
arg_10
)
arg_11
=
{
}
arg_11
[
'api-version'
]
=
arg_0
.
_serialize
.
query
(
"self.api_version"
,
arg_0
.
api_version
,
'str'
)
else
:
arg_9
=
arg_8
arg_11
=
{
}
arg_12
=
{
}
arg_12
[
'Accept'
]
=
'application/json'
arg_12
[
'Content-Type'
]
=
'application/json; charset=utf-8'
if
arg_0
.
config
.
generate_client_request_id
:
arg_12
[
'x-ms-client-request-id'
]
=
str
(
uuid
.
uuid1
(
)
)
if
arg_4
:
arg_12
.
update
(
arg_4
)
if
arg_0
.
config
.
accept_language
is
not
:
arg_12
[
'accept-language'
]
=
arg_0
.
_serialize
.
header
(
"self.config.accept_language"
,
arg_0
.
config
.
accept_language
,
'str'
)
arg_13
=
arg_0
.
_serialize
.
body
(
arg_7
,
'TopLevelDomainAgreementOption'
)
arg_14
=
arg_0
.
_client
.
post
(
arg_9
,
arg_11
,
arg_12
,
arg_13
)
arg_15
=
arg_0
.
_client
.
send
(
arg_14
,
stream
=
False
,
**
arg_6
)
if
arg_15
.
status_code
not
in
[
200
]
:
raise
models
.
DefaultErrorResponseException
(
arg_0
.
_deserialize
,
arg_15
)
return
arg_15
arg_16
=
models
.
TldLegalAgreementPaged
(
internal_paging
,
arg_0
.
_deserialize
.
dependencies
)
if
arg_5
:
arg_17
=
{
}
arg_18
=
models
.
TldLegalAgreementPaged
(
internal_paging
,
arg_0
.
_deserialize
.
dependencies
,
arg_17
)
return
arg_18
return
arg_16

def Func(
            arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None, arg_5=False, **arg_6):
        """Gets all legal agreements that user needs to accept before purchasing a
        domain.

        Gets all legal agreements that user needs to accept before purchasing a
        domain.

        :param name: Name of the top-level domain.
        :type name: str
        :param include_privacy: If true, then the list of
         agreements will include agreements for domain privacy as well;
         otherwise, false.
        :type include_privacy: bool
        :param for_transfer: If true, then the list of agreements
         will include agreements for domain transfer as well; otherwise,
         false.
        :type for_transfer: bool
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: An iterator like instance of TldLegalAgreement
        :rtype:
         ~azure.mgmt.web.models.TldLegalAgreementPaged[~azure.mgmt.web.models.TldLegalAgreement]
        :raises:
         :class:`DefaultErrorResponseException<azure.mgmt.web.models.DefaultErrorResponseException>`
        """
        arg_7 = models.TopLevelDomainAgreementOption(arg_2=arg_2, arg_3=arg_3)

        def internal_paging(arg_8=None, arg_5=False):

            if not arg_8:
                # Construct URL
                arg_9 = arg_0.Func.metadata['url']
                arg_10 = {
                    'name': arg_0._serialize.url("name", arg_1, 'str'),
                    'subscriptionId': arg_0._serialize.url("self.config.subscription_id", arg_0.config.subscription_id, 'str')
                }
                arg_9 = arg_0._client.format_url(arg_9, **arg_10)

                # Construct parameters
                arg_11 = {}
                arg_11['api-version'] = arg_0._serialize.query("self.api_version", arg_0.api_version, 'str')

            else:
                arg_9 = arg_8
                arg_11 = {}

            # Construct headers
            arg_12 = {}
            arg_12['Accept'] = 'application/json'
            arg_12['Content-Type'] = 'application/json; charset=utf-8'
            if arg_0.config.generate_client_request_id:
                arg_12['x-ms-client-request-id'] = str(uuid.uuid1())
            if arg_4:
                arg_12.update(arg_4)
            if arg_0.config.accept_language is not None:
                arg_12['accept-language'] = arg_0._serialize.header("self.config.accept_language", arg_0.config.accept_language, 'str')

            # Construct body
            arg_13 = arg_0._serialize.body(arg_7, 'TopLevelDomainAgreementOption')

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

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

            return arg_15

        # Deserialize response
        arg_16 = models.TldLegalAgreementPaged(internal_paging, arg_0._deserialize.dependencies)

        if arg_5:
            arg_17 = {}
            arg_18 = models.TldLegalAgreementPaged(internal_paging, arg_0._deserialize.dependencies, arg_17)
            return arg_18

        return arg_16

Gets all legal agreements that user needs to accept before purchasing a domain .


return ("" if isinstance(json_str, str) else u"").join(result_str)

def Func ( arg_0 ) : arg_1 = list ( arg_0 ) arg_2 = False arg_3 = True arg_4 = False arg_5 = False arg_6 = False arg_7 = False arg_8 = False arg_9 = None for arg_10 , arg_11 in enumerate ( arg_0 ) : if arg_2 : arg_2 = False continue if arg_7 : if arg_11 != '/' and arg_11 != '*' : arg_7 = False arg_3 = True continue if arg_8 : if arg_11 != '/' : arg_8 = False if arg_11 == '"' : if arg_3 and not arg_2 : arg_6 = True arg_3 = False elif arg_6 and not arg_2 : arg_6 = False arg_3 = True elif arg_11 == '\\' : if arg_3 or arg_6 : arg_2 = True elif arg_11 == '/' : if arg_7 : arg_7 = False arg_4 = True arg_3 = False arg_9 = arg_10 - 1 elif arg_8 : arg_8 = False arg_3 = True arg_5 = False for arg_12 in range ( arg_9 , arg_10 + 1 ) : arg_1 [ arg_12 ] = "" elif arg_3 : arg_7 = True arg_3 = False elif arg_11 == '*' : if arg_7 : arg_7 = False arg_5 = True arg_3 = False arg_9 = arg_10 - 1 elif arg_5 : arg_8 = True elif arg_11 == '\n' : if arg_4 : arg_4 = False arg_3 = True for arg_12 in range ( arg_9 , arg_10 + 1 ) : arg_1 [ arg_12 ] = "" elif arg_11 == ']' or arg_11 == '}' : if arg_3 : _remove_last_comma ( arg_1 , arg_10 ) return ( "" if isinstance ( arg_0 , str ) else u"" ) . join ( arg_1 )

def Func(arg_0):
    """Clear all comments in json_str.

    Clear JS-style comments like // and /**/ in json_str.
    Accept a str or unicode as input.

    Args:
        json_str: A json string of str or unicode to clean up comment

    Returns:
        str: The str without comments (or unicode if you pass in unicode)
    """
    arg_1 = list(arg_0)
    arg_2 = False
    arg_3 = True
    arg_4 = False
    arg_5 = False
    arg_6 = False

    arg_7 = False
    arg_8 = False

    arg_9 = None

    for arg_10, arg_11 in enumerate(arg_0):

        if arg_2:  # We have just met a '\'
            arg_2 = False
            continue

        if arg_7:  # We have just met a '/'
            if arg_11 != '/' and arg_11 != '*':
                arg_7 = False
                arg_3 = True
                continue

        if arg_8:  # We have just met a '*'
            if arg_11 != '/':
                arg_8 = False

        if arg_11 == '"':
            if arg_3 and not arg_2:
                # We are now in a string
                arg_6 = True
                arg_3 = False
            elif arg_6 and not arg_2:
                # We are now out of a string
                arg_6 = False
                arg_3 = True

        elif arg_11 == '\\':
            # '\' should not take effect in comment
            if arg_3 or arg_6:
                arg_2 = True

        elif arg_11 == '/':
            if arg_7:
                # Now we are in single line comment
                arg_7 = False
                arg_4 = True
                arg_3 = False
                arg_9 = arg_10 - 1
            elif arg_8:
                # Now we are out of comment
                arg_8 = False
                arg_3 = True
                arg_5 = False
                for arg_12 in range(arg_9, arg_10 + 1):
                    arg_1[arg_12] = ""

            elif arg_3:
                # Now we are just one step away from comment
                arg_7 = True
                arg_3 = False

        elif arg_11 == '*':
            if arg_7:
                # We are now in multi-line comment
                arg_7 = False
                arg_5 = True
                arg_3 = False
                arg_9 = arg_10 - 1
            elif arg_5:
                arg_8 = True
        elif arg_11 == '\n':
            if arg_4:
                arg_4 = False
                arg_3 = True
                for arg_12 in range(arg_9, arg_10 + 1):
                    arg_1[arg_12] = ""
        elif arg_11 == ']' or arg_11 == '}':
            if arg_3:
                _remove_last_comma(arg_1, arg_10)

    # Show respect to original input if we are in python2
    return ("" if isinstance(arg_0, str) else u"").join(arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = [ slice ( d ) for d in arg_0 . shape ] arg_2 [ arg_1 ] = np . newaxis arg_3 = np . mean ( arg_0 , arg_1 = arg_1 ) return arg_0 - arg_3 [ tuple ( arg_2 ) ]

def Func(arg_0, arg_1):
    "Subtracts an estimate of the mean from signal x at axis"
    arg_2 = [slice(d) for d in arg_0.shape]
    arg_2[arg_1] = np.newaxis
    arg_3 = np.mean(arg_0, arg_1=arg_1)
    return arg_0 - arg_3[tuple(arg_2)]


def Func(arg_0):
        """Returns the current ZipkinAttrs and generates new ones if needed.

        :returns: (report_root_timestamp, zipkin_attrs)
        :rtype: (bool, ZipkinAttrs)
        """
        # This check is technically not necessary since only root spans will have
        # sample_rate, zipkin_attrs or a transport set. But it helps making the
        # code clearer by separating the logic for a root span from the one for a
        # child span.
        if arg_0._is_local_root_span:

            # If sample_rate is set, we need to (re)generate a trace context.
            # If zipkin_attrs (trace context) were passed in as argument there are
            # 2 possibilities:
            # is_sampled = False --> we keep the same trace_id but re-roll the dice
            #                        for is_sampled.
            # is_sampled = True  --> we don't want to stop sampling halfway through
            #                        a sampled trace, so we do nothing.
            # If no zipkin_attrs were passed in, we generate new ones and start a
            # new trace.
            if arg_0.sample_rate is not None:

                # If this trace is not sampled, we re-roll the dice.
                if arg_0.zipkin_attrs_override and \
                        not arg_0.zipkin_attrs_override.is_sampled:
                    # This will be the root span of the trace, so we should
                    # set timestamp and duration.
                    return True, create_attrs_for_span(
                        sample_rate=arg_0.sample_rate,
                        trace_id=arg_0.zipkin_attrs_override.trace_id,
                    )

                # If zipkin_attrs_override was not passed in, we simply generate
                # new zipkin_attrs to start a new trace.
                elif not arg_0.zipkin_attrs_override:
                    return True, create_attrs_for_span(
                        sample_rate=arg_0.sample_rate,
                        use_128bit_trace_id=arg_0.use_128bit_trace_id,
                    )

            if arg_0.firehose_handler and not arg_0.zipkin_attrs_override:
                # If it has gotten here, the only thing that is
                # causing a trace is the firehose. So we force a trace
                # with sample rate of 0
                return True, create_attrs_for_span(
                    sample_rate=0.0,
                    use_128bit_trace_id=arg_0.use_128bit_trace_id,
                )

            # If we arrive here it means the sample_rate was not set while
            # zipkin_attrs_override was, so let's simply return that.
            return False, arg_0.zipkin_attrs_override

        else:
            # Check if there's already a trace context in _context_stack.
            arg_1 = arg_0.get_tracer().get_zipkin_attrs()
            # If there's an existing context, let's create new zipkin_attrs
            # with that context as parent.
            if arg_1:
                return False, ZipkinAttrs(
                    trace_id=arg_1.trace_id,
                    span_id=generate_random_64bit_string(),
                    parent_span_id=arg_1.span_id,
                    flags=arg_1.flags,
                    is_sampled=arg_1.is_sampled,
                )

        return False, None

Returns the current ZipkinAttrs and generates new ones if needed .


def Func(arg_0):
    """
    Decorator to ensure that a submit has been performed before
    calling the method.

    Args:
        func (callable): test function to be decorated.

    Returns:
        callable: the decorated function.
    """
    @functools.wraps(arg_0)
    def _wrapper(arg_1, *arg_2, **arg_3):
        if arg_1._future is None:
            raise JobError("Job not submitted yet!. You have to .submit() first!")
        return arg_0(arg_1, *arg_2, **arg_3)
    return _wrapper

Decorator to ensure that a submit has been performed before calling the method .


(self, value, relativePath, name=None,
                          description=False, klass=False,
                          dump=False, pull=False,
                          ACID=None, verbose=False)

def Func(arg_0, arg_1, arg_2, arg_3=None,
                          arg_4=False, arg_5=False,
                          arg_6=False, arg_7=False,
                          arg_8=None, arg_9=False):
        """
        Update the value and the utc timestamp of a file that is already in the Repository.\n
        If file is not registered in repository, and error will be thrown.\n
        If file is missing in the system, it will be regenerated as dump method is called.

        :Parameters:
            #. value (object): The value of the file to update. It is any python object or a file.
            #. relativePath (str): The relative to the repository path of the directory where the file should be dumped.
            #. name (None, string): The file name.
               If None is given, name will be split from relativePath.
            #. description (False, string, pickable object): Any random description about the file.
               If False is given, the description info won't be updated,
               otherwise it will be update to what description argument value is.
            #. klass (False, class): The dumped object class. If False is given,
               the class info won't be updated, otherwise it will be update to what klass argument value is.
            #. dump (False, string): The new dump method. If False is given, the old one will be used.
            #. pull (False, string): The new pull method. If False is given, the old one will be used.
            #. ACID (boolean): Whether to ensure the ACID (Atomicity, Consistency, Isolation, Durability)
               properties of the repository upon dumping a file. This is ensured by dumping the file in
               a temporary path first and then moving it to the desired path.
               If None is given, repository ACID property will be used.
            #. verbose (boolean): Whether to be warn and informed about any abnormalities.
        """
        # check ACID
        if arg_8 is None:
            arg_8 = arg_0.__ACID
        assert isinstance(arg_8, bool), "ACID must be boolean"
        # get relative path normalized
        arg_2 = os.path.normpath(arg_2)
        if arg_2 == '.':
            arg_2 = ''
            assert arg_3 != '.pyrepinfo', "'.pyrepinfo' is not allowed as file name in main repository directory"
            assert arg_3 != '.pyrepstate', "'.pyrepstate' is not allowed as file name in main repository directory"
            assert arg_3 != '.pyreplock', "'.pyreplock' is not allowed as file name in main repository directory"
        if arg_3 is None:
            assert len(arg_2), "name must be given when relative path is given as empty string or as a simple dot '.'"
            arg_2,arg_3 = os.path.split(arg_2)
        # get file info dict
        arg_10, arg_11 = arg_0.get_file_info(arg_2, arg_3)
        assert arg_10 is not None, arg_11
        # get real path
        arg_12 = os.path.join(arg_0.__path, arg_2)
        # check if file exists
        if arg_9:
            if not os.path.isfile( os.path.join(arg_12, arg_3) ):
                warnings.warn("file '%s' is in repository but does not exist in the system. It is therefore being recreated."%os.path.join(arg_12, arg_3))
        # convert dump and pull methods to strings
        if not arg_6:
            arg_6 = arg_10["dump"]
        if not arg_7:
            arg_7 = arg_10["pull"]
        # get savePath
        if arg_8:
            arg_13 = os.path.join(tempfile.gettempdir(), arg_3)
        else:
            arg_13 = os.path.join(arg_12,arg_3)
        # dump file
        try:
            exec( arg_6.replace("$FILE_PATH", str(arg_13)) )
        except Exception as e:
            arg_14 = "unable to dump the file (%s)"%e
            if 'pickle.dump(' in arg_6:
                arg_14 += '\nmore info: %s'%str(get_pickling_errors(arg_1))
            raise Exception( arg_14 )
        # copy if ACID
        if arg_8:
            try:
                shutil.copyfile(arg_13, os.path.join(arg_12,arg_3))
            except Exception as e:
                os.remove(arg_13)
                if arg_9:
                    warnings.warn(e)
                return
            os.remove(arg_13)
        # update timestamp
        arg_10["timestamp"] = datetime.utcnow()
        if arg_4 is not False:
            arg_10["description"] = arg_4
        if arg_5 is not False:
            assert inspect.isclass(arg_5), "klass must be a class definition"
            arg_10["class"] = arg_5
        # save repository
        arg_0.save()

Update the value and the utc timestamp of a file that is already in the Repository . \ n If file is not registered in repository and error will be thrown . \ n If file is missing in the system it will be regenerated as dump method is called .


(
            self, file_path,
            content_type='application/x-vnd.oasis.opendocument.spreadsheet')

def Func(
            arg_0, arg_1,
            arg_2='application/x-vnd.oasis.opendocument.spreadsheet'):
        """
        Uploads file to GDocs spreadsheet.
        Content type can be provided as argument, default is ods.
        """
        try:
            arg_3 = arg_0.gd_client.GetResourceById(arg_0.key)
            arg_4 = gdata.data.MediaSource(
                arg_1=arg_1, arg_2=arg_2)
            arg_0.gd_client.UpdateResource(
                arg_3, arg_4=arg_4, update_metadata=True)
        except (RequestError, IOError) as e:
            raise PODocsError(e)

Uploads file to GDocs spreadsheet . Content type can be provided as argument default is ods .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
for
arg_4
,
arg_5
in
arg_3
.
iteritems
(
)
:
assert
len
(
arg_5
)
==
2
,
"Bad flag: %r:%s"
%
(
arg_4
,
arg_5
)
assert
isinstance
(
arg_5
[
0
]
,
(
dict
,
Config
)
)
,
"Bad flag: %r:%s"
%
(
arg_4
,
arg_5
)
assert
isinstance
(
arg_5
[
1
]
,
basestring
)
,
"Bad flag: %r:%s"
%
(
arg_4
,
arg_5
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """ensure flags dict is valid"""
        for arg_4,arg_5 in arg_3.iteritems():
            assert len(arg_5) == 2, "Bad flag: %r:%s"%(arg_4,arg_5)
            assert isinstance(arg_5[0], (dict, Config)), "Bad flag: %r:%s"%(arg_4,arg_5)
            assert isinstance(arg_5[1], basestring), "Bad flag: %r:%s"%(arg_4,arg_5)


def Func(arg_0, arg_1, arg_2):
  """
  template apiserver.hcl
  """
  arg_3 = arg_1[0]
  arg_4 = "%s/standalone/templates/apiserver.template.hcl" \
                              % arg_0["config_path"]
  arg_5 = "%s/standalone/resources/apiserver.hcl" % arg_0["config_path"]

  arg_6 = {
      "<heron_apiserver_hostname>": '"%s"' % get_hostname(arg_3, arg_0),
      "<heron_apiserver_executable>": '"%s/heron-apiserver"'
                                      % config.get_heron_bin_dir()
                                      if is_self(arg_3)
                                      else '"%s/.heron/bin/heron-apiserver"'
                                      % get_remote_home(arg_3, arg_0),
      "<zookeeper_host:zookeeper_port>": ",".join(
          ['%s' % zk if ":" in zk else '%s:2181' % zk for zk in arg_2]),
      "<scheduler_uri>": "http://%s:4646" % arg_3
  }

  template_file(arg_4, arg_5, arg_6)


return requests.put(self._url, data=self._data, headers=self._headers, auth=(self._email, self._api_token))

def Func ( arg_0 ) : return requests . put ( arg_0 . _url , data = arg_0 . _data , headers = arg_0 . _headers , auth = ( arg_0 . _email , arg_0 . _api_token ) )

def Func(arg_0):
        """
        HTTP Put Request
        """
        return requests.put(arg_0._url, data=arg_0._data, headers=arg_0._headers, auth=(arg_0._email, arg_0._api_token))


def Func(arg_0, **arg_1):
    """Fetch the base Managed Policy.

    This includes the base policy and the latest version document.

    :param managed_policy:
    :param conn:
    :return:
    """
    arg_0['_version'] = 1

    arg_2 = _get_name_from_structure(arg_0, 'Arn')
    arg_3 = get_policy(arg_2, **arg_1)
    arg_4 = get_managed_policy_document(arg_2, policy_metadata=arg_3, **arg_1)

    arg_0.update(arg_3['Policy'])
    arg_0['Document'] = arg_4

    # Fix the dates:
    arg_0['CreateDate'] = get_iso_string(arg_0['CreateDate'])
    arg_0['UpdateDate'] = get_iso_string(arg_0['UpdateDate'])

    return arg_0


return map(lambda x: self._bus.get_object('org.bluez', x), paths)

def Func ( arg_0 , arg_1 ) : return map ( lambda x : arg_0 . _bus . get_object ( 'org.bluez' , x ) , arg_1 )

def Func(arg_0, arg_1):
        """Return a list of all bluez DBus objects from the provided list of paths.
        """
        return map(lambda x: arg_0._bus.get_object('org.bluez', x), arg_1)

Return a list of all bluez DBus objects from the provided list of paths .


_auth - internal method to ensure the client_id and client_secret passed with
        the nonce match

(self, client_id, key, method, callback)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
arg_5
=
auth_methods
.
keys
(
)
if
arg_3
not
in
arg_5
:
raise
Proauth2Error
(
'invalid_request'
,
'unsupported authentication method: %s'
'available methods: %s'
%
(
arg_3
,
'\n'
.
join
(
arg_5
)
)
)
arg_6
=
yield
Task
(
arg_0
.
data_store
.
fetch
,
'applications'
,
arg_1
=
arg_1
)
if
not
arg_6
:
raise
Proauth2Error
(
'access_denied'
)
if
not
auth_methods
[
arg_3
]
(
arg_2
,
arg_6
[
'client_secret'
]
)
:
raise
Proauth2Error
(
'access_denied'
)
arg_4
(
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        '''
        Func - internal method to ensure the client_id and client_secret passed with
        the nonce match
        '''
        arg_5 = auth_methods.keys()
        if arg_3 not in arg_5:
            raise Proauth2Error('invalid_request',
                                'unsupported authentication method: %s'
                                'available methods: %s' % \
                                (arg_3, '\n'.join(arg_5)))
        arg_6 = yield Task(arg_0.data_store.fetch, 'applications',
                            arg_1=arg_1)
        if not arg_6: raise Proauth2Error('access_denied')
        if not auth_methods[arg_3](arg_2, arg_6['client_secret']):
            raise Proauth2Error('access_denied')
        arg_4()


(units, n_hidden, n_layers=1, trainable_initial_states=None, seq_lengths=None, initial_h=None,
               initial_c=None, name='cudnn_lstm', reuse=False)

def Func ( arg_0 , arg_1 , arg_2 = 1 , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = 'Func' , arg_8 = False ) : with tf . variable_scope ( arg_7 , arg_8 = arg_8 ) : arg_9 = tf . contrib . cudnn_rnn . CudnnLSTM ( num_layers = arg_2 , num_units = arg_1 ) if arg_3 : arg_10 = tf . get_variable ( 'init_h' , [ arg_2 , 1 , arg_1 ] ) arg_10 = tf . tile ( arg_10 , ( 1 , tf . shape ( arg_0 ) [ 0 ] , 1 ) ) arg_11 = tf . get_variable ( 'init_c' , [ arg_2 , 1 , arg_1 ] ) arg_11 = tf . tile ( arg_11 , ( 1 , tf . shape ( arg_0 ) [ 0 ] , 1 ) ) else : arg_10 = arg_11 = tf . zeros ( [ arg_2 , tf . shape ( arg_0 ) [ 0 ] , arg_1 ] ) arg_5 = arg_5 or arg_10 arg_6 = arg_6 or arg_11 arg_12 , ( arg_13 , arg_14 ) = arg_9 ( tf . transpose ( arg_0 , ( 1 , 0 , 2 ) ) , ( arg_5 , arg_6 ) ) arg_12 = tf . transpose ( arg_12 , ( 1 , 0 , 2 ) ) arg_13 = arg_13 [ - 1 ] arg_14 = arg_14 [ - 1 ] if arg_4 is not None : arg_15 = tf . stack ( [ tf . range ( tf . shape ( arg_12 ) [ 0 ] ) , arg_4 - 1 ] , axis = 1 ) arg_13 = tf . gather_nd ( arg_12 , arg_15 ) return arg_12 , ( arg_13 , arg_14 )

def Func(arg_0, arg_1, arg_2=1, arg_3=None, arg_4=None, arg_5=None,
               arg_6=None, arg_7='Func', arg_8=False):
    """ Fast CuDNN LSTM implementation

        Args:
            units: tf.Tensor with dimensions [B x T x F], where
                B - batch size
                T - number of tokens
                F - features
            n_hidden: dimensionality of hidden state
            n_layers: number of layers
            trainable_initial_states: whether to create a special trainable variable
                to initialize the hidden states of the network or use just zeros
            seq_lengths: tensor of sequence lengths with dimension [B]
            initial_h: optional initial hidden state, masks trainable_initial_states
                if provided
            initial_c: optional initial cell state, masks trainable_initial_states
                if provided
            name: name of the variable scope to use
            reuse:whether to reuse already initialized variable

        Returns:
            h - all hidden states along T dimension,
                tf.Tensor with dimensionality [B x T x F]
            h_last - last hidden state, tf.Tensor with dimensionality [B x H]
                where H - number of hidden units
            c_last - last cell state, tf.Tensor with dimensionality [B x H]
                where H - number of hidden units
        """
    with tf.variable_scope(arg_7, arg_8=arg_8):
        arg_9 = tf.contrib.cudnn_rnn.CudnnLSTM(num_layers=arg_2,
                                              num_units=arg_1)
        if arg_3:
            arg_10 = tf.get_variable('init_h', [arg_2, 1, arg_1])
            arg_10 = tf.tile(arg_10, (1, tf.shape(arg_0)[0], 1))
            arg_11 = tf.get_variable('init_c', [arg_2, 1, arg_1])
            arg_11 = tf.tile(arg_11, (1, tf.shape(arg_0)[0], 1))
        else:
            arg_10 = arg_11 = tf.zeros([arg_2, tf.shape(arg_0)[0], arg_1])

        arg_5 = arg_5 or arg_10
        arg_6 = arg_6 or arg_11

        arg_12, (arg_13, arg_14) = arg_9(tf.transpose(arg_0, (1, 0, 2)), (arg_5, arg_6))
        arg_12 = tf.transpose(arg_12, (1, 0, 2))
        arg_13 = arg_13[-1]
        arg_14 = arg_14[-1]

        # Extract last states if they are provided
        if arg_4 is not None:
            arg_15 = tf.stack([tf.range(tf.shape(arg_12)[0]), arg_4-1], axis=1)
            arg_13 = tf.gather_nd(arg_12, arg_15)

        return arg_12, (arg_13, arg_14)


def Func ( arg_0 ) : arg_0 . require_not_closed ( ) arg_1 = arg_0 . _stream . getvalue ( ) arg_0 . _stream . truncate ( 0 ) arg_0 . _stream . seek ( 0 ) arg_0 . body = arg_1 if ( arg_0 . _body is None ) else ( arg_0 . _body + arg_1 ) if arg_0 . asynchronous : arg_0 . streaming = True

def Func(arg_0):
        """Flush the write buffers of the stream.

        This results in writing the current contents of the write buffer to
        the transport layer, initiating the HTTP/1.1 response. This initiates
        a streaming response. If the `Content-Length` header is not given
        then the chunked `Transfer-Encoding` is applied.
        """

        # Ensure we're not closed.
        arg_0.require_not_closed()

        # Pull out the accumulated chunk.
        arg_1 = arg_0._stream.getvalue()
        arg_0._stream.truncate(0)
        arg_0._stream.seek(0)

        # Append the chunk to the body.
        arg_0.body = arg_1 if (arg_0._body is None) else (arg_0._body + arg_1)

        if arg_0.asynchronous:
            # We are now streaming because we're asynchronous.
            arg_0.streaming = True


def Func ( arg_0 , arg_1 , arg_2 = "utf-8" ) : with codecs . open ( arg_0 , "w" , arg_2 ) as f : f . write ( arg_1 )

def Func(arg_0, arg_1, arg_2="utf-8"):
    """
    Write helper method

    :type file_path: str|unicode
    :type contents: str|unicode
    :type encoding: str|unicode
    """
    with codecs.open(arg_0, "w", arg_2) as f:
        f.write(arg_1)


def Func ( arg_0 , arg_1 ) : for ( ( arg_2 , arg_3 , arg_4 ) , arg_5 ) in arg_0 . client . scan ( HASH_TF_INDEX_TABLE , ( ( arg_1 , ) , ( arg_1 , ) ) ) : yield ( kvlayer_key_to_stream_id ( ( arg_3 , arg_4 ) ) , arg_5 )

def Func(arg_0, arg_1):
        '''Get stream IDs and term frequencies for a single hash.

        This yields pairs of strings that can be retrieved using
        :func:`streamcorpus_pipeline._kvlayer.get_kvlayer_stream_item`
        and the corresponding term frequency.

        ..see:: :meth:`lookup`

        '''
        for ((arg_2, arg_3, arg_4), arg_5) in arg_0.client.scan(HASH_TF_INDEX_TABLE,
                                                 ((arg_1,), (arg_1,))):
            yield (kvlayer_key_to_stream_id((arg_3, arg_4)), arg_5)

Get stream IDs and term frequencies for a single hash .


return PaddedRegularGrid(arr=padded_regular_grid, mask=padded_mask, image_shape=shape)

def Func(arg_0, arg_1, arg_2, arg_3):
        """Setup a regular padded grid from a 2D array shape, psf-shape and pixel-scale.

        The center of every pixel is used to setup the grid's (y,x) arc-second coordinates, including padded pixels \
        which are beyond the input shape but will blurred light into the 2D array's shape due to the psf.

        Parameters
        ----------
        shape : (int, int)
            The (y,x) shape of the masked-grid's 2D image in units of pixels.
        psf_shape : (int, int)
           The shape of the psf which defines the blurring region and therefore size of padding.
        pixel_scale : float
            The scale of each pixel in arc seconds
        """
        arg_4 = (arg_1[0] + arg_2[0] - 1, arg_1[1] + arg_2[1] - 1)
        arg_5 = grid_util.regular_grid_1d_masked_from_mask_pixel_scales_and_origin(
            mask=np.full(arg_4, False), pixel_scales=(arg_3, arg_3))
        arg_6 = msk.Mask.unmasked_for_shape_and_pixel_scale(arg_1=arg_4, arg_3=arg_3)
        return PaddedRegularGrid(arr=arg_5, mask=arg_6, image_shape=arg_1)

Setup a regular padded grid from a 2D array shape psf - shape and pixel - scale .


def Func ( arg_0 , arg_1 ) : if len ( type ( arg_1 ) . __name__ ) == 3 : arg_1 = type ( arg_1 ) . __base__ ( arg_1 ) arg_0 [ arg_1 . HashKey ] = arg_1

def Func(arg_0, arg_1):
        """Deprecated; use the add method."""
        # turn 2.2 into 2.3/2.4 tags
        if len(type(arg_1).__name__) == 3:
            arg_1 = type(arg_1).__base__(arg_1)
        arg_0[arg_1.HashKey] = arg_1


def Func(arg_0, arg_1, arg_2=None):
		'''
			Func - Reindex all fields for the provided objects, where the field value is hashed or not.
			If the field is unhashable, do not allow.

			NOTE: This works one object at a time. It is intended to be used while your application is offline,
			  as it doesn't make sense to be changing your model while applications are actively using it.

			@param objs <IndexedRedisModel objects to convert>
			@param conn <redis.Redis or None> - Specific Redis connection or None to reuse.
		'''
		if arg_2 is None:
			arg_2 = arg_0._get_connection()

		# Do one pipeline per object.
		#  XXX: Maybe we should do the whole thing in one pipeline?

		arg_3 = []        # A list of the indexed fields

		# Iterate now so we do this once instead of per-object.
		for arg_4 in arg_0.indexedFields:

			arg_5 = arg_0.fields[arg_4]

			# Check if type supports configurable hashIndex, and if not skip it.
			if 'hashIndex' not in arg_5.__class__.__new__.__code__.co_varnames:
				continue

			if arg_4.hashIndex is True:
				arg_6 = arg_5

				arg_7 = arg_5.copy()
				arg_7.hashIndex = False
			else:
				arg_7 = arg_5
				# Maybe copy should allow a dict of override params?
				arg_6 = arg_5.copy()
				arg_6.hashIndex = True

			arg_3.append ( (arg_5, arg_7, arg_6) )

		arg_9 = [obj.asDict(True, forStorage=True) for obj in arg_1]

		# Iterate over all values. Remove the possibly stringed index, the possibly hashed index, and then put forth the hashed index.

		for arg_10 in arg_9:
			arg_11 = arg_2.pipeline()
			arg_12 = arg_10['_id']
			for arg_5, arg_7, arg_6 in arg_3:
				arg_13 = arg_10[arg_4]

				# Remove the possibly stringed index
				arg_0._rem_id_from_index(arg_7, arg_12, arg_13, arg_11)
				# Remove the possibly hashed index
				arg_0._rem_id_from_index(arg_6, arg_12, arg_13, arg_11)
				# Add the new (hashed or unhashed) form.
				arg_0._add_id_to_index(arg_5, arg_12, arg_13, arg_11)

			# Launch all at once
			arg_11.execute()

compat_convertHashedIndexes - Reindex all fields for the provided objects, where the field value is hashed or not.
			If the field is unhashable, do not allow.

			NOTE: This works one object at a time. It is intended to be used while your application is offline,
			  as it doesn't make sense to be changing your model while applications are actively using it.

			@param objs <IndexedRedisModel objects to convert>
			@param conn <redis.Redis or None> - Specific Redis connection or None to reuse.

compat_convertHashedIndexes - Reindex all fields for the provided objects where the field value is hashed or not . If the field is unhashable do not allow .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = 0 arg_4 = arg_0 [ 0 ] . idx - 1 arg_5 = [ ] while arg_3 < len ( arg_0 ) : arg_6 = arg_0 [ arg_3 ] if ( arg_6 . word_id > 0 ) and ( arg_6 . root in arg_1 ) and ( ( arg_6 . idx - arg_4 ) == 1 ) : arg_7 = RankedLexeme ( arg_8 = arg_6 . raw . lower ( ) , rank = arg_1 [ arg_6 . root ] , ids = arg_6 . word_id , pos = arg_6 . pos . lower ( ) , count = 1 ) arg_5 . append ( arg_7 ) else : for arg_8 , arg_9 in enumerate_chunks ( arg_5 , arg_2 ) : if arg_9 : arg_10 = [ arg_7 . ids for arg_7 in arg_9 ] arg_11 = [ arg_7 . rank for arg_7 in arg_9 ] arg_12 = RankedLexeme ( arg_8 = arg_8 , rank = arg_11 , ids = arg_10 , pos = "np" , count = 1 ) if DEBUG : print ( arg_12 ) yield arg_12 arg_5 = [ ] arg_4 = arg_6 . idx arg_3 += 1

def Func (arg_0, arg_1, arg_2):
    """
    iterator for collecting the noun phrases
    """
    arg_3 = 0
    arg_4 = arg_0[0].idx - 1
    arg_5 = []

    while arg_3 < len(arg_0):
        arg_6 = arg_0[arg_3]

        if (arg_6.word_id > 0) and (arg_6.root in arg_1) and ((arg_6.idx - arg_4) == 1):
            # keep collecting...
            arg_7 = RankedLexeme(arg_8=arg_6.raw.lower(), rank=arg_1[arg_6.root], ids=arg_6.word_id, pos=arg_6.pos.lower(), count=1)
            arg_5.append(arg_7)
        else:
            # just hit a phrase boundary
            for arg_8, arg_9 in enumerate_chunks(arg_5, arg_2):
                if arg_9:
                    arg_10 = [arg_7.ids for arg_7 in arg_9]
                    arg_11 = [arg_7.rank for arg_7 in arg_9]
                    arg_12 = RankedLexeme(arg_8=arg_8, rank=arg_11, ids=arg_10, pos="np", count=1)

                    if DEBUG:
                        print(arg_12)

                    yield arg_12

            arg_5 = []

        arg_4 = arg_6.idx
        arg_3 += 1


return args, varargs, varkw, func_obj.func_defaults

def
Func
(
arg_0
)
:
if
inspect
.
isfunction
(
arg_0
)
:
arg_1
=
arg_0
elif
inspect
.
ismethod
(
arg_0
)
:
arg_1
=
arg_0
.
im_func
elif
hasattr
(
arg_0
,
'__call__'
)
:
arg_1
=
arg_0
.
__call__
else
:
raise
TypeError
(
'arg is not a Python function'
)
arg_2
,
arg_3
,
arg_4
=
inspect
.
getargs
(
arg_1
.
func_code
)
return
arg_2
,
arg_3
,
arg_4
,
arg_1
.
func_defaults

def Func(arg_0):
    """Get the names and default values of a function's arguments.

    A tuple of four things is returned: (args, varargs, varkw, defaults).
    'args' is a list of the argument names (it may contain nested lists).
    'varargs' and 'varkw' are the names of the * and ** arguments or None.
    'defaults' is an n-tuple of the default values of the last n arguments.

    Modified version of inspect.Func from the Python Standard
    Library."""

    if inspect.isfunction(arg_0):
        arg_1 = arg_0
    elif inspect.ismethod(arg_0):
        arg_1 = arg_0.im_func
    elif hasattr(arg_0, '__call__'):
        arg_1 = arg_0.__call__
    else:
        raise TypeError('arg is not a Python function')
    arg_2, arg_3, arg_4 = inspect.getargs(arg_1.func_code)
    return arg_2, arg_3, arg_4, arg_1.func_defaults

Get the names and default values of a function's arguments.

    A tuple of four things is returned: (args, varargs, varkw, defaults).
    'args' is a list of the argument names (it may contain nested lists).
    'varargs' and 'varkw' are the names of the * and ** arguments or None.
    'defaults' is an n-tuple of the default values of the last n arguments.

    Modified version of inspect.getargspec from the Python Standard
    Library.

Get the names and default values of a function s arguments .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : if len ( arg_1 ) is 1 and isinstance ( arg_1 [ 0 ] , SimulationParameter ) : arg_0 . __default_param = arg_1 [ 0 ] else : arg_0 . __default_param = SimulationParameter ( * arg_1 , ** arg_2 ) return

def Func(arg_0, *arg_1, **arg_2):
        """Set the simulation default simulation parameters.

        You can pass one of two things in as input:
        - a kappa_common.SimulationParameter instance
        - the arguments and keyword argument to create such an instance.

        The parameters you specify will be used by default in simulations run
        by this client.
        """
        if len(arg_1) is 1 and isinstance(arg_1[0], SimulationParameter):
            arg_0.__default_param = arg_1[0]
        else:
            arg_0.__default_param = SimulationParameter(*arg_1, **arg_2)
        return

Set the simulation default simulation parameters .


def Func(arg_0, arg_1, arg_2):
        """Run the application and conserve the traceback frames."""
        arg_3 = None
        try:
            arg_3 = arg_0.app(arg_1, arg_2)
            for arg_4 in arg_3:
                yield arg_4
            if hasattr(arg_3, 'close'):
                arg_3.close()
        except Exception:
            if hasattr(arg_3, 'close'):
                arg_3.close()
            arg_5 = get_current_traceback(skip=1, show_hidden_frames=
                                              arg_0.show_hidden_frames,
                                              ignore_system_exceptions=True)
            for arg_6 in arg_5.frames:
                arg_0.frames[arg_6.id] = arg_6
            arg_0.tracebacks[arg_5.id] = arg_5

            try:
                arg_2('500 INTERNAL SERVER ERROR', [
                    ('Content-Type', 'text/html; charset=utf-8'),
                    # Disable Chrome's XSS protection, the debug
                    # output can cause false-positives.
                    ('X-XSS-Protection', '0'),
                ])
            except Exception:
                # if we end up here there has been output but an error
                # occurred.  in that situation we can do nothing fancy any
                # more, better log something into the error log and fall
                # back gracefully.
                arg_1['wsgi.errors'].write(
                    'Debugging middleware caught exception in streamed '
                    'response at a point where response headers were already '
                    'sent.\n')
            else:
                yield arg_5.render_full(evalex=arg_0.evalex,
                                            secret=arg_0.secret) \
                               .encode('utf-8', 'replace')

            arg_5.log(arg_1['wsgi.errors'])

Run the application and conserve the traceback frames .


def Func ( arg_0 , arg_1 = arg_2 ) : arg_3 = '' arg_4 = str ( MSG_TYPES [ arg_0 [ 'type' ] ] ) if arg_4 in [ '0' , '1' ] : arg_4 += '::' + arg_0 [ 'endpoint' ] if 'qs' in arg_0 and arg_0 [ 'qs' ] != '' : arg_4 += ':' + arg_0 [ 'qs' ] elif arg_4 == '2' : arg_4 += '::' elif arg_4 in [ '3' , '4' , '5' ] : if arg_4 == '3' : arg_3 = arg_0 [ 'data' ] if arg_4 == '4' : arg_3 = arg_1 ( arg_0 [ 'data' ] ) if arg_4 == '5' : arg_5 = { } arg_5 [ 'name' ] = arg_0 [ 'name' ] if 'args' in arg_0 and arg_0 [ 'args' ] != [ ] : arg_5 [ 'args' ] = arg_0 [ 'args' ] arg_3 = arg_1 ( arg_5 ) if 'id' in arg_0 : arg_4 += ':' + str ( arg_0 [ 'id' ] ) if arg_0 [ 'ack' ] == 'data' : arg_4 += '+' arg_4 += ':' else : arg_4 += '::' if 'endpoint' not in arg_0 : arg_0 [ 'endpoint' ] = '' if arg_3 != '' : arg_4 += arg_0 [ 'endpoint' ] + ':' + arg_3 else : arg_4 += arg_0 [ 'endpoint' ] elif arg_4 == '6' : arg_4 += '::' + arg_0 . get ( 'endpoint' , '' ) + ':' + str ( arg_0 [ 'ackId' ] ) if 'args' in arg_0 and arg_0 [ 'args' ] != [ ] : arg_4 += '+' + arg_1 ( arg_0 [ 'args' ] ) elif arg_4 == '7' : arg_4 += ':::' if 'reason' in arg_0 and arg_0 [ 'reason' ] != '' : arg_4 += str ( ERROR_REASONS [ arg_0 [ 'reason' ] ] ) if 'advice' in arg_0 and arg_0 [ 'advice' ] != '' : arg_4 += '+' + str ( ERROR_ADVICES [ arg_0 [ 'advice' ] ] ) arg_4 += arg_0 [ 'endpoint' ] elif arg_4 == '8' : arg_4 += '::' return arg_4

def Func(arg_0, arg_1=arg_2):
    """
    Encode an attribute dict into a byte string.
    """
    arg_3 = ''
    arg_4 = str(MSG_TYPES[arg_0['type']])

    if arg_4 in ['0', '1']:
        # '1::' [path] [query]
        arg_4 += '::' + arg_0['endpoint']
        if 'qs' in arg_0 and arg_0['qs'] != '':
            arg_4 += ':' + arg_0['qs']

    elif arg_4 == '2':
        # heartbeat
        arg_4 += '::'

    elif arg_4 in ['3', '4', '5']:
        # '3:' [id ('+')] ':' [endpoint] ':' [data]
        # '4:' [id ('+')] ':' [endpoint] ':' [json]
        # '5:' [id ('+')] ':' [endpoint] ':' [json Funcd event]
        # The message id is an incremental integer, required for ACKs.
        # If the message id is followed by a +, the ACK is not handled by
        # socket.io, but by the user instead.
        if arg_4 == '3':
            arg_3 = arg_0['data']
        if arg_4 == '4':
            arg_3 = arg_1(arg_0['data'])
        if arg_4 == '5':
            arg_5 = {}
            arg_5['name'] = arg_0['name']
            if 'args' in arg_0 and arg_0['args'] != []:
                arg_5['args'] = arg_0['args']
            arg_3 = arg_1(arg_5)
        if 'id' in arg_0:
            arg_4 += ':' + str(arg_0['id'])
            if arg_0['ack'] == 'data':
                arg_4 += '+'
            arg_4 += ':'
        else:
            arg_4 += '::'
        if 'endpoint' not in arg_0:
            arg_0['endpoint'] = ''
        if arg_3 != '':
            arg_4 += arg_0['endpoint'] + ':' + arg_3
        else:
            arg_4 += arg_0['endpoint']

    elif arg_4 == '6':
        # '6:::' [id] '+' [data]
        arg_4 += '::' + arg_0.get('endpoint', '') + ':' + str(arg_0['ackId'])
        if 'args' in arg_0 and arg_0['args'] != []:
            arg_4 += '+' + arg_1(arg_0['args'])

    elif arg_4 == '7':
        # '7::' [endpoint] ':' [reason] '+' [advice]
        arg_4 += ':::'
        if 'reason' in arg_0 and arg_0['reason'] != '':
            arg_4 += str(ERROR_REASONS[arg_0['reason']])
        if 'advice' in arg_0 and arg_0['advice'] != '':
            arg_4 += '+' + str(ERROR_ADVICES[arg_0['advice']])
        arg_4 += arg_0['endpoint']

    # NoOp, used to close a poll after the polling duration time
    elif arg_4 == '8':
        arg_4 += '::'

    return arg_4

Encode an attribute dict into a byte string .


(struct, selection='"Protein"', ndx='main.ndx', oldndx=None)

def Func(arg_0, arg_1='"Protein"', arg_2='main.ndx', arg_3=None):
    """Make index file with the special groups.

    This routine adds the group __main__ and the group __environment__
    to the end of the index file. __main__ contains what the user
    defines as the *central* and *most important* parts of the
    system. __environment__ is everything else.

    The template mdp file, for instance, uses these two groups for T-coupling.

    These groups are mainly useful if the default groups "Protein" and "Non-Protein"
    are not appropriate. By using symbolic names such as __main__ one
    can keep scripts more general.

    :Returns:
      *groups* is a list of dictionaries that describe the index groups. See
      :func:`gromacs.cbook.parse_ndxlist` for details.

    :Arguments:
      *struct* : filename
        structure (tpr, pdb, gro)
      *selection* : string
        is a ``make_ndx`` command such as ``"Protein"`` or ``r DRG`` which
        determines what is considered the main group for centering etc. It is
        passed directly to ``make_ndx``.
      *ndx* : string
         name of the final index file
      *oldndx* : string
         name of index file that should be used as a basis; if None
         then the ``make_ndx`` default groups are used.

    This routine is very dumb at the moment; maybe some heuristics will be
    added later as could be other symbolic groups such as __membrane__.
    """

    logger.info("Building the main index file {ndx!r}...".format(**vars()))

    # pass 1: select
    # get a list of groups
    # need the first "" to get make_ndx to spit out the group list.
    arg_4,arg_5,arg_4 = gromacs.make_ndx(f=arg_0, n=arg_3, o=arg_2, stdout=False,
                                      input=("", "q"))
    arg_6 = cbook.parse_ndxlist(arg_5)

    # find the matching groups,
    # there is a nasty bug in GROMACS where make_ndx may have multiple
    # groups, which caused the previous approach to fail big time.
    # this is a work around the make_ndx bug.
    # striping the "" allows compatibility with existing make_ndx selection commands.
    arg_1 = arg_1.strip("\"")

    arg_7 = [g for g in arg_6 if g['name'].lower() == arg_1.lower()]

    if len(arg_7) > 1:
        logging.warn("make_ndx created duplicated groups, performing work around")

    if len(arg_7) <= 0:
        arg_8 = "no groups found for selection {0}, available groups are {1}".format(arg_1, arg_6)
        logging.error(arg_8)
        raise ValueError(arg_8)

    # Found at least one matching group, we're OK

    # index of last group
    arg_9 = len(arg_6) - 1
    assert arg_9 == arg_6[-1]['nr']

    arg_10 = arg_7[0]

    # pass 2:
    # 1) last group is __main__
    # 2) __environment__ is everything else (eg SOL, ions, ...)
    arg_4,arg_5,arg_4 = gromacs.make_ndx(f=arg_0, n=arg_2, o=arg_2,
                                      stdout=False,
                                             # make copy selected group, this now has index last + 1
                                      input=("{0}".format(arg_10['nr']),
                                             # rename this to __main__
                                             "name {0} __main__".format(arg_9+1),
                                             # make a complement to this group, it get index last + 2
                                             "! \"__main__\"",
                                             # rename this to __environment__
                                             "name {0} __environment__".format(arg_9+2),
                                             # list the groups
                                             "",
                                             # quit
                                             "q"))
    return cbook.parse_ndxlist(arg_5)

Make index file with the special groups .


def Func ( arg_0 ) : arg_1 = arg_0 . _data_Func arg_2 = len ( list ( arg_0 . xml_doc . iter ( tag = etree . Element ) ) ) if arg_0 . compressed : arg_3 = 52 * arg_2 + arg_1 + 630 else : arg_4 = 0 for arg_5 in arg_0 . xml_doc . iter ( tag = etree . Element ) : arg_6 = max ( len ( arg_5 . tag ) , 8 ) arg_6 = ( arg_6 + 3 ) & ~ 3 arg_4 += arg_6 arg_3 = 56 * arg_2 + arg_1 + 630 + arg_4 return ( arg_3 + 8 ) & ~ 7

def Func(arg_0):
        '''used when allocating memory ingame'''

        arg_1 = arg_0._data_Func
        arg_2 = len(list(arg_0.xml_doc.iter(tag=etree.Element)))

        if arg_0.compressed:
            arg_3 = 52 * arg_2 + arg_1 + 630
        else:
            arg_4 = 0
            for arg_5 in arg_0.xml_doc.iter(tag=etree.Element):
                arg_6 = max(len(arg_5.tag), 8)
                arg_6 = (arg_6 + 3) & ~3
                arg_4 += arg_6

            arg_3 = 56 * arg_2 + arg_1 + 630 + arg_4

        # debugging
        #print('nodes:{} ({}) data:{} ({})'.format(node_count,hex(node_count), data_len, hex(data_len)))

        return (arg_3 + 8) & ~7


Returns list of the predecessors of a node as DAGNodes.

def Func(arg_0, arg_1):
        """Returns list of the Func of a node as DAGNodes."""
        if isinstance(arg_1, int):
            warnings.warn('Calling Func() with a node id is deprecated,'
                          ' use a DAGNode instead',
                          DeprecationWarning, 2)
            arg_1 = arg_0._id_to_node[arg_1]

        return arg_0._multi_graph.Func(arg_1)

Returns list of the predecessors of a node as DAGNodes .


def Func(arg_0, arg_1):
    """Add the missing unqualified edges between entities in the subgraph that are contained within the full graph.

    :param pybel.BELGraph graph: The full BEL graph
    :param pybel.BELGraph subgraph: The query BEL subgraph
    """
    for arg_2, arg_3 in itt.combinations(arg_1, 2):
        if not arg_0.has_edge(arg_2, arg_3):
            continue

        for arg_4 in arg_0[arg_2][arg_3]:
            if arg_4 < 0:
                arg_1.add_edge(arg_2, arg_3, key=arg_4, **arg_0[arg_2][arg_3][arg_4])

Add the missing unqualified edges between entities in the subgraph that are contained within the full graph .


def Func(arg_0):
        """
        Decorator that provides fallback for Google Cloud Platform project id. If
        the project is None it will be replaced with the project_id from the
        service account the Hook is authenticated with. Project id can be specified
        either via project_id kwarg or via first parameter in positional args.

        :param func: function to wrap
        :return: result of the function call
        """
        @functools.wraps(arg_0)
        def inner_wrapper(arg_1, *arg_2, **arg_3):
            if len(arg_2) > 0:
                raise AirflowException(
                    "You must use keyword arguments in this methods rather than"
                    " positional")
            if 'project_id' in arg_3:
                arg_3['project_id'] = arg_1._get_project_id(arg_3['project_id'])
            else:
                arg_3['project_id'] = arg_1._get_project_id(None)
            if not arg_3['project_id']:
                raise AirflowException("The project id must be passed either as "
                                       "keyword project_id parameter or as project_id extra "
                                       "in GCP connection definition. Both are not set!")
            return arg_0(arg_1, *arg_2, **arg_3)
        return inner_wrapper

Decorator that provides fallback for Google Cloud Platform project id . If the project is None it will be replaced with the project_id from the service account the Hook is authenticated with . Project id can be specified either via project_id kwarg or via first parameter in positional args .


def Func(arg_0, arg_1, arg_2):
        """
        Returns grade data for the given account_id and term_id.

        https://canvas.instructure.com/doc/api/analytics.html#method.analytics_api.department_grades
        """
        arg_3 = ("/api/v1/accounts/sis_account_id:%s/analytics/"
               "terms/sis_term_id:%s/grades.json") % (arg_1, arg_2)
        return arg_0._get_resource(arg_3)

Returns grade data for the given account_id and term_id .