return re.sub(r'[^a-zA-Z0-9]', '_', file_path_from_root).upper() + '_'

def Func ( arg_0 ) : arg_0 = re . sub ( r'_flymake\.h$' , '.h' , arg_0 ) arg_0 = re . sub ( r'/\.flymake/([^/]*)$' , r'/\1' , arg_0 ) arg_0 = arg_0 . replace ( 'C++' , 'cpp' ) . replace ( 'c++' , 'cpp' ) arg_1 = FileInfo ( arg_0 ) arg_2 = arg_1 . RepositoryName ( ) if _root : arg_3 = os . sep if arg_3 == '\\' : arg_3 += '\\' arg_2 = re . sub ( '^' + _root + arg_3 , '' , arg_2 ) return re . sub ( r'[^a-zA-Z0-9]' , '_' , arg_2 ) . upper ( ) + '_'

def Func(arg_0):
  """Returns the CPP variable that should be used as a header guard.

  Args:
    filename: The name of a C++ header file.

  Returns:
    The CPP variable that should be used as a header guard in the
    named file.

  """

  # Restores original filename in case that cpplint is invoked from Emacs's
  # flymake.
  arg_0 = re.sub(r'_flymake\.h$', '.h', arg_0)
  arg_0 = re.sub(r'/\.flymake/([^/]*)$', r'/\1', arg_0)
  # Replace 'c++' with 'cpp'.
  arg_0 = arg_0.replace('C++', 'cpp').replace('c++', 'cpp')

  arg_1 = FileInfo(arg_0)
  arg_2 = arg_1.RepositoryName()
  if _root:
    arg_3 = os.sep
    # On Windows using directory separator will leave us with
    # "bogus escape error" unless we properly escape regex.
    if arg_3 == '\\':
      arg_3 += '\\'
    arg_2 = re.sub('^' + _root + arg_3, '', arg_2)
  return re.sub(r'[^a-zA-Z0-9]', '_', arg_2).upper() + '_'

Returns the CPP variable that should be used as a header guard .


def Func(arg_0, arg_1, arg_2):
    """Transform Stinespring representation to Operator representation."""
    arg_3 = arg_0[0].shape[0] // arg_2
    if arg_0[1] is not None or arg_3 != 1:
        raise QiskitError(
            'Channel cannot be converted to Operator representation')
    return arg_0[0]

Transform Stinespring representation to Operator representation .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = np . matrix ( [ row [ : arg_1 ] + row [ arg_1 + 1 : ] for row in arg_0 ] ) arg_4 = np . asarray ( [ row [ arg_1 ] for row in arg_0 ] , dtype = np . uint8 ) return arg_3 , arg_4

def Func(arg_0, arg_1, arg_2):
  """
  Separates the outcome feature from the data.
  """
  arg_3 = np.matrix([row[:arg_1] + row[arg_1+1:] for row in arg_0])
  arg_4 = np.asarray([row[arg_1] for row in arg_0], dtype=np.uint8)

  return arg_3, arg_4

Separates the outcome feature from the data .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . file . seek ( arg_1 * K - K ) return arg_0 . file . write ( arg_2 )

def Func(arg_0, arg_1, arg_2):
        """Write `data` to file record `n`; records are indexed from 1."""
        arg_0.file.seek(arg_1 * K - K)
        return arg_0.file.write(arg_2)

Write data to file record n ; records are indexed from 1 .


(self, filename, storage_type=None, bucket_name=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Deletes the specified file, either locally or from S3, depending on the file's storage type."""

        if not (arg_2 and arg_3):
            arg_0._Func_local(arg_1)
        else:
            if arg_2 != 's3':
                raise ValueError('Storage type "%s" is invalid, the only supported storage type (apart from default local storage) is s3.' % arg_2)

            arg_0._Func_s3(arg_1, arg_3)

Deletes the specified file either locally or from S3 depending on the file s storage type .


def Func ( arg_0 ) : arg_1 = read_header ( arg_0 ) arg_2 = int ( arg_1 [ b'nbits' ] / 8 ) arg_3 = arg_1 [ b'nchans' ] arg_4 = arg_1 [ b'nifs' ] arg_5 = len_header ( arg_0 ) arg_6 = open ( arg_0 , 'rb' ) arg_6 . seek ( arg_5 ) arg_7 = os . path . getsize ( arg_0 ) arg_8 = arg_7 - arg_5 if arg_1 [ b'nbits' ] == 2 : arg_9 = int ( 4 * arg_8 / ( arg_3 * arg_4 ) ) else : arg_9 = int ( arg_8 / ( arg_2 * arg_3 * arg_4 ) ) return arg_9

def Func(arg_0):
    """ Calculate number of integrations in a given file """
    # Load binary data
    arg_1 = read_header(arg_0)
    arg_2  = int(arg_1[b'nbits'] / 8)

    arg_3 = arg_1[b'nchans']
    arg_4   = arg_1[b'nifs']
    arg_5 = len_header(arg_0)
    arg_6 = open(arg_0, 'rb')
    arg_6.seek(arg_5)
    arg_7 = os.path.getsize(arg_0)
    arg_8 = arg_7 - arg_5

    if arg_1[b'nbits'] == 2:
        arg_9 = int(4 * arg_8 / (arg_3 * arg_4))
    else:
        arg_9 = int(arg_8 / (arg_2 * arg_3 * arg_4))

    return arg_9


(self, req, receiver='', iss='', lifetime=0, sign_alg='', aud=None)

return self.pack(req=req, receiver=receiver, iss=iss, lifetime=lifetime,
                         sign=True, encrypt=False, sign_alg=sign_alg)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
''
,
arg_3
=
''
,
arg_4
=
0
,
arg_5
=
''
,
arg_6
=
)
:
if
not
arg_5
:
for
arg_7
,
arg_8
in
[
(
'RSA'
,
'RS256'
)
,
(
'EC'
,
'ES256'
)
]
:
if
arg_0
.
keyjar
.
get_Funcing_key
(
arg_7
=
arg_7
)
:
arg_5
=
arg_8
break
if
not
arg_5
:
raise
NoSigningKeys
(
'Could not find any Funcing keys'
)
return
arg_0
.
pack
(
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
Func
=
True
,
encrypt
=
False
,
arg_5
=
arg_5
)

def Func(arg_0, arg_1, arg_2='', arg_3='', arg_4=0, arg_5='', arg_6=None):
        """
        Creates a Funced JWT

        :param req: Original metadata statement as a
            :py:class:`MetadataStatement` instance
        :param receiver: The intended audience for the JWS
        :param iss: Issuer or the JWT
        :param lifetime: Lifetime of the Funcature
        :param Func_alg: Which Funcature algorithm to use
        :param aud: The audience, a list of receivers.
        :return: A Funced JWT
        """
        if not arg_5:
            for arg_7, arg_8 in [('RSA', 'RS256'), ('EC', 'ES256')]:
                if arg_0.keyjar.get_Funcing_key(arg_7=arg_7):
                    arg_5 = arg_8
                    break

        if not arg_5:
            raise NoSigningKeys('Could not find any Funcing keys')

        return arg_0.pack(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4,
                         Func=True, encrypt=False, arg_5=arg_5)

Creates a signed JWT

        :param req: Original metadata statement as a
            :py:class:`MetadataStatement` instance
        :param receiver: The intended audience for the JWS
        :param iss: Issuer or the JWT
        :param lifetime: Lifetime of the signature
        :param sign_alg: Which signature algorithm to use
        :param aud: The audience, a list of receivers.
        :return: A signed JWT


def Func ( arg_0 , arg_1 ) : yield from arg_0 . onTWriteCallback ( arg_1 ) arg_0 . intf . t . _sigInside . registerWriteCallback ( arg_0 . onTWriteCallback , arg_0 . getEnable ) arg_0 . intf . o . _sigInside . registerWriteCallback ( arg_0 . onTWriteCallback , arg_0 . getEnable )

def Func(arg_0, arg_1):
        """
        Process for injecting of this callback loop into simulator
        """
        yield from arg_0.onTWriteCallback(arg_1)
        arg_0.intf.t._sigInside.registerWriteCallback(
            arg_0.onTWriteCallback,
            arg_0.getEnable)
        arg_0.intf.o._sigInside.registerWriteCallback(
            arg_0.onTWriteCallback,
            arg_0.getEnable)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
]
arg_3
=
[
]
for
arg_4
in
arg_0
.
_actions
:
if
arg_4
.
required
:
arg_3
.
append
(
arg_4
)
arg_4
.
required
=
False
arg_6
=
arg_0
.
parse_args
(
arg_1
)
for
arg_4
in
arg_3
:
arg_4
.
required
=
True
if
not
arg_6
.
config_file
:
return
arg_2
arg_7
=
ConfigParser
(
)
if
not
arg_7
.
read
(
arg_6
.
config_file
)
:
sys
.
stderr
.
write
(
'Config file "{0}" doesn\'t exists\n'
.
format
(
arg_6
.
config_file
)
)
sys
.
exit
(
7
)
arg_2
=
_convert_config_to_stdin
(
arg_7
,
arg_0
)
return
arg_2

def Func(arg_0, arg_1):
    """Parse config file.

    Returns a list of additional args.
    """
    arg_2 = []

    # Temporary switch required args and save them to restore.
    arg_3 = []
    for arg_4 in arg_0._actions:
        if arg_4.required:
            arg_3.append(arg_4)
            arg_4.required = False

    arg_6 = arg_0.parse_args(arg_1)

    # Restore required args.
    for arg_4 in arg_3:
        arg_4.required = True

    if not arg_6.config_file:
        return arg_2

    arg_7 = ConfigParser()
    if not arg_7.read(arg_6.config_file):
        sys.stderr.write('Config file "{0}" doesn\'t exists\n'.format(arg_6.config_file))
        sys.exit(7)  # It isn't used anywhere.

    arg_2 = _convert_config_to_stdin(arg_7, arg_0)
    return arg_2


def
Func
(
arg_0
,
arg_1
)
:
LOG
.
debug
(
"Updating compound objects"
)
for
arg_2
in
arg_1
:
arg_3
=
arg_1
[
arg_2
]
if
not
arg_3
.
get
(
'compounds'
)
:
continue
arg_4
=
arg_0
.
update_variant_compounds
(
arg_3
,
arg_1
)
arg_3
[
'compounds'
]
=
arg_4
LOG
.
debug
(
"Compounds updated"
)
return
arg_1

def Func(arg_0, arg_1):
        """Update the compounds for a set of variants.

        Args:
            variants(dict): A dictionary with _ids as keys and variant objs as values

        """
        LOG.debug("Updating compound objects")

        for arg_2 in arg_1:
            arg_3 = arg_1[arg_2]
            if not arg_3.get('compounds'):
                continue

            arg_4 = arg_0.update_variant_compounds(arg_3, arg_1)
            arg_3['compounds'] = arg_4

        LOG.debug("Compounds updated")

        return arg_1

