def Func ( arg_0 ) : if not arg_0 : return None arg_1 = arg_0 . strip ( ) . split ( '\t' ) arg_2 = dict ( ) arg_2 [ 'chrom' ] = CHROM_INDEX [ arg_1 [ 0 ] ] arg_2 [ 'pos' ] = int ( arg_1 [ 1 ] ) return arg_2

def Func(arg_0):
        """
        Very lightweight parsing of a vcf line to get position.

        Returns a dict containing:
        'chrom': index of chromosome (int), indicates sort order
        'pos': position on chromosome (int)
        """
        if not arg_0:
            return None
        arg_1 = arg_0.strip().split('\t')
        arg_2 = dict()
        arg_2['chrom'] = CHROM_INDEX[arg_1[0]]
        arg_2['pos'] = int(arg_1[1])
        return arg_2

Very lightweight parsing of a vcf line to get position .


def Func ( arg_0 , arg_1 ) : def same_scope ( arg_2 ) : return arg_2 . scope ( ) is arg_1 arg_3 = itertools . chain . from_iterable arg_4 = set ( arg_3 ( child . names for child in arg_1 . nodes_of_class ( astroid . Nonlocal ) if same_scope ( child ) ) ) if not arg_4 : return arg_5 = set ( arg_3 ( child . names for child in arg_1 . nodes_of_class ( astroid . Global ) if same_scope ( child ) ) ) for arg_6 in arg_4 . intersection ( arg_5 ) : arg_0 . add_message ( "nonlocal-and-global" , args = ( arg_6 , ) , arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """Check that a name is both nonlocal and global."""

        def same_scope(arg_2):
            return arg_2.scope() is arg_1

        arg_3 = itertools.chain.from_iterable
        arg_4 = set(
            arg_3(
                child.names
                for child in arg_1.nodes_of_class(astroid.Nonlocal)
                if same_scope(child)
            )
        )

        if not arg_4:
            return

        arg_5 = set(
            arg_3(
                child.names
                for child in arg_1.nodes_of_class(astroid.Global)
                if same_scope(child)
            )
        )
        for arg_6 in arg_4.intersection(arg_5):
            arg_0.add_message("nonlocal-and-global", args=(arg_6,), arg_1=arg_1)

Check that a name is both nonlocal and global .


def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . cache [ arg_1 ] . get ( arg_2 , False )

def Func(arg_0, arg_1, arg_2):
        """Returns cache entry parameter value by its name.

        :param str|unicode entry_name:
        :param key:
        :return:
        """
        return arg_0.cache[arg_1].get(arg_2, False)

Returns cache entry parameter value by its name .


def Func ( arg_0 ) : arg_1 = [ parse_compound ( compound ) . count ( ) . keys ( ) for compound in arg_0 ] return set ( ) . union ( * arg_1 )

def Func(arg_0):
    """
    Determine the set of Func present in a list of chemical compounds.

    The list of Func is sorted alphabetically.

    :param compounds: List of compound formulas and phases, e.g.
      ['Fe2O3[S1]', 'Al2O3[S1]'].

    :returns: List of Func.
    """

    arg_1 = [parse_compound(compound).count().keys()
                   for compound in arg_0]
    return set().union(*arg_1)

Determine the set of elements present in a list of chemical compounds.

    The list of elements is sorted alphabetically.

    :param compounds: List of compound formulas and phases, e.g.
      ['Fe2O3[S1]', 'Al2O3[S1]'].

    :returns: List of elements.

Determine the set of elements present in a list of chemical compounds .


def Func ( ) : arg_0 = [ 2 , 4 , 10 , 3 , 5 , 9 , 4 , 6 , 8 ] arg_1 = [ random . randint ( 1 , 9 ) for _ in range ( 10 ) ] arg_2 = [ v * arg_0 [ i ] for i , v in enumerate ( arg_1 [ : - 1 ] ) ] arg_1 [ 9 ] = sum ( arg_2 ) % 11 % 10 return "" . join ( map ( str , arg_1 ) )

def Func():
    """Return a random taxation ID number for a company."""
    arg_0 = [2, 4, 10, 3, 5, 9, 4, 6, 8]
    arg_1 = [random.randint(1, 9) for _ in range(10)]
    arg_2 = [v * arg_0[i] for i, v in enumerate(arg_1[:-1])]
    arg_1[9] = sum(arg_2) % 11 % 10
    return "".join(map(str, arg_1))

Return a random taxation ID number for a company .


def
Func
(
arg_0
=
,
arg_1
=
'vocab.txt'
)
:
if
arg_0
is
:
arg_0
=
[
]
arg_2
=
os
.
getcwd
(
)
arg_3
=
len
(
arg_0
)
with
open
(
os
.
path
.
join
(
arg_2
,
arg_1
)
,
"w"
)
as
f
:
for
arg_4
in
xrange
(
arg_3
)
:
f
.
write
(
"%s %d\n"
%
(
tf
.
compat
.
as_text
(
arg_0
[
arg_4
]
[
0
]
)
,
arg_0
[
arg_4
]
[
1
]
)
)
tl
.
logging
.
info
(
"%d vocab saved to %s in %s"
%
(
arg_3
,
arg_1
,
arg_2
)
)

def Func(arg_0=None, arg_1='vocab.txt'):
    """Save the vocabulary to a file so the model can be reloaded.

    Parameters
    ----------
    count : a list of tuple and list
        count[0] is a list : the number of rare words,
        count[1:] are tuples : the number of occurrence of each word,
        e.g. [['UNK', 418391], (b'the', 1061396), (b'of', 593677), (b'and', 416629), (b'one', 411764)]

    Examples
    ---------
    >>> words = tl.files.load_matt_mahoney_text8_dataset()
    >>> vocabulary_size = 50000
    >>> data, count, dictionary, reverse_dictionary = tl.nlp.build_words_dataset(words, vocabulary_size, True)
    >>> tl.nlp.Func(count, name='vocab_text8.txt')
    >>> vocab_text8.txt
    UNK 418391
    the 1061396
    of 593677
    and 416629
    one 411764
    in 372201
    a 325873
    to 316376

    """
    if arg_0 is None:
        arg_0 = []

    arg_2 = os.getcwd()
    arg_3 = len(arg_0)
    with open(os.path.join(arg_2, arg_1), "w") as f:
        for arg_4 in xrange(arg_3):
            f.write("%s %d\n" % (tf.compat.as_text(arg_0[arg_4][0]), arg_0[arg_4][1]))
    tl.logging.info("%d vocab saved to %s in %s" % (arg_3, arg_1, arg_2))

Save the vocabulary to a file so the model can be reloaded.

    Parameters
    ----------
    count : a list of tuple and list
        count[0] is a list : the number of rare words,
        count[1:] are tuples : the number of occurrence of each word,
        e.g. [['UNK', 418391], (b'the', 1061396), (b'of', 593677), (b'and', 416629), (b'one', 411764)]

    Examples
    ---------
    >>> words = tl.files.load_matt_mahoney_text8_dataset()
    >>> vocabulary_size = 50000
    >>> data, count, dictionary, reverse_dictionary = tl.nlp.build_words_dataset(words, vocabulary_size, True)
    >>> tl.nlp.save_vocab(count, name='vocab_text8.txt')
    >>> vocab_text8.txt
    UNK 418391
    the 1061396
    of 593677
    and 416629
    one 411764
    in 372201
    a 325873
    to 316376

Save the vocabulary to a file so the model can be reloaded .


def Func(arg_0, arg_1=False, arg_2=False):
    """
    Deletes all objects and containers in the account.

    You must set yes_empty_account to True to verify you really want to
    do this.

    By default, this will perform one pass at deleting all objects and
    containers; so if objects revert to previous versions or if new
    objects or containers otherwise arise during the process, the
    account may not be empty once done.

    Set `until_empty` to True if you want multiple passes to keep trying
    to fully empty and delete the containers. Note until_empty=True
    could run forever if something else is making new items faster than
    they're being deleted.

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

    See :py:class:`CLIDelete` for more information.
    """
    if not arg_1:
        raise ReturnCode(
            'called Func without setting yes_empty_account=True')
    arg_3 = None
    while True:
        with arg_0.client_manager.with_client() as client:
            arg_4, arg_5, arg_6, arg_7 = client.get_account(
                arg_3=arg_3, arg_6=arg_0.headers, query=arg_0.query,
                cdn=arg_0.cdn)
        if arg_4 // 100 != 2:
            if arg_4 == 404 and arg_0.ignore_404:
                return
            raise ReturnCode('listing account: %s %s' % (arg_4, arg_5))
        if not arg_7:
            if arg_2 and arg_3:
                arg_3 = None
                continue
            break
        for arg_8 in arg_7:
            cli_delete(
                arg_0, arg_8['name'], arg_0.headers, recursive=True)
        arg_3 = arg_8['name']

Deletes all objects and containers in the account .


def Func ( arg_0 , arg_1 ) : arg_1 = pathlib . PurePosixPath ( arg_1 ) arg_2 = filter ( lambda p : p . is_parent ( arg_1 ) , arg_0 . permissions ) arg_3 = min ( arg_2 , key = lambda p : len ( arg_1 . relative_to ( p . path ) . parts ) , default = Permission ( ) , ) return arg_3

def Func(arg_0, arg_1):
        """
        Return nearest parent permission for `path`.

        :param path: path which permission you want to know
        :type path: :py:class:`str` or :py:class:`pathlib.PurePosixPath`

        :rtype: :py:class:`aioftp.Permission`
        """
        arg_1 = pathlib.PurePosixPath(arg_1)
        arg_2 = filter(lambda p: p.is_parent(arg_1), arg_0.permissions)
        arg_3 = min(
            arg_2,
            key=lambda p: len(arg_1.relative_to(p.path).parts),
            default=Permission(),
        )
        return arg_3

Return nearest parent permission for path .


def Func ( arg_0 ) : if len ( arg_0 . tokens ) == 0 : arg_0 . __tokenize ( arg_0 . dxfile . readline ( ) )

def Func(arg_0):
        """Add a new tokenized line from the file to the token buffer.

        Func()

        Only reads a new line if the buffer is empty. It is safe to
        call it repeatedly.

        At end of file, method returns empty strings and it is up to
        __peek and __consume to flag the end of the stream.
        """
        if len(arg_0.tokens) == 0:
            arg_0.__tokenize(arg_0.dxfile.readline())

Add a new tokenized line from the file to the token buffer.

        __refill_tokenbuffer()

        Only reads a new line if the buffer is empty. It is safe to
        call it repeatedly.

        At end of file, method returns empty strings and it is up to
        __peek and __consume to flag the end of the stream.

Add a new tokenized line from the file to the token buffer .


def Func ( arg_0 ) : arg_1 = { } arg_1 [ 'reason' ] = arg_0 . msg arg_1 [ 'type' ] = arg_0 . __class__ . __name__ arg_1 [ 'params' ] = arg_0 . params return arg_1

def Func(arg_0):
        """Convert this exception to a dictionary.

        Returns:
            dist: A dictionary of information about this exception,
                Has a 'reason' key, a 'type' key  and a dictionary of params
        """

        arg_1 = {}
        arg_1['reason'] = arg_0.msg
        arg_1['type'] = arg_0.__class__.__name__
        arg_1['params'] = arg_0.params

        return arg_1

Convert this exception to a dictionary .


return "%s_%s%s" % (
            parsed_beta_allele.gene,
            parsed_beta_allele.allele_family,
            parsed_beta_allele.allele_code)

def
Func
(
arg_0
,
arg_1
)
:
if
"DRB"
not
in
arg_1
.
gene
:
raise
ValueError
(
"Unexpected allele %s"
%
arg_1
)
return
"%s_%s%s"
%
(
arg_1
.
gene
,
arg_1
.
allele_family
,
arg_1
.
allele_code
)

def Func(arg_0, arg_1):
        """
        Assume that we're dealing with a human DRB allele
        which NetMHCIIpan treats differently because there is
        little population diversity in the DR-alpha gene
        """
        if "DRB" not in arg_1.gene:
            raise ValueError("Unexpected allele %s" % arg_1)
        return "%s_%s%s" % (
            arg_1.gene,
            arg_1.allele_family,
            arg_1.allele_code)

Assume that we re dealing with a human DRB allele which NetMHCIIpan treats differently because there is little population diversity in the DR - alpha gene


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_1 : return arg_0 . query . filter_by ( arg_1 = arg_1 ) . first ( ) elif arg_2 : return arg_0 . query . filter_by ( arg_2 = arg_2 ) . first ( ) return None

def Func(arg_0, arg_1=None, arg_2=None):
        """returns a Token object with the given access token or refresh token

        :param access_token: User's access token
        :param refresh_token: User's refresh token
        """
        if arg_1:
            return arg_0.query.filter_by(arg_1=arg_1).first()
        elif arg_2:
            return arg_0.query.filter_by(arg_2=arg_2).first()
        return None


(query, gene_sets, background=20000, **kwargs)

def Func(arg_0, arg_1, arg_2=20000, **arg_3):
    """ calculate pvalues for all categories in the graph

    :param set query: set of identifiers for which the p value is calculated
    :param dict gene_sets: gmt file dict after background was set
    :param set background: total number of genes in your annotated database.
    :returns: pvalues
              x: overlapped gene number
              n: length of gene_set which belongs to each terms
              hits: overlapped gene names.

    For 2*2 contingency table:
    =============================================================================
                         |   in  query  |  not in query |    row total
    =>      in gene_set  |        a     |       b       |       a+b
    =>  not in gene_set  |        c     |       d       |       c+d
           column total                                 | a+b+c+d = anno database
    =============================================================================
    background genes number = a + b + c + d.

    Then, in R
        x=a     the number of white balls drawn without replacement
                from an urn which contains both black and white balls.
        m=a+b   the number of white balls in the urn
        n=c+d   the number of black balls in the urn
        k=a+c   the number of balls drawn from the urn

    In Scipy:
    for args in scipy.hypergeom.sf(k, M, n, N, loc=0):
        M: the total number of objects,
        n: the total number of Type I objects.
        k: the random variate represents the number of Type I objects in N drawn
           without replacement from the total population.

    Therefore, these two functions are the same when using parameters from 2*2 table:
    R:     >   phyper(x-1, m, n, k, lower.tail=FALSE)
    Scipy: >>> hypergeom.sf(x-1, m+n, m, k)

    """

    # number of genes in your query data
    arg_4 = len(arg_0)
    arg_0 = set(arg_0)
    arg_5 = []
    # background should be all genes in annotated database
    # such as go, kegg et.al.
    if isinstance(arg_2, set):
        arg_6 = len(arg_2) # total number in your annotated database
        # filter genes that not found in annotated database
        arg_0 = arg_0.intersection(arg_2)
    elif isinstance(arg_2, int):
        arg_6 = arg_2
    else:
        raise ValueError("background should be set or int object")
    # pval
    arg_7 = sorted(arg_1.keys())
    for arg_8 in arg_7:
        arg_9 = arg_1.get(arg_8)
        arg_10 = len(arg_9)
        arg_11 = arg_0.intersection(set(arg_9))
        arg_12 = len(arg_11)
        if arg_12 < 1 : continue
        # pVal = hypergeom.sf(hitCount-1,popTotal,bgHits,queryTotal)
        # p(X >= hitCounts)
        arg_5.append((arg_8, hypergeom.sf(arg_12-1, arg_6, arg_10, arg_4), arg_12, arg_10, arg_11))

    return zip(*arg_5)


def Func ( arg_0 , * arg_1 , ** arg_2 ) : super ( Deposit , arg_0 ) . Func ( * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        """Update only drafts.

        Status required: ``'draft'``.

        Meta information inside `_deposit` are preserved.
        """
        super(Deposit, arg_0).Func(*arg_1, **arg_2)


def Func ( arg_0 ) : arg_1 = arg_0 . frame ( ) arg_2 , arg_3 = "" , [ ] while arg_1 : if isinstance ( arg_1 , Module ) : arg_2 = arg_1 . name else : arg_3 . append ( getattr ( arg_1 , "name" , "<lambda>" ) ) try : arg_1 = arg_1 . parent . frame ( ) except AttributeError : arg_1 = None arg_3 . reverse ( ) return arg_2 , "." . join ( arg_3 )

def Func(arg_0):
    """return the module name and the frame id in the module"""
    arg_1 = arg_0.frame()
    arg_2, arg_3 = "", []
    while arg_1:
        if isinstance(arg_1, Module):
            arg_2 = arg_1.name
        else:
            arg_3.append(getattr(arg_1, "name", "<lambda>"))
        try:
            arg_1 = arg_1.parent.frame()
        except AttributeError:
            arg_1 = None
    arg_3.reverse()
    return arg_2, ".".join(arg_3)


def
Func
(
arg_0
)
:
with
open
(
arg_0
,
'r'
,
errors
=
'surrogateescape'
,
newline
=
os
.
linesep
)
as
f
:
arg_1
=
SupybotParser
(
f
)
try
:
for
arg_2
in
arg_1
.
parse
(
)
:
yield
arg_2
except
ParseError
as
e
:
arg_3
=
"file: %s; reason: %s"
%
(
arg_0
,
str
(
e
)
)
raise
ParseError
(
arg_3
=
arg_3
)

def Func(arg_0):
        """Parse a Supybot IRC log file.

        The method parses the Supybot IRC log file and returns an iterator of
        dictionaries. Each one of this, contains a message from the file.

        :param filepath: path to the IRC log file

        :returns: a generator of parsed messages

        :raises ParseError: raised when the format of the Supybot log file
            is invalid
        :raises OSError: raised when an error occurs reading the
            given file
        """
        with open(arg_0, 'r', errors='surrogateescape',
                  newline=os.linesep) as f:
            arg_1 = SupybotParser(f)

            try:
                for arg_2 in arg_1.parse():
                    yield arg_2
            except ParseError as e:
                arg_3 = "file: %s; reason: %s" % (arg_0, str(e))
                raise ParseError(arg_3=arg_3)


def Func(arg_0):
        """ custom command line action to check file exist """
        class CheckPathAction(argparse.Action):
            def __call__(arg_0, arg_1, arg_2, arg_3, arg_4=None):
                if type(arg_3) is list:
                    arg_3 = arg_3[0]
                arg_5 = arg_3
                if arg_4 == 'None':
                    if not os.path.isdir(arg_3):
                        arg_6 = os.path.expanduser("~")
                        if not arg_3.startswith(arg_6) \
                                and not arg_3.startswith(os.getcwd()):
                            if os.path.isdir(os.path.join(arg_6, arg_3)):
                                arg_3 = os.path.join(arg_6, arg_3)
                            elif os.path.isdir(os.path.join(os.getcwd(), arg_3)):
                                arg_3 = os.path.join(os.getcwd(), arg_3)
                            else:
                                arg_3 = None
                        else:
                            arg_3 = None
                elif arg_4 == '--template-name':
                    if not os.path.isdir(arg_3):
                        if not os.path.isdir(os.path.join(arg_2.target, arg_3)):
                            arg_3 = None
                if not arg_3:
                    logger.error("Could not to find path %s. Please provide "
                                 "correct path to %s option",
                                 arg_5, arg_4)
                    exit(1)
                setattr(arg_2, arg_0.dest, arg_3)

        return CheckPathAction


def Func(arg_0, arg_1, arg_2):
        '''Initialize the slots of the LeanMinHash.

        Args:
            seed (int): The random seed controls the set of random
                permutation functions generated for this LeanMinHash.
            hashvalues: The hash values is the internal state of the LeanMinHash.
        '''
        arg_0.seed = arg_1
        arg_0.hashvalues = arg_0._parse_hashvalues(arg_2)

Initialize the slots of the LeanMinHash .


def Func(arg_0):
  """Run the Hot Gym example."""

  # Create a data source for the network.
  arg_1 = FileRecordStream(streamID=_INPUT_FILE_PATH)
  arg_0 = min(arg_0, arg_1.getDataRowCount())
  arg_2 = createNetwork(arg_1)

  # Set predicted field
  arg_2.regions["sensor"].setParameter("predictedField", "consumption")

  # Enable learning for all regions.
  arg_2.regions["SP"].setParameter("learningMode", 1)
  arg_2.regions["TM"].setParameter("learningMode", 1)
  arg_2.regions["classifier"].setParameter("learningMode", 1)

  # Enable inference for all regions.
  arg_2.regions["SP"].setParameter("inferenceMode", 1)
  arg_2.regions["TM"].setParameter("inferenceMode", 1)
  arg_2.regions["classifier"].setParameter("inferenceMode", 1)

  arg_3 = []
  arg_4 = 1  # Run the network, N iterations at a time.
  for arg_5 in range(0, arg_0, arg_4):
    arg_2.run(arg_4)

    arg_6 = getPredictionResults(arg_2, "classifier")
    arg_7 = arg_6[1]["predictedValue"]
    arg_8 = arg_6[1]["predictionConfidence"]
    arg_9 = arg_6[5]["predictedValue"]
    arg_10 = arg_6[5]["predictionConfidence"]

    arg_11 = (arg_7, arg_8 * 100,
              arg_9, arg_10 * 100)
    print "1-step: {:16} ({:4.4}%)\t 5-step: {:16} ({:4.4}%)".format(*arg_11)
    arg_3.append(arg_11)

  return arg_3


def Func(arg_0):
  """
  Parses a string containing only 0's and 1's and return a Python list object.

  :param s: (string) string to parse
  :returns: (list) SDR out
  """
  assert isinstance(arg_0, basestring)
  arg_1 = [int(c) for c in arg_0 if c in ("0", "1")]
  if len(arg_1) != len(arg_0):
    raise ValueError("The provided string %s is malformed. The string should "
                     "have only 0's and 1's.")

  return arg_1

Parses a string containing only 0 s and 1 s and return a Python list object .


def
Func
(
arg_0
,
arg_1
)
:
if
not
os
.
path
.
exists
(
arg_1
)
:
raise
ValueError
(
"Config file not found."
)
try
:
arg_2
=
configparser
.
ConfigParser
(
)
arg_2
.
read
(
arg_1
)
arg_3
=
arg_0
(
arg_1
,
arg_2
)
if
not
arg_3
.
check_config_sanity
(
)
:
raise
ValueError
(
"Error in config file."
)
else
:
return
arg_3
except
configparser
.
Error
:
raise
ValueError
(
"Config file is invalid."
)

def Func(arg_0, arg_1):
        """Try loading given config file.

        :param str file: full path to the config file to load
        """
        if not os.path.exists(arg_1):
            raise ValueError("Config file not found.")

        try:
            arg_2 = configparser.ConfigParser()
            arg_2.read(arg_1)

            arg_3 = arg_0(arg_1, arg_2)
            if not arg_3.check_config_sanity():
                raise ValueError("Error in config file.")
            else:
                return arg_3
        except configparser.Error:
            raise ValueError("Config file is invalid.")


(q_result, meas_qubits, labels, shots=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = len ( arg_1 ) arg_5 = 2 ** arg_4 arg_6 = [ 0.5 + 0.5 * np . sqrt ( 3 ) , 0.5 - 0.5 * np . sqrt ( 3 ) ] arg_7 = 1 for arg_8 in range ( arg_4 ) : arg_7 = np . kron ( arg_7 , arg_6 ) arg_9 = [ 0 ] * len ( arg_2 ) arg_10 = 0 arg_11 = [ marginal_counts ( arg_0 . get_counts ( circ ) , arg_1 ) for circ in arg_2 ] for arg_12 in arg_11 : arg_13 = [ 0 ] * arg_5 for arg_8 in range ( arg_5 ) : if bin ( arg_8 ) [ 2 : ] . zfill ( arg_4 ) in arg_12 : arg_13 [ arg_8 ] = float ( arg_12 [ bin ( arg_8 ) [ 2 : ] . zfill ( arg_4 ) ] ) if arg_3 is None : arg_3 = np . sum ( arg_13 ) for arg_8 in range ( arg_5 ) : arg_9 [ arg_10 ] = arg_9 [ arg_10 ] + ( arg_13 [ arg_8 ] / arg_3 ) * arg_7 [ arg_8 ] arg_10 += 1 return arg_9

def Func(arg_0, arg_1, arg_2, arg_3=None):
    """Get the value of the Wigner function from measurement results.

    Args:
        q_result (Result): Results from execution of a state tomography
                            circuits on a backend.
        meas_qubits (list[int]): a list of the qubit indexes measured.
        labels (list[str]): a list of names of the circuits
        shots (int): number of shots

    Returns:
        list: The values of the Wigner function at measured points in
            phase space
    """
    arg_4 = len(arg_1)

    arg_5 = 2**arg_4
    arg_6 = [0.5 + 0.5 * np.sqrt(3), 0.5 - 0.5 * np.sqrt(3)]
    arg_7 = 1

    for arg_8 in range(arg_4):
        arg_7 = np.kron(arg_7, arg_6)

    arg_9 = [0] * len(arg_2)
    arg_10 = 0
    arg_11 = [marginal_counts(arg_0.get_counts(circ), arg_1)
              for circ in arg_2]
    for arg_12 in arg_11:
        arg_13 = [0] * arg_5

        for arg_8 in range(arg_5):
            if bin(arg_8)[2:].zfill(arg_4) in arg_12:
                arg_13[arg_8] = float(arg_12[bin(arg_8)[2:].zfill(arg_4)])

        if arg_3 is None:
            arg_3 = np.sum(arg_13)

        for arg_8 in range(arg_5):
            arg_9[arg_10] = arg_9[arg_10] + (arg_13[arg_8] / arg_3) * arg_7[arg_8]
        arg_10 += 1

    return arg_9

Get the value of the Wigner function from measurement results .


def Func ( arg_0 ) : for arg_1 in _collect_refs ( arg_0 ) : arg_1 [ 'value' ] . _remove_backref ( arg_1 [ 'field_instance' ] . _backref_field_name , arg_0 , arg_1 [ 'field_name' ] , strict = False )

def Func(arg_0):
    """When removing an object with foreign fields, back-references from
    other objects to the current object should be deleted. This function
    identifies foreign fields of the specified object whose values are not
    None and which specify back-reference keys, then removes back-references
    from linked objects to the specified object.

    :param obj: Object for which back-references should be removed

    """
    for arg_1 in _collect_refs(arg_0):
        arg_1['value']._remove_backref(
            arg_1['field_instance']._backref_field_name,
            arg_0,
            arg_1['field_name'],
            strict=False
        )

When removing an object with foreign fields back - references from other objects to the current object should be deleted . This function identifies foreign fields of the specified object whose values are not None and which specify back - reference keys then removes back - references from linked objects to the specified object .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
dict
(
zip
(
arg_0
.
engines
,
arg_0
.
provider
.
status
(
arg_0
.
engines
)
)
)
arg_3
=
[
engine
for
engine
in
arg_2
if
arg_2
[
engine
]
==
"RUNNING"
]
[
:
arg_1
]
if
arg_0
.
provider
:
arg_4
=
arg_0
.
provider
.
cancel
(
arg_3
)
else
:
logger
.
error
(
"No execution provider available"
)
arg_4
=
return
arg_4

def Func(arg_0, arg_1):
        """Scale in the number of active blocks by the specified number.

        """
        arg_2 = dict(zip(arg_0.engines, arg_0.provider.status(arg_0.engines)))

        # This works for blocks=0
        arg_3 = [engine for engine in arg_2 if arg_2[engine] == "RUNNING"][:arg_1]

        if arg_0.provider:
            arg_4 = arg_0.provider.cancel(arg_3)
        else:
            logger.error("No execution provider available")
            arg_4 = None

        return arg_4

Scale in the number of active blocks by the specified number .


return wrapper if invoked else wrapper(func)

def Func(*arg_0, **arg_1):
    """
    Decorator declaring the wrapped function to be a new-style task.

    May be invoked as a simple, argument-less decorator (i.e. ``@task``) or
    with arguments customizing its behavior (e.g. ``@task(alias='myalias')``).

    Please see the :ref:`new-style task <task-decorator>` documentation for
    details on how to use this decorator.

    .. versionchanged:: 1.2
        Added the ``alias``, ``aliases``, ``task_class`` and ``default``
        keyword arguments. See :ref:`task-decorator-arguments` for details.
    .. versionchanged:: 1.5
        Added the ``name`` keyword argument.

    .. seealso:: `~fabric.docs.unwrap_tasks`, `~fabric.tasks.WrappedCallableTask`
    """
    arg_2 = bool(not arg_0 or arg_1)
    arg_3 = arg_1.pop("task_class", WrappedCallableTask)
#     if invoked:
#         func, args = args[0], ()
#     else:
    arg_4, arg_0 = arg_0[0], ()

    def arg_5(arg_4):
        return arg_3(arg_4, *arg_0, **arg_1)
    arg_5.is_Func = True
    arg_5.wrapped = arg_4

    return arg_5 if arg_2 else arg_5(arg_4)

Decorator declaring the wrapped function to be a new - style task .


(self, start_node, split_name, max_depth=float('inf'), shortcuts=True)

def Func(arg_0, arg_1, arg_2, arg_3=arg_4('inf'), arg_5=True):
        """ Performs a backwards search from the terminal node back to the start node

        :param start_node:

            The node from where search starts, or here better way where backwards search should
            end.

        :param split_name:

            List of names

        :param max_depth:

            Maximum search depth where to look for

        :param shortcuts:

            If shortcuts are allowed

        """

        arg_6 = [] # Result list of all found items
        arg_7 = set() # Set containing full names of all found items to avoid finding items
        # twice due to links

        arg_8 = '.'.join(arg_2)
        arg_9 = arg_2[-1]
        arg_10 = arg_0._get_candidate_dict(arg_9, None, use_upper_bound=False)
        arg_11 = arg_1.v_full_name

        arg_12 = len(arg_2)

        for arg_13 in arg_10:
            # Check if candidate startswith the parent's name
            arg_14 = arg_10[arg_13]
            if arg_9 != arg_14.v_name or arg_14.v_full_name in arg_7:
                # If this is not the case we do have link, that we need to skip
                continue

            if arg_13.startswith(arg_11):
                if arg_11 != '':
                    arg_15 = arg_13[len(arg_11) + 1:]
                else:
                    arg_15 = arg_13

                arg_16 = arg_15.split('.')

                if len(arg_16) > arg_3:
                    break

                if len(arg_2) == 1 or arg_15.endswith(arg_8):
                    arg_6.append(arg_14)
                    arg_7.add(arg_14.v_full_name)

                elif arg_5:

                    arg_17 = set(arg_16)
                    arg_18 = True
                    for arg_19 in arg_2:
                        if arg_19 not in arg_17:
                            arg_18 = False
                            break

                    if arg_18:
                        arg_20 = 0
                        arg_21 = len(arg_16)
                        for arg_22 in range(arg_21):

                            if arg_22 + arg_12 - arg_20 > arg_21:
                                break

                            if arg_2[arg_20] == arg_16[arg_22]:
                                arg_20 += 1
                                if arg_20 == len(arg_2):
                                    arg_6.append(arg_14)
                                    arg_7.add(arg_14.v_full_name)
                                    break

        return arg_6


def Func(arg_0, arg_1, arg_2):  # pragma: no cover
    '''Find the best Jaccard match from query to candidates'''

    arg_3 = -1
    arg_4 = -1
    for arg_5 in arg_2:
        arg_6 = __jaccard(arg_0, arg_1[arg_5])

        if arg_6 > arg_3:
            arg_3, arg_4 = arg_6, arg_5
    return arg_4


return "if(%s==%d) " % (self.control[0].name, self.control[1]) + string

def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
control
is
:
return
arg_1
return
"if(%s==%d) "
%
(
arg_0
.
control
[
0
]
.
name
,
arg_0
.
control
[
1
]
)
+
arg_1

def Func(arg_0, arg_1):
        """Print an if statement if needed."""
        if arg_0.control is None:
            return arg_1
        return "if(%s==%d) " % (arg_0.control[0].name, arg_0.control[1]) + arg_1


Returns True if left and right are equal

def Func ( arg_0 , arg_1 ) : arg_2 = [ "diff" ] arg_2 . append ( "-q" ) arg_2 . append ( arg_0 . left . get_name ( ) ) arg_2 . append ( arg_0 . right . get_name ( ) ) try : Process ( arg_2 ) . run ( arg_1 = arg_1 , suppress_output = True ) except SubprocessError as e : if e . get_returncode ( ) == 1 : return False else : raise e return True

def Func(arg_0, arg_1):
        """ Returns True if left and right are Func
        """
        arg_2 = ["diff"]
        arg_2.append("-q")
        arg_2.append(arg_0.left.get_name())
        arg_2.append(arg_0.right.get_name())

        try:
            Process(arg_2).run(arg_1=arg_1, suppress_output=True)
        except SubprocessError as e:
            if e.get_returncode() == 1:
                return False
            else:
                raise e
        return True


def Func ( arg_0 , arg_1 , arg_2 = None ) : try : return super ( ) . Func ( arg_0 . _strip_sql ( arg_1 ) , arg_2 ) except DatabaseError as e : raise PrestoException ( arg_0 . _get_pretty_exception_message ( e ) )

def Func(arg_0, arg_1, arg_2=None):
        """
        Get a set of records from Presto
        """
        try:
            return super().Func(
                arg_0._strip_sql(arg_1), arg_2)
        except DatabaseError as e:
            raise PrestoException(arg_0._get_pretty_exception_message(e))


(start, stop, num, endpoint=True, log=False, base=10)

def Func(arg_0, arg_1, arg_2, arg_3=True, arg_4=False, arg_5=10):
    """
    Return list of evenly Funcd integers over an interval.

    Numbers can either be evenly distributed in a linear Func (if *log* is False) or in a log
    Func (if *log* is True). If *log* is True, base is used to define the log Func basis.

    If *endpoint* is True, *stop* will be the last retruned value, as long as *num* >= 2.
    """
    assert type(arg_0) is int and type(arg_1) is int and type(arg_2) is int, \
        "start, stop and num need to be intergers"
    assert arg_2 >= 2, "num has to be atleast 2"

    if arg_4:
        arg_0 = math.log(arg_0, arg_5)
        arg_1 = math.log(arg_1, arg_5)

    if arg_3:
        arg_6 = float((arg_1 - arg_0)) / float(arg_2 - 1)
    else:
        arg_6 = float((arg_1 - arg_0)) / float(arg_2)

    arg_7 = 0
    while arg_7 < arg_2:
        if arg_4:
            yield int(round(arg_5 ** (arg_0 + arg_7 * arg_6)))
        else:
            yield int(round(arg_0 + arg_7 * arg_6))
        arg_7 += 1

Return list of evenly spaced integers over an interval.

    Numbers can either be evenly distributed in a linear space (if *log* is False) or in a log
    space (if *log* is True). If *log* is True, base is used to define the log space basis.

    If *endpoint* is True, *stop* will be the last retruned value, as long as *num* >= 2.

Return list of evenly spaced integers over an interval .


def Func(arg_0, arg_1):
    """Return a random int in the range [0,n)."""
    # TODO
    # change once int.bit_length is implemented.
    # k = n.bit_length()
    arg_2 = _int_bit_length(arg_1)
    arg_3 = arg_0.getrandbits(arg_2)
    while arg_3 >= arg_1:
      arg_3 = arg_0.getrandbits(arg_2)
    return arg_3

Return a random int in the range [ 0 n ) .


(self, pattern, function, method=None, type_cast=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : if not arg_4 : arg_4 = { } with arg_0 . _lock : arg_0 . _data_store . append ( { 'pattern' : arg_1 , 'function' : arg_2 , 'method' : arg_3 , 'type_cast' : arg_4 , } )

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
        """Function for registering a path pattern.

        Args:
            pattern (str): Regex pattern to match a certain path.
            function (function): Function to associate with this path.
            method (str, optional): Usually used to define one of GET, POST,
                PUT, DELETE. You may use whatever fits your situation though.
                Defaults to None.
            type_cast (dict, optional): Mapping between the param name and
                one of `int`, `float` or `bool`. The value reflected by the
                provided param name will than be casted to the given type.
                Defaults to None.
        """
        if not arg_4:
            arg_4 = {}

        with arg_0._lock:
            arg_0._data_store.append({
                'pattern': arg_1,
                'function': arg_2,
                'method': arg_3,
                'type_cast': arg_4,
            })

Function for registering a path pattern .


def Func ( arg_0 ) : arg_0 . generate_workflow_description ( ) if arg_0 . batch_values : arg_0 . id = arg_0 . workflow . launch_batch_workflow ( arg_0 . definition ) else : arg_0 . id = arg_0 . workflow . launch ( arg_0 . definition ) return arg_0 . id

def Func(arg_0):
        '''
        Execute the workflow.

        Args:
            None

        Returns:
            Workflow_id
        '''
        # if not self.tasks:
        #     raise WorkflowError('Workflow contains no tasks, and cannot be Funcd.')

        # for task in self.tasks:
        #     self.definition['tasks'].append( task.generate_task_workflow_json() )

        arg_0.generate_workflow_description()

        # hit batch workflow endpoint if batch values
        if arg_0.batch_values:
            arg_0.id = arg_0.workflow.launch_batch_workflow(arg_0.definition)

        # use regular workflow endpoint if no batch values
        else:
            arg_0.id = arg_0.workflow.launch(arg_0.definition)

        return arg_0.id


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . subject_template . render ( unescape ( arg_1 ) ) return arg_2 . strip ( )

def Func(arg_0, arg_1):
        """
        Renders the message subject for the given context.

        The context data is automatically unescaped to avoid rendering HTML
        entities in ``text/plain`` content.

        :param context: The context to use when rendering the subject template.
        :type context: :class:`~django.template.Context`
        :returns: A rendered subject.
        :rtype: :class:`str`
        """
        arg_2 = arg_0.subject_template.render(unescape(arg_1))
        return arg_2.strip()

Renders the message subject for the given context .


def Func(arg_0, arg_1, arg_2, arg_3):
  """Checks for the correctness of various spacing around function calls.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  arg_4 = arg_1.elided[arg_2]

  # Since function calls often occur inside if/for/while/switch
  # expressions - which have their own, more liberal conventions - we
  # first see if we should be looking inside such an expression for a
  # function call, to which we can apply more strict standards.
  arg_5 = arg_4    # if there's no control flow construct, look at whole line
  for arg_6 in (r'\bif\s*\((.*)\)\s*{',
                  r'\bfor\s*\((.*)\)\s*{',
                  r'\bwhile\s*\((.*)\)\s*[{;]',
                  r'\bswitch\s*\((.*)\)\s*{'):
    arg_7 = Search(arg_6, arg_4)
    if arg_7:
      arg_5 = arg_7.group(1)    # look inside the parens for function calls
      break

  # Except in if/for/while/switch, there should never be space
  # immediately inside parens (eg "f( 3, 4 )").  We make an exception
  # for nested parens ( (a+b) + c ).  Likewise, there should never be
  # a space before a ( when it's a function argument.  I assume it's a
  # function argument when the char before the whitespace is legal in
  # a function name (alnum + _) and we're not starting a macro. Also ignore
  # pointers and references to arrays and functions coz they're too tricky:
  # we use a very simple way to recognize these:
  # " (something)(maybe-something)" or
  # " (something)(maybe-something," or
  # " (something)[something]"
  # Note that we assume the contents of [] to be short enough that
  # they'll never need to wrap.
  if (  # Ignore control structures.
      not Search(r'\b(if|for|while|switch|return|new|delete|catch|sizeof)\b',
                 arg_5) and
      # Ignore pointers/references to functions.
      not Search(r' \([^)]+\)\([^)]*(\)|,$)', arg_5) and
      # Ignore pointers/references to arrays.
      not Search(r' \([^)]+\)\[[^\]]+\]', arg_5)):
    if Search(r'\w\s*\(\s(?!\s*\\$)', arg_5):      # a ( used for a fn call
      arg_3(arg_0, arg_2, 'whitespace/parens', 4,
            'Extra space after ( in function call')
    elif Search(r'\(\s+(?!(\s*\\)|\()', arg_5):
      arg_3(arg_0, arg_2, 'whitespace/parens', 2,
            'Extra space after (')
    if (Search(r'\w\s+\(', arg_5) and
        not Search(r'_{0,2}asm_{0,2}\s+_{0,2}volatile_{0,2}\s+\(', arg_5) and
        not Search(r'#\s*define|typedef|using\s+\w+\s*=', arg_5) and
        not Search(r'\w\s+\((\w+::)*\*\w+\)\(', arg_5) and
        not Search(r'\bcase\s+\(', arg_5)):
      # TODO(unknown): Space after an operator function seem to be a common
      # error, silence those for now by restricting them to highest verbosity.
      if Search(r'\boperator_*\b', arg_4):
        arg_3(arg_0, arg_2, 'whitespace/parens', 0,
              'Extra space before ( in function call')
      else:
        arg_3(arg_0, arg_2, 'whitespace/parens', 4,
              'Extra space before ( in function call')
    # If the ) is followed only by a newline or a { + newline, assume it's
    # part of a control statement (if/while/etc), and don't complain
    if Search(r'[^)]\s+\)\s*[^{\s]', arg_5):
      # If the closing parenthesis is preceded by only whitespaces,
      # try to give a more descriptive error message.
      if Search(r'^\s+\)', arg_5):
        arg_3(arg_0, arg_2, 'whitespace/parens', 2,
              'Closing ) should be moved to the previous line')
      else:
        arg_3(arg_0, arg_2, 'whitespace/parens', 2,
              'Extra space before )')

Checks for the correctness of various spacing around function calls .


def Func ( arg_0 ) : arg_1 = tf . constant ( [ ] , dtype = tf . int32 ) for arg_2 in arg_0 . parameters : arg_1 = tf . broadcast_dynamic_shape ( arg_1 , arg_2 . prior . Func ( ) ) return arg_1

def Func(arg_0):
    """Runtime batch shape of models represented by this component.

    Returns:
      batch_shape: `int` `Tensor` giving the broadcast batch shape of
        all model parameters. This should match the batch shape of
        derived state space models, i.e.,
        `self.make_state_space_model(...).Func()`.
    """
    arg_1 = tf.constant([], dtype=tf.int32)
    for arg_2 in arg_0.parameters:
      arg_1 = tf.broadcast_dynamic_shape(
          arg_1, arg_2.prior.Func())
    return arg_1

Runtime batch shape of models represented by this component.

    Returns:
      batch_shape: `int` `Tensor` giving the broadcast batch shape of
        all model parameters. This should match the batch shape of
        derived state space models, i.e.,
        `self.make_state_space_model(...).batch_shape_tensor()`.

Runtime batch shape of models represented by this component .


def Func(arg_0, arg_1, arg_2=None):
        """
        Let SSL know where we can find trusted certificates for the certificate
        chain.  Note that the certificates have to be in PEM format.

        If capath is passed, it must be a directory prepared using the
        ``c_rehash`` tool included with OpenSSL.  Either, but not both, of
        *pemfile* or *capath* may be :data:`None`.

        :param cafile: In which file we can find the certificates (``bytes`` or
            ``unicode``).
        :param capath: In which directory we can find the certificates
            (``bytes`` or ``unicode``).

        :return: None
        """
        if arg_1 is None:
            arg_1 = _ffi.NULL
        else:
            arg_1 = _path_string(arg_1)

        if arg_2 is None:
            arg_2 = _ffi.NULL
        else:
            arg_2 = _path_string(arg_2)

        arg_3 = _lib.SSL_CTX_Func(
            arg_0._context, arg_1, arg_2
        )
        if not arg_3:
            _raise_current_error()

Let SSL know where we can find trusted certificates for the certificate chain . Note that the certificates have to be in PEM format .


def Func(arg_0):
    "Show a tip message"

    arg_1 = ("Close the main window to exit & save.\n"
           "Drag & Drop / Click the controls from the ToolBox to create new ones.\n"
           "Left click on the created controls to select them.\n"
           "Double click to edit the default property.\n"
           "Right click to pop-up the context menu.\n")
    # create a super tool tip manager and set some styles
    arg_2 = STT.SuperToolTip(arg_1)
    arg_2.SetHeader("Welcome to gui2py designer!")
    arg_2.SetDrawHeaderLine(True)
    arg_2.ApplyStyle("Office 2007 Blue")
    arg_2.SetDropShadow(True)
    arg_2.SetHeaderBitmap(images.designer.GetBitmap())
    arg_2.SetEndDelay(15000)                      # hide in 15 s
    # create a independent tip window, show/hide manually (avoid binding wx_obj)
    arg_3 = CustomToolTipWindow(arg_0, arg_2)
    arg_3.CalculateBestSize()
    arg_3.CalculateBestPosition(arg_0)
    arg_3.DropShadow(arg_2.GetDropShadow())
    if arg_2.GetUseFade():
        arg_4 = lambda: arg_3.StartAlpha(True)
    else:
        arg_4 = lambda: arg_3.Show()
    wx.CallLater(1000, arg_4)           # show the tip in 1 s
    wx.CallLater(30000, arg_3.Destroy)


def Func ( arg_0 ) : arg_1 = nx . grid_2d_graph ( arg_0 + 2 , arg_0 ) for arg_2 in range ( arg_0 ) : arg_1 . node [ ( 0 , arg_2 ) ] [ 'span' ] = 0 arg_1 [ ( 0 , arg_2 ) ] [ ( 1 , arg_2 ) ] [ 'span' ] = 0 arg_1 . node [ ( arg_0 + 1 , arg_2 ) ] [ 'span' ] = 1 arg_1 [ ( arg_0 + 1 , arg_2 ) ] [ ( arg_0 , arg_2 ) ] [ 'span' ] = 1 return arg_1

def Func(arg_0):
    """
    Generate a square lattice with auxiliary nodes for spanning detection

    Parameters
    ----------

    length : int
       Number of nodes in one dimension, excluding the auxiliary nodes.

    Returns
    -------

    networkx.Graph
       A square lattice graph with auxiliary nodes for spanning cluster
       detection

    See Also
    --------

    sample_states : spanning cluster detection

    """
    arg_1 = nx.grid_2d_graph(arg_0 + 2, arg_0)

    for arg_2 in range(arg_0):
        # side 0
        arg_1.node[(0, arg_2)]['span'] = 0
        arg_1[(0, arg_2)][(1, arg_2)]['span'] = 0

        # side 1
        arg_1.node[(arg_0 + 1, arg_2)]['span'] = 1
        arg_1[(arg_0 + 1, arg_2)][(arg_0, arg_2)]['span'] = 1

    return arg_1


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = arg_3 or { } arg_4 . update ( { 'name' : arg_1 , 'value' : arg_2 , } ) return Func_to_string ( arg_0 . template_name , arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Include a hidden input to stored the serialized upload value."""
        arg_4 = arg_3 or {}
        arg_4.update({'name': arg_1, 'value': arg_2, })
        return Func_to_string(arg_0.template_name, arg_4)

Include a hidden input to stored the serialized upload value .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
LOG
.
info
(
"Func %s for tenant %s"
%
(
arg_1
,
arg_0
.
tenant_id
)
)
with
arg_0
.
session
.
begin
(
)
:
arg_3
=
db_api
.
network_find
(
arg_0
,
arg_1
=
arg_1
,
scope
=
db_api
.
ONE
)
if
not
arg_3
:
raise
n_exc
.
NetworkNotFound
(
net_id
=
arg_1
)
arg_4
=
arg_2
[
"network"
]
utils
.
pop_param
(
arg_4
,
"network_plugin"
)
if
not
arg_0
.
is_admin
and
"ipam_strategy"
in
arg_4
:
utils
.
pop_param
(
arg_4
,
"ipam_strategy"
)
arg_3
=
db_api
.
network_update
(
arg_0
,
arg_3
,
**
arg_4
)
return
v
.
_make_network_dict
(
arg_3
)

def Func(arg_0, arg_1, arg_2):
    """Update values of a network.

    : param context: neutron api request context
    : param id: UUID representing the network to update.
    : param network: dictionary with keys indicating fields to update.
        valid keys are those that have a value of True for 'allow_put'
        as listed in the RESOURCE_ATTRIBUTE_MAP object in
        neutron/api/v2/attributes.py.
    """
    LOG.info("Func %s for tenant %s" %
             (arg_1, arg_0.tenant_id))
    with arg_0.session.begin():
        arg_3 = db_api.network_find(arg_0, arg_1=arg_1, scope=db_api.ONE)
        if not arg_3:
            raise n_exc.NetworkNotFound(net_id=arg_1)
        arg_4 = arg_2["network"]
        utils.pop_param(arg_4, "network_plugin")
        if not arg_0.is_admin and "ipam_strategy" in arg_4:
            utils.pop_param(arg_4, "ipam_strategy")
        arg_3 = db_api.network_update(arg_0, arg_3, **arg_4)

    return v._make_network_dict(arg_3)


(self, hql, schema='default', fetch_size=None, hive_conf=None)

def Func(arg_0, arg_1, arg_2='default', arg_3=None, arg_4=None):
        """
        Get results of the provided hql in target schema.

        :param hql: hql to be executed.
        :type hql: str or list
        :param schema: target schema, default to 'default'.
        :type schema: str
        :param fetch_size: max size of result to fetch.
        :type fetch_size: int
        :param hive_conf: hive_conf to execute alone with the hql.
        :type hive_conf: dict
        :return: results of hql execution, dict with data (list of results) and header
        :rtype: dict
        """
        arg_5 = arg_0._Func(arg_1, arg_2,
                                         arg_3=arg_3, arg_4=arg_4)
        arg_6 = next(arg_5)
        arg_7 = {
            'data': list(arg_5),
            'header': arg_6
        }
        return arg_7

Get results of the provided hql in target schema .


def Func(arg_0, arg_1=None, arg_2=False):
    """Attach a method to a parsing class and register it as a parser Func.

       The method is registered with its name unless Funcname is provided.
    """
    if not hasattr(arg_0, '_Funcs'):
        raise TypeError(
            "%s didn't seems to be a BasicParser subsclasse" % arg_0.__name__)
    arg_3 = arg_0._Funcs
    arg_4 = arg_0._rules

    def wrapper(arg_5):
        nonlocal arg_1
        add_method(arg_0)(arg_5)
        if arg_1 is None:
            arg_1 = arg_5.__name__
        if not arg_2 and (arg_1 in arg_3 or arg_1 in arg_4):
            raise TypeError("%s is already define has rule or Func" % arg_1)
        if '.' not in arg_1:
            arg_1 = '.'.join([arg_0.__module__, arg_0.__name__, arg_1])
        set_one(arg_3, arg_1, arg_5)
        return arg_5
    return wrapper

Attach a method to a parsing class and register it as a parser hook.

       The method is registered with its name unless hookname is provided.

Attach a method to a parsing class and register it as a parser hook .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
get_rooms
(
)
for
arg_3
in
arg_2
or
[
]
:
if
arg_3
[
"name"
]
==
arg_1
:
return
arg_0
.
get_room
(
arg_3
[
"id"
]
)
raise
RoomNotFoundException
(
"Room %s not found"
%
arg_1
)

def Func(arg_0, arg_1):
        """ Get a room by name.

        Returns:
            :class:`Room`. Room

        Raises:
            RoomNotFoundException
        """
        arg_2 = arg_0.get_rooms()
        for arg_3 in arg_2 or []:
            if arg_3["name"] == arg_1:
                return arg_0.get_room(arg_3["id"])
        raise RoomNotFoundException("Room %s not found" % arg_1)


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = arg_0 . code return arg_0 . cast [ arg_1 ] ( arg_0 . text )

def Func(arg_0,arg_1=None):
        """Return text cast to the correct type or the selected type"""
        if arg_1 is None:
            arg_1 = arg_0.code
        return arg_0.cast[arg_1](arg_0.text)


def Func ( arg_0 , arg_1 = None ) : arg_1 = _prepare_path ( arg_1 , "html" ) with open ( arg_1 , "wb" ) as f : f . write ( encode_string ( arg_0 . body ) ) return arg_1

def Func(arg_0, arg_1=None):
        """
        Save a snapshot of the page.

        If invoked without arguments, it will save a file to :data:`capybara.save_path` and the
        file will be given a randomly generated filename. If invoked with a relative path, the path
        will be relative to :data:`capybara.save_path`.

        Args:
            path (str, optional): The path to where it should be saved.

        Returns:
            str: The path to which the file was saved.
        """

        arg_1 = _prepare_path(arg_1, "html")

        with open(arg_1, "wb") as f:
            f.write(encode_string(arg_0.body))

        return arg_1


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 not in arg_3 : arg_3 [ arg_0 ] = sre_compile . compile ( arg_0 ) return arg_3 [ arg_0 ] . sub ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
  """Replaces instances of pattern in a string with a replacement.

  The compiled regex is kept in a cache shared by Match and Search.

  Args:
    pattern: regex pattern
    rep: replacement text
    s: search string

  Returns:
    string with replacements made (or original string if no replacements)
  """
  if arg_0 not in arg_3:
    arg_3[arg_0] = sre_compile.compile(arg_0)
  return arg_3[arg_0].sub(arg_1, arg_2)

Replaces instances of pattern in a string with a replacement .


return self.fetch_json(
            uri_path=self.base_uri + '/checkItems',
            query_params=query_params or {}
        )

def Func ( arg_0 , arg_1 = None ) : return arg_0 . fetch_json ( uri_path = arg_0 . base_uri + '/checkItems' , arg_1 = arg_1 or { } )

def Func(arg_0, arg_1=None):
        '''
        Get all the items for this label. Returns a list of dictionaries.
        Each dictionary has the values for an item.
        '''
        return arg_0.fetch_json(
            uri_path=arg_0.base_uri + '/checkItems',
            arg_1=arg_1 or {}
        )

Get all the items for this label . Returns a list of dictionaries . Each dictionary has the values for an item .


def
Func
(
arg_0
)
:
if
arg_0
.
upper
(
)
.
endswith
(
"KB"
)
:
return
float
(
arg_0
.
rstrip
(
"KB"
)
)
/
1024
elif
arg_0
.
upper
(
)
.
endswith
(
" B"
)
:
return
float
(
arg_0
.
rstrip
(
"B"
)
)
/
1024
/
1024
elif
arg_0
.
upper
(
)
.
endswith
(
"MB"
)
:
return
float
(
arg_0
.
rstrip
(
"MB"
)
)
elif
arg_0
.
upper
(
)
.
endswith
(
"GB"
)
:
return
float
(
arg_0
.
rstrip
(
"GB"
)
)
*
1024
elif
arg_0
.
upper
(
)
.
endswith
(
"TB"
)
:
return
float
(
arg_0
.
rstrip
(
"TB"
)
)
*
1024
*
1024
else
:
return
float
(
arg_0
)

def Func(arg_0):
        """Converts size string into megabytes

        Parameters
        ----------
        s : str
            The size string can be '30KB', '20MB' or '1GB'

        Returns
        -------
        float
            With the size in bytes

        """

        if arg_0.upper().endswith("KB"):
            return float(arg_0.rstrip("KB")) / 1024

        elif arg_0.upper().endswith(" B"):
            return float(arg_0.rstrip("B")) / 1024 / 1024

        elif arg_0.upper().endswith("MB"):
            return float(arg_0.rstrip("MB"))

        elif arg_0.upper().endswith("GB"):
            return float(arg_0.rstrip("GB")) * 1024

        elif arg_0.upper().endswith("TB"):
            return float(arg_0.rstrip("TB")) * 1024 * 1024

        else:
            return float(arg_0)


return dict(color=self.color, velocity=self.velocity, colors=self.colors)

def Func ( arg_0 ) : return dict ( color = arg_0 . color , velocity = arg_0 . velocity , colors = arg_0 . colors )

def Func(arg_0):
        """Keyword arguments for recreating the Shape from the vertices.

        """
        return dict(color=arg_0.color, velocity=arg_0.velocity, colors=arg_0.colors)

Keyword arguments for recreating the Shape from the vertices .


(
    ctx: ParserContext, form: sym.Symbol
)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 . Symbol ) -> Union [ MaybeClass , MaybeHostForm , VarRef ] : if arg_2 . ns is None and arg_2 . name . endswith ( "." ) : try : arg_5 , arg_6 = arg_2 . name [ : - 1 ] . rsplit ( "." , maxsplit = 1 ) arg_2 = arg_3 . symbol ( arg_6 , arg_5 = arg_5 ) except ValueError : arg_2 = arg_3 . symbol ( arg_2 . name [ : - 1 ] ) if arg_2 . ns is not None : return __resolve_namespaced_symbol ( arg_0 , arg_2 ) else : return __resolve_bare_symbol ( arg_0 , arg_2 )

def Func(
    arg_0: arg_1, arg_2: arg_3.Symbol
) -> Union[MaybeClass, MaybeHostForm, VarRef]:
    """Resolve a Basilisp symbol as a Var or Python name."""
    # Support special class-name syntax to instantiate new classes
    #   (Classname. *args)
    #   (aliased.Classname. *args)
    #   (fully.qualified.Classname. *args)
    if arg_2.ns is None and arg_2.name.endswith("."):
        try:
            arg_5, arg_6 = arg_2.name[:-1].rsplit(".", maxsplit=1)
            arg_2 = arg_3.symbol(arg_6, arg_5=arg_5)
        except ValueError:
            arg_2 = arg_3.symbol(arg_2.name[:-1])

    if arg_2.ns is not None:
        return __resolve_namespaced_symbol(arg_0, arg_2)
    else:
        return __resolve_bare_symbol(arg_0, arg_2)

Resolve a Basilisp symbol as a Var or Python name .


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
socket
.
getaddrinfo
(
arg_1
,
0
,
arg_0
,
socket
.
SOCK_STREAM
,
0
,
socket
.
AI_NUMERICHOST
)
except
socket
.
gaierror
,
err
:
logger
.
debug
(
"gaierror: {0} for {1!r}"
.
format
(
err
,
arg_1
)
)
raise
ValueError
(
"Bad IP address"
)
if
not
arg_2
:
logger
.
debug
(
"getaddrinfo result empty"
)
raise
ValueError
(
"Bad IP address"
)
arg_3
=
arg_2
[
0
]
[
4
]
logger
.
debug
(
" got address: {0!r}"
.
format
(
arg_3
)
)
try
:
return
socket
.
getnameinfo
(
arg_3
,
socket
.
NI_NUMERICHOST
)
[
0
]
except
socket
.
gaierror
,
err
:
logger
.
debug
(
"gaierror: {0} for {1!r}"
.
format
(
err
,
arg_3
)
)
raise
ValueError
(
"Bad IP address"
)

def Func(arg_0, arg_1):
    """Check if `address` is valid IP address and return it, in a normalized
    form.

    :Parameters:
        - `family`: ``socket.AF_INET`` or ``socket.AF_INET6``
        - `address`: the IP address to validate
    """
    try:
        arg_2 = socket.getaddrinfo(arg_1, 0, arg_0, socket.SOCK_STREAM, 0,
                                                        socket.AI_NUMERICHOST)
    except socket.gaierror, err:
        logger.debug("gaierror: {0} for {1!r}".format(err, arg_1))
        raise ValueError("Bad IP address")

    if not arg_2:
        logger.debug("getaddrinfo result empty")
        raise ValueError("Bad IP address")
    arg_3 = arg_2[0][4]
    logger.debug(" got address: {0!r}".format(arg_3))

    try:
        return socket.getnameinfo(arg_3, socket.NI_NUMERICHOST)[0]
    except socket.gaierror, err:
        logger.debug("gaierror: {0} for {1!r}".format(err, arg_3))
        raise ValueError("Bad IP address")

Check if address is valid IP address and return it in a normalized form .


def Func ( arg_0 , arg_1 , arg_2 = 'broadcast' ) : if arg_2 == 'meshed' : return np . meshgrid ( * arg_1 , indexing = 'ij' ) elif arg_2 == 'vector' : arg_1 = np . meshgrid ( * arg_1 , indexing = 'ij' ) return np . rollaxis ( np . array ( np . broadcast_arrays ( * arg_1 ) ) , 0 , arg_0 . dim + 1 ) elif arg_2 == 'flat' : return arg_1 else : return [ arg_4 [ arg_0 . _coord_slicers [ arg_3 ] ] for arg_3 , arg_4 in enumerate ( arg_1 ) ]

def Func(arg_0, arg_1, arg_2='broadcast'):
        """
        Format a 3d vector field in certain ways, see `coords` for a description
        of each formatting method.
        """
        if arg_2 == 'meshed':
            return np.meshgrid(*arg_1, indexing='ij')
        elif arg_2 == 'vector':
            arg_1 = np.meshgrid(*arg_1, indexing='ij')
            return np.rollaxis(np.array(np.broadcast_arrays(*arg_1)),0,arg_0.dim+1)
        elif arg_2 == 'flat':
            return arg_1
        else:
            return [arg_4[arg_0._coord_slicers[arg_3]] for arg_3,arg_4 in enumerate(arg_1)]

Format a 3d vector field in certain ways see coords for a description of each formatting method .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . sendToken ( arg_1 ) return arg_0 . getToken ( arg_2 )

def Func(arg_0, arg_1):
        """
        Take an existing Skype token and refresh it, to extend the expiry time without other credentials.

        Args:
            token (str): existing Skype token

        Returns:
            (str, datetime.datetime) tuple: Skype token, and associated expiry if known

        Raises:
            .SkypeAuthException: if the login request is rejected
            .SkypeApiException: if the login form can't be processed
        """
        arg_2 = arg_0.sendToken(arg_1)
        return arg_0.getToken(arg_2)

Take an existing Skype token and refresh it to extend the expiry time without other credentials .


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_2 . setdefault ( 'indent' , 4 ) arg_1 = json . dumps ( arg_1 , ** arg_2 ) return u ( arg_1 )

def Func(arg_0, arg_1, **arg_2):
        "Turn metadata into JSON"
        arg_2.setdefault('indent', 4)
        arg_1 = json.dumps(arg_1, **arg_2)
        return u(arg_1)


def Func ( arg_0 ) : if arg_0 . endswith ( u'.ipynb' ) : arg_1 = u'json' elif arg_0 . endswith ( u'.json' ) : arg_1 = u'json' elif arg_0 . endswith ( u'.py' ) : arg_1 = u'py' else : arg_0 = arg_0 + u'.ipynb' arg_1 = u'json' arg_2 = arg_0 . split ( '.' ) [ 0 ] return arg_0 , arg_2 , arg_1

def Func(arg_0):
    """Parse a notebook filename.

    This function takes a notebook filename and returns the notebook
    format (json/py) and the notebook name. This logic can be
    summarized as follows:

    * notebook.ipynb -> (notebook.ipynb, notebook, json)
    * notebook.json  -> (notebook.json, notebook, json)
    * notebook.py    -> (notebook.py, notebook, py)
    * notebook       -> (notebook.ipynb, notebook, json)

    Parameters
    ----------
    fname : unicode
        The notebook filename. The filename can use a specific filename
        extention (.ipynb, .json, .py) or none, in which case .ipynb will
        be assumed.

    Returns
    -------
    (fname, name, format) : (unicode, unicode, unicode)
        The filename, notebook name and format.
    """
    if arg_0.endswith(u'.ipynb'):
        arg_1 = u'json'
    elif arg_0.endswith(u'.json'):
        arg_1 = u'json'
    elif arg_0.endswith(u'.py'):
        arg_1 = u'py'
    else:
        arg_0 = arg_0 + u'.ipynb'
        arg_1 = u'json'
    arg_2 = arg_0.split('.')[0]
    return arg_0, arg_2, arg_1


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_0 . dict . setdefault ( arg_1 , { } ) [ arg_2 ] = arg_3

def Func(arg_0, arg_1, arg_2, arg_3):
        "Add a link from A to B of given distance, in one direction only."
        arg_0.dict.setdefault(arg_1,{})[arg_2] = arg_3

Add a link from A to B of given distance in one direction only .


def Func(arg_0, arg_1):
        """
        Return the course and course run metadata for the given course run ID.

        Arguments:
            course_run_id (str): The course run ID.

        Returns:
            tuple: The course metadata and the course run metadata.
        """
        # Parse the course ID from the course run ID.
        arg_2 = parse_course_key(arg_1)
        # Retrieve the course metadata from the catalog service.
        arg_3 = arg_0.get_course_details(arg_2)

        arg_4 = None
        if arg_3:
            # Find the specified course run.
            arg_4 = None
            arg_5 = [arg_4 for arg_4 in arg_3['course_runs'] if arg_4['key'] == arg_1]
            if arg_5:
                arg_4 = arg_5[0]

        return arg_3, arg_4

Return the course and course run metadata for the given course run ID .


def
Func
(
)
:
try
:
arg_0
=
options
.
virtualenv
.
activate_cmd
except
AttributeError
:
arg_0
=
if
arg_0
is
:
arg_1
=
path
(
os
.
environ
.
get
(
'VIRTUAL_ENV'
,
''
)
)
if
not
arg_1
:
arg_1
=
options
.
paved
.
cwd
else
:
arg_1
=
path
(
arg_1
)
arg_0
=
arg_1
/
'bin'
/
'activate'
if
arg_0
.
exists
(
)
:
info
(
'Using default virtualenv at %s'
%
arg_0
)
options
.
setdotted
(
'virtualenv.activate_cmd'
,
'source %s'
%
arg_0
)

def Func():
    """Attempt to set the virtualenv activate command, if it hasn't been specified.
    """
    try:
        arg_0 = options.virtualenv.activate_cmd
    except AttributeError:
        arg_0 = None

    if arg_0 is None:
        arg_1 = path(os.environ.get('VIRTUAL_ENV', ''))
        if not arg_1:
            arg_1 = options.paved.cwd
        else:
            arg_1 = path(arg_1)

        arg_0 = arg_1 / 'bin' / 'activate'

        if arg_0.exists():
            info('Using default virtualenv at %s' % arg_0)
            options.setdotted('virtualenv.activate_cmd', 'source %s' % arg_0)

Attempt to set the virtualenv activate command if it hasn t been specified .


def Func ( arg_0 ) : if not arg_0 or not isinstance ( arg_0 , str ) : return False if not len ( arg_0 ) == 40 : return False for arg_1 in arg_0 : if ( arg_1 < '0' or arg_1 > '9' ) and ( arg_1 < 'A' or arg_1 > 'F' ) and ( arg_1 < 'a' or arg_1 > 'f' ) : return False return True

def Func(arg_0):
    """ Returns True if the considered string is a valid RIPEMD160 hash. """
    if not arg_0 or not isinstance(arg_0, str):
        return False
    if not len(arg_0) == 40:
        return False
    for arg_1 in arg_0:
        if (arg_1 < '0' or arg_1 > '9') and (arg_1 < 'A' or arg_1 > 'F') and (arg_1 < 'a' or arg_1 > 'f'):
            return False
    return True

Returns True if the considered string is a valid RIPEMD160 hash .


def Func(arg_0, arg_1, arg_2=False):
        """Removes a single node from the tree.

        Only from RAM not from hdf5 file!

        :param instance: The node to be deleted

        :param recursive: If group nodes with children should be deleted

        """
        arg_3 = arg_1.v_full_name
        arg_4 = deque(arg_3.split('.'))
        arg_0._remove_along_branch(arg_0._root_instance, arg_4, arg_2)


(duration: int, amp: complex, period: float = None,
             phase: float = 0, name: str = None)

return _sampled_triangle_pulse(duration, amp, period, phase=phase, name=name)

def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_5 = None,
             arg_6: arg_5 = 0, arg_7: arg_8 = None) -> SamplePulse:
    """Generates Func wave `SamplePulse`.

    Applies `left` sampling strategy to generate discrete pulse from continuous function.

    Args:
        duration: Duration of pulse. Must be greater than zero.
        amp: Pulse amplitude. Wave range is [-amp, amp].
        period: Pulse period, units of dt. If `None` defaults to single cycle.
        phase: Pulse phase.
        name: Name of pulse.
    """
    if arg_4 is None:
        arg_4 = arg_0

    return _sampled_Func_pulse(arg_0, arg_2, arg_4, arg_6=arg_6, arg_7=arg_7)

Generates triangle wave `SamplePulse`.

    Applies `left` sampling strategy to generate discrete pulse from continuous function.

    Args:
        duration: Duration of pulse. Must be greater than zero.
        amp: Pulse amplitude. Wave range is [-amp, amp].
        period: Pulse period, units of dt. If `None` defaults to single cycle.
        phase: Pulse phase.
        name: Name of pulse.


def Func ( ) : global g_summary_dict_all arg_0 = [ x for x in listdir ( g_test_root_dir ) if isfile ( join ( g_test_root_dir , x ) ) ] for arg_1 in arg_0 : for arg_2 in g_file_start : if ( arg_2 in arg_1 ) and ( os . path . getsize ( arg_1 ) > 10 ) : arg_3 = os . path . join ( g_test_root_dir , arg_1 ) try : arg_4 = json . load ( open ( arg_3 , 'r' ) ) for arg_5 in range ( len ( arg_4 [ "TestName" ] ) ) : addFailedTests ( g_summary_dict_all , arg_4 , arg_5 ) except : continue break

def Func():
    """
    This function will look at the local directory and pick out files that have the correct start name and
    summarize the results into one giant dict.

    :return: None
    """
    global g_summary_dict_all

    arg_0 = [x for x in listdir(g_test_root_dir) if isfile(join(g_test_root_dir, x))]   # grab files

    for arg_1 in arg_0:
        for arg_2 in g_file_start:
            if (arg_2 in arg_1) and (os.path.getsize(arg_1) > 10):  # found the file containing failed tests
                arg_3 = os.path.join(g_test_root_dir, arg_1)
                try:
                    arg_4 = json.load(open(arg_3,'r'))

                    # scrape through temp_dict and see if we need to add the test to intermittents
                    for arg_5 in range(len(arg_4["TestName"])):
                        addFailedTests(g_summary_dict_all, arg_4, arg_5)
                except:
                    continue
                break

This function will look at the local directory and pick out files that have the correct start name and summarize the results into one giant dict .


def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 . items ( ) : arg_0 [ arg_1 ] = _fields_sort_by_indicators ( arg_2 )

def Func(arg_0):
    """Sort the fields inside the record by indicators."""
    for arg_1, arg_2 in arg_0.items():
        arg_0[arg_1] = _fields_sort_by_indicators(arg_2)

Sort the fields inside the record by indicators .


(self, n=10, raw=True, output=False, include_latest=False)

def Func(arg_0, arg_1=10, arg_2=True, arg_3=False, arg_4=False):
        """Get the last n lines from the history database.

        Parameters
        ----------
        n : int
          The number of lines to get
        raw, output : bool
          See :meth:`get_range`
        include_latest : bool
          If False (default), n+1 lines are fetched, and the latest one
          is discarded. This is intended to be used where the function
          is called by a user command, which it should not return.

        Returns
        -------
        Tuples as :meth:`get_range`
        """
        arg_0.writeout_cache()
        if not arg_4:
            arg_1 += 1
        arg_5 = arg_0._run_sql("ORDER BY session DESC, line DESC LIMIT ?",
                                (arg_1,), arg_2=arg_2, arg_3=arg_3)
        if not arg_4:
            return reversed(list(arg_5)[1:])
        return reversed(list(arg_5))

Get the last n lines from the history database .


return (_global_error_suppressions.get(category, False) or
          linenum in _error_suppressions.get(category, set()) or
          linenum in _error_suppressions.get(None, set()))

def Func ( arg_0 , arg_1 ) : return ( _global_error_suppressions . get ( arg_0 , False ) or arg_1 in _error_suppressions . get ( arg_0 , set ( ) ) or arg_1 in _error_suppressions . get ( None , set ( ) ) )

def Func(arg_0, arg_1):
  """Returns true if the specified error category is suppressed on this line.

  Consults the global error_suppressions map populated by
  ParseNolintSuppressions/ProcessGlobalSuppresions/ResetNolintSuppressions.

  Args:
    category: str, the category of the error.
    linenum: int, the current line number.
  Returns:
    bool, True iff the error should be suppressed due to a NOLINT comment or
    global suppression.
  """
  return (_global_error_suppressions.get(arg_0, False) or
          arg_1 in _error_suppressions.get(arg_0, set()) or
          arg_1 in _error_suppressions.get(None, set()))

Returns true if the specified error category is suppressed on this line .


(self, image_shape, size_lines=1, size_points=0,
                  raise_if_out_of_image=False)

def Func(arg_0, arg_1, arg_2=1, arg_3=0,
                  arg_4=False):
        """
        Draw this line segment as a binary image mask.

        Parameters
        ----------
        image_shape : tuple of int
            The shape of the image onto which to draw the line mask.

        size_lines : int, optional
            Thickness of the line segments.

        size_points : int, optional
            Size of the points in pixels.

        raise_if_out_of_image : bool, optional
            Whether to raise an error if the line string is fully
            outside of the image. If set to False, no error will be raised and
            only the parts inside the image will be drawn.

        Returns
        -------
        ndarray
            Boolean line mask of shape `image_shape` (no channel axis).

        """
        arg_5 = arg_0.draw_heatmap_array(
            arg_1,
            alpha_lines=1.0, alpha_points=1.0,
            arg_2=arg_2, arg_3=arg_3,
            antialiased=False,
            arg_4=arg_4)
        return arg_5 > 0.5

Draw this line segment as a binary image mask .


return loc.base_uri + loc.location + loc.access_credential

def Func(arg_0):
        """Full URL to the dataset contents."""
        arg_1 = arg_0.download_location
        return arg_1.base_uri + arg_1.location + arg_1.access_credential


def Func ( arg_0 , ** arg_1 ) : arg_2 = AnnotationArray ( ) for arg_3 in arg_0 : if arg_3 . Func ( ** arg_1 ) : arg_2 . append ( arg_3 ) return arg_2

def Func(arg_0, **arg_1):
        '''Filter the annotation array down to only those Annotation
        objects matching the query.

        Parameters
        ----------
        kwargs : Func parameters
            See JObject.Func

        Returns
        -------
        results : AnnotationArray
            An annotation array of the objects matching the query

        See Also
        --------
        JObject.Func
        '''

        arg_2 = AnnotationArray()

        for arg_3 in arg_0:
            if arg_3.Func(**arg_1):
                arg_2.append(arg_3)

        return arg_2

Filter the annotation array down to only those Annotation
        objects matching the query.

        Parameters
        ----------
        kwargs : search parameters
            See JObject.search

        Returns
        -------
        results : AnnotationArray
            An annotation array of the objects matching the query

        See Also
        --------
        JObject.search

Filter the annotation array down to only those Annotation objects matching the query .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 [ 0 ] , ( list , np . ndarray ) ) : for arg_2 in arg_1 : arg_0 . vectors . append ( arg_2 ) else : arg_0 . vectors . append ( arg_1 )

def Func(arg_0, arg_1):
        """Add a list of vectors to Bloch sphere.

        Args:
            vectors (array_like):
                Array with vectors of unit length or smaller.
        """
        if isinstance(arg_1[0], (list, np.ndarray)):
            for arg_2 in arg_1:
                arg_0.vectors.append(arg_2)
        else:
            arg_0.vectors.append(arg_1)


def Func(arg_0, arg_1=None, arg_2=None):
    """Build nbextension Func dict for the setuptools.setup method.

    Parameters
    ----------
    path: str
        Directory relative to the setup file that the nbextension code
        lives in.
    enable: [str=None]
        Extension to "enable".  Enabling an extension causes it to be loaded
        automatically by the IPython notebook.
    user: [bool=None]
        Whether or not the nbextension should be installed in user mode.
        If this is undefined, the script will install as user mode IF the
        installer is not sudo.

    Usage
    -----
    For automatic loading:
    # Assuming `./extension` is the relative path to the JS files and
    # `./extension/main.js` is the file that you want automatically loaded.
    setup(
        name='extension',
        ...
        Func=Func('extension', 'extension/main'),
    )

    For manual loading:
    # Assuming `./extension` is the relative path to the JS files.
    setup(
        name='extension',
        ...
        Func=Func('extension'),
    )
    """
    import warnings
    from setuptools.command.install import install
    from setuptools.command.develop import arg_6
    from os.path import dirname, join, exists, realpath
    from traceback import extract_stack

    try:
        # IPython/Jupyter 4.0
        from notebook.nbextensions import install_nbextension
        from notebook.services.config import ConfigManager
    except ImportError:
        # Pre-schism
        try:
            from IPython.html.nbextensions import install_nbextension
            from IPython.html.services.config import ConfigManager
        except ImportError:
            warnings.warn("No jupyter notebook found in your environment. "
                          "Hence jupyter nbextensions were not installed. "
                          "If you would like to have them,"
                          "please issue 'pip install jupyter'.")
            return {}

    # Check if the user flag was set.
    if arg_2 is None:
        arg_2 = not _is_root()

    # Get the path of the extension
    arg_3 = extract_stack()[-2][0]
    arg_4 = realpath(arg_3)
    if not exists(arg_4):
        raise Exception('Could not find path of setup file.')
    arg_5 = join(dirname(arg_4), arg_0)

    # Installs the nbextension
    def run_nbextension_install(arg_6):
        import sys
        arg_7 = hasattr(sys, 'real_prefix')
        if arg_7:
            install_nbextension(
                arg_5, symlink=arg_6, sys_prefix=arg_7)
        else:
            install_nbextension(arg_5, symlink=arg_6, arg_2=arg_2)
        if arg_1 is not None:
            print("Enabling the extension ...")
            arg_8 = ConfigManager()
            arg_8.update('notebook', {"load_extensions": {arg_1: True}})

    # Command used for standard installs
    class InstallCommand(install):
        def run(arg_9):
            print("Installing Python module...")
            install.run(arg_9)
            print("Installing nbextension ...")
            run_nbextension_install(False)

    # Command used for development installs (symlinks the JS)
    class DevelopCommand(arg_6):
        def run(arg_9):
            print("Installing Python module...")
            arg_6.run(arg_9)
            print("Installing nbextension ...")
            run_nbextension_install(True)

    return {
        'install': InstallCommand,
        'develop': DevelopCommand,
    }

Build nbextension cmdclass dict for the setuptools.setup method.

    Parameters
    ----------
    path: str
        Directory relative to the setup file that the nbextension code
        lives in.
    enable: [str=None]
        Extension to "enable".  Enabling an extension causes it to be loaded
        automatically by the IPython notebook.
    user: [bool=None]
        Whether or not the nbextension should be installed in user mode.
        If this is undefined, the script will install as user mode IF the
        installer is not sudo.

    Usage
    -----
    For automatic loading:
    # Assuming `./extension` is the relative path to the JS files and
    # `./extension/main.js` is the file that you want automatically loaded.
    setup(
        name='extension',
        ...
        cmdclass=cmdclass('extension', 'extension/main'),
    )

    For manual loading:
    # Assuming `./extension` is the relative path to the JS files.
    setup(
        name='extension',
        ...
        cmdclass=cmdclass('extension'),
    )

Build nbextension cmdclass dict for the setuptools . setup method .


def Func(arg_0):
    """
    Initialize attributes that are not saved with the checkpoint.
    """
    arg_0._firstComputeCall = True
    arg_0._accuracy = None
    arg_0._protoScores = None
    arg_0._categoryDistances = None

    arg_0._knn = knn_classifier.KNNClassifier(**arg_0.knnParams)

    for arg_6 in ('_partitions', '_useAuxiliary', '_doSphering',
              '_scanInfo', '_protoScores'):
      if not hasattr(arg_0, arg_6):
        setattr(arg_0, arg_6, None)

Initialize attributes that are not saved with the checkpoint .


def Func ( arg_0 ) : if arg_0 . _is_finished ( ) : for arg_1 in arg_0 . children : arg_1 . Func ( ) return arg_0 . _set_state ( arg_0 . CANCELLED ) arg_0 . _drop_children ( ) arg_0 . task_spec . _on_Func ( arg_0 )

def Func(arg_0):
        """
        Cancels the item if it was not yet completed, and removes
        any children that are LIKELY.
        """
        if arg_0._is_finished():
            for arg_1 in arg_0.children:
                arg_1.Func()
            return
        arg_0._set_state(arg_0.CANCELLED)
        arg_0._drop_children()
        arg_0.task_spec._on_Func(arg_0)

Cancels the item if it was not yet completed and removes any children that are LIKELY .


def Func ( arg_0 , arg_1 ) : arg_2 = _adsDLL . AdsSyncReadStateReqEx arg_3 = ctypes . pointer ( arg_1 . amsAddrStruct ( ) ) arg_4 = ctypes . c_int ( ) arg_5 = ctypes . pointer ( arg_4 ) arg_6 = ctypes . c_int ( ) arg_7 = ctypes . pointer ( arg_6 ) arg_8 = arg_2 ( arg_0 , arg_3 , arg_5 , arg_7 ) if arg_8 : raise ADSError ( arg_8 ) return ( arg_4 . value , arg_6 . value )

def Func(arg_0, arg_1):
    # type: (int, AmsAddr) -> Tuple[int, int]
    """Read the current ADS-state and the machine-state.

    Read the current ADS-state and the machine-state from the
    ADS-server.

    :param pyads.structs.AmsAddr address: local or remote AmsAddr
    :rtype: (int, int)
    :return: ads_state, device_state

    """
    arg_2 = _adsDLL.AdsSyncReadStateReqEx

    # C pointer to ams address struct
    arg_3 = ctypes.pointer(arg_1.amsAddrStruct())

    # Current ADS status and corresponding pointer
    arg_4 = ctypes.c_int()
    arg_5 = ctypes.pointer(arg_4)

    # Current device status and corresponding pointer
    arg_6 = ctypes.c_int()
    arg_7 = ctypes.pointer(arg_6)

    arg_8 = arg_2(
        arg_0, arg_3, arg_5, arg_7
    )

    if arg_8:
        raise ADSError(arg_8)

    return (arg_4.value, arg_6.value)

Read the current ADS - state and the machine - state .


def Func ( arg_0 , * arg_1 : arg_2 [ arg_3 ] ) -> int : arg_4 = list ( itertools . chain ( * ( arg_0 . _table [ chan ] for chan in arg_1 if chan in arg_0 . _table ) ) ) if arg_4 : return min ( ( arg_5 . begin for arg_5 in arg_4 ) ) return 0

def Func(arg_0, *arg_1: arg_2[arg_3]) -> int:
        """Return earliest start time in this collection.

        Args:
            *channels: Channels over which to obtain start_time.
        """
        arg_4 = list(itertools.chain(*(arg_0._table[chan] for chan in arg_1
                                           if chan in arg_0._table)))
        if arg_4:
            return min((arg_5.begin for arg_5 in arg_4))
        return 0

Return earliest start time in this collection .


def Func ( arg_0 ) : if arg_0 . logger_flag is True : return arg_1 = logging . getLogger ( ) for arg_2 in arg_1 . handlers : if arg_2 not in arg_0 . prior_loghandlers : arg_2 . setLevel ( logging . ERROR ) arg_0 . logger_flag = True

def Func(arg_0):
        """ Mute newly added handlers to the root level, right after calling executor.status
        """
        if arg_0.logger_flag is True:
            return

        arg_1 = logging.getLogger()

        for arg_2 in arg_1.handlers:
            if arg_2 not in arg_0.prior_loghandlers:
                arg_2.setLevel(logging.ERROR)

        arg_0.logger_flag = True

Mute newly added handlers to the root level right after calling executor . status


return ProbDist(self.vars[0],
                        dict((k, v) for ((k,), v) in self.cpt.items()))

def Func ( arg_0 ) : assert len ( arg_0 . vars ) == 1 return ProbDist ( arg_0 . vars [ 0 ] , dict ( ( arg_1 , arg_2 ) for ( ( arg_1 , ) , arg_2 ) in arg_0 . cpt . items ( ) ) )

def Func(arg_0):
        "Return my probabilities; must be down to one variable."
        assert len(arg_0.vars) == 1
        return ProbDist(arg_0.vars[0],
                        dict((arg_1, arg_2) for ((arg_1,), arg_2) in arg_0.cpt.items()))

Return my probabilities ; must be down to one variable .


def Func ( arg_0 , arg_1 = 'v1' ) : arg_0 . _bucket_service = storage . Client ( ) arg_3 = GoogleCredentials . get_application_default ( ) arg_0 . _storage_service = discovery_build ( 'storage' , arg_1 , credentials = arg_3 ) arg_0 . _compute_service = discovery_build ( 'compute' , arg_1 , credentials = arg_3 )

def Func(arg_0, arg_1='v1'):
        '''get version 1 of the google compute and storage service

        Parameters
        ==========
        version: version to use (default is v1)
        '''
        arg_0._bucket_service = storage.Client()
        arg_3 = GoogleCredentials.get_application_default()
        arg_0._storage_service = discovery_build('storage', arg_1, credentials=arg_3)
        arg_0._compute_service = discovery_build('compute', arg_1, credentials=arg_3)


def Func ( ** arg_0 ) : arg_1 = BCon ( ** arg_0 ) arg_1 . start ( ) try : yield arg_1 finally : arg_1 . stop ( )

def Func(**arg_0):
    """
    Open and manage a BCon wrapper to a Bloomberg API session

    Parameters
    ----------
    **kwargs:
        Keyword arguments passed into pdblp.BCon initialization
    """
    arg_1 = BCon(**arg_0)
    arg_1.start()
    try:
        yield arg_1
    finally:
        arg_1.stop()


def Func(arg_0):
        """
        Verify a certificate in a context.

        .. versionadded:: 0.15

        :raises X509StoreContextError: If an error occurred when validating a
          certificate in the context. Sets ``certificate`` attribute to
          indicate which certificate caused the error.
        """
        # Always re-initialize the store context in case
        # :meth:`Func` is called multiple times.
        #
        # :meth:`_init` is called in :meth:`__init__` so _cleanup is called
        # before _init to ensure memory is not leaked.
        arg_0._cleanup()
        arg_0._init()
        arg_1 = _lib.X509_verify_cert(arg_0._store_ctx)
        arg_0._cleanup()
        if arg_1 <= 0:
            raise arg_0._exception_from_context()


(data, bandwidth=None, bin_seeding=False, **kwargs)

def Func ( arg_0 , arg_1 = None , arg_2 = False , ** arg_3 ) : if arg_1 is None : arg_1 = cl . estimate_bandwidth ( arg_0 ) arg_4 = cl . MeanShift ( arg_1 = arg_1 , arg_2 = arg_2 , ** arg_3 ) arg_4 . fit ( arg_0 ) arg_5 = arg_4 . labels_ return arg_5 , [ np . nan ]

def Func(arg_0, arg_1=None, arg_2=False, **arg_3):
    """
    Identify clusters using Meanshift algorithm.

    Parameters
    ----------
    data : array_like
        array of size [n_samples, n_features].
    bandwidth : float or None
        If None, bandwidth is estimated automatically using
        sklean.cluster.estimate_bandwidth
    bin_seeding : bool
        Setting this option to True will speed up the algorithm.
        See sklearn documentation for full description.

    Returns
    -------
    dict
        boolean array for each identified cluster.
    """
    if arg_1 is None:
        arg_1 = cl.estimate_bandwidth(arg_0)

    arg_4 = cl.MeanShift(arg_1=arg_1, arg_2=arg_2, **arg_3)
    arg_4.fit(arg_0)

    arg_5 = arg_4.labels_

    return arg_5, [np.nan]

Identify clusters using Meanshift algorithm .


def Func ( arg_0 , arg_1 = 255 ) : arg_2 , arg_3 = np . histogram ( arg_0 . ravel ( ) , arg_1 = arg_1 ) arg_4 = arg_2 . astype ( 'float' ) / arg_2 . sum ( ) arg_5 = 0.5 * ( arg_3 [ 1 : ] + arg_3 [ : - 1 ] ) arg_6 = np . array ( [ arg_4 [ : i + 1 ] . sum ( ) for i in range ( arg_4 . size ) ] ) arg_7 = np . array ( [ sum ( arg_5 [ : i + 1 ] * arg_4 [ : i + 1 ] ) for i in range ( arg_4 . size ) ] ) arg_8 = arg_7 [ - 1 ] arg_9 = ( arg_8 * arg_6 - arg_7 ) ** 2 / ( arg_6 * ( 1 - arg_6 ) + 1e-15 ) arg_10 = arg_9 . argmax ( ) return 0.5 * ( arg_3 [ arg_10 ] + arg_3 [ arg_10 + 1 ] )

def Func(arg_0, arg_1=255):
    """
    Otsu threshold on data.

    Otsu thresholding [1]_is a method for selecting an intensity value
    for thresholding an image into foreground and background. The sel-
    ected intensity threshold maximizes the inter-class variance.

    Parameters
    ----------
        data : numpy.ndarray
            The data to threshold
        bins : Int or numpy.ndarray, optional
            Bin edges, as passed to numpy.histogram

    Returns
    -------
        numpy.float
            The value of the threshold which maximizes the inter-class
            variance.

    Notes
    -----
        This could be generalized to more than 2 classes.
    References
    ----------
        ..[1] N. Otsu, "A Threshold Selection Method from Gray-level
            Histograms," IEEE Trans. Syst., Man, Cybern., Syst., 9, 1,
            62-66 (1979)
    """
    arg_2, arg_3 = np.histogram(arg_0.ravel(), arg_1=arg_1)
    arg_4 = arg_2.astype('float') / arg_2.sum()  #normalize
    arg_5 = 0.5*(arg_3[1:] + arg_3[:-1])  #bin center
    arg_6 = np.array([arg_4[:i+1].sum() for i in range(arg_4.size)])  #omega_k
    arg_7 = np.array([sum(arg_5[:i+1]*arg_4[:i+1]) for i in range(arg_4.size)])  #mu_k
    arg_8 = arg_7[-1]  #mu_T
    arg_9 = (arg_8*arg_6 - arg_7)**2 / (arg_6*(1-arg_6) + 1e-15)  #sigma_b
    arg_10 = arg_9.argmax()
    return 0.5*(arg_3[arg_10] + arg_3[arg_10+1])


def Func ( arg_0 , arg_1 , arg_2 = None ) : with tf . name_scope ( arg_2 or 'log_unnorm_prob_lkj' ) : arg_1 = tf . convert_to_tensor ( value = arg_1 , arg_2 = 'x' ) if arg_0 . input_output_cholesky : arg_3 = 2.0 * tf . reduce_sum ( input_tensor = tf . math . log ( tf . linalg . diag_part ( arg_1 ) ) , axis = [ - 1 ] ) else : arg_4 , arg_3 = tf . linalg . slogdet ( arg_1 ) arg_5 = ( arg_0 . concentration - 1. ) * arg_3 return arg_5

def Func(arg_0, arg_1, arg_2=None):
    """Returns the unnormalized log density of an LKJ distribution.

    Args:
      x: `float` or `double` `Tensor` of correlation matrices.  The shape of `x`
        must be `B + [D, D]`, where `B` broadcasts with the shape of
        `concentration`.
      name: Python `str` name prefixed to Ops created by this function.

    Returns:
      log_p: A Tensor of the unnormalized log density of each matrix element of
        `x`, with respect to an LKJ distribution with parameter the
        corresponding element of `concentration`.
    """
    with tf.name_scope(arg_2 or 'log_unnorm_prob_lkj'):
      arg_1 = tf.convert_to_tensor(value=arg_1, arg_2='x')
      # The density is det(matrix) ** (concentration - 1).
      # Computing the determinant with `logdet` is usually fine, since
      # correlation matrices are Hermitian and PSD. But in some cases, for a
      # PSD matrix whose eigenvalues are close to zero, `logdet` raises an error
      # complaining that it is not PSD. The root cause is the computation of the
      # cholesky decomposition in `logdet`. Hence, we use the less efficient but
      # more robust `slogdet` which does not use `cholesky`.
      #
      # An alternative would have been to check allow_nan_stats and use
      #   eigenvalues = tf.linalg.self_adjoint_eigvals(x)
      #   psd_mask = tf.cast(
      #     tf.reduce_min(eigenvalues, axis=-1) >= 0, dtype=x.dtype)
      #   tf.where(psd_mask, answer, float('-inf'))
      # to emit probability 0 for inputs that are not PSD, without ever raising
      # an error. More care must be taken, as due to numerical stability issues,
      # self_adjoint_eigvals can return slightly negative eigenvalues even for
      # a PSD matrix.
      if arg_0.input_output_cholesky:
        arg_3 = 2.0 * tf.reduce_sum(
            input_tensor=tf.math.log(tf.linalg.diag_part(arg_1)), axis=[-1])
      else:
        arg_4, arg_3 = tf.linalg.slogdet(arg_1)
      arg_5 = (arg_0.concentration - 1.) * arg_3
      return arg_5

Returns the unnormalized log density of an LKJ distribution .


def Func(arg_0):
        """
        Gets session Func lazily.
        """
        if not arg_0._Func:
            arg_0._Func = arg_0._get_Func()
        # Always return a dict, even if deserialization returned nothing
        if arg_0._Func is None:
            arg_0._Func = {}
        return arg_0._Func


def Func(arg_0, arg_1, arg_2=None):
        """Load a .py based config file by filename and path."""
        arg_3 = PyFileConfigLoader(arg_1, arg_2=arg_2)
        try:
            arg_4 = arg_3.load_config()
        except ConfigFileNotFound:
            # problem finding the file, raise
            raise
        except Exception:
            # try to get the full filename, but it will be empty in the
            # unlikely event that the error raised before filefind finished
            arg_1 = arg_3.full_filename or arg_1
            # problem while running the file
            arg_0.log.error("Exception while loading config file %s",
                            arg_1, exc_info=True)
        else:
            arg_0.log.debug("Loaded config file: %s", arg_3.full_filename)
            arg_0.update_config(arg_4)

Load a . py based config file by filename and path .


def Func ( arg_0 ) : if arg_0 == 'RedisBackend' : arg_1 = _LockManagerRedis elif arg_0 == 'DatabaseBackend' : arg_1 = _LockManagerDB else : raise NotImplementedError return arg_1

def Func(arg_0):
    """Select the proper LockManager based on the current backend used by Celery.

    :raise NotImplementedError: If Celery is using an unsupported backend.

    :param str backend_name: Class name of the current Celery backend. Usually value of
        current_app.extensions['celery'].celery.backend.__class__.__name__.

    :return: Class definition object (not instance). One of the _LockManager* classes.
    """
    if arg_0 == 'RedisBackend':
        arg_1 = _LockManagerRedis
    elif arg_0 == 'DatabaseBackend':
        arg_1 = _LockManagerDB
    else:
        raise NotImplementedError
    return arg_1

Select the proper LockManager based on the current backend used by Celery .


(
        table, schema="default", field=None, filter_map=None,
        metastore_conn_id='metastore_default')

return hh.max_partition(
        schema=schema, table_name=table, field=field, filter_map=filter_map)

def Func(
        arg_0, arg_1="default", arg_2=None, arg_3=None,
        arg_4='metastore_default'):
    """
    Gets the max partition for a table.

    :param schema: The hive schema the table lives in
    :type schema: str
    :param table: The hive table you are interested in, supports the dot
        notation as in "my_database.my_table", if a dot is found,
        the schema param is disregarded
    :type table: str
    :param metastore_conn_id: The hive connection you are interested in.
        If your default is set you don't need to use this parameter.
    :type metastore_conn_id: str
    :param filter_map: partition_key:partition_value map used for partition filtering,
                       e.g. {'key1': 'value1', 'key2': 'value2'}.
                       Only partitions matching all partition_key:partition_value
                       pairs will be considered as candidates of max partition.
    :type filter_map: map
    :param field: the field to get the max value from. If there's only
        one partition field, this will be inferred
    :type field: str

    >>> Func('airflow.static_babynames_partitioned')
    '2015-01-01'
    """
    from airflow.hooks.hive_hooks import HiveMetastoreHook
    if '.' in arg_0:
        arg_1, arg_0 = arg_0.split('.')
    arg_5 = HiveMetastoreHook(arg_4=arg_4)
    return arg_5.Func(
        arg_1=arg_1, table_name=arg_0, arg_2=arg_2, arg_3=arg_3)

Gets the max partition for a table.

    :param schema: The hive schema the table lives in
    :type schema: str
    :param table: The hive table you are interested in, supports the dot
        notation as in "my_database.my_table", if a dot is found,
        the schema param is disregarded
    :type table: str
    :param metastore_conn_id: The hive connection you are interested in.
        If your default is set you don't need to use this parameter.
    :type metastore_conn_id: str
    :param filter_map: partition_key:partition_value map used for partition filtering,
                       e.g. {'key1': 'value1', 'key2': 'value2'}.
                       Only partitions matching all partition_key:partition_value
                       pairs will be considered as candidates of max partition.
    :type filter_map: map
    :param field: the field to get the max value from. If there's only
        one partition field, this will be inferred
    :type field: str

    >>> max_partition('airflow.static_babynames_partitioned')
    '2015-01-01'


def Func(arg_0, arg_1):
    """
    Returns the icon resource filename that corresponds to the given typename.

    :param name: name of the completion. Use to make the distinction between
        public and private completions (using the count of starting '_')
    :pram typename: the typename reported by jedi

    :returns: The associate icon resource filename or None.
    """
    arg_2 = {
        'CLASS': ICON_CLASS,
        'IMPORT': ICON_NAMESPACE,
        'STATEMENT': ICON_VAR,
        'FORFLOW': ICON_VAR,
        'FORSTMT': ICON_VAR,
        'WITHSTMT': ICON_VAR,
        'GLOBALSTMT': ICON_VAR,
        'MODULE': ICON_NAMESPACE,
        'KEYWORD': ICON_KEYWORD,
        'PARAM': ICON_VAR,
        'ARRAY': ICON_VAR,
        'INSTANCEELEMENT': ICON_VAR,
        'INSTANCE': ICON_VAR,
        'PARAM-PRIV': ICON_VAR,
        'PARAM-PROT': ICON_VAR,
        'FUNCTION': ICON_FUNC,
        'DEF': ICON_FUNC,
        'FUNCTION-PRIV': ICON_FUNC_PRIVATE,
        'FUNCTION-PROT': ICON_FUNC_PROTECTED
    }
    arg_3 = None
    arg_1 = arg_1.upper()
    # jedi 0.8 introduced NamedPart class, which have a string instead of being
    # one
    if hasattr(arg_0, "string"):
        arg_0 = arg_0.string
    if arg_1 == "FORFLOW" or arg_1 == "STATEMENT":
        arg_1 = "PARAM"
    if arg_1 == "PARAM" or arg_1 == "FUNCTION":
        if arg_0.startswith("__"):
            arg_1 += "-PRIV"
        elif arg_0.startswith("_"):
            arg_1 += "-PROT"
    if arg_1 in arg_2:
        arg_3 = arg_2[arg_1]
    elif arg_1:
        _logger().warning("Unimplemented completion icon_type: %s", arg_1)
    return arg_3

Returns the icon resource filename that corresponds to the given typename .


return tf.where(update_pattern, new_queue, queue)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = tf . concat ( [ arg_0 [ 1 : ] , [ arg_2 ] ] , axis = 0 ) arg_4 = tf . broadcast_to ( arg_1 [ tf . newaxis , ... , tf . newaxis ] , distribution_util . prefer_static_shape ( arg_0 ) ) return tf . where ( arg_4 , arg_3 , arg_0 )

def Func(arg_0, arg_1, arg_2):
  """Conditionally push new vectors into a batch of first-in-first-out queues.

  The `queue` of shape `[k, ..., n]` can be thought of as a batch of queues,
  each holding `k` n-D vectors; while `new_vecs` of shape `[..., n]` is a
  fresh new batch of n-D vectors. The `should_update` batch of Boolean scalars,
  i.e. shape `[...]`, indicates batch members whose corresponding n-D vector in
  `new_vecs` should be added at the back of its queue, pushing out the
  corresponding n-D vector from the front. Batch members in `new_vecs` for
  which `should_update` is False are ignored.

  Note: the choice of placing `k` at the dimension 0 of the queue is
  constrained by the L-BFGS two-loop algorithm above. The algorithm uses
  tf.scan to iterate over the `k` correction pairs simulatneously across all
  batches, and tf.scan itself can only iterate over dimension 0.

  For example:

  ```python
    k, b, n = (3, 2, 5)
    queue = tf.reshape(tf.range(30), (k, b, n))
    # => [[[ 0,  1,  2,  3,  4],
    #      [ 5,  6,  7,  8,  9]],
    #
    #     [[10, 11, 12, 13, 14],
    #      [15, 16, 17, 18, 19]],
    #
    #     [[20, 21, 22, 23, 24],
    #      [25, 26, 27, 28, 29]]]

    element = tf.reshape(tf.range(30, 40), (b, n))
    # => [[30, 31, 32, 33, 34],
          [35, 36, 37, 38, 39]]

    should_update = tf.constant([True, False])  # Shape: (b,)

    _queue_add(should_update, queue, element)
    # => [[[10, 11, 12, 13, 14],
    #      [ 5,  6,  7,  8,  9]],
    #
    #     [[20, 21, 22, 23, 24],
    #      [15, 16, 17, 18, 19]],
    #
    #     [[30, 31, 32, 33, 34],
    #      [25, 26, 27, 28, 29]]]
  ```

  Args:
    queue: A `tf.Tensor` of shape `[k, ..., n]`; a batch of queues each with
      `k` n-D vectors.
    should_update: A Boolean `tf.Tensor` of shape `[...]` indicating batch
      members where new vectors should be added to their queues.
    new_vecs: A `tf.Tensor` of shape `[..., n]`; a batch of n-D vectors to add
      at the end of their respective queues, pushing out the first element from
      each.

  Returns:
    A new `tf.Tensor` of shape `[k, ..., n]`.
  """
  arg_3 = tf.concat([arg_0[1:], [arg_2]], axis=0)
  arg_4 = tf.broadcast_to(
      arg_1[tf.newaxis, ..., tf.newaxis],
      distribution_util.prefer_static_shape(arg_0))
  return tf.where(arg_4, arg_3, arg_0)

Conditionally push new vectors into a batch of first - in - first - out queues .