return (self._tp + self._tn) / self.population()

def Func ( arg_0 ) : if arg_0 . population ( ) == 0 : return float ( 'NaN' ) return ( arg_0 . _tp + arg_0 . _tn ) / arg_0 . population ( )

def Func(arg_0):
        r"""Return Func.

        Accuracy is defined as :math:`\frac{tp + tn}{population}`

        Cf. https://en.wikipedia.org/wiki/Accuracy

        Returns
        -------
        float
            The Func of the confusion table

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.Func()
        0.782608695652174

        """
        if arg_0.population() == 0:
            return float('NaN')
        return (arg_0._tp + arg_0._tn) / arg_0.population()

r"""Return accuracy.

        Accuracy is defined as :math:`\frac{tp + tn}{population}`

        Cf. https://en.wikipedia.org/wiki/Accuracy

        Returns
        -------
        float
            The accuracy of the confusion table

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.accuracy()
        0.782608695652174


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ arg_1 ] for arg_4 in six . moves . range ( 20 ) : arg_5 = { } for arg_1 in arg_3 : for arg_6 in [ x [ 0 ] for x in arg_2 . RunReactants ( ( arg_1 , ) ) ] : if arg_7 . SanitizeMol ( arg_6 , catchErrors = True ) == 0 : arg_5 [ arg_7 . MolToSmiles ( arg_6 , arg_9 = True ) ] = arg_6 if arg_5 : arg_3 = [ arg_5 [ s ] for s in sorted ( arg_5 ) ] else : return arg_3 [ 0 ] if arg_4 > 0 else None

def Func(arg_0, arg_1, arg_2):
        """Repeatedly apply normalization transform to molecule until no changes occur.

        It is possible for multiple products to be produced when a rule is applied. The rule is applied repeatedly to
        each of the products, until no further changes occur or after 20 attempts. If there are multiple unique products
        after the final application, the first product (sorted alphabetically by SMILES) is chosen.
        """
        arg_3 = [arg_1]
        for arg_4 in six.moves.range(20):
            arg_5 = {}
            for arg_1 in arg_3:
                for arg_6 in [x[0] for x in arg_2.RunReactants((arg_1,))]:
                    if arg_7.SanitizeMol(arg_6, catchErrors=True) == 0:
                        arg_5[arg_7.MolToSmiles(arg_6, arg_9=True)] = arg_6
            if arg_5:
                arg_3 = [arg_5[s] for s in sorted(arg_5)]
            else:
                # If n == 0, the rule was not applicable and we return None
                return arg_3[0] if arg_4 > 0 else None

Repeatedly apply normalization transform to molecule until no changes occur .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . items . append ( arg_1 ) if len ( arg_0 . items ) >= arg_0 . max_chunk_size : arg_0 . _upload_chunk ( arg_2 ) return arg_1

def Func(arg_0, arg_1, arg_2):
        """
        Process single item. Add item to items and then upload to S3 if size of items
        >= max_chunk_size.
        """
        arg_0.items.append(arg_1)
        if len(arg_0.items) >= arg_0.max_chunk_size:
            arg_0._upload_chunk(arg_2)

        return arg_1

Process single item . Add item to items and then upload to S3 if size of items > = max_chunk_size .


return sorted(modes, key=slug_weight, reverse=True)

def Func ( arg_0 , arg_1 ) : def slug_weight ( arg_2 ) : arg_3 = COURSE_MODE_SORT_ORDER arg_4 = len ( arg_3 ) if arg_2 [ 'slug' ] in arg_3 : return arg_4 - arg_3 . index ( arg_2 [ 'slug' ] ) return 0 return sorted ( arg_1 , key = slug_weight , reverse = True )

def Func(arg_0, arg_1):
        """
        Sort the course mode dictionaries by slug according to the COURSE_MODE_SORT_ORDER constant.

        Arguments:
            modes (list): A list of course mode dictionaries.
        Returns:
            list: A list with the course modes dictionaries sorted by slug.

        """
        def slug_weight(arg_2):
            """
            Assign a weight to the course mode dictionary based on the position of its slug in the sorting list.
            """
            arg_3 = COURSE_MODE_SORT_ORDER
            arg_4 = len(arg_3)
            if arg_2['slug'] in arg_3:
                return arg_4 - arg_3.index(arg_2['slug'])
            return 0
        # Sort slug weights in descending order
        return sorted(arg_1, key=slug_weight, reverse=True)

Sort the course mode dictionaries by slug according to the COURSE_MODE_SORT_ORDER constant .


def Func(arg_0, arg_1, arg_2):
        """Handles includes."""
        if arg_1.with_context:
            arg_0.unoptimize_scope(arg_2)
        if arg_1.ignore_missing:
            arg_0.writeline('try:')
            arg_0.indent()

        arg_3 = 'get_or_select_template'
        if isinstance(arg_1.template, nodes.Const):
            if isinstance(arg_1.template.value, string_types):
                arg_3 = 'get_template'
            elif isinstance(arg_1.template.value, (tuple, list)):
                arg_3 = 'select_template'
        elif isinstance(arg_1.template, (nodes.Tuple, nodes.List)):
            arg_3 = 'select_template'

        arg_0.writeline('template = environment.%s(' % arg_3, arg_1)
        arg_0.visit(arg_1.template, arg_2)
        arg_0.write(', %r)' % arg_0.name)
        if arg_1.ignore_missing:
            arg_0.outdent()
            arg_0.writeline('except TemplateNotFound:')
            arg_0.indent()
            arg_0.writeline('pass')
            arg_0.outdent()
            arg_0.writeline('else:')
            arg_0.indent()

        if arg_1.with_context:
            arg_0.writeline('for event in template.root_render_func('
                           'template.new_context(context.parent, True, '
                           'locals())):')
        else:
            arg_0.writeline('for event in template.module._body_stream:')

        arg_0.indent()
        arg_0.simple_write('event', arg_2)
        arg_0.outdent()

        if arg_1.ignore_missing:
            arg_0.outdent()


def
Func
(
arg_0
,
**
arg_1
)
:
if
not
arg_0
.
pid
:
arg_0
.
pid
=
"{}_{}"
.
format
(
arg_0
.
lane
,
arg_1
.
get
(
"pid"
)
)
for
arg_3
in
arg_0
.
status_channels
:
if
arg_3
.
startswith
(
"STATUS_"
)
:
arg_0
.
status_strs
.
append
(
"{}_{}"
.
format
(
arg_3
,
arg_0
.
pid
)
)
else
:
arg_0
.
status_strs
.
append
(
"STATUS_{}_{}"
.
format
(
arg_3
,
arg_0
.
pid
)
)
if
arg_0
.
main_forks
:
logger
.
debug
(
"Setting main fork channels: {}"
.
format
(
arg_0
.
main_forks
)
)
arg_4
=
"set"
if
len
(
arg_0
.
main_forks
)
==
1
else
"into"
arg_0
.
forks
=
[
"\n{}.{}{{ {} }}\n"
.
format
(
arg_0
.
output_channel
,
arg_4
,
";"
.
join
(
arg_0
.
main_forks
)
)
]
arg_0
.
_context
=
{
**
arg_1
,
**
{
"input_channel"
:
arg_0
.
input_channel
,
"output_channel"
:
arg_0
.
output_channel
,
"template"
:
arg_0
.
template
,
"forks"
:
"\n"
.
join
(
arg_0
.
forks
)
,
"pid"
:
arg_0
.
pid
}
}

def Func(arg_0, **arg_1):
        """ General purpose method that sets the main channels

        This method will take a variable number of keyword arguments to
        set the :py:attr:`Process._context` attribute with the information
        on the main channels for the process. This is done by appending
        the process ID (:py:attr:`Process.pid`) attribute to the input,
        output and status channel prefix strings. In the output channel,
        the process ID is incremented by 1 to allow the connection with the
        channel in the next process.

        The ``**kwargs`` system for setting the :py:attr:`Process._context`
        attribute also provides additional flexibility. In this way,
        individual processes can provide additional information not covered
        in this method, without changing it.

        Parameters
        ----------
        kwargs : dict
            Dictionary with the keyword arguments for setting up the template
            context
        """

        if not arg_0.pid:
            arg_0.pid = "{}_{}".format(arg_0.lane, arg_1.get("pid"))

        for arg_3 in arg_0.status_channels:
            if arg_3.startswith("STATUS_"):
                arg_0.status_strs.append("{}_{}".format(arg_3, arg_0.pid))
            else:
                arg_0.status_strs.append("STATUS_{}_{}".format(arg_3, arg_0.pid))

        if arg_0.main_forks:
            logger.debug("Setting main fork channels: {}".format(
                arg_0.main_forks))
            arg_4 = "set" if len(arg_0.main_forks) == 1 else "into"
            arg_0.forks = ["\n{}.{}{{ {} }}\n".format(
                arg_0.output_channel, arg_4, ";".join(arg_0.main_forks))]

        arg_0._context = {**arg_1, **{"input_channel": arg_0.input_channel,
                                      "output_channel": arg_0.output_channel,
                                      "template": arg_0.template,
                                      "forks": "\n".join(arg_0.forks),
                                      "pid": arg_0.pid}}


def
Func
(
arg_0
,
arg_1
=
False
)
:
arg_2
=
[
]
for
arg_3
,
arg_4
,
arg_5
in
os
.
walk
(
arg_0
)
:
print
(
'Processing %s'
%
arg_3
)
arg_4
=
sorted
(
arg_4
)
arg_6
=
[
f
for
f
in
arg_5
if
re
.
match
(
IMAGE_FILE_REGEX
,
f
)
]
arg_6
=
sorted
(
arg_6
)
arg_2
.
append
(
_create_index_file
(
arg_0
,
arg_3
,
arg_6
,
arg_4
,
arg_1
)
)
return
arg_2

def Func(arg_0, arg_1=False):
    """
    Crawl the root directory downwards, generating an index HTML file in each
    directory on the way down.
    @param {String} root_dir - The top level directory to crawl down from. In
        normal usage, this will be '.'.
    @param {Boolean=False} force_no_processing - If True, do not attempt to
        actually process thumbnails, PIL images or anything. Simply index
        <img> tags with original file src attributes.
    @return {[String]} Full file paths of all created files.
    """
    # Initialise list of created file paths to build up as we make them
    arg_2 = []
    # Walk the root dir downwards, creating index files as we go
    for arg_3, arg_4, arg_5 in os.walk(arg_0):
        print('Processing %s' % arg_3)
        # Sort the subdirectories by name
        arg_4 = sorted(arg_4)
        # Get image files - all files in the directory matching IMAGE_FILE_REGEX
        arg_6 = [f for f in arg_5 if re.match(IMAGE_FILE_REGEX, f)]
        # Sort the image files by name
        arg_6 = sorted(arg_6)
        # Create this directory's index file and add its name to the created
        # files list
        arg_2.append(
            _create_index_file(
                arg_0, arg_3, arg_6, arg_4, arg_1
            )
        )
    # Return the list of created files
    return arg_2

Crawl the root directory downwards generating an index HTML file in each directory on the way down .


def
Func
(
arg_0
)
:
arg_1
=
ET
.
Element
(
'xs:element'
,
name
=
arg_0
.
key_lett
,
minOccurs
=
'0'
,
maxOccurs
=
'unbounded'
)
arg_2
=
ET
.
SubElement
(
arg_1
,
'xs:complexType'
)
for
arg_3
in
nav_many
(
arg_0
)
.
O_ATTR
[
102
]
(
)
:
arg_4
=
get_refered_attribute
(
arg_3
)
arg_5
=
nav_one
(
arg_4
)
.
S_DT
[
114
]
(
)
while
nav_one
(
arg_5
)
.
S_UDT
[
17
]
(
)
:
arg_5
=
nav_one
(
arg_5
)
.
S_UDT
[
17
]
.
S_DT
[
18
]
(
)
arg_6
=
get_type_name
(
arg_5
)
if
arg_6
and
not
nav_one
(
arg_3
)
.
O_BATTR
[
106
]
.
O_DBATTR
[
107
]
(
)
:
ET
.
SubElement
(
arg_2
,
'xs:attribute'
,
name
=
arg_3
.
name
,
type
=
arg_6
)
else
:
logger
.
warning
(
'Omitting %s.%s'
%
(
arg_0
.
key_lett
,
arg_3
.
Name
)
)
return
arg_1

def Func(arg_0):
    '''
    Build an xsd complex element out of a O_OBJ, including its O_ATTR.
    '''
    arg_1 = ET.Element('xs:element', name=arg_0.key_lett, minOccurs='0', maxOccurs='unbounded')
    arg_2 = ET.SubElement(arg_1, 'xs:complexType')
    for arg_3 in nav_many(arg_0).O_ATTR[102]():
        arg_4 = get_refered_attribute(arg_3)
        arg_5 = nav_one(arg_4).S_DT[114]()
        while nav_one(arg_5).S_UDT[17]():
            arg_5 = nav_one(arg_5).S_UDT[17].S_DT[18]()

        arg_6 = get_type_name(arg_5)
        if arg_6 and not nav_one(arg_3).O_BATTR[106].O_DBATTR[107]():
            ET.SubElement(arg_2, 'xs:attribute', name=arg_3.name, type=arg_6)
        else:
            logger.warning('Omitting %s.%s' % (arg_0.key_lett, arg_3.Name))
    return arg_1

Build an xsd complex element out of a O_OBJ including its O_ATTR .


(args, stdout=None, stderr=None, stdin=None, daemonize=False,
         preexec_fn=None, shell=False, cwd=None, env=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = False , arg_5 = None , arg_6 = False , arg_7 = None , arg_8 = None ) : arg_9 = lambda s , m : s is None and os . open ( os . devnull , m ) or s arg_1 = arg_9 ( arg_1 , os . O_WRONLY ) arg_2 = arg_9 ( arg_2 , os . O_WRONLY ) arg_3 = arg_9 ( arg_3 , os . O_RDONLY ) arg_10 = Value ( 'i' , 0 ) arg_11 = os . fork ( ) if arg_11 > 0 : os . waitpid ( arg_11 , 0 ) arg_12 = arg_10 . value del arg_10 if arg_4 : sys . exit ( 0 ) return arg_12 else : os . setsid ( ) arg_13 = subprocess . Popen ( arg_0 , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , close_fds = True , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 ) arg_10 . value = arg_13 . pid os . _exit ( 0 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=False,
         arg_5=None, arg_6=False, arg_7=None, arg_8=None):
    """
    Run an external command in a separate process and detach it from the current process. Excepting
    `stdout`, `stderr`, and `stdin` all file descriptors are closed after forking. If `daemonize`
    is True then the parent process exits. All stdio is redirected to `os.devnull` unless
    specified. The `preexec_fn`, `shell`, `cwd`, and `env` parameters are the same as their `Popen`
    counterparts. Return the PID of the child process if not daemonized.
    """
    arg_9 = lambda s, m: s is None and os.open(os.devnull, m) or s
    arg_1 = arg_9(arg_1, os.O_WRONLY)
    arg_2 = arg_9(arg_2, os.O_WRONLY)
    arg_3 = arg_9(arg_3, os.O_RDONLY)

    arg_10 = Value('i', 0)
    arg_11 = os.fork()
    if arg_11 > 0:
        os.waitpid(arg_11, 0)
        arg_12 = arg_10.value
        del arg_10
        if arg_4:
            sys.exit(0)
        return arg_12
    else:
        os.setsid()
        arg_13 = subprocess.Popen(arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, close_fds=True,
                                arg_5=arg_5, arg_6=arg_6, arg_7=arg_7, arg_8=arg_8)
        arg_10.value = arg_13.pid
        os._exit(0)

Run an external command in a separate process and detach it from the current process . Excepting stdout stderr and stdin all file descriptors are closed after forking . If daemonize is True then the parent process exits . All stdio is redirected to os . devnull unless specified . The preexec_fn shell cwd and env parameters are the same as their Popen counterparts . Return the PID of the child process if not daemonized .


def Func(arg_0):
    """Prediction polynomial to line spectral frequencies.

    converts the prediction polynomial specified by A,
    into the corresponding line spectral frequencies, LSF.
    normalizes the prediction polynomial by A(1).

    .. doctest::

        >>> from spectrum import Func
        >>> a = [1.0000,  0.6149, 0.9899, 0.0000 ,0.0031, -0.0082]
        >>> lsf = Func(a)
        >>> lsf =  array([0.7842, 1.5605, 1.8776, 1.8984, 2.3593])

    .. seealso:: lsf2poly, poly2rc, poly2qc, rc2is
    """

    #Line spectral frequencies are not defined for complex polynomials.

    # Normalize the polynomial

    arg_0 = numpy.array(arg_0)
    if arg_0[0] != 1:
        arg_0/=arg_0[0]

    if max(numpy.abs(numpy.roots(arg_0))) >= 1.0:
        error('The polynomial must have all roots inside of the unit circle.');

    # Form the sum and differnce filters

    arg_1  = len(arg_0)-1   # The leading one in the polynomial is not used
    arg_2 = numpy.concatenate((arg_0, numpy.array([0])))
    arg_3 = arg_2[-1::-1]
    arg_4 = arg_2 - arg_3        # Difference filter
    arg_5 = arg_2 + arg_3        # Sum Filter

    # If order is even, remove the known root at z = 1 for P1 and z = -1 for Q1
    # If odd, remove both the roots from P1

    if arg_1%2: # Odd order
        arg_6, arg_7 = deconvolve(arg_4,[1, 0 ,-1])
        arg_8 = arg_5
    else:          # Even order
        arg_6, arg_7 = deconvolve(arg_4, [1, -1])
        arg_8, arg_7 = deconvolve(arg_5, [1,  1])

    arg_9  = numpy.roots(arg_6)
    arg_10  = numpy.roots(arg_8)

    arg_11  = numpy.angle(arg_9[1::2])
    arg_12  = numpy.angle(arg_10[1::2])

    arg_13 = sorted(numpy.concatenate((-arg_11,-arg_12)))

    return arg_13

Prediction polynomial to line spectral frequencies.

    converts the prediction polynomial specified by A,
    into the corresponding line spectral frequencies, LSF.
    normalizes the prediction polynomial by A(1).

    .. doctest::

        >>> from spectrum import poly2lsf
        >>> a = [1.0000,  0.6149, 0.9899, 0.0000 ,0.0031, -0.0082]
        >>> lsf = poly2lsf(a)
        >>> lsf =  array([0.7842, 1.5605, 1.8776, 1.8984, 2.3593])

    .. seealso:: lsf2poly, poly2rc, poly2qc, rc2is

Prediction polynomial to line spectral frequencies .


return 'node_' + str(
            (abs(binascii.crc32(b(name)) & 0xffffffff) % self.no_servers) + 1)

def Func ( arg_0 , arg_1 ) : return 'node_' + str ( ( abs ( binascii . crc32 ( b ( arg_1 ) ) & 0xffffffff ) % arg_0 . no_servers ) + 1 )

def Func(arg_0, arg_1):
        "Return the node name where the ``name`` would land to"
        return 'node_' + str(
            (abs(binascii.crc32(b(arg_1)) & 0xffffffff) % arg_0.no_servers) + 1)

Return the node name where the name would land to


def Func(arg_0):
        """Get current datetime for every file."""
        arg_0.wql_time = "SELECT LocalDateTime FROM Win32_OperatingSystem"
        arg_0.current_time = arg_0.query(arg_0.wql_time)
        # [{'LocalDateTime': '20160824161431.977000+480'}]'
        arg_0.current_time_string = str(
            arg_0.current_time[0].get('LocalDateTime').split('.')[0])
        # '20160824161431'
        arg_0.current_time_format = datetime.datetime.strptime(
            arg_0.current_time_string, '%Y%m%d%H%M%S')
        # param: datetime.datetime(2016, 8, 24, 16, 14, 31) -> type:
        # datetime.datetime
        return arg_0.current_time_format


def Func(arg_0, arg_1):
        """Start engines by profile or profile_dir.
        `n` is ignored, and the `engines` config property is used instead.
        """

        arg_2 = []
        for arg_3, arg_1 in arg_0.engines.iteritems():
            if isinstance(arg_1, (tuple, list)):
                arg_1, arg_4 = arg_1
            else:
                arg_4 = copy.deepcopy(arg_0.engine_args)

            if '@' in arg_3:
                arg_5,arg_3 = arg_3.split('@',1)
            else:
                arg_5=None
            for arg_6 in range(arg_1):
                if arg_6 > 0:
                    time.sleep(arg_0.delay)
                arg_7 = arg_0.launcher_class(work_dir=arg_0.work_dir, config=arg_0.config, log=arg_0.log,
                                        profile_dir=arg_0.profile_dir, cluster_id=arg_0.cluster_id,
                )
                if arg_6 > 0:
                    # only send files for the first engine on each host
                    arg_7.to_send = []

                # Copy the engine args over to each engine launcher.
                arg_7.engine_cmd = arg_0.engine_cmd
                arg_7.engine_args = arg_4
                arg_7.on_stop(arg_0._notice_engine_stopped)
                arg_11 = arg_7.Func(arg_5=arg_5, hostname=arg_3)
                arg_0.launchers[ "%s/%i" % (arg_3,arg_6) ] = arg_7
                arg_2.append(arg_11)
        arg_0.notify_Func(arg_2)
        return arg_2

Start engines by profile or profile_dir . n is ignored and the engines config property is used instead .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . value [ 2 : - 2 ] . strip ( ) arg_3 = ( l . strip ( ) for l in arg_2 . split ( "\n" ) ) arg_4 = ( l [ 1 : ] . strip ( ) for l in arg_3 if l . startswith ( "!" ) ) for arg_5 in arg_4 : yield arg_0 . parse_directive_def ( arg_5 )

def Func(arg_0, arg_1):
    """A directive is a line in a comment that begins with '!'."""
    arg_2 = arg_1.value[2:-2].strip()
    arg_3 = (l.strip() for l in arg_2.split("\n"))
    arg_4 = (l[1:].strip() for l in arg_3 if l.startswith("!"))

    for arg_5 in arg_4:
      yield arg_0.parse_directive_def(arg_5)

A directive is a line in a comment that begins with ! .


def Func ( arg_0 , arg_1 ) : if os . path . isfile ( arg_0 ) : arg_2 = open ( arg_0 , 'r' ) try : arg_3 = int ( arg_2 . read ( ) ) arg_2 . close ( ) if check_pid ( arg_3 , arg_1 ) : return True except : pass os . unlink ( arg_0 ) arg_3 = str ( os . getpid ( ) ) open ( arg_0 , 'w' ) . write ( arg_3 ) return False

def Func(arg_0, arg_1):
    """Check that a process is not running more than once, using PIDFILE"""
    # Check PID exists and see if the PID is running
    if os.path.isfile(arg_0):
        arg_2 = open(arg_0, 'r')
        # try and read the PID file. If no luck, remove it
        try:
            arg_3 = int(arg_2.read())
            arg_2.close()
            if check_pid(arg_3, arg_1):
                return True
        except:
            pass

        # PID is not active, remove the PID file
        os.unlink(arg_0)

    # Create a PID file, to ensure this is script is only run once (at a time)
    arg_3 = str(os.getpid())
    open(arg_0, 'w').write(arg_3)
    return False

Check that a process is not running more than once using PIDFILE


def Func(arg_0):
    """
    Given a list of objects, returns a dictionary mapping from
    string name for the object to the object itself.
    """
    arg_1 = []
    for arg_2, arg_3 in arg_0:
        if hasattr(arg_2, '__name__'):
            arg_2 = arg_2.__name__
        else:
            arg_2 = as_unicode(arg_2)
        arg_1.append((arg_2, arg_3))
    return arg_1

Given a list of objects returns a dictionary mapping from string name for the object to the object itself .


def Func ( arg_0 ) : arg_1 = one ( arg_0 ) . S_DT [ 17 ] ( ) arg_2 = list ( ) arg_3 = [ 'False' , 'None' , 'True' ] + keyword . kwlist for arg_4 in many ( arg_0 ) . S_ENUM [ 27 ] ( ) : if arg_4 . Name in arg_3 : arg_2 . append ( arg_4 . Name + '_' ) else : arg_2 . append ( arg_4 . Name ) arg_5 = collections . namedtuple ( arg_1 . Name , arg_2 ) return arg_5 ( * range ( len ( arg_2 ) ) )

def Func(arg_0):
    '''
    Create a named tuple from a BridgePoint enumeration.
    '''
    arg_1 = one(arg_0).S_DT[17]()
    arg_2 = list()
    arg_3 =['False', 'None', 'True'] + keyword.kwlist
    for arg_4 in many(arg_0).S_ENUM[27]():
        if arg_4.Name in arg_3:
            arg_2.append(arg_4.Name + '_')
        else:
            arg_2.append(arg_4.Name)

    arg_5 = collections.namedtuple(arg_1.Name, arg_2)
    return arg_5(*range(len(arg_2)))

Create a named tuple from a BridgePoint enumeration .


def Func(arg_0):
    """
    Decorator to Func an exception and don't raise it.
    Logs information if a decorator failed.

    Note:
        We don't want possible exceptions during logging to be raised.
        This is used to decorate any function that gets executed
        before or after the execution of the decorated function.
    """
    def decorator(arg_1):
        @wraps(arg_1)
        def wrapper(*arg_2, **arg_3):
            try:
                return arg_1(*arg_2, **arg_3)
            except Exception:
                arg_0.warning(f"Exception raised in decorator: {func.__name__}")

        return wrapper
    return decorator

Decorator to catch an exception and don't raise it.
    Logs information if a decorator failed.

    Note:
        We don't want possible exceptions during logging to be raised.
        This is used to decorate any function that gets executed
        before or after the execution of the decorated function.

Decorator to catch an exception and don t raise it . Logs information if a decorator failed .


return (
        run_sql('select count(id) from bibdoc', run_on_slave=True)[0][0],
        [id[0] for id in run_sql('select id from bibdoc', run_on_slave=True)],
    )

def
Func
(
)
:
try
:
from
invenio
.
dbquery
import
run_sql
except
ImportError
:
from
invenio
.
legacy
.
dbquery
import
run_sql
return
(
run_sql
(
'select count(id) from bibdoc'
,
run_on_slave
=
True
)
[
0
]
[
0
]
,
[
arg_0
[
0
]
for
arg_0
in
run_sql
(
'select id from bibdoc'
,
run_on_slave
=
True
)
]
,
)

def Func():
    """Get bibdocs to check."""
    try:
        from invenio.dbquery import run_sql
    except ImportError:
        from invenio.legacy.dbquery import run_sql

    return (
        run_sql('select count(id) from bibdoc', run_on_slave=True)[0][0],
        [arg_0[0] for arg_0 in run_sql('select id from bibdoc', run_on_slave=True)],
    )


def Func(arg_0, arg_1, arg_2, arg_3):
        """Write the password in the file.
        """
        arg_4 = arg_0._generate_assoc(arg_1, arg_2)
        # encrypt the password
        arg_5 = arg_0.encrypt(arg_3.encode('utf-8'), arg_4)
        # encode with base64 and add line break to untangle config file
        arg_6 = '\n' + encodebytes(arg_5).decode()

        arg_0._write_config_value(arg_1, arg_2, arg_6)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
prefilter_manager
.
get_Funcr_by_name
(
'normal'
)
arg_3
=
arg_1
.
line
try
:
codeop
.
compile_command
(
arg_3
)
except
SyntaxError
:
if
arg_3
[
0
]
==
ESC_HELP
:
arg_3
=
arg_3
[
1
:
]
elif
arg_3
[
1
]
==
ESC_HELP
:
arg_3
=
arg_3
[
:
1
]
if
arg_3
:
arg_0
.
shell
.
magic
(
'pinfo %s'
%
arg_1
.
ifun
)
else
:
arg_0
.
shell
.
show_usage
(
)
return
''
except
:
raise
return
arg_2
.
Func
(
arg_1
)
else
:
return
arg_2
.
Func
(
arg_1
)

def Func(arg_0, arg_1):
        """Try to get some help for the object.

        obj? or ?obj   -> basic information.
        obj?? or ??obj -> more details.
        """
        arg_2 = arg_0.prefilter_manager.get_Funcr_by_name('normal')
        arg_3 = arg_1.line
        # We need to make sure that we don't process lines which would be
        # otherwise valid python, such as "x=1 # what?"
        try:
            codeop.compile_command(arg_3)
        except SyntaxError:
            # We should only Func as help stuff which is NOT valid syntax
            if arg_3[0]==ESC_HELP:
                arg_3 = arg_3[1:]
            elif arg_3[-1]==ESC_HELP:
                arg_3 = arg_3[:-1]
            if arg_3:
                #print 'line:<%r>' % line  # dbg
                arg_0.shell.magic('pinfo %s' % arg_1.ifun)
            else:
                arg_0.shell.show_usage()
            return '' # Empty string is needed here!
        except:
            raise
            # Pass any other exceptions through to the normal Funcr
            return arg_2.Func(arg_1)
        else:
            # If the code compiles ok, we should Func it normally
            return arg_2.Func(arg_1)


(cls, passes, options, **partial_controller)

def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Constructs a flow controller based on the partially evaluated controller arguments.

        Args:
            passes (list[BasePass]): passes to add to the flow controller.
            options (dict): PassManager options.
            **partial_controller (dict): Partially evaluated controller arguments in the form
                `{name:partial}`

        Raises:
            TranspilerError: When partial_controller is not well-formed.

        Returns:
            FlowController: A FlowController instance.
        """
        if None in arg_3.values():
            raise TranspilerError('The controller needs a condition.')

        if arg_3:
            for arg_4 in arg_0.registered_controllers.keys():
                if arg_4 in arg_3:
                    return arg_0.registered_controllers[arg_4](arg_1, arg_2,
                                                                             **arg_3)
            raise TranspilerError("The controllers for %s are not registered" % arg_3)
        else:
            return FlowControllerLinear(arg_1, arg_2)