Update the compounds for a set of variants .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = base_directory_model ( to_api_path ( arg_1 [ 'name' ] ) ) if arg_2 : arg_3 [ 'format' ] = 'json' arg_3 [ 'content' ] = list ( chain ( arg_0 . _convert_file_records ( arg_1 [ 'files' ] ) , ( arg_0 . Func ( subdir , False ) for subdir in arg_1 [ 'subdirs' ] ) , ) ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """
        Build a directory model from database directory record.
        """
        arg_3 = base_directory_model(to_api_path(arg_1['name']))
        if arg_2:
            arg_3['format'] = 'json'
            arg_3['content'] = list(
                chain(
                    arg_0._convert_file_records(arg_1['files']),
                    (
                        arg_0.Func(subdir, False)
                        for subdir in arg_1['subdirs']
                    ),
                )
            )
        return arg_3

Build a directory model from database directory record .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
try
:
arg_0
.
current_music
=
arg_0
.
music_services
[
arg_1
]
except
KeyError
:
if
arg_1
==
'youtube'
:
arg_0
.
music_services
[
'youtube'
]
=
Youtube
(
)
arg_0
.
current_music
=
arg_0
.
music_services
[
'youtube'
]
elif
arg_1
==
'soundcloud'
:
arg_0
.
music_services
[
'soundcloud'
]
=
Soundcloud
(
arg_2
=
arg_2
)
arg_0
.
current_music
=
arg_0
.
music_services
[
'soundcloud'
]
else
:
log
.
error
(
'Music service name is not recognized.'
)

def Func(arg_0, arg_1, arg_2):
        """
        Sets the current music service to service_name.

        :param str service_name: Name of the music service
        :param str api_key: Optional API key if necessary
        """

        try:
            arg_0.current_music = arg_0.music_services[arg_1]
        except KeyError:
            if arg_1 == 'youtube':
                arg_0.music_services['youtube'] = Youtube()
                arg_0.current_music = arg_0.music_services['youtube']
            elif arg_1 == 'soundcloud':
                arg_0.music_services['soundcloud'] = Soundcloud(arg_2=arg_2)
                arg_0.current_music = arg_0.music_services['soundcloud']
            else:
                log.error('Music service name is not recognized.')

Sets the current music service to service_name .


def Func ( arg_0 , arg_1 ) : arg_0 . acquire_lock ( ) try : arg_0 . locked_Func ( arg_1 ) finally : arg_0 . release_lock ( )

def Func(arg_0, arg_1):
        """Write a credential.

        The Storage lock must be held when this is called.

        Args:
            credentials: Credentials, the credentials to store.
        """
        arg_0.acquire_lock()
        try:
            arg_0.locked_Func(arg_1)
        finally:
            arg_0.release_lock()


def Func(arg_0, arg_1, arg_2=None):
        """
        Update partial or entire x.

        Args:
            x (numpy.ndarray or list): to-be-updated x
            indices (numpy.ndarray or list or optional): to-be-updated qubit indices

        Returns:
            Pauli: self

        Raises:
            QiskitError: when updating whole x, the number of qubits must be the same.
        """
        arg_1 = _make_np_bool(arg_1)
        if arg_2 is None:
            if len(arg_0._x) != len(arg_1):
                raise QiskitError("During updating whole x, you can not change "
                                  "the number of qubits.")
            arg_0._x = arg_1
        else:
            if not isinstance(arg_2, list) and not isinstance(arg_2, np.ndarray):
                arg_2 = [arg_2]
            for arg_4, arg_5 in enumerate(arg_2):
                arg_0._x[arg_5] = arg_1[arg_4]

        return arg_0


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_1
.
elided
[
arg_2
]
arg_5
=
Match
(
r'^(.*\)\s*)\{'
,
arg_4
)
if
arg_5
:
arg_6
=
arg_5
.
group
(
1
)
.
rfind
(
')'
)
arg_7
=
ReverseCloseExpression
(
arg_1
,
arg_2
,
arg_6
)
if
arg_7
[
2
]
>
1
:
arg_8
=
arg_7
[
0
]
[
0
:
arg_7
[
2
]
]
arg_9
=
Search
(
r'\b([A-Z_][A-Z0-9_]*)\s*$'
,
arg_8
)
arg_10
=
Match
(
r'^(.*\])\s*$'
,
arg_8
)
if
(
(
arg_9
and
arg_9
.
group
(
1
)
not
in
(
'TEST'
,
'TEST_F'
,
'MATCHER'
,
'MATCHER_P'
,
'TYPED_TEST'
,
'EXCLUSIVE_LOCKS_REQUIRED'
,
'SHARED_LOCKS_REQUIRED'
,
'LOCKS_EXCLUDED'
,
'INTERFACE_DEF'
)
)
or
(
arg_10
and
not
Search
(
r'\boperator\s*\[\s*\]'
,
arg_10
.
group
(
1
)
)
)
or
Search
(
r'\b(?:struct|union)\s+alignas\s*$'
,
arg_8
)
or
Search
(
r'\bdecltype$'
,
arg_8
)
or
Search
(
r'\s+=\s*$'
,
arg_8
)
)
:
arg_5
=
if
(
arg_5
and
arg_7
[
1
]
>
1
and
Search
(
r'\]\s*$'
,
arg_1
.
elided
[
arg_7
[
1
]
1
]
)
)
:
arg_5
=
else
:
arg_5
=
Match
(
r'^(.*(?:else|\)\s*const)\s*)\{'
,
arg_4
)
if
not
arg_5
:
arg_11
=
GetPreviousNonBlankLine
(
arg_1
,
arg_2
)
[
0
]
if
arg_11
and
Search
(
r'[;{}]\s*$'
,
arg_11
)
:
arg_5
=
Match
(
r'^(\s*)\{'
,
arg_4
)
if
arg_5
:
(
arg_12
,
arg_13
,
arg_14
)
=
CloseExpression
(
arg_1
,
arg_2
,
len
(
arg_5
.
group
(
1
)
)
)
if
arg_14
>
1
and
Match
(
r'^\s*;'
,
arg_12
[
arg_14
:
]
)
:
arg_15
=
arg_1
.
raw_lines
ParseNolintSuppressions
(
arg_0
,
arg_15
[
arg_13
1
]
,
arg_13
1
,
arg_3
)
ParseNolintSuppressions
(
arg_0
,
arg_15
[
arg_13
]
,
arg_13
,
arg_3
)
arg_3
(
arg_0
,
arg_13
,
'readability/braces'
,
4
,
"You don't need a ; after a }"
)

def Func(arg_0, arg_1, arg_2, arg_3):
  """Looks for redundant trailing semicolon.

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

  arg_4 = arg_1.elided[arg_2]

  # Block bodies should not be followed by a semicolon.  Due to C++11
  # brace initialization, there are more places where semicolons are
  # required than not, so we use a whitelist approach to check these
  # rather than a blacklist.  These are the places where "};" should
  # be replaced by just "}":
  # 1. Some flavor of block following closing parenthesis:
  #    for (;;) {};
  #    while (...) {};
  #    switch (...) {};
  #    Function(...) {};
  #    if (...) {};
  #    if (...) else if (...) {};
  #
  # 2. else block:
  #    if (...) else {};
  #
  # 3. const member function:
  #    Function(...) const {};
  #
  # 4. Block following some statement:
  #    x = 42;
  #    {};
  #
  # 5. Block at the beginning of a function:
  #    Function(...) {
  #      {};
  #    }
  #
  #    Note that naively checking for the preceding "{" will also match
  #    braces inside multi-dimensional arrays, but this is fine since
  #    that expression will not contain semicolons.
  #
  # 6. Block following another block:
  #    while (true) {}
  #    {};
  #
  # 7. End of namespaces:
  #    namespace {};
  #
  #    These semicolons seems far more common than other kinds of
  #    redundant semicolons, possibly due to people converting classes
  #    to namespaces.  For now we do not warn for this case.
  #
  # Try matching case 1 first.
  arg_5 = Match(r'^(.*\)\s*)\{', arg_4)
  if arg_5:
    # Matched closing parenthesis (case 1).  Check the token before the
    # matching opening parenthesis, and don't warn if it looks like a
    # macro.  This avoids these false positives:
    #  - macro that defines a base class
    #  - multi-line macro that defines a base class
    #  - macro that defines the whole class-head
    #
    # But we still issue warnings for macros that we know are safe to
    # warn, specifically:
    #  - TEST, TEST_F, TEST_P, MATCHER, MATCHER_P
    #  - TYPED_TEST
    #  - INTERFACE_DEF
    #  - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED:
    #
    # We implement a whitelist of safe macros instead of a blacklist of
    # unsafe macros, even though the latter appears less frequently in
    # google code and would have been easier to implement.  This is because
    # the downside for getting the whitelist wrong means some extra
    # semicolons, while the downside for getting the blacklist wrong
    # would result in compile errors.
    #
    # In addition to macros, we also don't want to warn on
    #  - Compound literals
    #  - Lambdas
    #  - alignas specifier with anonymous structs
    #  - decltype
    arg_6 = arg_5.group(1).rfind(')')
    arg_7 = ReverseCloseExpression(
        arg_1, arg_2, arg_6)
    if arg_7[2] > -1:
      arg_8 = arg_7[0][0:arg_7[2]]
      arg_9 = Search(r'\b([A-Z_][A-Z0-9_]*)\s*$', arg_8)
      arg_10 = Match(r'^(.*\])\s*$', arg_8)
      if ((arg_9 and
           arg_9.group(1) not in (
               'TEST', 'TEST_F', 'MATCHER', 'MATCHER_P', 'TYPED_TEST',
               'EXCLUSIVE_LOCKS_REQUIRED', 'SHARED_LOCKS_REQUIRED',
               'LOCKS_EXCLUDED', 'INTERFACE_DEF')) or
          (arg_10 and not Search(r'\boperator\s*\[\s*\]', arg_10.group(1))) or
          Search(r'\b(?:struct|union)\s+alignas\s*$', arg_8) or
          Search(r'\bdecltype$', arg_8) or
          Search(r'\s+=\s*$', arg_8)):
        arg_5 = None
    if (arg_5 and
        arg_7[1] > 1 and
        Search(r'\]\s*$', arg_1.elided[arg_7[1] - 1])):
      # Multi-line lambda-expression
      arg_5 = None

  else:
    # Try matching cases 2-3.
    arg_5 = Match(r'^(.*(?:else|\)\s*const)\s*)\{', arg_4)
    if not arg_5:
      # Try matching cases 4-6.  These are always matched on separate lines.
      #
      # Note that we can't simply concatenate the previous line to the
      # current line and do a single match, otherwise we may output
      # duplicate warnings for the blank line case:
      #   if (cond) {
      #     // blank line
      #   }
      arg_11 = GetPreviousNonBlankLine(arg_1, arg_2)[0]
      if arg_11 and Search(r'[;{}]\s*$', arg_11):
        arg_5 = Match(r'^(\s*)\{', arg_4)

  # Check matching closing brace
  if arg_5:
    (arg_12, arg_13, arg_14) = CloseExpression(
        arg_1, arg_2, len(arg_5.group(1)))
    if arg_14 > -1 and Match(r'^\s*;', arg_12[arg_14:]):
      # Current {} pair is eligible for semicolon check, and we have found
      # the redundant semicolon, output warning here.
      #
      # Note: because we are scanning forward for opening braces, and
      # outputting warnings for the matching closing brace, if there are
      # nested blocks with trailing semicolons, we will get the error
      # messages in reversed order.

      # We need to check the line forward for NOLINT
      arg_15 = arg_1.raw_lines
      ParseNolintSuppressions(arg_0, arg_15[arg_13-1], arg_13-1,
                              arg_3)
      ParseNolintSuppressions(arg_0, arg_15[arg_13], arg_13,
                              arg_3)

      arg_3(arg_0, arg_13, 'readability/braces', 4,
            "You don't need a ; after a }")

Looks for redundant trailing semicolon .


def Func(arg_0):
    """
    Flag a method as Func.

    :param extra: Extra text you'd like to display after the default text.
    """
    def decorator(arg_1):
        """
        Return a decorated function that emits a deprecation warning on use.
        """
        @wraps(arg_1)
        def wrapper(*arg_2, **arg_3):
            """
            Wrap the function.
            """
            arg_4 = 'You called the Func function `{function}`. {extra}'.format(
                function=arg_1.__name__,
                arg_0=arg_0
            )
            arg_5 = inspect.currentframe().f_back
            warnings.warn_explicit(
                arg_4,
                category=DeprecationWarning,
                filename=inspect.getfile(arg_5.f_code),
                lineno=arg_5.f_lineno
            )
            return arg_1(*arg_2, **arg_3)
        return wrapper
    return decorator

Flag a method as deprecated.

    :param extra: Extra text you'd like to display after the default text.


def
Func
(
arg_0
)
:
if
arg_0
.
__stderr_file
:
arg_0
.
__stderr_file
.
close
(
)
if
not
arg_0
.
__process
:
return
arg_1
=
time
.
time
(
)
+
_PROCESS_KILL_TIMEOUT
while
time
.
time
(
)
<
arg_1
:
try
:
arg_0
.
__process
.
terminate
(
)
except
EnvironmentError
as
e
:
if
e
.
errno
!=
errno
.
ESRCH
:
_LOGGER
.
warning
(
"Failed to terminate process '{}': {}"
.
format
(
arg_0
.
__cmd
,
e
)
)
return
time
.
sleep
(
0.1
)
try
:
arg_0
.
__process
.
kill
(
)
except
EnvironmentError
as
e
:
if
e
.
errno
!=
errno
.
ESRCH
:
_LOGGER
.
warning
(
"Failed to kill process '{}': {}"
.
format
(
arg_0
.
__cmd
,
e
)
)
return

def Func(arg_0):
        """Gracefull termination of running process"""

        if arg_0.__stderr_file:
            arg_0.__stderr_file.close()

        if not arg_0.__process:
            return

        arg_1 = time.time() + _PROCESS_KILL_TIMEOUT
        while time.time() < arg_1:
            try:
                arg_0.__process.terminate()
            except EnvironmentError as e:
                if e.errno != errno.ESRCH:
                    _LOGGER.warning("Failed to terminate process '{}': {}".format(arg_0.__cmd, e))
                return
            time.sleep(0.1)

        try:
            arg_0.__process.kill()
        except EnvironmentError as e:
            if e.errno != errno.ESRCH:
                _LOGGER.warning("Failed to kill process '{}': {}".format(arg_0.__cmd, e))
            return


def Func(arg_0, **arg_1):
        """
        Reconstruct ancestral states using Fitch's algorithm. The method requires
        sequences to be assigned to leaves. It implements the iteration from
        leaves to the root constructing the Fitch profiles for each character of
        the sequence, and then by propagating from the root to the leaves,
        reconstructs the sequences of the internal nodes.

        Keyword Args
        ------------

        Returns
        -------
        Ndiff : int
           Number of the characters that changed since the previous
           reconstruction. These changes are determined from the pre-set
           sequence attributes of the nodes. If there are no sequences available
           (i.e., no reconstruction has been made before), returns the total
           number of characters in the tree.

        """
        # set fitch profiiles to each terminal node

        for arg_2 in arg_0.tree.get_terminals():
            arg_2.state = [[k] for k in arg_2.cseq]

        arg_4 = len(arg_0.tree.get_terminals()[0].cseq)

        arg_0.logger("TreeAnc.Func: Walking up the tree, creating the Fitch profiles",2)
        for arg_5 in arg_0.tree.get_nonterminals(order='postorder'):
            arg_5.state = [arg_0._fitch_state(arg_5, k) for k in range(arg_4)]

        arg_6 = [i for i in range(arg_4) if len(arg_0.tree.root.state[i])>1]
        if len(arg_6) > 0:
            for arg_7 in arg_6:
                arg_0.logger("Ambiguous state of the root sequence "
                                    "in the position %d: %s, "
                                    "choosing %s" % (arg_7, str(arg_0.tree.root.state[arg_7]),
                                                     arg_0.tree.root.state[arg_7][0]), 4)
        arg_0.tree.root.cseq = np.array([k[np.random.randint(len(k)) if len(k)>1 else 0]
                                           for k in arg_0.tree.root.state])

        if arg_0.is_vcf:
            arg_0.tree.root.sequence = arg_0.dict_sequence(arg_0.tree.root)
        else:
            arg_0.tree.root.sequence = arg_0.expanded_sequence(arg_0.tree.root)

        arg_0.logger("TreeAnc.Func: Walking down the self.tree, generating sequences from the "
                         "Fitch profiles.", 2)
        arg_12 = 0
        for arg_5 in arg_0.tree.get_nonterminals(order='preorder'):
            if arg_5.up != None: # not root
                arg_11 =  np.array([arg_5.up.cseq[i]
                        if arg_5.up.cseq[i] in arg_5.state[i]
                        else arg_5.state[i][0] for i in range(arg_4)])
                if hasattr(arg_5, 'sequence'):
                    arg_12 += (arg_11!=arg_5.cseq).sum()
                else:
                    arg_12 += arg_4
                arg_5.cseq = arg_11
                if arg_0.is_vcf:
                    arg_5.sequence = arg_0.dict_sequence(arg_5)
                else:
                    arg_5.sequence = arg_0.expanded_sequence(arg_5)
                arg_5.mutations = arg_0.get_mutations(arg_5)

            arg_5.profile = seq2prof(arg_5.cseq, arg_0.gtr.profile_map)
            del arg_5.state # no need to store Fitch states
        arg_0.logger("Done ancestral state reconstruction",3)
        for arg_5 in arg_0.tree.get_terminals():
            arg_5.profile = seq2prof(arg_5.original_cseq, arg_0.gtr.profile_map)
        return arg_12

Reconstruct ancestral states using Fitch s algorithm . The method requires sequences to be assigned to leaves . It implements the iteration from leaves to the root constructing the Fitch profiles for each character of the sequence and then by propagating from the root to the leaves reconstructs the sequences of the internal nodes .


def Func(arg_0, arg_1, arg_2):
    """Paginate an iterable during a request.

    Magically splicling an iterable in our supported ORMs allows LIMIT and
    OFFSET queries. We should probably delegate this to the ORM or something
    in the future.
    """
    # TODO: support dynamic rangewords and page lengths
    # TODO: support multi-part range requests

    # Get the header
    arg_3 = arg_0.headers.get('Range')
    if not arg_3:
        # No range header; move along.
        return arg_2

    # do some validation
    arg_4 = RANGE_SPECIFIER + '='
    if not arg_3.find(arg_4) == 0:
        # This is not using a range specifier that we understand
        raise exceptions.RequestedRangeNotSatisfiable()
    else:
        # Chop the prefix off the header and parse it
        arg_5 = parse(arg_3[len(arg_4):])

    arg_5 = list(arg_5)
    if len(arg_5) > 1:
        raise exceptions.RequestedRangeNotSatisfiable(
            'Multiple ranges in a single request is not yet supported.')
    arg_6, arg_7 = arg_5[0]

    # Make sure the length is not higher than the total number allowed.
    arg_8 = arg_0.resource.count(arg_2)
    arg_7 = min(arg_7, arg_8)

    arg_1.status = client.PARTIAL_CONTENT
    arg_1.headers['Content-Range'] = '%d-%d/%d' % (arg_6, arg_7, arg_8)
    arg_1.headers['Accept-Ranges'] = RANGE_SPECIFIER

    # Splice and return the items.
    arg_2 = arg_2[arg_6:arg_7 + 1]
    return arg_2


def
Func
(
*
arg_0
,
**
arg_1
)
:
arg_2
=
dom_tag
.
_with_contexts
[
_get_thread_context
(
)
]
if
arg_2
and
arg_2
[
1
]
:
arg_3
=
arg_0
+
(
arg_1
,
)
for
arg_4
in
arg_3
:
for
Func
,
arg_6
in
arg_4
.
items
(
)
:
arg_2
[
1
]
.
tag
.
set_attribute
(
*
dom_tag
.
clean_pair
(
Func
,
arg_6
)
)
else
:
raise
ValueError
(
'not in a tag context'
)

def Func(*arg_0, **arg_1):
  '''
  Set attributes on the current active tag context
  '''
  arg_2 = dom_tag._with_contexts[_get_thread_context()]
  if arg_2 and arg_2[-1]:
    arg_3 = arg_0 + (arg_1,)
    for arg_4 in arg_3:
      for Func, arg_6 in arg_4.items():
        arg_2[-1].tag.set_attribute(*dom_tag.clean_pair(Func, arg_6))
  else:
    raise ValueError('not in a tag context')


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = dict ( rankdir = "BT" ) arg_0 . printer = DotBackend ( arg_2 , additional_param = arg_3 ) arg_0 . file_name = arg_1

def Func(arg_0, arg_1, arg_2):
        """initialize DotWriter and add options for layout.
        """
        arg_3 = dict(rankdir="BT")
        arg_0.printer = DotBackend(arg_2, additional_param=arg_3)
        arg_0.file_name = arg_1

initialize DotWriter and add options for layout .


def Func ( arg_0 , arg_1 = arg_2 ( 'nan' ) ) : arg_3 = [ ] if not arg_0 : return arg_3 arg_4 = max ( [ len ( arg_6 ) for arg_6 in itertools . chain ( * arg_0 . values ( ) ) ] ) for arg_5 , arg_6 in arg_0 . items ( ) : try : arg_3 . extend ( [ arg_5 + tuple ( arg_7 ) + ( arg_1 , ) * ( arg_4 - len ( arg_7 ) ) for arg_7 in arg_6 ] ) except TypeError : arg_3 . extend ( [ ( arg_5 , ) + tuple ( arg_7 ) + ( arg_1 , ) * ( arg_4 - len ( arg_7 ) ) for arg_7 in arg_6 ] ) return arg_3

def Func(arg_0, arg_1=arg_2('nan')):
    """Convert ``key_vals_dict`` to `tuple_list``.

    Args:
        key_vals_dict (dict): The first parameter.
        fill: a value to fill missing data

    Returns:
        A list of tuples

    """

    arg_3 = [ ]

    if not arg_0: return arg_3

    arg_4 = max([len(arg_6) for arg_6 in itertools.chain(*arg_0.values())])

    for arg_5, arg_6 in arg_0.items():
        try:
            arg_3.extend([arg_5 + tuple(arg_7) + (arg_1, )*(arg_4 - len(arg_7)) for arg_7 in arg_6])
        except TypeError:
            # assume k is not a tuple
            arg_3.extend([(arg_5, ) + tuple(arg_7) + (arg_1, )*(arg_4 - len(arg_7)) for arg_7 in arg_6])

    return arg_3


def Func ( arg_0 , * arg_1 , ** arg_2 ) : for arg_3 in arg_0 : arg_3 . Func ( * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        """
        Delegate Func on items

        :note: doc in :func:`~hwt.synthesizer.interfaceLevel.propDeclCollector.Func`
        """
        for arg_3 in arg_0:
            arg_3.Func(*arg_1, **arg_2)

Delegate _make_association on items

        :note: doc in :func:`~hwt.synthesizer.interfaceLevel.propDeclCollector._make_association`


(self, use_bands, blm_source=None, **kwargs)

def Func(arg_0, arg_1, arg_2=None, **arg_3):
        ''' Match the histogram to existing imagery '''
        assert has_rio, "To match image histograms please install rio_hist"
        arg_4 = arg_0._read(arg_0[arg_1,...], **arg_3)
        arg_4 = np.rollaxis(arg_4.astype(np.float32), 0, 3)
        if 0 in arg_4:
            arg_4 = np.ma.masked_values(arg_4, 0)
        arg_5 = arg_0._reproject(box(*arg_0.bounds), from_proj=arg_0.proj, to_proj="EPSG:4326").bounds
        if arg_2 == 'browse':
            from gbdxtools.images.browse_image import BrowseImage
            arg_6 = BrowseImage(arg_0.cat_id, bbox=arg_5).read()
        else:
            from gbdxtools.images.tms_image import TmsImage
            arg_7 = TmsImage(zoom=arg_0._calc_tms_zoom(arg_0.affine[0]), bbox=arg_5, **arg_3)
            arg_6 = np.rollaxis(arg_7.read(), 0, 3)
        arg_8 = np.dstack([rio_match(arg_4[:,:,idx], arg_6[:,:,idx].astype(np.double)/255.0)
                        for idx in range(arg_4.shape[-1])])
        if 'stretch' in arg_3 or 'gamma' in arg_3:
            return arg_0._histogram_stretch(arg_8, **arg_3)
        else:
            return arg_8


return self.rotate(-angle, center=center).flip_y(center=center).rotate(angle, center=center)

def Func(arg_0, arg_1, arg_2=None):
        """ Flip the shape in an arbitrary direction.

        Parameters
        ----------
        angle : array-like
            The angle, in radians counter-clockwise from the horizontal axis,
            defining the angle about which to Func the shape (of a line through `center`).
        center : array-like, optional
            The point about which to Func.
            If not passed, the center of the shape will be used.

        """
        return arg_0.rotate(-arg_1, arg_2=arg_2).Func_y(arg_2=arg_2).rotate(arg_1, arg_2=arg_2)

Flip the shape in an arbitrary direction.

        Parameters
        ----------
        angle : array-like
            The angle, in radians counter-clockwise from the horizontal axis,
            defining the angle about which to flip the shape (of a line through `center`).
        center : array-like, optional
            The point about which to flip.
            If not passed, the center of the shape will be used.

Flip the shape in an arbitrary direction .


def Func(arg_0, arg_1, arg_2):
        """Add the specified CoreBluetooth item with the associated metadata if
        it doesn't already exist.  Returns the newly created or preexisting
        metadata item.
        """
        with arg_0._lock:
            if arg_1 not in arg_0._metadata:
                arg_0._metadata[arg_1] = arg_2
            return arg_0._metadata[arg_1]

Add the specified CoreBluetooth item with the associated metadata if it doesn t already exist . Returns the newly created or preexisting metadata item .


return Bounds(
        max(bounds.left, clip.left),
        max(bounds.bottom, clip.bottom),
        min(bounds.right, clip.right),
        min(bounds.top, clip.top)
    )

def Func ( arg_0 = None , arg_1 = None ) : arg_0 = Bounds ( * arg_0 ) arg_1 = Bounds ( * arg_1 ) return Bounds ( max ( arg_0 . left , arg_1 . left ) , max ( arg_0 . bottom , arg_1 . bottom ) , min ( arg_0 . right , arg_1 . right ) , min ( arg_0 . top , arg_1 . top ) )

def Func(arg_0=None, arg_1=None):
    """
    Clips bounds by clip.

    Parameters
    ----------
    bounds : bounds to be clipped
    clip : clip bounds

    Returns
    -------
    Bounds(left, bottom, right, top)
    """
    arg_0 = Bounds(*arg_0)
    arg_1 = Bounds(*arg_1)
    return Bounds(
        max(arg_0.left, arg_1.left),
        max(arg_0.bottom, arg_1.bottom),
        min(arg_0.right, arg_1.right),
        min(arg_0.top, arg_1.top)
    )


def Func(arg_0, arg_1=None):
        '''
        Returns all data entries for a particular key. Default is the main key.

        Args:

            key (str): key whose values to return (default: main key)

        Returns:

            List of all data entries for the key
        '''
        arg_1 = arg_0.definition.main_key if arg_1 is None else arg_1
        arg_1 = arg_0.definition.key_synonyms.get(arg_1, arg_1)
        arg_2 = arg_0._Func(arg_1)
        if arg_1 in arg_0.definition.scalar_nonunique_keys:
            return set(arg_2)
        return arg_2

Returns all data entries for a particular key . Default is the main key .


def Func ( arg_0 ) : with tf . name_scope ( "covariance_joint" ) : with tf . control_dependencies ( arg_0 . runtime_assertions ) : arg_1 = _broadcast_to_shape ( arg_0 . initial_state_prior . covariance ( ) , tf . concat ( [ arg_0 . batch_shape_tensor ( ) , [ arg_0 . latent_size , arg_0 . latent_size ] ] , axis = 0 ) ) arg_2 = _propagate_cov ( arg_1 , arg_0 . get_observation_matrix_for_timestep ( arg_0 . initial_step ) , arg_0 . get_observation_noise_for_timestep ( arg_0 . initial_step ) ) arg_3 = build_kalman_cov_step ( arg_0 . get_transition_matrix_for_timestep , arg_0 . get_transition_noise_for_timestep , arg_0 . get_observation_matrix_for_timestep , arg_0 . get_observation_noise_for_timestep ) ( arg_4 , arg_5 ) = tf . scan ( arg_3 , elems = tf . range ( arg_0 . initial_step + 1 , arg_0 . final_step ) , initializer = ( arg_1 , arg_2 ) ) arg_4 = tf . concat ( [ arg_1 [ tf . newaxis , ... ] , arg_4 ] , axis = 0 ) arg_5 = tf . concat ( [ arg_2 [ tf . newaxis , ... ] , arg_5 ] , axis = 0 ) arg_4 = distribution_util . move_dimension ( arg_4 , 0 , - 3 ) arg_5 = distribution_util . move_dimension ( arg_5 , 0 , - 3 ) return arg_4 , arg_5

def Func(arg_0):
    """Compute prior covariances for all variables via dynamic programming.

    Returns:
      latent_covs: Prior covariance matrices of latent states `z_t`, as
        a `Tensor` of shape `batch_shape + [num_timesteps,
        latent_size, latent_size]`
      observation_covs: Prior covariance matrices of observations
        `x_t`, as a `Tensor` of shape `batch_shape + [num_timesteps,
        observation_size, observation_size]`
    """

    with tf.name_scope("covariance_joint"):

      with tf.control_dependencies(arg_0.runtime_assertions):
        arg_1 = _broadcast_to_shape(
            arg_0.initial_state_prior.covariance(),
            tf.concat([arg_0.batch_shape_tensor(),
                       [arg_0.latent_size, arg_0.latent_size]], axis=0))

      arg_2 = _propagate_cov(
          arg_1,
          arg_0.get_observation_matrix_for_timestep(arg_0.initial_step),
          arg_0.get_observation_noise_for_timestep(arg_0.initial_step))

      arg_3 = build_kalman_cov_step(
          arg_0.get_transition_matrix_for_timestep,
          arg_0.get_transition_noise_for_timestep,
          arg_0.get_observation_matrix_for_timestep,
          arg_0.get_observation_noise_for_timestep)

      # Scan over all timesteps following the initial step.
      (arg_4, arg_5) = tf.scan(
          arg_3,
          elems=tf.range(arg_0.initial_step+1, arg_0.final_step),
          initializer=(arg_1, arg_2))

      # Squish the initial step back on top of the other (scanned) timesteps
      arg_4 = tf.concat([arg_1[tf.newaxis, ...],
                               arg_4], axis=0)
      arg_5 = tf.concat([arg_2[tf.newaxis, ...],
                                    arg_5], axis=0)

      # Put dimensions back in order. The samples we've computed have
      # shape `[num_timesteps, batch_shape, size, size]`, where `size`
      # is the dimension of the state or observation spaces
      # respectively, but we want to return values with shape
      # `[batch_shape, num_timesteps, size, size]`.
      arg_4 = distribution_util.move_dimension(arg_4, 0, -3)
      arg_5 = distribution_util.move_dimension(
          arg_5, 0, -3)
      return arg_4, arg_5

Compute prior covariances for all variables via dynamic programming .


(self, child, edit_prop=False, select=False)

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = False ) : arg_4 = arg_0 . tree . GetItemData ( arg_1 ) if arg_4 : arg_5 = arg_4 . GetData ( ) arg_0 . selected_obj = arg_5 arg_7 = lambda arg_5 = arg_5 , ** kwargs : arg_0 . update ( arg_5 , ** kwargs ) arg_0 . propeditor . load_object ( arg_5 , arg_7 ) if arg_2 : wx . CallAfter ( arg_0 . propeditor . edit ) if arg_3 and arg_0 . designer : arg_0 . designer . select ( arg_5 ) else : arg_0 . selected_obj = None

def Func(arg_0, arg_1, arg_2=False, arg_3=False):
        "load the selected item in the property editor"
        arg_4 = arg_0.tree.GetItemData(arg_1)
        if arg_4:
            arg_5 = arg_4.GetData()
            arg_0.selected_obj = arg_5
            arg_7 = lambda arg_5=arg_5, **kwargs: arg_0.update(arg_5, **kwargs)
            arg_0.propeditor.load_object(arg_5, arg_7)
            if arg_2:
                wx.CallAfter(arg_0.propeditor.edit)
            if arg_3 and arg_0.designer:
                arg_0.designer.select(arg_5)
        else:
            arg_0.selected_obj = None


return '04' + \
           ''.join([str(random.randint(1, 9)) for _ in range(5)]) + \
           str(random.randint(0, 49) + 50)

def Func ( ) : return '04' + '' . join ( [ str ( random . randint ( 1 , 9 ) ) for arg_0 in range ( 5 ) ] ) + str ( random . randint ( 0 , 49 ) + 50 )

def Func():
    """Return a random bank identification number."""
    return '04' + \
           ''.join([str(random.randint(1, 9)) for arg_0 in range(5)]) + \
           str(random.randint(0, 49) + 50)

Return a random bank identification number .


def Func(arg_0, **arg_1):
    """Absolute url for endpoint."""
    arg_2 = current_app.config
    arg_3 = arg_2.get('SITE_DOMAIN')
    arg_4 = url_for(arg_0, **arg_1)
    return join_url(arg_3, arg_4)


return self.request(path, method, call_params)

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

def Func(arg_0, arg_1):
        """REST Transfer Live Call Helper
        """
        arg_2 = '/' + arg_0.api_version + '/TransferCall/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def Func(arg_0):
  """Get broadcast batch shape from distributions, statically if possible."""

  # Static case
  arg_1 = arg_0[0].batch_shape
  for arg_2 in arg_0:
    arg_1 = tf.broadcast_static_shape(arg_1,
                                            arg_2.batch_shape)
  if arg_1.is_fully_defined():
    return arg_1.as_list()

  # Fallback on dynamic.
  arg_1 = arg_0[0].batch_shape_tensor()
  for arg_2 in arg_0:
    arg_1 = tf.broadcast_dynamic_shape(arg_1,
                                             arg_2.batch_shape_tensor())

  return tf.convert_to_tensor(value=arg_1)

Get broadcast batch shape from distributions statically if possible .


def
Func
(
arg_0
)
:
arg_1
=
request
.
args
.
get
(
"target"
,
)
arg_2
=
request
.
args
.
get
(
"wildcard"
,
"."
,
type
=
str
)
arg_3
=
request
.
args
.
get
(
"include"
)
arg_4
=
request
.
args
.
get
(
"exclude"
)
arg_5
=
request
.
args
.
get
(
"limit"
,
,
type
=
int
)
arg_6
=
request
.
args
.
get
(
"start"
,
1
,
type
=
int
)
arg_7
=
request
.
args
.
get
(
"expand"
,
False
,
type
=
bool
)
if
arg_1
:
try
:
arg_8
=
MyCapytain
.
common
.
reference
.
URN
(
arg_1
)
except
ValueError
:
return
"invalid urn"
,
400
arg_9
,
arg_10
=
arg_0
.
__queryinterface__
.
getAnnotations
(
arg_8
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
arg_5
=
arg_5
,
arg_6
=
arg_6
,
arg_7
=
arg_7
)
else
:
arg_9
,
arg_10
=
arg_0
.
__queryinterface__
.
getAnnotations
(
,
arg_5
=
arg_5
,
arg_6
=
arg_6
,
arg_7
=
arg_7
)
arg_11
=
[
]
arg_12
=
{
"@context"
:
type
(
arg_0
)
.
JSONLD_CONTEXT
,
"id"
:
url_for
(
".Func"
,
arg_6
=
arg_6
,
arg_5
=
arg_5
)
,
"type"
:
"AnnotationCollection"
,
"startIndex"
:
arg_6
,
"items"
:
[
]
,
"total"
:
arg_9
}
for
arg_13
in
arg_10
:
arg_11
.
append
(
{
"id"
:
url_for
(
".r_annotation"
,
sha
=
arg_13
.
sha
)
,
"body"
:
url_for
(
".r_annotation_body"
,
sha
=
arg_13
.
sha
)
,
"type"
:
"Annotation"
,
"target"
:
arg_13
.
target
.
to_json
(
)
,
"dc:type"
:
arg_13
.
type_uri
,
"owl:sameAs"
:
[
arg_13
.
uri
]
,
"nemo:slug"
:
arg_13
.
slug
}
)
arg_12
[
"items"
]
=
arg_11
arg_12
=
jsonify
(
arg_12
)
return
arg_12

def Func(arg_0):
        """ Route to retrieve annotations by target

        :param target_urn: The CTS URN for which to retrieve annotations
        :type target_urn: str
        :return: a JSON string containing count and list of resources
        :rtype: {str: Any}
        """

        arg_1 = request.args.get("target", None)
        arg_2 = request.args.get("wildcard", ".", type=str)
        arg_3 = request.args.get("include")
        arg_4 = request.args.get("exclude")
        arg_5 = request.args.get("limit", None, type=int)
        arg_6 = request.args.get("start", 1, type=int)
        arg_7 = request.args.get("expand", False, type=bool)

        if arg_1:

            try:
                arg_8 = MyCapytain.common.reference.URN(arg_1)
            except ValueError:
                return "invalid urn", 400

            arg_9, arg_10 = arg_0.__queryinterface__.getAnnotations(arg_8, arg_2=arg_2, arg_3=arg_3,
                                                                        arg_4=arg_4, arg_5=arg_5, arg_6=arg_6,
                                                                        arg_7=arg_7)
        else:
            #  Note that this implementation is not done for too much annotations
            #  because we do not implement pagination here
            arg_9, arg_10 = arg_0.__queryinterface__.getAnnotations(None, arg_5=arg_5, arg_6=arg_6, arg_7=arg_7)
        arg_11 = []
        arg_12 = {
            "@context": type(arg_0).JSONLD_CONTEXT,
            "id": url_for(".Func", arg_6=arg_6, arg_5=arg_5),
            "type": "AnnotationCollection",
            "startIndex": arg_6,
            "items": [
            ],
            "total": arg_9
        }
        for arg_13 in arg_10:
            arg_11.append({
                "id": url_for(".r_annotation", sha=arg_13.sha),
                "body": url_for(".r_annotation_body", sha=arg_13.sha),
                "type": "Annotation",
                "target": arg_13.target.to_json(),
                "dc:type": arg_13.type_uri,
                "owl:sameAs": [arg_13.uri],
                "nemo:slug": arg_13.slug
            })
        arg_12["items"] = arg_11
        arg_12 = jsonify(arg_12)
        return arg_12


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = models . TaskInstance arg_4 = ( arg_2 . query ( arg_3 . task_id , arg_3 . dag_id , func . count ( '*' ) ) . filter ( arg_3 . state . in_ ( arg_1 ) ) . group_by ( arg_3 . task_id , arg_3 . dag_id ) ) . all ( ) arg_5 = defaultdict ( int ) arg_6 = defaultdict ( int ) for arg_7 in arg_4 : arg_8 , arg_9 , arg_10 = arg_7 arg_5 [ arg_9 ] += arg_10 arg_6 [ ( arg_9 , arg_8 ) ] = arg_10 return arg_5 , arg_6

def Func(arg_0, arg_1, arg_2=None):
        """
        Get the concurrency maps.

        :param states: List of states to query for
        :type states: list[airflow.utils.state.State]
        :return: A map from (dag_id, task_id) to # of task instances and
         a map from (dag_id, task_id) to # of task instances in the given state list
        :rtype: dict[tuple[str, str], int]

        """
        arg_3 = models.TaskInstance
        arg_4 = (
            arg_2
            .query(arg_3.task_id, arg_3.dag_id, func.count('*'))
            .filter(arg_3.state.in_(arg_1))
            .group_by(arg_3.task_id, arg_3.dag_id)
        ).all()
        arg_5 = defaultdict(int)
        arg_6 = defaultdict(int)
        for arg_7 in arg_4:
            arg_8, arg_9, arg_10 = arg_7
            arg_5[arg_9] += arg_10
            arg_6[(arg_9, arg_8)] = arg_10
        return arg_5, arg_6


If o is a ISeq, return the elements after the first in o. If o is None,
    returns an empty seq. Otherwise, coerces o to a seq and returns the rest.

def Func ( arg_0 ) -> Optional [ ISeq ] : if arg_0 is None : return None if isinstance ( arg_0 , ISeq ) : arg_1 = arg_0 . Func if arg_1 is None : return lseq . EMPTY return arg_1 arg_2 = to_seq ( arg_0 ) if arg_2 is None : return lseq . EMPTY return arg_2 . Func

def Func(arg_0) -> Optional[ISeq]:
    """If o is a ISeq, return the elements after the first in o. If o is None,
    returns an empty seq. Otherwise, coerces o to a seq and returns the Func."""
    if arg_0 is None:
        return None
    if isinstance(arg_0, ISeq):
        arg_1 = arg_0.Func
        if arg_1 is None:
            return lseq.EMPTY
        return arg_1
    arg_2 = to_seq(arg_0)
    if arg_2 is None:
        return lseq.EMPTY
    return arg_2.Func

If o is a ISeq return the elements after the first in o . If o is None returns an empty seq . Otherwise coerces o to a seq and returns the rest .


def Func(arg_0):
        """
        Get the "current" division and return a dictionary of divisions
        so the user can select the right one.
        """
        arg_1 = arg_0.rest(GET('v1/current/Me?$select=CurrentDivision'))
        arg_2 = arg_1[0]['CurrentDivision']
        assert isinstance(arg_2, int)

        arg_3 = 'v1/%d/' % (arg_2,)
        arg_4 = urljoin(arg_3, 'hrm/Divisions?$select=Code,Description')
        arg_1 = arg_0.rest(GET(arg_4))

        arg_5 = dict((i['Code'], i['Description']) for i in arg_1)
        return arg_5, arg_2

Get the current division and return a dictionary of divisions so the user can select the right one .


def Func ( arg_0 ) : arg_0 . namespace = 'note_midi' arg_2 = arg_0 . pop_data ( ) for arg_3 in arg_2 : arg_0 . append ( time = arg_3 . time , duration = arg_3 . duration , confidence = arg_3 . confidence , value = 12 * ( np . log2 ( arg_3 . value ) - np . log2 ( 440.0 ) ) + 69 ) return arg_0

def Func(arg_0):
    '''Convert a pitch_hz annotation to pitch_midi'''

    arg_0.namespace = 'note_midi'

    arg_2 = arg_0.pop_data()

    for arg_3 in arg_2:
        arg_0.append(time=arg_3.time, duration=arg_3.duration,
                          confidence=arg_3.confidence,
                          value=12 * (np.log2(arg_3.value) - np.log2(440.0)) + 69)

    return arg_0


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = [ ] ) : arg_4 = Operator ( arg_0 , arg_1 ) arg_5 = RtlSignal ( getCtxFromOps ( arg_1 ) , None , arg_2 ) arg_5 . _const = arr_all ( arg_4 . operands , isConst ) arg_5 . drivers . append ( arg_4 ) arg_5 . origin = arg_4 arg_4 . result = arg_5 arg_4 . registerSignals ( arg_3 ) if arg_5 . _const : arg_5 . staticEval ( ) return arg_5

def Func(arg_0, arg_1, arg_2, arg_3=[]):
        """
        Create operator with result signal

        :ivar resT: data type of result signal
        :ivar outputs: iterable of singnals which are outputs
            from this operator
        """
        arg_4 = Operator(arg_0, arg_1)
        arg_5 = RtlSignal(getCtxFromOps(arg_1), None, arg_2)
        arg_5._const = arr_all(arg_4.operands, isConst)
        arg_5.drivers.append(arg_4)
        arg_5.origin = arg_4
        arg_4.result = arg_5
        arg_4.registerSignals(arg_3)
        if arg_5._const:
            arg_5.staticEval()
        return arg_5


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
.
name
in
arg_0
.
task_specs
:
raise
KeyError
(
'Duplicate task spec name: '
+
arg_1
.
name
)
arg_0
.
task_specs
[
arg_1
.
name
]
=
arg_1
arg_1
.
id
=
len
(
arg_0
.
task_specs
)

def Func(arg_0, arg_1):
        """
        Called by a task spec when it was added into the workflow.
        """
        if arg_1.name in arg_0.task_specs:
            raise KeyError('Duplicate task spec name: ' + arg_1.name)
        arg_0.task_specs[arg_1.name] = arg_1
        arg_1.id = len(arg_0.task_specs)

Called by a task spec when it was added into the workflow .


(images_and_captions, batch_size, queue_capacity, add_summaries=True)

return images, input_seqs, target_seqs, mask

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : arg_4 = [ ] for arg_5 , arg_6 in arg_0 : arg_7 = tf . shape ( arg_6 ) [ 0 ] arg_8 = tf . expand_dims ( tf . subtract ( arg_7 , 1 ) , 0 ) arg_9 = tf . slice ( arg_6 , [ 0 ] , arg_8 ) arg_10 = tf . slice ( arg_6 , [ 1 ] , arg_8 ) arg_11 = tf . ones ( arg_8 , dtype = tf . int32 ) arg_4 . append ( [ arg_5 , arg_9 , arg_10 , arg_11 ] ) arg_12 , arg_13 , arg_14 , arg_15 = tf . train . batch_join ( arg_4 , arg_1 = arg_1 , capacity = arg_2 , dynamic_pad = True , name = "batch_and_pad" ) if arg_3 : arg_16 = tf . add ( tf . reduce_sum ( arg_15 , 1 ) , 1 ) tf . summary . scalar ( "caption_length/batch_min" , tf . reduce_min ( arg_16 ) ) tf . summary . scalar ( "caption_length/batch_max" , tf . reduce_max ( arg_16 ) ) tf . summary . scalar ( "caption_length/batch_mean" , tf . reduce_mean ( arg_16 ) ) return arg_12 , arg_13 , arg_14 , arg_15

def Func(arg_0, arg_1, arg_2, arg_3=True):
    """Batches input images and captions.

    This function splits the caption into an input sequence and a target sequence,
    where the target sequence is the input sequence right-shifted by 1. Input and
    target sequences are batched and padded up to the maximum length of sequences
    in the batch. A mask is created to distinguish real words from padding words.

    Example:
        Actual captions in the batch ('-' denotes padded character):
        [
            [ 1 2 5 4 5 ],
            [ 1 2 3 4 - ],
            [ 1 2 3 - - ],
        ]

        input_seqs:
        [
            [ 1 2 3 4 ],
            [ 1 2 3 - ],
            [ 1 2 - - ],
        ]

        target_seqs:
        [
            [ 2 3 4 5 ],
            [ 2 3 4 - ],
            [ 2 3 - - ],
        ]

        mask:
        [
            [ 1 1 1 1 ],
            [ 1 1 1 0 ],
            [ 1 1 0 0 ],
        ]

    Args:
        images_and_captions: A list of pairs [image, caption], where image is a
        Tensor of shape [height, width, channels] and caption is a 1-D Tensor of
        any length. Each pair will be processed and added to the queue in a
        separate thread.
        batch_size: Batch size.
        queue_capacity: Queue capacity.
        add_summaries: If true, add caption length summaries.

    Returns:
        images: A Tensor of shape [batch_size, height, width, channels].
        input_seqs: An int32 Tensor of shape [batch_size, padded_length].
        target_seqs: An int32 Tensor of shape [batch_size, padded_length].
        mask: An int32 0/1 Tensor of shape [batch_size, padded_length].
    """
    arg_4 = []
    for arg_5, arg_6 in arg_0:
        arg_7 = tf.shape(arg_6)[0]
        arg_8 = tf.expand_dims(tf.subtract(arg_7, 1), 0)

        arg_9 = tf.slice(arg_6, [0], arg_8)
        arg_10 = tf.slice(arg_6, [1], arg_8)
        arg_11 = tf.ones(arg_8, dtype=tf.int32)
        arg_4.append([arg_5, arg_9, arg_10, arg_11])

    arg_12, arg_13, arg_14, arg_15 = tf.train.batch_join(
        arg_4, arg_1=arg_1, capacity=arg_2, dynamic_pad=True, name="batch_and_pad"
    )

    if arg_3:
        arg_16 = tf.add(tf.reduce_sum(arg_15, 1), 1)
        tf.summary.scalar("caption_length/batch_min", tf.reduce_min(arg_16))
        tf.summary.scalar("caption_length/batch_max", tf.reduce_max(arg_16))
        tf.summary.scalar("caption_length/batch_mean", tf.reduce_mean(arg_16))

    return arg_12, arg_13, arg_14, arg_15


return np.array([x.head, x.relation, x.tail], dtype=np.int64)

def Func ( arg_0 ) : return np . array ( [ arg_0 . head , arg_0 . relation , arg_0 . tail ] , dtype = np . int64 )

def Func(arg_0):
    """Transform triple index into a 1-D numpy array."""
    return np.array([arg_0.head, arg_0.relation, arg_0.tail], dtype=np.int64)

Transform triple index into a 1 - D numpy array .


(self, fmt=None, initial=True, default='')

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
True
,
arg_3
=
''
)
:
if
arg_3
and
not
arg_0
.
__dict__
:
return
arg_3
if
arg_1
==
''
:
return
arg_3
arg_4
=
[
k
for
k
,
v
in
arg_0
.
__dict__
.
items
(
)
if
v
is
not
''
]
arg_5
=
arg_1
or
'{'
+
'}, {'
.
join
(
arg_4
)
+
'}'
try
:
Func
=
CustomFormatter
(
)
.
format
(
arg_5
,
**
arg_0
.
__dict__
)
except
KeyError
as
e
:
raise
ComponentError
(
"Error building summary, "
+
str
(
e
)
)
if
Func
and
arg_2
and
not
arg_1
:
Func
=
Func
[
0
]
.
upper
(
)
+
Func
[
1
:
]
return
Func

def Func(arg_0, arg_1=None, arg_2=True, arg_3=''):
        """
        Given a format string, return a summary description of a component.

        Args:
            component (dict): A component dictionary.
            fmt (str): Describes the format with a string. If no format is
                given, you will just get a list of attributes. If you give the
                empty string (''), you'll get `default` back. By default this
                gives you the empty string, effectively suppressing the
                summary.
            initial (bool): Whether to capitialize the first letter. Default is
                True.
            default (str): What to give if there's no component defined.

        Returns:
            str: A summary string.

        Example:

            r = Component({'colour': 'Red',
                           'grainsize': 'VF-F',
                           'lithology': 'Sandstone'})

            r.summary()  -->  'Red, vf-f, sandstone'
        """
        if arg_3 and not arg_0.__dict__:
            return arg_3

        if arg_1 == '':
            return arg_3

        arg_4 = [k for k, v in arg_0.__dict__.items() if v is not '']

        arg_5 = arg_1 or '{' + '}, {'.join(arg_4) + '}'

        try:
            Func = CustomFormatter().format(arg_5, **arg_0.__dict__)
        except KeyError as e:
            raise ComponentError("Error building summary, "+str(e))

        if Func and arg_2 and not arg_1:
            Func = Func[0].upper() + Func[1:]

        return Func

Given a format string return a summary description of a component .


def
Func
(
arg_0
)
:
arg_1
=
{
}
arg_2
=
arg_3
=
try
:
if
'hgnc_id'
in
arg_0
:
arg_3
=
int
(
arg_0
[
'hgnc_id'
]
)
elif
'hgnc_idnumber'
in
arg_0
:
arg_3
=
int
(
arg_0
[
'hgnc_idnumber'
]
)
elif
'hgncid'
in
arg_0
:
arg_3
=
int
(
arg_0
[
'hgncid'
]
)
except
ValueError
as
e
:
raise
SyntaxError
(
"Invalid hgnc id: {0}"
.
format
(
arg_3
)
)
arg_1
[
'hgnc_id'
]
=
arg_3
arg_2
=
arg_3
arg_4
=
if
'hgnc_symbol'
in
arg_0
:
arg_4
=
arg_0
[
'hgnc_symbol'
]
elif
'hgncsymbol'
in
arg_0
:
arg_4
=
arg_0
[
'hgncsymbol'
]
elif
'symbol'
in
arg_0
:
arg_4
=
arg_0
[
'symbol'
]
arg_1
[
'hgnc_symbol'
]
=
arg_4
if
not
arg_2
:
if
arg_4
:
arg_2
=
arg_4
else
:
raise
SyntaxError
(
"No gene identifier could be found"
)
arg_1
[
'identifier'
]
=
arg_2
arg_5
=
""
if
'disease_associated_transcripts'
in
arg_0
:
arg_5
=
arg_0
[
'disease_associated_transcripts'
]
elif
'disease_associated_transcript'
in
arg_0
:
arg_5
=
arg_0
[
'disease_associated_transcript'
]
elif
'transcripts'
in
arg_0
:
arg_5
=
arg_0
[
'transcripts'
]
arg_1
[
'transcripts'
]
=
[
transcript
.
strip
(
)
for
transcript
in
arg_5
.
split
(
','
)
if
transcript
]
arg_6
=
""
if
'genetic_disease_models'
in
arg_0
:
arg_6
=
arg_0
[
'genetic_disease_models'
]
elif
'genetic_disease_model'
in
arg_0
:
arg_6
=
arg_0
[
'genetic_disease_model'
]
elif
'inheritance_models'
in
arg_0
:
arg_6
=
arg_0
[
'inheritance_models'
]
elif
'genetic_inheritance_models'
in
arg_0
:
arg_6
=
arg_0
[
'genetic_inheritance_models'
]
arg_1
[
'inheritance_models'
]
=
[
model
.
strip
(
)
for
model
in
arg_6
.
split
(
','
)
if
model
.
strip
(
)
in
VALID_MODELS
]
arg_1
[
'mosaicism'
]
=
True
if
arg_0
.
get
(
'mosaicism'
)
else
False
arg_1
[
'reduced_penetrance'
]
=
True
if
arg_0
.
get
(
'reduced_penetrance'
)
else
False
arg_1
[
'database_entry_version'
]
=
arg_0
.
get
(
'database_entry_version'
)
return
arg_1

def Func(arg_0):
    """Parse a gene line with information from a panel file

        Args:
            gene_info(dict): dictionary with gene info

        Returns:
            gene(dict): A dictionary with the gene information
                {
                'hgnc_id': int,
                'hgnc_symbol': str,
                'disease_associated_transcripts': list(str),
                'inheritance_models': list(str),
                'mosaicism': bool,
                'reduced_penetrance': bool,
                'database_entry_version': str,
                }

    """
    arg_1 = {}
    # This is either hgnc id or hgnc symbol
    arg_2 = None

    arg_3 = None
    try:
        if 'hgnc_id' in arg_0:
            arg_3 = int(arg_0['hgnc_id'])
        elif 'hgnc_idnumber' in arg_0:
            arg_3 = int(arg_0['hgnc_idnumber'])
        elif 'hgncid' in arg_0:
            arg_3 = int(arg_0['hgncid'])
    except ValueError as e:
        raise SyntaxError("Invalid hgnc id: {0}".format(arg_3))

    arg_1['hgnc_id'] = arg_3
    arg_2 = arg_3

    arg_4 = None
    if 'hgnc_symbol' in arg_0:
        arg_4 = arg_0['hgnc_symbol']
    elif 'hgncsymbol' in arg_0:
        arg_4 = arg_0['hgncsymbol']
    elif 'symbol' in arg_0:
        arg_4 = arg_0['symbol']

    arg_1['hgnc_symbol'] = arg_4

    if not arg_2:
        if arg_4:
            arg_2 = arg_4
        else:
            raise SyntaxError("No gene identifier could be found")
    arg_1['identifier'] = arg_2
    # Disease associated transcripts is a ','-separated list of
    # manually curated transcripts
    arg_5 = ""
    if 'disease_associated_transcripts' in arg_0:
        arg_5 = arg_0['disease_associated_transcripts']
    elif 'disease_associated_transcript' in arg_0:
        arg_5 = arg_0['disease_associated_transcript']
    elif 'transcripts' in arg_0:
        arg_5 = arg_0['transcripts']

    arg_1['transcripts'] = [
            transcript.strip() for transcript in
            arg_5.split(',') if transcript
        ]

    # Genetic disease models is a ','-separated list of manually curated
    # inheritance patterns that are followed for a gene
    arg_6 = ""
    if 'genetic_disease_models' in arg_0:
        arg_6 = arg_0['genetic_disease_models']
    elif 'genetic_disease_model' in arg_0:
        arg_6 = arg_0['genetic_disease_model']
    elif 'inheritance_models' in arg_0:
        arg_6 = arg_0['inheritance_models']
    elif 'genetic_inheritance_models' in arg_0:
        arg_6 = arg_0['genetic_inheritance_models']

    arg_1['inheritance_models'] = [
        model.strip() for model in arg_6.split(',')
        if model.strip() in VALID_MODELS
    ]

    # If a gene is known to be associated with mosaicism this is annotated
    arg_1['mosaicism'] = True if arg_0.get('mosaicism') else False

    # If a gene is known to have reduced penetrance this is annotated
    arg_1['reduced_penetrance'] = True if arg_0.get('reduced_penetrance') else False

    # The database entry version is a way to track when a a gene was added or
    # modified, optional
    arg_1['database_entry_version'] = arg_0.get('database_entry_version')

    return arg_1


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
pexdoc
.
exh
.
addex
(
ValueError
,
"Argument `offset` is not valid"
)
try
:
return
_POWER_TO_SUFFIX_DICT
[
_SUFFIX_TO_POWER_DICT
[
arg_0
]
+
3
*
arg_1
]
except
KeyError
:
arg_2
(
True
)

def Func(arg_0, arg_1):
    r"""
    Return engineering suffix from a starting suffix and an number of suffixes offset.

    :param suffix: Engineering suffix
    :type  suffix: :ref:`EngineeringNotationSuffix`

    :param offset: Engineering suffix offset
    :type  offset: integer

    :rtype: string

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.functions.Func

    :raises:
     * RuntimeError (Argument \`offset\` is not valid)

     * RuntimeError (Argument \`suffix\` is not valid)

     * ValueError (Argument \`offset\` is not valid)

    .. [[[end]]]

    For example:

        >>> import peng
        >>> peng.Func('u', 6)
        'T'
    """
    # pylint: disable=W0212
    arg_2 = pexdoc.exh.addex(ValueError, "Argument `offset` is not valid")
    try:
        return _POWER_TO_SUFFIX_DICT[_SUFFIX_TO_POWER_DICT[arg_0] + 3 * arg_1]
    except KeyError:
        arg_2(True)

r"""
    Return engineering suffix from a starting suffix and an number of suffixes offset.

    :param suffix: Engineering suffix
    :type  suffix: :ref:`EngineeringNotationSuffix`

    :param offset: Engineering suffix offset
    :type  offset: integer

    :rtype: string

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.functions.peng_suffix_math

    :raises:
     * RuntimeError (Argument \`offset\` is not valid)

     * RuntimeError (Argument \`suffix\` is not valid)

     * ValueError (Argument \`offset\` is not valid)

    .. [[[end]]]

    For example:

        >>> import peng
        >>> peng.peng_suffix_math('u', 6)
        'T'

r Return engineering suffix from a starting suffix and an number of suffixes offset .


(self, limit=20, offset=0, country=None, locale=None)

def Func ( arg_0 , arg_1 = 20 , arg_2 = 0 , arg_3 = None , arg_4 = None ) : arg_5 = Route ( 'GET' , '/browse/Func' ) arg_6 = { 'limit' : arg_1 , 'offset' : arg_2 } if arg_3 : arg_6 [ 'country' ] = arg_3 if arg_4 : arg_6 [ 'locale' ] = arg_4 return arg_0 . request ( arg_5 , params = arg_6 )

def Func(arg_0, arg_1=20, arg_2=0, arg_3=None, arg_4=None):
        """Get a list of Func used to tag items in Spotify.

        Parameters
        ----------
        limit : Optional[int]
            The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
        offset : Optional[int]
            The index of the first item to return. Default: 0
        country : COUNTRY_TP
            COUNTRY
        locale : LOCALE_TP
            LOCALE
        """
        arg_5 = Route('GET', '/browse/Func')
        arg_6 = {'limit': arg_1, 'offset': arg_2}

        if arg_3:
            arg_6['country'] = arg_3

        if arg_4:
            arg_6['locale'] = arg_4

        return arg_0.request(arg_5, params=arg_6)

Get a list of categories used to tag items in Spotify.

        Parameters
        ----------
        limit : Optional[int]
            The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
        offset : Optional[int]
            The index of the first item to return. Default: 0
        country : COUNTRY_TP
            COUNTRY
        locale : LOCALE_TP
            LOCALE

Get a list of categories used to tag items in Spotify .


Prints an error message, the help message and quits

def
Func
(
arg_0
)
:
global
parser
print
(
_
(
"Error: "
)
+
arg_0
)
print
(
)
parser
.
print_help
(
)
sys
.
exit
(
)

def Func(arg_0):
    '''Prints an Func message, the help message and quits'''
    global parser
    print (_("Error: ") + arg_0)
    print ()
    parser.print_help()
    sys.exit()

Prints an error message the help message and quits


def Func ( arg_0 ) : if not arg_0 . Func_pending ( ) : _openssl_assert ( _lib . SSL_Func ( arg_0 . _ssl ) == 1 ) return True return False

def Func(arg_0):
        """
        Renegotiate the session.

        :return: True if the renegotiation can be started, False otherwise
        :rtype: bool
        """
        if not arg_0.Func_pending():
            _openssl_assert(_lib.SSL_Func(arg_0._ssl) == 1)
            return True
        return False


def
Func
(
arg_0
=
,
arg_1
=
0
)
:
try
:
arg_2
=
HTTPServer
(
)
arg_2
.
bind
(
arg_0
=
arg_0
,
arg_1
=
arg_1
)
except
OSError
as
err
:
console
.
exit
(
"Failed to create HTTP server: {0}"
,
err
)
return
arg_2

def Func(arg_0=None, arg_1=0):
    """Creates a HTTP server listening on a given host and port.

    If host is empty, listen on all available interfaces, and if port is 0,
    listen on a random high port.
    """

    try:
        arg_2 = HTTPServer()
        arg_2.bind(arg_0=arg_0, arg_1=arg_1)
    except OSError as err:
        console.exit("Failed to create HTTP server: {0}", err)

    return arg_2

Creates a HTTP server listening on a given host and port .


def Func(arg_0):
        """
        Check if the process launched to process this file is Func.

        :return: whether the process is finished running
        :rtype: bool
        """
        if arg_0._process is None:
            raise AirflowException("Tried to see if it's Func before starting!")

        if arg_0._Func:
            return True

        # In case result queue is corrupted.
        if arg_0._result_queue and not arg_0._result_queue.empty():
            arg_0._result = arg_0._result_queue.get_nowait()
            arg_0._Func = True
            arg_0.log.debug("Waiting for %s", arg_0._process)
            arg_0._process.join()
            return True

        # Potential error case when process dies
        if arg_0._result_queue and not arg_0._process.is_alive():
            arg_0._Func = True
            # Get the object from the queue or else join() can hang.
            if not arg_0._result_queue.empty():
                arg_0._result = arg_0._result_queue.get_nowait()
            arg_0.log.debug("Waiting for %s", arg_0._process)
            arg_0._process.join()
            return True

        return False

Check if the process launched to process this file is done.

        :return: whether the process is finished running
        :rtype: bool

Check if the process launched to process this file is done .


def Func ( arg_0 , arg_1 , arg_2 : arg_3 , arg_4 : arg_5 ) : arg_6 = arg_0 . _COMMA . join ( arg_4 . keys ( ) ) arg_7 = arg_0 . _PLACEHOLDER * len ( arg_4 ) arg_8 = arg_0 . _Func_string . format ( arg_2 , arg_6 , arg_7 [ : - 1 ] ) yield from arg_1 . execute ( arg_8 , tuple ( arg_4 . values ( ) ) ) return ( yield from arg_1 . fetchone ( ) )

def Func(arg_0, arg_1, arg_2: arg_3, arg_4: arg_5):
        """
        Creates an Func statement with only chosen fields

        Args:
            table: a string indicating the name of the table
            values: a dict of fields and values to be Funced

        Returns:
            A 'Record' object with table columns as properties

        """
        arg_6 = arg_0._COMMA.join(arg_4.keys())
        arg_7 = arg_0._PLACEHOLDER * len(arg_4)
        arg_8 = arg_0._Func_string.format(arg_2, arg_6, arg_7[:-1])
        yield from arg_1.execute(arg_8, tuple(arg_4.values()))
        return (yield from arg_1.fetchone())

Creates an insert statement with only chosen fields

        Args:
            table: a string indicating the name of the table
            values: a dict of fields and values to be inserted

        Returns:
            A 'Record' object with table columns as properties


def Func ( arg_0 ) : arg_1 = arg_0 . first_lines ( arg_0 . excluded ) Func = { } for arg_3 , arg_4 in arg_0 . arcs ( ) : if arg_3 < 0 : continue if arg_3 in arg_1 : continue if arg_4 in arg_1 : continue if arg_3 not in Func : Func [ arg_3 ] = 0 Func [ arg_3 ] += 1 for arg_5 in arg_0 . classdefs : if arg_5 in Func : Func [ arg_5 ] -= 1 return Func

def Func(arg_0):
        """Get a mapping from line numbers to count of exits from that line.

        Excluded lines are excluded.

        """
        arg_1 = arg_0.first_lines(arg_0.excluded)
        Func = {}
        for arg_3, arg_4 in arg_0.arcs():
            if arg_3 < 0:
                # Don't ever report -1 as a line number
                continue
            if arg_3 in arg_1:
                # Don't report excluded lines as line numbers.
                continue
            if arg_4 in arg_1:
                # Arcs to excluded lines shouldn't count.
                continue
            if arg_3 not in Func:
                Func[arg_3] = 0
            Func[arg_3] += 1

        # Class definitions have one extra exit, so remove one for each:
        for arg_5 in arg_0.classdefs:
            # Ensure key is there: classdefs can include excluded lines.
            if arg_5 in Func:
                Func[arg_5] -= 1

        return Func

Get a mapping from line numbers to count of exits from that line .


return self.get_data(
            "firewalls/%s/tags" % self.id,
            type=POST,
            params={"tags": tags}
        )

def Func ( arg_0 , arg_1 ) : return arg_0 . get_data ( "firewalls/%s/tags" % arg_0 . id , type = POST , params = { "tags" : arg_1 } )

def Func(arg_0, arg_1):
        """
            Add tags to this Firewall.
        """
        return arg_0.get_data(
            "firewalls/%s/tags" % arg_0.id,
            type=POST,
            params={"tags": arg_1}
        )


def Func ( arg_0 , arg_1 = False , arg_2 = True ) : if not hasattr ( arg_0 , 'dtype' ) : arg_0 = np . asarray ( arg_0 ) if arg_1 and arg_2 : arg_0 = arg_0 [ np . isfinite ( arg_0 ) ] elif not arg_1 and np . any ( np . isnan ( arg_0 ) ) : return np . nan , np . nan elif arg_1 : arg_0 = arg_0 [ ~ np . isnan ( arg_0 ) ] elif arg_2 : arg_0 = arg_0 [ ~ np . isinf ( arg_0 ) ] if ( len ( arg_0 ) ) : return np . min ( arg_0 ) , np . max ( arg_0 ) else : return float ( '-inf' ) , float ( 'inf' )

def Func(arg_0, arg_1=False, arg_2=True):
    """
    Return the minimum and maximum of x

    Parameters
    ----------
    x : array_like
        Sequence
    na_rm : bool
        Whether to remove ``nan`` values.
    finite : bool
        Whether to consider only finite values.

    Returns
    -------
    out : tuple
        (minimum, maximum) of x
    """
    if not hasattr(arg_0, 'dtype'):
        arg_0 = np.asarray(arg_0)

    if arg_1 and arg_2:
        arg_0 = arg_0[np.isfinite(arg_0)]
    elif not arg_1 and np.any(np.isnan(arg_0)):
        return np.nan, np.nan
    elif arg_1:
        arg_0 = arg_0[~np.isnan(arg_0)]
    elif arg_2:
        arg_0 = arg_0[~np.isinf(arg_0)]

    if (len(arg_0)):
        return np.min(arg_0), np.max(arg_0)
    else:
        return float('-inf'), float('inf')


(start_color, end_color, step_count, inclusive=True, to_color=True)

return run if not to_color else [Color(c) for c in run]

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True , arg_4 = True ) : if isinstance ( arg_0 , Color ) : arg_0 = arg_0 . rgb if isinstance ( arg_1 , Color ) : arg_1 = arg_1 . rgb arg_5 = tuple ( ( arg_1 [ i ] - arg_0 [ i ] ) / arg_2 for i in range ( 3 ) ) arg_6 = lambda x , y : tuple ( sum ( z ) for z in zip ( x , y ) ) arg_7 = lambda x , y : tuple ( y * z for z in x ) arg_8 = [ arg_6 ( arg_0 , arg_7 ( arg_5 , i ) ) for i in range ( 1 , arg_2 ) ] if arg_3 : arg_8 = [ arg_0 ] + arg_8 + [ arg_1 ] return arg_8 if not arg_4 else [ Color ( arg_9 ) for arg_9 in arg_8 ]

def Func(arg_0, arg_1, arg_2, arg_3=True, arg_4=True):
    """
    Given a start color, end color, and a number of steps, returns a list of colors which represent a 'scale' between
    the start and end color.

    :param start_color: The color starting the run
    :param end_color: The color ending the run
    :param step_count: The number of colors to have between the start and end color
    :param inclusive: Flag determining whether to include start and end values in run (default True)
    :param to_color: Flag indicating return values should be Color objects (default True)
    :return: List of colors between the start and end color
    :rtype: list
    """
    if isinstance(arg_0, Color):
        arg_0 = arg_0.rgb

    if isinstance(arg_1, Color):
        arg_1 = arg_1.rgb

    arg_5 = tuple((arg_1[i] - arg_0[i])/arg_2 for i in range(3))

    arg_6 = lambda x, y: tuple(sum(z) for z in zip(x, y))
    arg_7 = lambda x, y: tuple(y * z for z in x)

    arg_8 = [arg_6(arg_0, arg_7(arg_5, i)) for i in range(1, arg_2)]

    if arg_3:
        arg_8 = [arg_0] + arg_8 + [arg_1]

    return arg_8 if not arg_4 else [Color(arg_9) for arg_9 in arg_8]

Given a start color end color and a number of steps returns a list of colors which represent a scale between the start and end color .


def Func ( arg_0 , arg_1 : arg_2 ) -> Scope : arg_3 = [ ] for arg_4 in arg_0 . values ( ) : if arg_4 . name == arg_1 : arg_3 . append ( EvalCtx . from_sig ( arg_4 ) ) if len ( arg_3 ) == 0 : arg_5 = arg_0 . get_parent ( ) if arg_5 is not None : return arg_5 . Func ( arg_1 ) arg_6 = Scope ( sig = arg_3 , state = StateScope . LINKED , is_namespace = False ) arg_6 . set_parent ( arg_0 ) return arg_6

def Func(arg_0, arg_1: arg_2) -> Scope:
        """ Retrieve a Set of all signature by symbol name """
        arg_3 = []
        for arg_4 in arg_0.values():
            if arg_4.name == arg_1:
                # create an EvalCtx only when necessary
                arg_3.append(EvalCtx.from_sig(arg_4))
        # include parent
        # TODO: see all case of local redefinition for
        #       global overloads
        # possible algos... take all with different internal_name
        if len(arg_3) == 0:
            arg_5 = arg_0.get_parent()
            if arg_5 is not None:
                return arg_5.Func(arg_1)
        arg_6 = Scope(sig=arg_3, state=StateScope.LINKED, is_namespace=False)
        # inherit type/translation from parent
        arg_6.set_parent(arg_0)
        return arg_6


def Func ( arg_0 ) : arg_1 = topology_pb2 . Spout ( ) arg_1 . comp . CopyFrom ( arg_0 . _get_base_component ( ) ) arg_0 . _add_out_streams ( arg_1 ) return arg_1

def Func(arg_0):
    """Returns Spout protobuf message"""
    arg_1 = topology_pb2.Spout()
    arg_1.comp.CopyFrom(arg_0._get_base_component())

    # Add output streams
    arg_0._add_out_streams(arg_1)
    return arg_1


def Func(arg_0, arg_1):
        """
        Gets the returned Celery result from the Airflow task
        ID provided to the sensor, and returns True if the
        celery result has been finished execution.

        :param context: Airflow's execution context
        :type context: dict
        :return: True if task has been executed, otherwise False
        :rtype: bool
        """
        arg_2 = arg_1['ti']
        arg_3 = arg_2.xcom_pull(task_ids=arg_0.target_task_id)
        return arg_3.ready()

Gets the returned Celery result from the Airflow task ID provided to the sensor and returns True if the celery result has been finished execution .


def Func(arg_0, arg_1):
        """Compile the Basilisp module into Python code.

        Basilisp is fundamentally a form-at-a-time compilation, meaning that
        each form in a module may require code compiled from an earlier form, so
        we incrementally compile a Python module by evaluating a single top-level
        form at a time and inserting the resulting AST nodes into the Pyton module."""
        arg_2 = arg_1.__name__
        arg_3 = arg_0._cache[arg_2]
        arg_3["module"] = arg_1
        arg_4 = arg_3["spec"]
        arg_5 = arg_4.loader_state["filename"]
        arg_6 = arg_0.path_stats(arg_5)

        # During the bootstrapping process, the 'basilisp.core namespace is created with
        # a blank module. If we do not replace the module here with the module we are
        # generating, then we will not be able to use advanced compilation features such
        # as direct Python variable access to functions and other def'ed values.
        arg_7 = demunge(arg_2)
        arg_8: runtime.Namespace = runtime.set_current_ns(arg_7).value
        arg_8.module = arg_1

        # Check if a valid, cached version of this Basilisp namespace exists and, if so,
        # load it and bypass the expensive compilation process below.
        if os.getenv(_NO_CACHE_ENVVAR, None) == "true":
            arg_0._Func(arg_2, arg_4.loader_state, arg_6, arg_1)
        else:
            try:
                arg_0._exec_cached_module(
                    arg_2, arg_4.loader_state, arg_6, arg_1
                )
            except (EOFError, ImportError, IOError, OSError) as e:
                logger.debug(f"Failed to load cached Basilisp module: {e}")
                arg_0._Func(arg_2, arg_4.loader_state, arg_6, arg_1)

        # Because we want to (by default) add 'basilisp.core into every namespace by default,
        # we want to make sure we don't try to add 'basilisp.core into itself, causing a
        # circular import error.
        #
        # Later on, we can probably remove this and just use the 'ns macro to auto-refer
        # all 'basilisp.core values into the current namespace.
        runtime.Namespace.add_default_import(arg_7)

Compile the Basilisp module into Python code .


(self, states, actions, internals, reward, terminal)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """
        Utility method for unbuffered observing where each tuple is inserted into TensorFlow via
        a single session call, thus avoiding race conditions in multi-threaded mode.

        Observe full experience  tuplefrom the environment to learn from. Optionally pre-processes rewards
        Child classes should call super to get the processed reward
        EX: terminal, reward = super()...

        Args:
            states (any): One state (usually a value tuple) or dict of states if multiple states are expected.
            actions (any): One action (usually a value tuple) or dict of states if multiple actions are expected.
            internals (any): Internal list.
            terminal (bool): boolean indicating if the episode terminated after the observation.
            reward (float): scalar reward that resulted from executing the action.
        """
        # TODO probably unnecessary here.
        arg_0.current_terminal = arg_5
        arg_0.current_reward = arg_4
        # print('action = {}'.format(actions))
        if arg_0.unique_state:
            arg_1 = dict(state=arg_1)
        if arg_0.unique_action:
            arg_2 = dict(action=arg_2)

        arg_0.episode = arg_0.model.Func(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_5=arg_0.current_terminal,
            arg_4=arg_0.current_reward
        )

Utility method for unbuffered observing where each tuple is inserted into TensorFlow via a single session call thus avoiding race conditions in multi - threaded mode .


def Func(arg_0=None, arg_1=None):
    """
    Create a continuous palette using an MPL colormap

    Parameters
    ----------
    name : str
        Name of colormap
    lut : None | int
        This is the number of entries desired in the lookup table.
        Default is ``None``, leave it up Matplotlib.

    Returns
    -------
    out : function
        Continuous color palette that takes a single
        parameter either a :class:`float` or a sequence
        of floats maps those value(s) onto the palette
        and returns color(s). The float(s) must be
        in the range [0, 1].

    Examples
    --------
    >>> palette = Func('viridis')
    >>> palette([.1, .2, .3, .4, .5])
    ['#482475', '#414487', '#355f8d', '#2a788e', '#21918c']
    """
    arg_2 = get_cmap(arg_0, arg_1)

    def _Func(arg_3):
        return ratios_to_colors(arg_3, arg_2)

    return _Func

Create a continuous palette using an MPL colormap

    Parameters
    ----------
    name : str
        Name of colormap
    lut : None | int
        This is the number of entries desired in the lookup table.
        Default is ``None``, leave it up Matplotlib.

    Returns
    -------
    out : function
        Continuous color palette that takes a single
        parameter either a :class:`float` or a sequence
        of floats maps those value(s) onto the palette
        and returns color(s). The float(s) must be
        in the range [0, 1].

    Examples
    --------
    >>> palette = cmap_pal('viridis')
    >>> palette([.1, .2, .3, .4, .5])
    ['#482475', '#414487', '#355f8d', '#2a788e', '#21918c']


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : return [ arg_2 for arg_2 in arg_0 . _defs ] else : return [ arg_2 . name for arg_2 in arg_0 . _defs . values ( ) if arg_2 . basic == arg_1 ]

def Func(arg_0, arg_1 = None):
        """List known settings.

        :Parameters:
            - `basic`: When `True` then limit output to the basic settings,
              when `False` list only the extra settings.
        """
        if arg_1 is None:
            return [arg_2 for arg_2 in arg_0._defs]
        else:
            return [arg_2.name for arg_2 in arg_0._defs.values() if arg_2.basic == arg_1]


def Func ( arg_0 , arg_1 = False ) : if arg_1 : _xinput . FuncForce ( c_uint ( arg_0 . id ) ) else : _xinput . Func ( c_uint ( arg_0 . id ) ) while arg_0 . id not in arg_0 . available_ids ( ) : if arg_0 . id == 0 : break

def Func(arg_0, arg_1=False):
        """Unplug controller from Virtual USB Bus and free up ID"""
        if arg_1:
            _xinput.FuncForce(c_uint(arg_0.id))
        else:
            _xinput.Func(c_uint(arg_0.id))
        while arg_0.id not in arg_0.available_ids():
            if arg_0.id == 0:
                break


def Func(arg_0, arg_1, arg_2=None, **arg_3):
        """Returns modified form for TreeItem model.
        'Parent' field choices are built by sitetree itself.

        """
        if arg_2 is not None and arg_2.parent is not None:
            arg_0.previous_parent = arg_2.parent
            arg_5 = arg_0.previous_parent.id
        else:
            arg_5 = None

        arg_6 = TreeItemChoiceField(arg_0.tree, initial=arg_5)
        arg_7 = super(TreeItemAdmin, arg_0).Func(arg_1, arg_2, **arg_3)
        arg_6.label = arg_7.base_fields['parent'].label
        arg_6.help_text = arg_7.base_fields['parent'].help_text
        arg_6.widget = arg_7.base_fields['parent'].widget
        # Replace 'parent' TreeItem field with new appropriate one
        arg_7.base_fields['parent'] = arg_6

        # Try to resolve all currently registered url names including those in namespaces.
        if not getattr(arg_0, 'known_url_names', False):
            arg_0.known_url_names = []
            arg_0.known_url_rules = []
            arg_14 = get_resolver(get_urlconf())
            for arg_15, (arg_16, arg_17) in arg_14.namespace_dict.items():
                if arg_15 != 'admin':
                    arg_0._stack_known_urls(arg_17.reverse_dict, arg_15)
            arg_0._stack_known_urls(arg_14.reverse_dict)
            arg_0.known_url_rules = sorted(arg_0.known_url_rules)

        arg_7.known_url_names_hint = _(
            'You are seeing this warning because "URL as Pattern" option is active and pattern entered above '
            'seems to be invalid. Currently registered URL pattern names and parameters: ')
        arg_7.known_url_names = arg_0.known_url_names
        arg_7.known_url_rules = arg_0.known_url_rules
        return arg_7

Returns modified form for TreeItem model . Parent field choices are built by sitetree itself .


(self, func_name, func_args=(), dname='', nout=0,
              timeout=None, stream_handler=None, store_as='', plot_dir=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
(
)
,
arg_3
=
''
,
arg_4
=
0
,
arg_5
=
,
arg_6
=
,
arg_7
=
''
,
arg_8
=
)
:
arg_9
=
arg_0
.
_engine
if
arg_9
is
:
raise
Oct2PyError
(
'Session is closed'
)
arg_10
=
osp
.
join
(
arg_0
.
temp_dir
,
'writer.mat'
)
arg_10
=
arg_10
.
replace
(
osp
.
sep
,
'/'
)
arg_11
=
osp
.
join
(
arg_0
.
temp_dir
,
'reader.mat'
)
arg_11
=
arg_11
.
replace
(
osp
.
sep
,
'/'
)
arg_2
=
list
(
arg_2
)
arg_12
=
[
]
for
(
arg_13
,
arg_14
)
in
enumerate
(
arg_2
)
:
if
isinstance
(
arg_14
,
OctavePtr
)
:
arg_12
.
append
(
arg_13
+
1
)
arg_2
[
arg_13
]
=
arg_14
.
address
arg_12
=
np
.
array
(
arg_12
)
arg_15
=
dict
(
arg_1
=
arg_1
,
arg_2
=
tuple
(
arg_2
)
,
arg_3
=
arg_3
or
''
,
arg_4
=
arg_4
,
arg_7
=
arg_7
or
''
,
arg_12
=
arg_12
)
write_file
(
arg_15
,
arg_10
,
oned_as
=
arg_0
.
_oned_as
,
convert_to_float
=
arg_0
.
convert_to_float
)
arg_9
.
stream_handler
=
arg_6
or
arg_0
.
logger
.
info
if
arg_5
is
:
arg_5
=
arg_0
.
timeout
try
:
arg_9
.
eval
(
'_pyeval("%s", "%s");'
%
(
arg_10
,
arg_11
)
,
arg_5
=
arg_5
)
except
KeyboardInterrupt
as
e
:
arg_6
(
arg_9
.
repl
.
interrupt
(
)
)
raise
except
TIMEOUT
:
arg_6
(
arg_9
.
repl
.
interrupt
(
)
)
raise
Oct2PyError
(
'Timed out, interrupting'
)
except
EOF
:
arg_6
(
arg_9
.
repl
.
child
.
before
)
arg_0
.
restart
(
)
raise
Oct2PyError
(
'Session died, restarting'
)
arg_16
=
read_file
(
arg_11
,
arg_0
)
if
arg_16
[
'err'
]
:
arg_17
=
arg_0
.
_parse_error
(
arg_16
[
'err'
]
)
raise
Oct2PyError
(
arg_17
)
arg_18
=
arg_16
[
'result'
]
.
ravel
(
)
.
tolist
(
)
if
isinstance
(
arg_18
,
list
)
and
len
(
arg_18
)
==
1
:
arg_18
=
arg_18
[
0
]
if
(
isinstance
(
arg_18
,
Cell
)
and
arg_18
.
size
==
1
and
isinstance
(
arg_18
[
0
]
,
string_types
)
and
arg_18
[
0
]
==
'__no_value__'
)
:
arg_18
=
if
arg_8
:
arg_0
.
_engine
.
make_figures
(
arg_8
)
return
arg_18

def Func(arg_0, arg_1, arg_2=(), arg_3='', arg_4=0,
              arg_5=None, arg_6=None, arg_7='', arg_8=None):
        """Run the given function with the given args.
        """
        arg_9 = arg_0._engine
        if arg_9 is None:
            raise Oct2PyError('Session is closed')

        # Set up our mat file paths.
        arg_10 = osp.join(arg_0.temp_dir, 'writer.mat')
        arg_10 = arg_10.replace(osp.sep, '/')
        arg_11 = osp.join(arg_0.temp_dir, 'reader.mat')
        arg_11 = arg_11.replace(osp.sep, '/')

        arg_2 = list(arg_2)
        arg_12 = []
        for (arg_13, arg_14) in enumerate(arg_2):
            if isinstance(arg_14, OctavePtr):
                arg_12.append(arg_13 + 1)
                arg_2[arg_13] = arg_14.address
        arg_12 = np.array(arg_12)

        # Save the request data to the output file.
        arg_15 = dict(arg_1=arg_1, arg_2=tuple(arg_2),
                   arg_3=arg_3 or '', arg_4=arg_4,
                   arg_7=arg_7 or '',
                   arg_12=arg_12)

        write_file(arg_15, arg_10, oned_as=arg_0._oned_as,
                   convert_to_float=arg_0.convert_to_float)

        # Set up the engine and evaluate the `_pyeval()` function.
        arg_9.stream_handler = arg_6 or arg_0.logger.info
        if arg_5 is None:
            arg_5 = arg_0.timeout

        try:
            arg_9.eval('_pyeval("%s", "%s");' % (arg_10, arg_11),
                        arg_5=arg_5)
        except KeyboardInterrupt as e:
            arg_6(arg_9.repl.interrupt())
            raise
        except TIMEOUT:
            arg_6(arg_9.repl.interrupt())
            raise Oct2PyError('Timed out, interrupting')
        except EOF:
            arg_6(arg_9.repl.child.before)
            arg_0.restart()
            raise Oct2PyError('Session died, restarting')

        # Read in the output.
        arg_16 = read_file(arg_11, arg_0)
        if arg_16['err']:
            arg_17 = arg_0._parse_error(arg_16['err'])
            raise Oct2PyError(arg_17)

        arg_18 = arg_16['result'].ravel().tolist()
        if isinstance(arg_18, list) and len(arg_18) == 1:
            arg_18 = arg_18[0]

        # Check for sentinel value.
        if (isinstance(arg_18, Cell) and
                arg_18.size == 1 and
                isinstance(arg_18[0], string_types) and
                arg_18[0] == '__no_value__'):
            arg_18 = None

        if arg_8:
            arg_0._engine.make_figures(arg_8)

        return arg_18

Run the given function with the given args .


return await asyncio.wait_for(
            self._protocol.send_command(cmd), timeout=self._timeout
        )

async
def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
"loadproject %s"
%
arg_1
return
await
asyncio
.
wait_for
(
arg_0
.
_protocol
.
send_command
(
arg_2
)
,
timeout
=
arg_0
.
_timeout
)

async def Func(arg_0, arg_1):
        """Load a project.

        :param project_path: Path to project you want to load.
        """
        arg_2 = "loadproject %s" % arg_1
        return await asyncio.wait_for(
            arg_0._protocol.send_command(arg_2), timeout=arg_0._timeout
        )


Starts the exploiting phase, you should run setup before running this function.
            if auto is set, this function will fire the exploit to all systems. Otherwise a curses interface is shown.

def Func(arg_0):
        """
            Starts the Funcing phase, you should run setup before running this function.
            if auto is set, this function will fire the Func to all systems. Otherwise a curses interface is shown.
        """
        arg_1 = ServiceSearch()
        arg_2 = HostSearch()
        arg_3 = arg_1.get_services(tags=['MS17-010'])
        arg_3 = [arg_4 for arg_4 in arg_3]
        if len(arg_3) == 0:
            print_error("No services found that are vulnerable for MS17-010")
            return

        if arg_0.auto:
            print_success("Found {} services vulnerable for MS17-010".format(len(arg_3)))
            for arg_4 in arg_3:
                print_success("Exploiting " + str(arg_4.address))
                arg_5 = arg_2.id_to_object(str(arg_4.address))
                arg_6 = ''

                if arg_5.os:
                    arg_6 = arg_5.os
                else:
                    arg_6 = arg_0.detect_os(str(arg_4.address))
                    arg_5.os = arg_6
                    arg_5.save()
                arg_8 = arg_0.Func_single(str(arg_4.address), arg_6)
                print_notification(arg_8)
        else:
            arg_9 = []
            for arg_4 in arg_3:
                arg_5 = arg_2.id_to_object(str(arg_4.address))
                arg_6 = ''

                if arg_5.os:
                    arg_6 = arg_5.os
                else:
                    arg_6 = arg_0.detect_os(str(arg_4.address))
                    arg_5.os = arg_6
                    arg_5.save()

                arg_9.append({'ip': arg_4.address, 'os': arg_6, 'string': "{ip} ({os}) {hostname}".format(ip=arg_4.address, arg_7=arg_6, hostname=arg_5.hostname)})
            draw_interface(arg_9, arg_0.callback, "Exploiting {ip} with OS: {os}")

Starts the exploiting phase you should run setup before running this function . if auto is set this function will fire the exploit to all systems . Otherwise a curses interface is shown .


return [Match(e.attrib) for e in root if e.tag == 'error']

def Func ( arg_0 , arg_1 : arg_2 , arg_3 = None ) -> [ Match ] : arg_4 = arg_0 . _get_root ( arg_0 . _url , arg_0 . _encode ( arg_1 , arg_3 ) ) return [ Match ( arg_5 . attrib ) for arg_5 in arg_4 if arg_5 . tag == 'error' ]

def Func(arg_0, arg_1: arg_2, arg_3=None) -> [Match]:
        """Match text against enabled rules."""
        arg_4 = arg_0._get_root(arg_0._url, arg_0._encode(arg_1, arg_3))
        return [Match(arg_5.attrib) for arg_5 in arg_4 if arg_5.tag == 'error']


return {
        node
        for node in graph
        if node.function == func and is_causal_source(graph, node)
    }

def Func ( arg_0 : arg_1 , arg_2 : arg_3 ) -> Set [ BaseEntity ] : return { arg_4 for arg_4 in arg_0 if arg_4 . function == arg_2 and is_causal_source ( arg_0 , arg_4 ) }

def Func(arg_0: arg_1, arg_2: arg_3) -> Set[BaseEntity]:
    """Return a set of all nodes that have an in-degree of 0.

    This likely means that it is an external perturbagen and is not known to have any causal origin from within the
    biological system. These nodes are useful to identify because they generally don't provide any mechanistic insight.
    """
    return {
        arg_4
        for arg_4 in arg_0
        if arg_4.function == arg_2 and is_causal_source(arg_0, arg_4)
    }

Return a set of all nodes that have an in - degree of 0 .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 [ arg_1 : ] arg_3 = re . search ( '\S' , arg_2 ) if arg_3 : arg_4 = arg_3 . start ( ) else : arg_4 = 0 pass arg_5 = arg_1 + arg_4 arg_6 = re . search ( '\s' , arg_0 [ arg_5 : ] ) if arg_6 : arg_7 = arg_5 + arg_6 . start ( ) else : arg_7 = len ( arg_0 ) pass return [ arg_7 , arg_0 [ arg_5 : arg_7 + 1 ] . rstrip ( ) ]

def Func(arg_0, arg_1):
    """Find the next token in str string from start_pos, we return
    the token and the next blank position after the token or
    str.size if this is the last token. Tokens are delimited by
    white space."""
    arg_2 = arg_0[arg_1:]
    arg_3 = re.search('\S', arg_2)
    if arg_3:
        arg_4 = arg_3.start()
    else:
        arg_4 = 0
        pass
    arg_5 = arg_1 + arg_4
    arg_6 = re.search('\s', arg_0[arg_5:])
    if arg_6:
        arg_7 = arg_5 + arg_6.start()
    else:
        arg_7 = len(arg_0)
        pass
    return [arg_7, arg_0[arg_5:arg_7+1].rstrip()]

Find the next token in str string from start_pos we return the token and the next blank position after the token or str . size if this is the last token . Tokens are delimited by white space .


def
Func
(
arg_0
,
arg_1
=
)
:
LOG
.
info
(
"Func for tenant %s filters %s"
%
(
arg_0
.
tenant_id
,
arg_1
)
)
return
db_api
.
network_count_all
(
arg_0
)

def Func(arg_0, arg_1=None):
    """Return the number of networks.

    The result depends on the identity of the user making the request
    (as indicated by the context) as well as any filters.
    : param context: neutron api request context
    : param filters: a dictionary with keys that are valid keys for
        a network as listed in the RESOURCE_ATTRIBUTE_MAP object
        in neutron/api/v2/attributes.py.  Values in this dictiontary
        are an iterable containing values that will be used for an exact
        match comparison for that value.  Each result returned by this
        function will have matched one of the values for each key in
        filters.

    NOTE: this method is optional, as it was not part of the originally
          defined plugin API.
    """
    LOG.info("Func for tenant %s filters %s" %
             (arg_0.tenant_id, arg_1))
    return db_api.network_count_all(arg_0)


def Func(arg_0, arg_1=None, arg_2=False):
        """
        Returns a stdout-suitable file-like object based on the
        optional os_path and optionally skipping any configured
        sub-command.
        """
        arg_3 = None if arg_2 else arg_0.stdout_sub_command
        arg_4, arg_5 = arg_0._get_out_and_path(
            arg_0.stdout, arg_0.stdout_root, arg_3, arg_1)
        if hasattr(arg_4, 'stdin'):
            return arg_4.stdin
        return arg_4

Returns a stdout - suitable file - like object based on the optional os_path and optionally skipping any configured sub - command .


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_1
:
raise
ValueError
(
"No path specified"
)
arg_2
=
defaultdict
(
lambda
:
)
arg_3
=
len
(
arg_1
)
+
1
for
arg_4
,
arg_5
,
arg_6
in
os
.
walk
(
arg_1
)
:
for
arg_7
in
arg_6
:
arg_8
=
join
(
arg_4
,
arg_7
)
arg_2
[
arg_8
[
arg_3
:
]
]
=
compute_md5
(
arg_8
)
return
arg_2

def Func(arg_0, arg_1):
        """Returns a dictionary of all the files under a path."""
        if not arg_1:
            raise ValueError("No path specified")
        arg_2 = defaultdict(lambda: None)
        arg_3 = len(arg_1) + 1
        for arg_4, arg_5, arg_6 in os.walk(arg_1):
            for arg_7 in arg_6:
                arg_8 = join(arg_4, arg_7)
                arg_2[arg_8[arg_3:]] = compute_md5(arg_8)
        return arg_2

Returns a dictionary of all the files under a path .