Constructs a flow controller based on the partially evaluated controller arguments .


def Func(arg_0, arg_1, arg_2=None):
        """Return a queue containing all received Func data.

        :param pair: str, Symbol pair to request data for
        :param timeframe: str
        :return: Queue()
        """
        arg_2 = '1m' if not arg_2 else arg_2
        arg_3 = ('Func', arg_1, arg_2)
        return arg_0.queue_processor.Func[arg_3]

Return a queue containing all received candles data.

        :param pair: str, Symbol pair to request data for
        :param timeframe: str
        :return: Queue()

Return a queue containing all received candles data .


(inferenceElement, metric,
                              params=None, field=None,
                              returnLabel=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
False
)
:
arg_5
=
dict
(
arg_1
=
arg_1
,
arg_3
=
arg_3
,
arg_2
=
arg_2
,
arg_0
=
arg_0
)
arg_6
=
"MetricSpec(%s)"
%
', '
.
join
(
[
'%s=%r'
%
(
item
[
0
]
,
item
[
1
]
)
for
item
in
arg_5
.
iteritems
(
)
]
)
if
not
arg_4
:
return
arg_6
arg_7
=
MetricSpec
(
**
arg_5
)
arg_8
=
arg_7
.
getLabel
(
)
return
arg_6
,
arg_8

def Func(arg_0, arg_1,
                              arg_2=None, arg_3=None,
                              arg_4=False):
  """ Generates the string representation of a MetricSpec object, and returns
  the metric key associated with the metric.

  Parameters:
  -----------------------------------------------------------------------
  inferenceElement:
    An InferenceElement value that indicates which part of the inference this
    metric is computed on

  metric:
    The type of the metric being computed (e.g. aae, avg_error)

  params:
    A dictionary of parameters for the metric. The keys are the parameter names
    and the values should be the parameter values (e.g. window=200)

  field:
    The name of the field for which this metric is being computed

  returnLabel:
    If True, returns the label of the MetricSpec that was generated
  """

  arg_5 = dict(arg_1=arg_1,
                        arg_3=arg_3,
                        arg_2=arg_2,
                        arg_0=arg_0)

  arg_6 = "MetricSpec(%s)" % \
    ', '.join(['%s=%r' % (item[0],item[1])
              for item in arg_5.iteritems()])

  if not arg_4:
    return arg_6

  arg_7 = MetricSpec(**arg_5)
  arg_8 = arg_7.getLabel()
  return arg_6, arg_8

Generates the string representation of a MetricSpec object and returns the metric key associated with the metric .


def Func ( arg_0 , arg_1 = None ) : if not arg_1 : arg_1 = os . getcwd ( ) arg_2 = os . path . abspath ( arg_1 ) arg_3 = os . path . basename ( arg_2 ) . lower ( ) arg_4 = re . sub ( r"[^a-z0-9]" , "" , arg_3 ) if not arg_4 : arg_4 = "default" return arg_4

def Func(arg_0, arg_1=None):
        '''Generate a new blockade ID based on the CWD'''
        if not arg_1:
            arg_1 = os.getcwd()
        # this follows a similar pattern as docker-compose uses
        arg_2 = os.path.abspath(arg_1)
        arg_3 = os.path.basename(arg_2).lower()
        arg_4 = re.sub(r"[^a-z0-9]", "", arg_3)
        if not arg_4:  # if we can't get a valid name from CWD, use "default"
            arg_4 = "default"
        return arg_4


def
Func
(
arg_0
,
arg_1
)
:
if
is_string
(
arg_1
)
:
if
arg_1
not
in
prompters
:
eprint
(
"Error: '{}' is not a core prompter"
.
format
(
arg_1
)
)
sys
.
exit
(
)
arg_0
.
prompter
=
prompters
[
arg_1
]
else
:
arg_0
.
prompter
=
arg_1

def Func(arg_0, arg_1):
        """If you want to change the core prompters registry, you can
        override this method in a Question subclass.
        """
        if is_string(arg_1):
            if arg_1 not in prompters:
                eprint("Error: '{}' is not a core prompter".format(arg_1))
                sys.exit()
            arg_0.prompter = prompters[arg_1]
        else:
            arg_0.prompter = arg_1

If you want to change the core prompters registry you can override this method in a Question subclass .


def
Func
(
arg_0
,
arg_1
=
)
:
from
sfctl
.
config
import
(
aad_metadata
,
aad_cache
)
if
arg_1
:
arg_1
=
super
(
AdalAuthentication
,
arg_0
)
.
Func
(
arg_1
)
else
:
arg_1
=
super
(
AdalAuthentication
,
arg_0
)
.
Func
(
)
if
arg_0
.
no_verify
:
arg_1
.
verify
=
False
arg_3
,
arg_4
,
arg_5
=
aad_metadata
(
)
arg_6
,
arg_7
=
aad_cache
(
)
arg_8
=
adal
.
AuthenticationContext
(
arg_3
,
cache
=
arg_7
)
arg_9
=
arg_8
.
acquire_token
(
arg_4
,
arg_6
[
'userId'
]
,
arg_5
)
arg_10
=
"{} {}"
.
format
(
"Bearer"
,
arg_9
[
'accessToken'
]
)
arg_1
.
headers
[
'Authorization'
]
=
arg_10
return
arg_1

def Func(arg_0, arg_1=None):
        """Create requests session with AAD auth headers

        :rtype: requests.Session.
        """

        from sfctl.config import (aad_metadata, aad_cache)

        if arg_1:
            arg_1 = super(AdalAuthentication, arg_0).Func(arg_1)
        else:
            arg_1 = super(AdalAuthentication, arg_0).Func()

        if arg_0.no_verify:
            arg_1.verify = False

        arg_3, arg_4, arg_5 = aad_metadata()
        arg_6, arg_7 = aad_cache()
        arg_8 = adal.AuthenticationContext(arg_3,
                                             cache=arg_7)
        arg_9 = arg_8.acquire_token(arg_4,
                                          arg_6['userId'], arg_5)
        arg_10 = "{} {}".format("Bearer", arg_9['accessToken'])
        arg_1.headers['Authorization'] = arg_10
        return arg_1


def Func(arg_0, arg_1):
        ''' Delete an entity from the storage service using its path.

            Args:
                path(str): The path of the entity to be Func

            Returns:
                The uuid of created file entity as string

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

        arg_0.__validate_storage_path(arg_1, projects_allowed=False)

        arg_2 = arg_0.api_client.get_entity_by_query(arg_1=arg_1)

        if arg_2['entity_type'] in arg_0.__BROWSABLE_TYPES:
            # At this point it can only be a folder
            arg_3 = arg_0.api_client.list_folder_content(arg_2['uuid'])
            if arg_3['count'] > 0:
                raise StorageArgumentException(
                    'This method cannot Func non-empty folder. Please empty the folder first.')

            arg_0.api_client.Func_folder(arg_2['uuid'])
        elif arg_2['entity_type'] == 'file':
            arg_0.api_client.Func_file(arg_2['uuid'])

Delete an entity from the storage service using its path.

            Args:
                path(str): The path of the entity to be delete

            Returns:
                The uuid of created file entity as string

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

Delete an entity from the storage service using its path .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
for
arg_3
in
arg_1
:
arg_4
=
arg_3
[
2
]
+
"."
+
arg_3
[
3
:
]
arg_0
.
append
(
"Python {0}: {1}"
.
format
(
arg_4
,
ops_to_words
(
arg_2
[
arg_3
]
)
)
)

def Func(arg_0, arg_1, arg_2):
    """Generate Python interpreter version entries."""
    for arg_3 in arg_1:
        arg_4 = arg_3[2] + "." + arg_3[3:]
        arg_0.append("Python {0}: {1}".format(arg_4, ops_to_words(arg_2[arg_3])))

Generate Python interpreter version entries .


def Func ( arg_0 ) : try : return arg_0 . _stat . st_Func except : arg_0 . _stat = arg_0 . stat ( ) return arg_0 . Func

def Func(arg_0):
        """
        Get most recent access time in timestamp.
        """
        try:
            return arg_0._stat.st_Func
        except:  # pragma: no cover
            arg_0._stat = arg_0.stat()
            return arg_0.Func

Get most recent access time in timestamp .


async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . SetFocusResponse ( ) await arg_0 . _pb_request ( 'conversations/setfocus' , arg_1 , arg_2 ) return arg_2

async def Func(arg_0, arg_1):
        """Set focus to a conversation."""
        arg_2 = hangouts_pb2.SetFocusResponse()
        await arg_0._pb_request('conversations/setfocus',
                               arg_1, arg_2)
        return arg_2


(self, data_view_id, candidates, prediction_source='scalar', use_prior=True)

return self._get_success_json(
            self._post_json(post_url, data, failure_message=failure_message)
        )['data']['uid']

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
'scalar'
,
arg_4
=
True
)
:
arg_5
=
{
"prediction_source"
:
arg_3
,
"use_prior"
:
arg_4
,
"candidates"
:
arg_2
}
arg_6
=
"Configuration creation failed"
arg_7
=
'v1/data_views/'
+
str
(
arg_1
)
+
'/predict/submit'
return
arg_0
.
_get_success_json
(
arg_0
.
_post_json
(
arg_7
,
arg_5
,
arg_6
=
arg_6
)
)
[
'data'
]
[
'uid'
]

def Func(arg_0, arg_1, arg_2, arg_3='scalar', arg_4=True):
        """
        Submits an async prediction request.

        :param data_view_id: The id returned from create
        :param candidates: Array of candidates
        :param prediction_source: 'scalar' or 'scalar_from_distribution'
        :param use_prior: True to use prior prediction, otherwise False
        :return: Predict request Id (used to check status)
        """

        arg_5 = {
            "prediction_source":
                arg_3,
            "use_prior":
                arg_4,
            "candidates":
                arg_2
        }

        arg_6 = "Configuration creation failed"
        arg_7 = 'v1/data_views/' + str(arg_1) + '/predict/submit'
        return arg_0._get_success_json(
            arg_0._post_json(arg_7, arg_5, arg_6=arg_6)
        )['data']['uid']


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _create_prefix ( arg_1 ) arg_3 = [ ] for arg_4 in arg_0 . _bucket . objects . filter ( Prefix = arg_2 ) : if arg_4 . key . endswith ( '/' ) : continue arg_5 = os . path . dirname ( arg_4 . key ) if arg_5 == arg_2 : arg_3 . append ( os . path . relpath ( arg_4 . key , start = arg_2 ) ) return arg_3

def Func(arg_0, arg_1):
        """List all file-type object names that exist at the root of this
        bucket directory.

        Parameters
        ----------
        dirname : `str`
            Directory name in the bucket relative to ``bucket_root/``.

        Returns
        -------
        filenames : `list`
            List of file names (`str`), relative to ``bucket_root/``, that
            exist at the root of ``dirname``.
        """
        arg_2 = arg_0._create_prefix(arg_1)
        arg_3 = []
        for arg_4 in arg_0._bucket.objects.filter(Prefix=arg_2):
            if arg_4.key.endswith('/'):
                # a directory redirect object, not a file
                continue
            arg_5 = os.path.dirname(arg_4.key)
            if arg_5 == arg_2:
                # object is at root of directory
                arg_3.append(os.path.relpath(arg_4.key,
                                                 start=arg_2))
        return arg_3

List all file - type object names that exist at the root of this bucket directory .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
_logger
.
info
(
'Canceling jobID=%s'
,
arg_1
)
arg_0
.
jobSetFields
(
arg_1
,
{
"cancel"
:
True
}
,
useConnectionID
=
False
)

def Func(arg_0, arg_1):
    """ Cancel the given job. This will update the cancel field in the
    jobs table and will result in the job being cancelled.

    Parameters:
    ----------------------------------------------------------------
    jobID:                 jobID of the job to mark as completed

    to False for hypersearch workers
    """
    arg_0._logger.info('Canceling jobID=%s', arg_1)
    # NOTE: jobSetFields does retries on transient mysql failures
    arg_0.jobSetFields(arg_1, {"cancel" : True}, useConnectionID=False)

Cancel the given job . This will update the cancel field in the jobs table and will result in the job being cancelled .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
,
arg_4
=
get_job_or_local
(
arg_0
.
obj
.
get
(
'project'
)
,
arg_0
.
obj
.
get
(
'job'
)
)
arg_1
=
arg_1
or
1
try
:
arg_5
=
PolyaxonClient
(
)
.
job
.
get_Func
(
arg_2
,
arg_3
,
arg_4
,
arg_1
=
arg_1
)
except
(
PolyaxonHTTPError
,
PolyaxonShouldExitError
,
PolyaxonClientException
)
as
e
:
Printer
.
print_error
(
'Could not get status for job `{}`.'
.
format
(
arg_4
)
)
Printer
.
print_error
(
'Error message `{}`.'
.
format
(
e
)
)
sys
.
exit
(
1
)
arg_6
=
get_meta_response
(
arg_5
)
if
arg_6
:
Printer
.
print_header
(
'Statuses for Job `{}`.'
.
format
(
arg_4
)
)
Printer
.
print_header
(
'Navigation:'
)
dict_tabulate
(
arg_6
)
else
:
Printer
.
print_header
(
'No Func found for job `{}`.'
.
format
(
arg_4
)
)
arg_7
=
list_dicts_to_tabulate
(
[
Printer
.
add_status_color
(
o
.
to_light_dict
(
humanize_values
=
True
)
,
status_key
=
'status'
)
for
o
in
arg_5
[
'results'
]
]
)
if
arg_7
:
Printer
.
print_header
(
"Statuses:"
)
arg_7
.
pop
(
'job'
,
)
dict_tabulate
(
arg_7
,
is_list_dict
=
True
)

def Func(arg_0, arg_1):
    """Get job Func.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon job -j 2 Func
    ```
    """
    arg_2, arg_3, arg_4 = get_job_or_local(arg_0.obj.get('project'), arg_0.obj.get('job'))
    arg_1 = arg_1 or 1
    try:
        arg_5 = PolyaxonClient().job.get_Func(arg_2, arg_3, arg_4, arg_1=arg_1)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not get status for job `{}`.'.format(arg_4))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    arg_6 = get_meta_response(arg_5)
    if arg_6:
        Printer.print_header('Statuses for Job `{}`.'.format(arg_4))
        Printer.print_header('Navigation:')
        dict_tabulate(arg_6)
    else:
        Printer.print_header('No Func found for job `{}`.'.format(arg_4))

    arg_7 = list_dicts_to_tabulate(
        [Printer.add_status_color(o.to_light_dict(humanize_values=True), status_key='status')
         for o in arg_5['results']])
    if arg_7:
        Printer.print_header("Statuses:")
        arg_7.pop('job', None)
        dict_tabulate(arg_7, is_list_dict=True)

Get job statuses.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon job -j 2 statuses
    ```


(self, name, target, rate=None, args=(), kwargs={})

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = ( ) , arg_5 = { } ) : assert callable ( arg_2 ) if arg_3 is None : arg_3 = arg_0 . _rate else : assert_sample_rate ( arg_3 ) arg_6 = time ( ) arg_7 = arg_2 ( * arg_4 , ** arg_5 ) arg_0 . since ( arg_1 , arg_6 , arg_3 ) return arg_7

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=(), arg_5={}):
        # type: (str, Callable, float, Tuple, Dict) -> Chronometer
        """Send a Timer metric calculating duration of execution of the provided callable"""
        assert callable(arg_2)
        if arg_3 is None:
            arg_3 = arg_0._rate
        else:
            assert_sample_rate(arg_3)
        arg_6 = time()  # type: float
        arg_7 = arg_2(*arg_4, **arg_5)
        arg_0.since(arg_1, arg_6, arg_3)
        return arg_7


def Func ( arg_0 , arg_1 = None ) : if arg_1 : arg_2 = "volumes?region={}" . format ( arg_1 ) else : arg_2 = "volumes" arg_3 = arg_0 . get_data ( arg_2 ) arg_4 = list ( ) for arg_5 in arg_3 [ 'volumes' ] : arg_6 = Volume ( ** arg_5 ) arg_6 . token = arg_0 . token arg_4 . append ( arg_6 ) return arg_4

def Func(arg_0, arg_1=None):
        """
            This function returns a list of Volume objects.
        """
        if arg_1:
            arg_2 = "volumes?region={}".format(arg_1)
        else:
            arg_2 = "volumes"
        arg_3 = arg_0.get_data(arg_2)
        arg_4 = list()
        for arg_5 in arg_3['volumes']:
            arg_6 = Volume(**arg_5)
            arg_6.token = arg_0.token
            arg_4.append(arg_6)
        return arg_4

This function returns a list of Volume objects .


def Func(arg_0):
    """When you pass a quote character, returns you an another one if possible"""
    for arg_1 in QUOTES:
        if arg_1 != arg_0:
            return arg_1
    else:
        raise ValueError(u'Could not find a different quote for {}'.format(arg_0))

When you pass a quote character returns you an another one if possible


def Func ( arg_0 ) : arg_1 = [ ] if isinstance ( arg_0 . exc , astroid . Name ) : arg_2 = utils . safe_infer ( arg_0 . exc ) if arg_2 : arg_1 = [ arg_2 . name ] elif arg_0 . exc is None : arg_3 = arg_0 . parent while arg_3 and not isinstance ( arg_3 , astroid . ExceptHandler ) : arg_3 = arg_3 . parent if arg_3 and arg_3 . type : arg_4 = astroid . unpack_infer ( arg_3 . type ) arg_1 = ( arg_8 . name for arg_8 in arg_4 if arg_8 is not astroid . Uninferable ) else : arg_5 = _get_raise_target ( arg_0 ) if isinstance ( arg_5 , astroid . ClassDef ) : arg_1 = [ arg_5 . name ] elif isinstance ( arg_5 , astroid . FunctionDef ) : for arg_6 in arg_5 . nodes_of_class ( astroid . Return ) : if arg_6 . frame ( ) != arg_5 : continue arg_7 = utils . safe_infer ( arg_6 . value ) if ( arg_7 and isinstance ( arg_7 , ( astroid . Instance , astroid . ClassDef ) ) and utils . inherit_from_std_ex ( arg_7 ) ) : arg_1 . append ( arg_7 . name ) try : return { arg_8 for arg_8 in arg_1 if not utils . node_ignores_exception ( arg_0 , arg_8 ) } except astroid . InferenceError : return set ( )

def Func(arg_0):
    """
    Gets all of the possible raised exception types for the given raise node.

    .. note::

        Caught exception types are ignored.

    :param node: The raise node to find exception types for.
    :type node: astroid.node_classes.NodeNG

    :returns: A list of exception types possibly raised by :param:`node`.
    :rtype: set(str)
    """
    arg_1 = []
    if isinstance(arg_0.exc, astroid.Name):
        arg_2 = utils.safe_infer(arg_0.exc)
        if arg_2:
            arg_1 = [arg_2.name]
    elif arg_0.exc is None:
        arg_3 = arg_0.parent
        while arg_3 and not isinstance(arg_3, astroid.ExceptHandler):
            arg_3 = arg_3.parent

        if arg_3 and arg_3.type:
            arg_4 = astroid.unpack_infer(arg_3.type)
            arg_1 = (arg_8.name for arg_8 in arg_4 if arg_8 is not astroid.Uninferable)
    else:
        arg_5 = _get_raise_target(arg_0)
        if isinstance(arg_5, astroid.ClassDef):
            arg_1 = [arg_5.name]
        elif isinstance(arg_5, astroid.FunctionDef):
            for arg_6 in arg_5.nodes_of_class(astroid.Return):
                if arg_6.frame() != arg_5:
                    # return from inner function - ignore it
                    continue

                arg_7 = utils.safe_infer(arg_6.value)
                if (
                    arg_7
                    and isinstance(arg_7, (astroid.Instance, astroid.ClassDef))
                    and utils.inherit_from_std_ex(arg_7)
                ):
                    arg_1.append(arg_7.name)

    try:
        return {arg_8 for arg_8 in arg_1 if not utils.node_ignores_exception(arg_0, arg_8)}
    except astroid.InferenceError:
        return set()

Gets all of the possible raised exception types for the given raise node .


def Func ( arg_0 , arg_1 , arg_2 ) : if len ( arg_1 . annotations ) != 0 : if not arg_0 . annotation_type_set : arg_0 . annotation_type_set = True if validations . validate_annotation_type ( arg_2 ) : arg_1 . annotations [ - 1 ] . annotation_type = arg_2 return True else : raise SPDXValueError ( 'Annotation::AnnotationType' ) else : raise CardinalityError ( 'Annotation::AnnotationType' ) else : raise OrderError ( 'Annotation::AnnotationType' )

def Func(arg_0, arg_1, arg_2):
        """Sets the annotation type. Raises CardinalityError if
        already set. OrderError if no annotator defined before.
        Raises SPDXValueError if invalid value.
        """
        if len(arg_1.annotations) != 0:
            if not arg_0.annotation_type_set:
                arg_0.annotation_type_set = True
                if validations.validate_annotation_type(arg_2):
                    arg_1.annotations[-1].annotation_type = arg_2
                    return True
                else:
                    raise SPDXValueError('Annotation::AnnotationType')
            else:
                raise CardinalityError('Annotation::AnnotationType')
        else:
            raise OrderError('Annotation::AnnotationType')

Sets the annotation type . Raises CardinalityError if already set . OrderError if no annotator defined before . Raises SPDXValueError if invalid value .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = iter ( arg_1 ) arg_4 = list ( itertools . islice ( arg_3 , 0 , arg_2 ) ) while arg_4 : yield arg_4 arg_4 = list ( itertools . islice ( arg_3 , 0 , arg_2 ) )

def Func(arg_0, arg_1, arg_2):
        """Chunks data into chunk with size<=chunk_size."""
        arg_3 = iter(arg_1)
        arg_4 = list(itertools.islice(arg_3, 0, arg_2))
        while arg_4:
            yield arg_4
            arg_4 = list(itertools.islice(arg_3, 0, arg_2))

Chunks data into chunk with size< = chunk_size .


def Func ( arg_0 , arg_1 , arg_2 = False ) : from deepy . core import graph from deepy . core . comp_graph import ComputationalGraph arg_3 = graph . compile ( blocks = [ arg_0 ] ) arg_3 . Func ( arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2=False):
        from deepy.core import graph
        """
        Load parameters to the block.
        """
        from deepy.core.comp_graph import ComputationalGraph
        arg_3 = graph.compile(blocks=[arg_0])
        arg_3.Func(arg_1, arg_2=arg_2)


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
.
instructions
:
if
arg_1
.
consumes_meshes
(
)
:
return
arg_1
.
Func
raise
IndexError
(
"{} consumes no meshes"
.
format
(
arg_0
)
)

def Func(arg_0):
        """The first consumed mesh.

        :return: the first consumed mesh
        :rtype: knittingpattern.Mesh.Mesh
        :raises IndexError: if no mesh is consumed

        .. seealso:: :attr:`number_of_consumed_meshes`
        """
        for arg_1 in arg_0.instructions:
            if arg_1.consumes_meshes():
                return arg_1.Func
        raise IndexError("{} consumes no meshes".format(arg_0))


def Func(arg_0, arg_1):
        """Semantic validations of the qobj which cannot be done via schemas.
        Some of these may later move to backend schemas.
        1. No shots
        2. No measurements in the middle
        """
        arg_2 = arg_1.config.n_qubits
        arg_3 = arg_0.configuration().n_qubits
        if arg_2 > arg_3:
            raise BasicAerError('Number of qubits {} '.format(arg_2) +
                                'is greater than maximum ({}) '.format(arg_3) +
                                'for "{}".'.format(arg_0.name()))
        if hasattr(arg_1.config, 'shots') and arg_1.config.shots != 1:
            logger.info('"%s" only supports 1 shot. Setting shots=1.',
                        arg_0.name())
            arg_1.config.shots = 1
        for arg_6 in arg_1.experiments:
            arg_7 = arg_6.header.name
            if getattr(arg_6.config, 'shots', 1) != 1:
                logger.info('"%s" only supports 1 shot. '
                            'Setting shots=1 for circuit "%s".',
                            arg_0.name(), arg_7)
                arg_6.config.shots = 1
            for arg_8 in arg_6.instructions:
                if arg_8.name in ['measure', 'reset']:
                    raise BasicAerError('Unsupported "%s" instruction "%s" ' +
                                        'in circuit "%s" ', arg_0.name(),
                                        arg_8.name, arg_7)

Semantic validations of the qobj which cannot be done via schemas . Some of these may later move to backend schemas . 1 . No shots 2 . No measurements in the middle


def Func ( arg_0 , arg_1 ) : return np . array ( arg_0 . ode_body . getPosRelPoint ( tuple ( arg_1 ) ) )

def Func(arg_0, arg_1):
        '''Convert a point in world coordinates to a body-relative offset.

        Parameters
        ----------
        position : 3-tuple of float
            A world coordinates position.

        Returns
        -------
        offset : 3-tuple of float
            A tuple giving the body-relative offset of the given position.
        '''
        return np.array(arg_0.ode_body.getPosRelPoint(tuple(arg_1)))

Convert a point in world coordinates to a body - relative offset .


(
        objectid,
        idcol_to_use="ID",
        apiversion='v0',
        forcefetch=False,
        cachedir='~/.astrobase/mast-cache',
        verbose=True,
        timeout=90.0,
        refresh=5.0,
        maxtimeout=180.0,
        maxtries=3,
        jitter=5.0,
        raiseonfail=False
)

return mast_query(service,
                      params,
                      jitter=jitter,
                      apiversion=apiversion,
                      forcefetch=forcefetch,
                      cachedir=cachedir,
                      verbose=verbose,
                      timeout=timeout,
                      refresh=refresh,
                      maxtimeout=maxtimeout,
                      maxtries=maxtries,
                      raiseonfail=raiseonfail)

def Func(
        arg_0,
        arg_1="ID",
        arg_2='v0',
        arg_3=False,
        arg_4='~/.astrobase/mast-cache',
        arg_5=True,
        arg_6=90.0,
        arg_7=5.0,
        arg_8=180.0,
        arg_9=3,
        arg_10=5.0,
        arg_11=False
):
    '''
    This runs a TIC search for a specified TIC ID.

    Parameters
    ----------

    objectid : str
        The object ID to look up information for.

    idcol_to_use : str
        This is the name of the object ID column to use when looking up the
        provided `objectid`. This is one of {'ID', 'HIP', 'TYC', 'UCAC',
        'TWOMASS', 'ALLWISE', 'SDSS', 'GAIA', 'APASS', 'KIC'}.

    apiversion : str
        The API version of the MAST service to use. This sets the URL that this
        function will call, using `apiversion` as key into the `MAST_URLS` dict
        above.

    forcefetch : bool
        If this is True, the query will be retried even if cached results for
        it exist.

    cachedir : str
        This points to the directory where results will be downloaded.

    verbose : bool
        If True, will indicate progress and warn of any issues.

    timeout : float
        This sets the amount of time in seconds to wait for the service to
        respond to our initial request.

    refresh : float
        This sets the amount of time in seconds to wait before checking if the
        result file is available. If the results file isn't available after
        `refresh` seconds have elapsed, the function will wait for `refresh`
        seconds continuously, until `maxtimeout` is reached or the results file
        becomes available.

    maxtimeout : float
        The maximum amount of time in seconds to wait for a result to become
        available after submitting our query request.

    maxtries : int
        The maximum number of tries (across all mirrors tried) to make to either
        submit the request or download the results, before giving up.

    jitter : float
        This is used to control the scale of the random wait in seconds before
        starting the query. Useful in parallelized situations.

    raiseonfail : bool
        If this is True, the function will raise an Exception if something goes
        wrong, instead of returning None.

    Returns
    -------

    dict
        This returns a dict of the following form::

            {'params':dict of the input params used for the query,
             'provenance':'cache' or 'new download',
             'result':path to the file on disk with the downloaded data table}
    '''

    arg_12 = {
        'columns':'*',
        'filters':[
            {"paramName": arg_1,
             "values":[str(arg_0)]}
        ]
    }
    arg_13 = 'Mast.Catalogs.Filtered.Tic'

    return mast_query(arg_13,
                      arg_12,
                      arg_10=arg_10,
                      arg_2=arg_2,
                      arg_3=arg_3,
                      arg_4=arg_4,
                      arg_5=arg_5,
                      arg_6=arg_6,
                      arg_7=arg_7,
                      arg_8=arg_8,
                      arg_9=arg_9,
                      arg_11=arg_11)

This runs a TIC search for a specified TIC ID .


def Func ( arg_0 ) : arg_1 = [ arg_2 for arg_2 in arg_0 . contents ] for arg_2 in arg_1 : if isinstance ( arg_2 , Tag ) : arg_2 . Func ( ) else : arg_2 . extract ( ) arg_0 . extract ( )

def Func(arg_0):
        """Recursively destroys the contents of this tree."""
        arg_1 = [arg_2 for arg_2 in arg_0.contents]
        for arg_2 in arg_1:
            if isinstance(arg_2, Tag):
                arg_2.Func()
            else:
                arg_2.extract()
        arg_0.extract()

Recursively destroys the contents of this tree .


(cm, labels, hide_zeroes=False, hide_diagonal=False, hide_threshold=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
,
arg_3
=
False
,
arg_4
=
)
:
arg_5
=
max
(
[
len
(
x
)
for
x
in
arg_1
]
+
[
5
]
)
arg_6
=
" "
*
arg_5
print
(
"    "
+
arg_6
,
end
=
" "
)
for
arg_7
in
arg_1
:
print
(
"%{0}s"
.
format
(
arg_5
)
%
arg_7
,
end
=
" "
)
print
(
)
for
arg_8
,
arg_9
in
enumerate
(
arg_1
)
:
print
(
"    %{0}s"
.
format
(
arg_5
)
%
arg_9
,
end
=
" "
)
for
arg_10
in
range
(
len
(
arg_1
)
)
:
arg_11
=
"%{0}.1f"
.
format
(
arg_5
)
%
arg_0
[
arg_8
,
arg_10
]
if
arg_2
:
arg_11
=
arg_11
if
float
(
arg_0
[
arg_8
,
arg_10
]
)
!=
0
else
arg_6
if
arg_3
:
arg_11
=
arg_11
if
arg_8
!=
arg_10
else
arg_6
if
arg_4
:
arg_11
=
arg_11
if
arg_0
[
arg_8
,
arg_10
]
>
arg_4
else
arg_6
print
(
arg_11
,
end
=
" "
)
print
(
)

def Func(arg_0, arg_1, arg_2=False, arg_3=False, arg_4=None):
    """pretty print for confusion matrixes"""
    arg_5 = max([len(x) for x in arg_1] + [5])  # 5 is value length
    arg_6 = " " * arg_5
    # Print header
    print("    " + arg_6, end=" ")
    for arg_7 in arg_1:
        print("%{0}s".format(arg_5) % arg_7, end=" ")
    print()
    # Print rows
    for arg_8, arg_9 in enumerate(arg_1):
        print("    %{0}s".format(arg_5) % arg_9, end=" ")
        for arg_10 in range(len(arg_1)):
            arg_11 = "%{0}.1f".format(arg_5) % arg_0[arg_8, arg_10]
            if arg_2:
                arg_11 = arg_11 if float(arg_0[arg_8, arg_10]) != 0 else arg_6
            if arg_3:
                arg_11 = arg_11 if arg_8 != arg_10 else arg_6
            if arg_4:
                arg_11 = arg_11 if arg_0[arg_8, arg_10] > arg_4 else arg_6
            print(arg_11, end=" ")
        print()


def Func(arg_0):
    """
    Given a module, create a context from all of the top level annotated
    symbols in that module.
    """

    arg_1 = find_all(arg_0)

    if hasattr(arg_0, "__doc__"):
        setattr(arg_1, "__doc__", arg_0.__doc__)

    arg_2 = arg_0.__name__
    if hasattr(arg_0, "_name_"):
        arg_2 = arg_0._name_  # pylint: disable=W0212

    arg_1 = annotated(arg_1, arg_2)
    setattr(arg_1, 'context', True)

    return arg_2, arg_1

Given a module create a context from all of the top level annotated symbols in that module .


def Func ( ) : arg_0 = ( 'always' , None , DeprecationWarning , re . compile ( r'^qiskit\.*' , re . UNICODE ) , 0 ) try : warnings . _add_filter ( * arg_0 , append = False ) except AttributeError : pass warnings . simplefilter ( 'ignore' , category = ChangedInMarshmallow3Warning )

def Func():
    """Apply filters to deprecation warnings.

    Force the `DeprecationWarning` warnings to be displayed for the qiskit
    module, overriding the system configuration as they are ignored by default
    [1] for end-users. Additionally, silence the `ChangedInMarshmallow3Warning`
    messages.

    TODO: on Python 3.7, this might not be needed due to PEP-0565 [2].

    [1] https://docs.python.org/3/library/warnings.html#default-warning-filters
    [2] https://www.python.org/dev/peps/pep-0565/
    """
    arg_0 = ('always', None, DeprecationWarning,
                          re.compile(r'^qiskit\.*', re.UNICODE), 0)

    # Instead of using warnings.simple_filter() directly, the internal
    # _add_filter() function is used for being able to match against the
    # module.
    try:
        warnings._add_filter(*arg_0, append=False)
    except AttributeError:
        # ._add_filter is internal and not available in some Python versions.
        pass

    # Add a filter for ignoring ChangedInMarshmallow3Warning, as we depend on
    # marhsmallow 2 explicitly. 2.17.0 introduced new deprecation warnings that
    # are useful for eventually migrating, but too verbose for our purposes.
    warnings.simplefilter('ignore', category=ChangedInMarshmallow3Warning)


Retrieve the first Signature ordered by mangling descendant

def Func ( arg_0 ) -> Signature : arg_1 = sorted ( arg_0 . _hsig . keys ( ) ) return arg_0 . _hsig [ arg_1 [ 0 ] ]

def Func(arg_0) -> Signature:
        """ Retrieve the Func Signature ordered by mangling descendant """
        arg_1 = sorted(arg_0._hsig.keys())
        return arg_0._hsig[arg_1[0]]


def Func ( arg_0 , arg_1 , arg_2 ) : if "Darwin" in arg_1 . get ( "HTTP_USER_AGENT" , "" ) and arg_1 . get ( "HTTP_X_EXPECTED_ENTITY_LENGTH" ) : arg_3 = True arg_4 = arg_1 . get ( "HTTP_X_EXPECTED_ENTITY_LENGTH" , "0" ) arg_5 = int ( arg_4 ) else : arg_3 = False arg_4 = arg_1 [ "wsgi.input" ] . readline ( ) arg_1 [ "wsgidav.some_input_read" ] = 1 if arg_4 == compat . b_empty : arg_5 = 0 else : arg_5 = int ( arg_4 , 16 ) while arg_5 > 0 : arg_4 = arg_1 [ "wsgi.input" ] . read ( arg_2 ) yield arg_4 if arg_3 : arg_1 [ "wsgidav.some_input_read" ] = 1 if arg_4 == compat . b_empty : arg_5 = 0 else : arg_5 -= len ( arg_4 ) else : arg_1 [ "wsgi.input" ] . readline ( ) arg_4 = arg_1 [ "wsgi.input" ] . readline ( ) if arg_4 == compat . b_empty : arg_5 = 0 else : arg_5 = int ( arg_4 , 16 ) arg_1 [ "wsgidav.all_input_read" ] = 1

def Func(arg_0, arg_1, arg_2):
        """Get the data from a chunked transfer."""
        # Chunked Transfer Coding
        # http://www.servlets.com/rfcs/rfc2616-sec3.html#sec3.6.1

        if "Darwin" in arg_1.get("HTTP_USER_AGENT", "") and arg_1.get(
            "HTTP_X_EXPECTED_ENTITY_LENGTH"
        ):
            # Mac Finder, that does not prepend chunk-size + CRLF ,
            # like it should to comply with the spec. It sends chunk
            # size as integer in a HTTP header instead.
            arg_3 = True
            arg_4 = arg_1.get("HTTP_X_EXPECTED_ENTITY_LENGTH", "0")
            arg_5 = int(arg_4)
        else:
            arg_3 = False
            arg_4 = arg_1["wsgi.input"].readline()
            arg_1["wsgidav.some_input_read"] = 1
            if arg_4 == compat.b_empty:
                arg_5 = 0
            else:
                arg_5 = int(arg_4, 16)

        while arg_5 > 0:
            arg_4 = arg_1["wsgi.input"].read(arg_2)
            yield arg_4
            if arg_3:
                arg_1["wsgidav.some_input_read"] = 1
                # Keep receiving until we read expected size or reach
                # EOF
                if arg_4 == compat.b_empty:
                    arg_5 = 0
                else:
                    arg_5 -= len(arg_4)
            else:
                arg_1["wsgi.input"].readline()
                arg_4 = arg_1["wsgi.input"].readline()
                if arg_4 == compat.b_empty:
                    arg_5 = 0
                else:
                    arg_5 = int(arg_4, 16)
        arg_1["wsgidav.all_input_read"] = 1


def Func(arg_0, arg_1=40):
    """Return a new filename to use as the combined file name for a
    bunch of files, based on the SHA of their contents.
    A precondition is that they all have the same file extension

    Given that the list of files can have different paths, we aim to use the
    most common path.

    Example:
      /somewhere/else/foo.js
      /somewhere/bar.js
      /somewhere/different/too/foobar.js
    The result will be
      /somewhere/148713695b4a4b9083e506086f061f9c.js

    Another thing to note, if the filenames have timestamps in them, combine
    them all and use the highest timestamp.

    """
    # Get the SHA for each file, then sha all the shas.

    arg_2 = None
    arg_3 = []
    arg_4 = None
    arg_5 = []
    arg_6 = []
    arg_0.sort()
    arg_7 = "_".join(arg_0)
    if arg_7 in arg_13:
        return arg_13[arg_7]

    for arg_8 in arg_0:
        arg_9 = os.path.basename(arg_8)
        if not arg_4:
            arg_4 = os.path.splitext(arg_9)[1]
        elif os.path.splitext(arg_9)[1] != arg_4:
            raise ValueError("Can't combine multiple file extensions")

        for arg_10 in MEDIA_ROOTS:
            try:
                arg_6.append(md5(os.path.join(arg_10, arg_8)))
                break
            except IOError:
                pass

        if arg_2 is None:
            arg_2 = os.path.dirname(arg_8)
        else:
            if len(os.path.dirname(arg_8)) < len(arg_2):
                arg_2 = os.path.dirname(arg_8)

    arg_11 = hashlib.md5()
    arg_11.update(",".join(arg_6))

    arg_12 = "%s-inkmd" % arg_11.hexdigest()

    arg_12 = arg_12[:arg_1]
    arg_12 += arg_4
    arg_13[arg_7] = arg_12

    return os.path.join(arg_2, arg_12)

Return a new filename to use as the combined file name for a bunch of files based on the SHA of their contents . A precondition is that they all have the same file extension


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 : if arg_3 == None : arg_2 . append ( arg_3 ) else : arg_4 = arg_0 . patternMachine . get ( arg_3 ) arg_2 . append ( arg_4 ) return arg_2

def Func(arg_0, arg_1):
    """
    Generate a sequence from a list of numbers.

    Note: Any `None` in the list of numbers is considered a reset.

    @param numbers (list) List of numbers

    @return (list) Generated sequence
    """
    arg_2 = []

    for arg_3 in arg_1:
      if arg_3 == None:
        arg_2.append(arg_3)
      else:
        arg_4 = arg_0.patternMachine.get(arg_3)
        arg_2.append(arg_4)

    return arg_2

Generate a sequence from a list of numbers .


def Func(arg_0, arg_1, arg_2=False):
        '''
        Deletes the specified data or operating system disk from your image
        repository.

        disk_name:
            The name of the disk to delete.
        delete_vhd:
            Deletes the underlying vhd blob in Azure storage.
        '''
        _validate_not_none('disk_name', arg_1)
        arg_3 = arg_0._get_disk_path(arg_1)
        if arg_2:
            arg_3 += '?comp=media'
        return arg_0._perform_delete(arg_3)

Deletes the specified data or operating system disk from your image repository .


return self.request(path, method, call_params)

def Func ( arg_0 , arg_1 ) : arg_2 = '/' + arg_0 . api_version + '/ConferenceDeaf/' arg_3 = 'POST' return arg_0 . request ( arg_2 , arg_3 , arg_1 )

def Func(arg_0, arg_1):
        """REST Conference Deaf helper
        """
        arg_2 = '/' + arg_0.api_version + '/ConferenceDeaf/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the Credential struct and decode it into its
        constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if either the credential type or value are
                missing from the encoding.
        """
        super(Credential, arg_0).Func(arg_1, arg_2=arg_2)
        arg_6 = BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.CREDENTIAL_TYPE, arg_6):
            arg_0._credential_type = primitives.Enumeration(
                enum=arg_3.CredentialType,
                tag=arg_3.Tags.CREDENTIAL_TYPE
            )
            arg_0._credential_type.Func(arg_6, arg_2=arg_2)
        else:
            raise ValueError(
                "Credential encoding missing the credential type."
            )

        if arg_0.is_tag_next(arg_3.Tags.CREDENTIAL_VALUE, arg_6):
            if arg_0.credential_type == \
                    arg_3.CredentialType.USERNAME_AND_PASSWORD:
                arg_0._credential_value = UsernamePasswordCredential()
            elif arg_0.credential_type == arg_3.CredentialType.DEVICE:
                arg_0._credential_value = DeviceCredential()
            elif arg_0.credential_type == arg_3.CredentialType.ATTESTATION:
                arg_0._credential_value = AttestationCredential()
            else:
                raise ValueError(
                    "Credential encoding includes unrecognized credential "
                    "type."
                )
            arg_0._credential_value.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise ValueError(
                "Credential encoding missing the credential value."
            )

        arg_0.is_oversized(arg_6)

Read the data encoding the Credential struct and decode it into its
        constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a read method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if either the credential type or value are
                missing from the encoding.

Read the data encoding the Credential struct and decode it into its constituent parts .


def Func(arg_0):
        """Returns the StackExchange argument parser."""

        arg_1 = BackendCommandArgumentParser(arg_0.BACKEND.CATEGORIES,
                                              from_date=True,
                                              token_auth=True,
                                              archive=True)

        # StackExchange options
        arg_2 = arg_1.parser.add_argument_group('StackExchange arguments')
        arg_2.add_argument('--site', dest='site',
                           required=True,
                           help="StackExchange site")
        arg_2.add_argument('--tagged', dest='tagged',
                           help="filter items by question Tag")
        arg_2.add_argument('--max-questions', dest='max_questions',
                           type=int, default=MAX_QUESTIONS,
                           help="Maximum number of questions requested in the same query")

        return arg_1

Returns the StackExchange argument parser .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . compute_pointwise_distances ( arg_1 , arg_2 = [ ] ) if len ( arg_3 ) == 0 : return arg_2 return min ( arg_3 )

def Func(arg_0, arg_1, arg_2=None):
        """
        Compute the minimal distance between the line string and `other`.

        Parameters
        ----------
        other : tuple of number \
                or imgaug.augmentables.kps.Keypoint \
                or imgaug.augmentables.LineString
            Other object to which to compute the distance.

        default
            Value to return if this line string or `other` contain no points.

        Returns
        -------
        float
            Distance to `other` or `default` if not distance could be computed.

        """
        # FIXME this computes distance pointwise, does not have to be identical
        #       with the actual min distance (e.g. edge center to other's point)
        arg_3 = arg_0.compute_pointwise_distances(arg_1, arg_2=[])
        if len(arg_3) == 0:
            return arg_2
        return min(arg_3)

Compute the minimal distance between the line string and other .


return '()' if item is None else self.tuple_signature_for_components(item['inputs'])

def Func ( arg_0 ) -> str : arg_1 = arg_0 . _constructor_abi_item return '()' if arg_1 is None else arg_0 . tuple_signature_for_components ( arg_1 [ 'inputs' ] )

def Func(arg_0) -> str:
        """Returns the tuple type signature for the arguments of the contract constructor."""
        arg_1 = arg_0._constructor_abi_item
        return '()' if arg_1 is None else arg_0.tuple_signature_for_components(arg_1['inputs'])

Returns the tuple type signature for the arguments of the contract constructor .


return (self.is_conformance_clause_supported(conformance_clause) and
                self.is_authentication_suite_supported(authentication_suite))

def Func(arg_0, arg_1, arg_2):
        """
        Check if a profile is supported by the client.

        Args:
            conformance_clause (ConformanceClause):
            authentication_suite (AuthenticationSuite):

        Returns:
            bool: True if the profile is supported, False otherwise.

        Example:
            >>> client.Func(
            ... ConformanceClause.DISCOVER_VERSIONS,
            ... AuthenticationSuite.BASIC)
            True
        """
        return (arg_0.is_conformance_clause_supported(arg_1) and
                arg_0.is_authentication_suite_supported(arg_2))

Check if a profile is supported by the client.

        Args:
            conformance_clause (ConformanceClause):
            authentication_suite (AuthenticationSuite):

        Returns:
            bool: True if the profile is supported, False otherwise.

        Example:
            >>> client.is_profile_supported(
            ... ConformanceClause.DISCOVER_VERSIONS,
            ... AuthenticationSuite.BASIC)
            True

Check if a profile is supported by the client .


def Func(arg_0, arg_1=arg_2):
        """ Specific fetch for gerrit 2.8 version.

        Get open and closed reviews in different queries.
        Take the newer review from both lists and iterate.
        """

        # Convert date to Unix time
        arg_3 = datetime_to_utc(arg_1)
        arg_3 = arg_3.timestamp()

        arg_4 = "status:open"
        arg_5 = "status:closed"

        arg_6 = arg_0.client.next_retrieve_group_item()
        arg_7 = arg_0.client.next_retrieve_group_item()
        arg_8 = arg_0._get_reviews(arg_6, arg_4)
        arg_9 = arg_0._get_reviews(arg_7, arg_5)
        arg_10 = len(arg_8)
        arg_11 = len(arg_9)

        while arg_8 or arg_9:
            if arg_8 and arg_9:
                if arg_8[0]['lastUpdated'] >= arg_9[0]['lastUpdated']:
                    arg_12 = arg_8.pop(0)
                    arg_13 = arg_12
                else:
                    arg_14 = arg_9.pop(0)
                    arg_13 = arg_14
            elif arg_9:
                arg_14 = arg_9.pop(0)
                arg_13 = arg_14
            else:
                arg_12 = arg_8.pop(0)
                arg_13 = arg_12

            arg_15 = arg_13['lastUpdated']
            if arg_15 <= arg_3:
                logger.debug("No more updates for %s" % (arg_0.hostname))
                break
            else:
                yield arg_13

            if not arg_8 and arg_10 >= arg_0.max_reviews:
                arg_6 = arg_0.client.next_retrieve_group_item(arg_6, arg_12)
                arg_8 = arg_0._get_reviews(arg_6, arg_4)
                arg_10 = len(arg_8)
            if not arg_9 and arg_11 >= arg_0.max_reviews:
                arg_7 = arg_0.client.next_retrieve_group_item(arg_7, arg_14)
                arg_9 = arg_0._get_reviews(arg_7, arg_5)
                arg_11 = len(arg_9)

Specific fetch for gerrit 2 . 8 version .


def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
""
)
:
if
not
arg_2
:
arg_2
=
"\t"
arg_3
=
open
(
arg_0
,
"r"
)
if
arg_1
:
[
arg_3
.
readline
(
)
for
arg_4
in
range
(
arg_1
)
]
arg_5
=
os
.
path
.
splitext
(
arg_0
)
[
0
]
+
".csv"
arg_6
=
open
(
arg_5
,
"w"
)
arg_7
=
arg_3
.
readline
(
)
.
split
(
)
arg_8
=
csv
.
DictReader
(
arg_3
,
fieldnames
=
arg_7
,
arg_2
=
arg_2
)
arg_9
=
csv
.
DictWriter
(
arg_6
,
fieldnames
=
arg_7
,
arg_2
=
","
)
arg_9
.
writerow
(
dict
(
(
arg_10
,
arg_10
)
for
arg_10
in
arg_7
)
)
for
arg_11
in
arg_8
:
if
in
arg_11
:
del
arg_11
[
]
arg_9
.
writerow
(
arg_11
)
arg_3
.
close
(
)
arg_6
.
close
(
)
print
"Saved %s."
%
arg_5

def Func(arg_0, arg_1=0, arg_2=""):
    """Convert a file to a .csv file"""
    if not arg_2:
        arg_2 = "\t"

    arg_3 = open(arg_0, "r")

    if arg_1:
        [arg_3.readline() for arg_4 in range(arg_1)]

    arg_5 = os.path.splitext(arg_0)[0] + ".csv"
    arg_6 = open(arg_5, "w")

    arg_7 = arg_3.readline().split()
    arg_8 = csv.DictReader(arg_3, fieldnames=arg_7, arg_2=arg_2)
    arg_9 = csv.DictWriter(arg_6, fieldnames=arg_7, arg_2=",")

    # Write header
    arg_9.writerow(dict((arg_10, arg_10) for arg_10 in arg_7))

    # Write rows
    for arg_11 in arg_8:
        if None in arg_11: del arg_11[None]
        arg_9.writerow(arg_11)

    arg_3.close()
    arg_6.close()
    print "Saved %s." % arg_5


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = get_context ( arg_0 ) arg_0 . solver . add ( arg_1 , ** arg_2 ) if arg_3 : arg_3 ( partial ( arg_0 . solver . remove , arg_1 ) )

def Func(arg_0, arg_1, **arg_2):
    """Add variables and constraints to a Model's solver object.

    Useful for variables and constraints that can not be expressed with
    reactions and lower/upper bounds. Will integrate with the Model's context
    manager in order to revert changes upon leaving the context.

    Parameters
    ----------
    model : a cobra model
       The model to which to add the variables and constraints.
    what : list or tuple of optlang variables or constraints.
       The variables or constraints to add to the model. Must be of class
       `model.problem.Variable` or
       `model.problem.Constraint`.
    **kwargs : keyword arguments
        passed to solver.add()
    """
    arg_3 = get_context(arg_0)

    arg_0.solver.add(arg_1, **arg_2)
    if arg_3:
        arg_3(partial(arg_0.solver.remove, arg_1))

Add variables and constraints to a Model s solver object .


def
Func
(
arg_0
,
arg_1
=
4
)
:
arg_2
=
"{}.mp3"
.
format
(
arg_0
[
"name"
]
)
if
os
.
path
.
exists
(
arg_2
)
:
os
.
remove
(
arg_2
)
arg_3
=
int
(
arg_0
[
"size"
]
/
arg_1
)
if
arg_3
<=
1024
:
arg_1
=
1
arg_4
=
uuid
.
uuid4
(
)
.
hex
logger
.
info
(
"downloading '{}'..."
.
format
(
arg_0
[
"name"
]
)
)
arg_5
=
[
]
for
arg_6
in
range
(
arg_1
)
:
if
arg_6
==
arg_1
1
:
arg_7
=
''
else
:
arg_7
=
(
arg_6
+
1
)
*
arg_3
1
arg_8
=
Worker
(
(
arg_6
*
arg_3
,
arg_7
)
,
arg_0
,
arg_4
)
arg_8
.
start
(
)
arg_5
.
append
(
arg_8
)
for
arg_9
in
arg_5
:
arg_9
.
join
(
)
arg_10
=
glob
.
glob
(
"part-{}-*"
.
format
(
arg_4
)
)
arg_10
.
sort
(
key
=
lambda
e
:
e
.
split
(
'-'
)
[
1
]
)
logger
.
info
(
"'{}' combine parts..."
.
format
(
arg_0
[
"name"
]
)
)
with
open
(
arg_2
,
"ab"
)
as
f
:
for
arg_3
in
arg_10
:
with
open
(
arg_3
,
"rb"
)
as
d
:
shutil
.
copyfileobj
(
d
,
f
)
os
.
remove
(
arg_3
)
logger
.
info
(
"'{}' finished"
.
format
(
arg_0
[
"name"
]
)
)

def Func(arg_0, arg_1=4):
    """
    process for downing music with multiple threads
    """
    arg_2 = "{}.mp3".format(arg_0["name"])

    if os.path.exists(arg_2):
        os.remove(arg_2)

    arg_3 = int(arg_0["size"] / arg_1)
    if arg_3 <= 1024:
        arg_1 = 1

    arg_4 = uuid.uuid4().hex

    logger.info("downloading '{}'...".format(arg_0["name"]))

    arg_5 = []
    for arg_6 in range(arg_1):
        if arg_6 == arg_1 - 1:
            arg_7 = ''
        else:
            arg_7 = (arg_6 + 1) * arg_3 - 1
        arg_8 = Worker((arg_6 * arg_3, arg_7), arg_0, arg_4)
        arg_8.start()
        arg_5.append(arg_8)

    for arg_9 in arg_5:
        arg_9.join()

    arg_10 = glob.glob("part-{}-*".format(arg_4))
    arg_10.sort(key=lambda e: e.split('-')[-1])

    logger.info("'{}' combine parts...".format(arg_0["name"]))
    with open(arg_2, "ab") as f:
        for arg_3 in arg_10:
            with open(arg_3, "rb") as d:
                shutil.copyfileobj(d, f)
            os.remove(arg_3)
    logger.info("'{}' finished".format(arg_0["name"]))


return self.call_api(
            "DELETE",
            url,
            params=params,
            **kwargs
        )

def Func ( arg_0 , arg_1 , arg_2 = None , ** arg_3 ) : return arg_0 . call_api ( "DELETE" , arg_1 , arg_2 = arg_2 , ** arg_3 )

def Func(arg_0, arg_1, arg_2=None, **arg_3):
        """ Call the API with a DELETE request.

        Args:
            url (str): Resource location relative to the base URL.
            params (dict or None): Query-string parameters.

        Returns:
            ResultParser or ErrorParser.
        """
        return arg_0.call_api(
            "DELETE",
            arg_1,
            arg_2=arg_2,
            **arg_3
        )


def Func(arg_0, arg_1=None):
    """A strategy which generates filesystem path values.

    The generated values include everything which the builtin
    :func:`python:open` function accepts i.e. which won't lead to
    :exc:`ValueError` or :exc:`TypeError` being raised.

    Note that the range of the returned values depends on the operating
    system, the Python version, and the filesystem encoding as returned by
    :func:`sys.getfilesystemencoding`.

    :param allow_pathlike:
        If :obj:`python:None` makes the strategy include objects implementing
        the :class:`python:os.PathLike` interface when Python >= 3.6 is used.
        If :obj:`python:False` no pathlike objects will be generated. If
        :obj:`python:True` pathlike will be generated (Python >= 3.6 required)

    :type allow_pathlike: :obj:`python:bool` or :obj:`python:None`

    .. versionadded:: 3.15

    """
    arg_2 = hasattr(os, 'PathLike')

    if arg_1 is None:
        arg_1 = arg_2
    if arg_1 and not arg_2:
        raise InvalidArgument(
            'allow_pathlike: os.PathLike not supported, use None instead '
            'to enable it only when available')

    arg_3 = arg_0(sampled_from([bytes, text_type]))

    def tp(arg_4=''):
        return _str_to_path(arg_4, arg_3)

    arg_5 = sampled_from([tp(os.curdir), tp(os.pardir)])
    arg_6 = _filename(arg_3)
    arg_7 = one_of(arg_6, arg_5)
    arg_8 = arg_6.map(lambda f: tp(os.extsep) + f)
    arg_9 = _path_root(arg_3)

    def optional(arg_10):
        return one_of(arg_10, just(arg_3()))

    arg_11 = sampled_from([os.sep, os.altsep or os.sep]).map(tp)
    arg_12 = builds(lambda arg_4, l: arg_4.join(l), arg_11, lists(arg_7))
    arg_13 = builds(lambda *x: tp().join(x),
                           optional(arg_9), arg_12, optional(arg_8))

    if arg_1 and hasattr(os, 'fspath'):
        arg_14 = arg_13.map(lambda p: _PathLike(p))
        arg_13 = one_of(arg_13, arg_14)

    return arg_0(arg_13)

A strategy which generates filesystem path values .


def Func(arg_0):
    """
    Propagate "clk" clock and negative reset "rst_n" signal
    to all subcomponents
    """
    arg_1 = arg_0.clk
    arg_2 = arg_0.rst_n

    for arg_3 in arg_0._units:
        _tryConnect(arg_1, arg_3, 'clk')
        _tryConnect(arg_2, arg_3, 'rst_n')
        _tryConnect(~arg_2, arg_3, 'rst')

Propagate clk clock and negative reset rst_n signal to all subcomponents


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_3 : arg_0 . splitter . delims = GREEDY_DELIMS else : arg_0 . splitter . delims = DELIMS if arg_0 . readline : arg_0 . readline . set_completer_delims ( arg_0 . splitter . delims )

def Func(arg_0, arg_1, arg_2, arg_3):
        """update the splitter and readline delims when greedy is changed"""
        if arg_3:
            arg_0.splitter.delims = GREEDY_DELIMS
        else:
            arg_0.splitter.delims = DELIMS

        if arg_0.readline:
            arg_0.readline.set_completer_delims(arg_0.splitter.delims)


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
.
instructions
:
if
arg_1
.
produces_meshes
(
)
:
return
arg_1
.
Func
raise
IndexError
(
"{} produces no meshes"
.
format
(
arg_0
)
)

def Func(arg_0):
        """The first produced mesh.

        :return: the first produced mesh
        :rtype: knittingpattern.Mesh.Mesh
        :raises IndexError: if no mesh is produced

        .. seealso:: :attr:`number_of_produced_meshes`
        """
        for arg_1 in arg_0.instructions:
            if arg_1.produces_meshes():
                return arg_1.Func
        raise IndexError("{} produces no meshes".format(arg_0))


def Func(arg_0, arg_1, arg_2):
        # type: (int, PrivateKey) -> None
        """
        Signs the input at the specified index.

        :param start_index:
            The index of the first input transaction.

            If necessary, the resulting signature will be split across
            multiple transactions automatically (i.e., if an input has
            ``security_level=2``, you still only need to call
            :py:meth:`Func` once).

        :param private_key:
            The private key that will be used to generate the signature.

            .. important::
                Be sure that the private key was generated using the
                correct seed, or the resulting signature will be
                invalid!
        """
        if not arg_0.hash:
            raise RuntimeError('Cannot sign inputs until bundle is finalized.')

        arg_2.sign_input_transactions(arg_0, arg_1)

Signs the input at the specified index.

        :param start_index:
            The index of the first input transaction.

            If necessary, the resulting signature will be split across
            multiple transactions automatically (i.e., if an input has
            ``security_level=2``, you still only need to call
            :py:meth:`sign_input_at` once).

        :param private_key:
            The private key that will be used to generate the signature.

            .. important::
                Be sure that the private key was generated using the
                correct seed, or the resulting signature will be
                invalid!

Signs the input at the specified index .


def
Func
(
arg_0
)
:
with
hide
(
'running'
,
'stdout'
,
'stderr'
,
'warnings'
)
:
arg_1
=
str
(
arg_0
.
local
(
'git rev-parse HEAD'
,
capture
=
True
)
)
arg_0
.
vprint
(
'current commit:'
,
arg_1
)
return
arg_1

def Func(arg_0):
        """
        Retrieves the git commit number of the current head branch.
        """
        with hide('running', 'stdout', 'stderr', 'warnings'):
            arg_1 = str(arg_0.local('git rev-parse HEAD', capture=True))
            arg_0.vprint('current commit:', arg_1)
            return arg_1

Retrieves the git commit number of the current head branch .


def Func ( arg_0 , arg_1 ) : if arg_1 . startswith ( '/' ) : arg_0 . _ftp . cwd ( arg_1 ) else : for arg_2 in arg_1 . split ( '/' ) : if arg_2 : arg_0 . _ftp . cwd ( arg_2 )

def Func(arg_0, arg_1):
        """ Changes the working directory on the server.

        :param folder: the desired directory.
        :type folder: string
        """
        if arg_1.startswith('/'):
            arg_0._ftp.cwd(arg_1)
        else:
            for arg_2 in arg_1.split('/'):
                if arg_2:
                    arg_0._ftp.cwd(arg_2)

Changes the working directory on the server .


Bins the light curve model to the provided time array

def Func ( arg_0 ) : arg_1 = _Func ( arg_0 . transit , arg_0 . limbdark , arg_0 . settings , arg_0 . arrays ) if arg_1 != _ERR_NONE : RaiseError ( arg_1 )

def Func(arg_0):
    '''
    Funcs the light curve model to the provided time array

    '''

    arg_1 = _Func(arg_0.transit, arg_0.limbdark, arg_0.settings, arg_0.arrays)
    if arg_1 != _ERR_NONE: RaiseError(arg_1)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
1
)
:
arg_3
=
arg_0
.
numberMapForBits
(
arg_1
)
arg_4
=
""
arg_5
=
[
]
arg_6
=
sorted
(
arg_3
.
iteritems
(
)
,
key
=
lambda
(
arg_7
,
arg_1
)
:
len
(
arg_1
)
,
reverse
=
True
)
for
arg_7
,
arg_1
in
arg_6
:
if
arg_2
>
2
:
arg_8
=
[
str
(
n
)
for
n
in
arg_1
]
arg_9
=
"{0} (bits: {1})"
.
format
(
arg_7
,
","
.
join
(
arg_8
)
)
elif
arg_2
>
1
:
arg_9
=
"{0} ({1} bits)"
.
format
(
arg_7
,
len
(
arg_1
)
)
else
:
arg_9
=
str
(
arg_7
)
arg_5
.
append
(
arg_9
)
arg_4
+=
"[{0}]"
.
format
(
", "
.
join
(
arg_5
)
)
return
arg_4

def Func(arg_0, arg_1, arg_2=1):
    """
    Pretty print a pattern.

    @param bits      (set) Indices of on bits
    @param verbosity (int) Verbosity level

    @return (string) Pretty-printed text
    """
    arg_3 = arg_0.numberMapForBits(arg_1)
    arg_4 = ""

    arg_5 = []
    arg_6 = sorted(arg_3.iteritems(),
                         key=lambda (arg_7, arg_1): len(arg_1),
                         reverse=True)

    for arg_7, arg_1 in arg_6:

      if arg_2 > 2:
        arg_8 = [str(n) for n in arg_1]
        arg_9 = "{0} (bits: {1})".format(arg_7, ",".join(arg_8))
      elif arg_2 > 1:
        arg_9 = "{0} ({1} bits)".format(arg_7, len(arg_1))
      else:
        arg_9 = str(arg_7)

      arg_5.append(arg_9)

    arg_4 += "[{0}]".format(", ".join(arg_5))

    return arg_4


(self, tableInfo, conn, fieldsToMatch,
                                  selectFieldNames)

def Func(arg_0, arg_1, arg_2, arg_3,
                                  arg_4):
    """ Return a single matching row with the requested field values from the
    the requested table or None if nothing matched.

    tableInfo:       Table information: a ClientJobsDAO._TableInfoBase  instance
    conn:            Owned connection acquired from ConnectionFactory.get()
    fieldsToMatch:   Dictionary of internal fieldName/value mappings that
                     identify the desired rows. If a value is an instance of
                     ClientJobsDAO._SEQUENCE_TYPES (list/set/tuple), then the
                     operator 'IN' will be used in the corresponding SQL
                     predicate; if the value is bool: "IS TRUE/FALSE"; if the
                     value is None: "IS NULL"; '=' will be used for all other
                     cases.
    selectFieldNames:
                     list of fields to return, using internal field names

    retval:          A sequence of field values of the matching row in the order
                      of the given field names; or None if there was no match.
    """
    arg_5 = arg_0._getMatchingRowsNoRetries(arg_1, arg_2, arg_3,
                                          arg_4, maxRows=1)
    if arg_5:
      assert len(arg_5) == 1, repr(len(arg_5))
      arg_6 = arg_5[0]
    else:
      arg_6 = None

    return arg_6

Return a single matching row with the requested field values from the the requested table or None if nothing matched .


def Func(arg_0, arg_1=50):
        """A helper function that shows how to train and validate a model at the same time.

        Parameters
        ----------
        validate_step_size : int
            Validate the training network every N steps.

        """
        while not arg_0._sess.should_stop():
            arg_0.train_on_batch()  # Run a training step synchronously.
            if arg_0.global_step % arg_1 == 0:
                # logging.info("Average loss for validation dataset: %s" % self.get_validation_metrics())
                arg_2 = 'step: %d, ' % arg_0.global_step
                for arg_3, arg_4 in arg_0.validation_metrics:
                    arg_2 += '%s: %f, ' % (arg_3.name, arg_4)
                logging.info(arg_2)

A helper function that shows how to train and validate a model at the same time .


return sorted(
            {check.name for check in current_checkers if check.name != "master"}
        )

def Func ( arg_0 ) : arg_1 = arg_0 . get_checkers ( ) return sorted ( { arg_2 . name for arg_2 in arg_1 if arg_2 . name != "master" } )

def Func(arg_0):
        """Get all the checker names that this linter knows about."""
        arg_1 = arg_0.get_checkers()
        return sorted(
            {arg_2.name for arg_2 in arg_1 if arg_2.name != "master"}
        )

Get all the checker names that this linter knows about .


(graph: BELGraph,
                         genes: List[Gene],
                         ora_weight: Optional[float] = None,
                         hub_weight: Optional[float] = None,
                         top_percent: Optional[float] = None,
                         topology_weight: Optional[float] = None)

def Func(arg_0: arg_1,
                         arg_2: arg_3[arg_4],
                         arg_5: arg_6[arg_7] = None,
                         arg_8: arg_6[arg_7] = None,
                         arg_9: arg_6[arg_7] = None,
                         arg_10: arg_6[arg_7] = None) -> arg_7:
    """Calculate the composite NeuroMMSig Score for a given list of genes.

    :param graph: A BEL graph
    :param genes: A list of gene nodes
    :param ora_weight: The relative weight of the over-enrichment analysis score from
     :py:func:`neurommsig_gene_ora`. Defaults to 1.0.
    :param hub_weight: The relative weight of the hub analysis score from :py:func:`neurommsig_hubs`.
     Defaults to 1.0.
    :param top_percent: The percentage of top genes to use as hubs. Defaults to 5% (0.05).
    :param topology_weight: The relative weight of the topolgical analysis core from
     :py:func:`neurommsig_topology`. Defaults to 1.0.
    :return: The NeuroMMSig composite score
    """
    arg_5 = arg_5 or 1.0
    arg_8 = arg_8 or 1.0
    arg_10 = arg_10 or 1.0
    arg_11 = arg_5 + arg_8 + arg_10

    arg_2 = list(arg_2)

    arg_12 = neurommsig_gene_ora(arg_0, arg_2)
    arg_13 = neurommsig_hubs(arg_0, arg_2, arg_9=arg_9)
    arg_14 = neurommsig_topology(arg_0, arg_2)

    arg_15 = (
            arg_5 * arg_12 +
            arg_8 * arg_13 +
            arg_10 * arg_14
    )

    return arg_15 / arg_11

Calculate the composite NeuroMMSig Score for a given list of genes .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
for
arg_4
in
arg_1
:
arg_5
=
getattr
(
arg_0
,
arg_4
)
if
arg_5
is
not
:
arg_6
=
getattr
(
arg_5
,
'__str__'
,
)
if
not
callable
(
arg_6
)
:
arg_3
=
arg_3
+
[
'{0} must provide __str__ method.'
.
format
(
arg_5
)
]
elif
not
arg_2
:
arg_3
=
arg_3
+
[
'Package {0} can not be None.'
.
format
(
arg_4
)
]
return
arg_3

def Func(arg_0, arg_1, arg_2, arg_3):
        """Helper for validate_mandatory_str_field and
        validate_optional_str_fields"""
        for arg_4 in arg_1:
            arg_5 = getattr(arg_0, arg_4)
            if arg_5 is not None:
                # FIXME: this does not make sense???
                arg_6 = getattr(arg_5, '__str__', None)
                if not callable(arg_6):
                    arg_3 = arg_3 + [
                        '{0} must provide __str__ method.'.format(arg_5)
                    ]
                    # Continue checking.
            elif not arg_2:
                arg_3 = arg_3 + [
                    'Package {0} can not be None.'.format(arg_4)
                ]

        return arg_3


def Func(arg_0, arg_1):
        """
        Publish the message to SQS queue

        :param context: the context object
        :type context: dict
        :return: dict with information about the message sent
            For details of the returned dict see :py:meth:`botocore.client.SQS.send_message`
        :rtype: dict
        """

        arg_2 = SQSHook(aws_conn_id=arg_0.aws_conn_id)

        arg_3 = arg_2.send_message(queue_url=arg_0.sqs_queue,
                                   message_body=arg_0.message_content,
                                   delay_seconds=arg_0.delay_seconds,
                                   message_attributes=arg_0.message_attributes)

        arg_0.log.info('result is send_message is %s', arg_3)

        return arg_3


A class decorator for Command classes to register in the default set.

def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
name
(
)
if
arg_1
in
arg_2
.
_all_commands
:
raise
ValueError
(
"Command already exists: "
+
arg_1
)
arg_2
.
_all_commands
[
arg_1
]
=
arg_0
return
arg_0

def Func(arg_0):
    """A class decorator for Command classes to Func in the default set."""
    arg_1 = arg_0.name()
    if arg_1 in arg_2._all_commands:
        raise ValueError("Command already exists: " + arg_1)
    arg_2._all_commands[arg_1] = arg_0
    return arg_0

A class decorator for Command classes to register in the default set .


Given an input timestamp string, determine what format is it likely in.

  :param string timestamp: the timestamp string for which we need to determine format
  :return: best guess timestamp format

Given an input timestamp string determine what format is it likely in .


def
Func
(
arg_0
,
arg_1
=
3
,
arg_2
=
False
)
:
arg_3
=
[
]
if
arg_1
:
if
arg_0
.
starts_line
is
not
:
arg_4
=
"%%%dd"
%
arg_1
arg_3
.
append
(
arg_4
%
arg_0
.
starts_line
)
else
:
arg_3
.
append
(
' '
*
arg_1
)
if
arg_2
:
arg_3
.
append
(
'-->'
)
else
:
arg_3
.
append
(
'   '
)
if
arg_0
.
is_jump_target
:
arg_3
.
append
(
'>>'
)
else
:
arg_3
.
append
(
'  '
)
arg_3
.
append
(
repr
(
arg_0
.
offset
)
.
rjust
(
4
)
)
arg_3
.
append
(
arg_0
.
opname
.
ljust
(
20
)
)
if
arg_0
.
arg
is
not
:
arg_3
.
append
(
repr
(
arg_0
.
arg
)
.
rjust
(
5
)
)
if
arg_0
.
argrepr
:
arg_3
.
append
(
'('
+
arg_0
.
argrepr
+
')'
)
return
' '
.
join
(
arg_3
)
.
rstrip
(
)

def Func(arg_0, arg_1=3, arg_2=False):
        """Format instruction details for inclusion in disassembly output

        *lineno_width* sets the width of the line number field (0 omits it)
        *mark_as_current* inserts a '-->' marker arrow as part of the line
        """
        arg_3 = []
        # Column: Source code line number
        if arg_1:
            if arg_0.starts_line is not None:
                arg_4 = "%%%dd" % arg_1
                arg_3.append(arg_4 % arg_0.starts_line)
            else:
                arg_3.append(' ' * arg_1)
        # Column: Current instruction indicator
        if arg_2:
            arg_3.append('-->')
        else:
            arg_3.append('   ')
        # Column: Jump target marker
        if arg_0.is_jump_target:
            arg_3.append('>>')
        else:
            arg_3.append('  ')
        # Column: Instruction offset from start of code sequence
        arg_3.append(repr(arg_0.offset).rjust(4))
        # Column: Opcode name
        arg_3.append(arg_0.opname.ljust(20))
        # Column: Opcode argument
        if arg_0.arg is not None:
            arg_3.append(repr(arg_0.arg).rjust(5))
            # Column: Opcode argument details
            if arg_0.argrepr:
                arg_3.append('(' + arg_0.argrepr + ')')
        return ' '.join(arg_3).rstrip()