return [
            self.tile(*intersecting_tile.id)
            for intersecting_tile in self.tile_pyramid.intersecting(tile)
        ]

def Func ( arg_0 , arg_1 ) : return [ arg_0 . tile ( * arg_2 . id ) for arg_2 in arg_0 . tile_pyramid . Func ( arg_1 ) ]

def Func(arg_0, arg_1):
        """
        Return all BufferedTiles Func with tile.

        Parameters
        ----------
        tile : ``BufferedTile``
            another tile
        """
        return [
            arg_0.tile(*arg_2.id)
            for arg_2 in arg_0.tile_pyramid.Func(arg_1)
        ]

Return all BufferedTiles intersecting with tile.

        Parameters
        ----------
        tile : ``BufferedTile``
            another tile

Return all BufferedTiles intersecting with tile .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
split_contents
(
)
if
len
(
arg_2
)
>
1
:
raise
TemplateSyntaxError
(
"'%s' takes no arguments"
%
arg_2
[
0
]
)
return
ClickmapNode
(
)

def Func(arg_0, arg_1):
    """
    Clickmap tracker template tag.

    Renders Javascript code to track page visits.  You must supply
    your Func tracker ID (as a string) in the ``CLICKMAP_TRACKER_ID``
    setting.
    """
    arg_2 = arg_1.split_contents()
    if len(arg_2) > 1:
        raise TemplateSyntaxError("'%s' takes no arguments" % arg_2[0])
    return ClickmapNode()

Clickmap tracker template tag.

    Renders Javascript code to track page visits.  You must supply
    your clickmap tracker ID (as a string) in the ``CLICKMAP_TRACKER_ID``
    setting.


def Func(arg_0, arg_1, arg_2):
        '''
        Gets an existing subscription.

        topic_name:
            Name of the topic.
        subscription_name:
            Name of the subscription.
        '''
        _validate_not_none('topic_name', arg_1)
        _validate_not_none('subscription_name', arg_2)
        arg_3 = HTTPRequest()
        arg_3.method = 'GET'
        arg_3.host = arg_0._get_host()
        arg_3.path = '/' + \
            _str(arg_1) + '/subscriptions/' + _str(arg_2) + ''
        arg_3.path, arg_3.query = arg_0._httpclient._update_request_uri_query(arg_3)  # pylint: disable=protected-access
        arg_3.headers = arg_0._update_service_bus_header(arg_3)
        arg_9 = arg_0._perform_request(arg_3)

        return _convert_response_to_subscription(arg_9)


def Func ( arg_0 , arg_1 = None ) : assert_is_type ( arg_1 , None , dict ) arg_2 = arg_0 . names arg_3 = arg_0 . ncols for arg_4 , arg_5 in arg_1 . items ( ) : arg_6 = None if is_type ( arg_4 , int ) and ( - arg_3 <= arg_4 < arg_3 ) : arg_6 = ( arg_4 + arg_3 ) % arg_3 elif is_type ( arg_4 , str ) and arg_4 in arg_0 . names : arg_6 = arg_0 . names . index ( arg_4 ) if arg_6 is not None : arg_2 [ arg_6 ] = arg_5 return arg_0 . set_names ( arg_2 )

def Func(arg_0, arg_1=None):
        """
        Change names of columns in the frame.

        Dict key is an index or name of the column whose name is to be set.
        Dict value is the new name of the column.

        :param columns: dict-like transformations to apply to the column names
        """
        assert_is_type(arg_1, None, dict)
        arg_2 = arg_0.names
        arg_3 = arg_0.ncols

        for arg_4, arg_5 in arg_1.items():
            arg_6 = None
            if is_type(arg_4, int) and (-arg_3 <= arg_4 < arg_3):
                arg_6 = (arg_4 + arg_3) % arg_3  # handle negative indices
            elif is_type(arg_4, str) and arg_4 in arg_0.names:
                arg_6 = arg_0.names.index(arg_4)  # lookup the name

            if arg_6 is not None:
                arg_2[arg_6] = arg_5

        return arg_0.set_names(arg_2)


def Func(arg_0, arg_1):
        """Skips forward in a string as fast as possible using information from
        an optimization info block."""
        # pattern starts with a known prefix
        # <5=length> <6=skip> <7=prefix data> <overlap data>
        arg_2 = arg_1[2]
        arg_3 = arg_1[5]
        arg_4 = arg_1[6] # don't really know what this is good for
        arg_5 = arg_1[7:7 + arg_3]
        arg_6 = arg_1[7 + arg_3 - 1:arg_1[1] + 1]
        arg_1 = arg_1[arg_1[1] + 1:]
        arg_7 = 0
        arg_8 = arg_0.string_position
        while arg_8 < arg_0.end:
            while True:
                if ord(arg_0.string[arg_8]) != arg_5[arg_7]:
                    if arg_7 == 0:
                        break
                    else:
                        arg_7 = arg_6[arg_7]
                else:
                    arg_7 += 1
                    if arg_7 == arg_3:
                        # found a potential match
                        arg_0.start = arg_8 + 1 - arg_3
                        arg_0.string_position = arg_8 + 1 \
                                                     - arg_3 + arg_4
                        if arg_2 & SRE_INFO_LITERAL:
                            return True # matched all of pure literal pattern
                        if arg_0.match(arg_1[2 * arg_4:]):
                            return True
                        arg_7 = arg_6[arg_7]
                    break
            arg_8 += 1
        return False

Skips forward in a string as fast as possible using information from an optimization info block .


def Func ( arg_0 , arg_1 ) : arg_2 = super ( GalleryAdmin , arg_0 ) . Func ( arg_1 ) return arg_2 . annotate ( photo_count = Count ( 'photos' ) )

def Func(arg_0, arg_1):
        """
        Add number of photos to each gallery.
        """
        arg_2 = super(GalleryAdmin, arg_0).Func(arg_1)
        return arg_2.annotate(photo_count=Count('photos'))


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : arg_6 = "{0:b}" . format ( abs ( arg_0 . value ) ) arg_6 = ( "0" * ( 64 - ( len ( arg_6 ) % 64 ) ) ) + arg_6 if arg_0 . value < 0 : arg_6 = arg_6 . replace ( '1' , 'i' ) arg_6 = arg_6 . replace ( '0' , '1' ) arg_6 = arg_6 . replace ( 'i' , '0' ) arg_7 = arg_6 . rfind ( '0' ) arg_6 = arg_6 [ 0 : arg_7 ] + '1' + ( '0' * len ( arg_6 [ arg_7 + 1 : ] ) ) arg_8 = b'' for arg_9 in range ( 0 , len ( arg_6 ) , 8 ) : arg_10 = arg_6 [ arg_9 : arg_9 + 8 ] arg_10 = int ( arg_10 , 2 ) arg_8 += struct . pack ( '!B' , arg_10 ) arg_0 . length = len ( arg_8 ) super ( BigInteger , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_1 . Func ( arg_8 )

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the encoding of the BigInteger to the output stream.

        Args:
            ostream (Stream): A buffer to contain the encoded bytes of a
                BigInteger object. Usually a BytearrayStream object.
                Required.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.
        """
        # Convert the value to binary and pad it as needed.
        arg_6 = "{0:b}".format(abs(arg_0.value))
        arg_6 = ("0" * (64 - (len(arg_6) % 64))) + arg_6

        # If the value is negative, convert via two's complement.
        if arg_0.value < 0:
            arg_6 = arg_6.replace('1', 'i')
            arg_6 = arg_6.replace('0', '1')
            arg_6 = arg_6.replace('i', '0')

            arg_7 = arg_6.rfind('0')
            arg_6 = arg_6[0:arg_7] + '1' + ('0' * len(arg_6[arg_7 + 1:]))

        # Convert each byte to hex and build the hex string for the value.
        arg_8 = b''
        for arg_9 in range(0, len(arg_6), 8):
            arg_10 = arg_6[arg_9:arg_9 + 8]
            arg_10 = int(arg_10, 2)
            arg_8 += struct.pack('!B', arg_10)

        arg_0.length = len(arg_8)
        super(BigInteger, arg_0).Func(arg_1, arg_2=arg_2)
        arg_1.Func(arg_8)

Write the encoding of the BigInteger to the output stream .


return _remove_extra_delims(expr, ldelim=ldelim, rdelim=rdelim)

def
Func
(
arg_0
,
arg_1
=
"("
,
arg_2
=
")"
)
:
arg_3
=
""
for
arg_4
in
_OP_PREC
:
if
isinstance
(
arg_4
,
list
)
:
for
arg_5
in
arg_4
:
arg_3
+=
arg_5
else
:
arg_3
+=
arg_4
arg_6
=
zip
(
[
arg_0
,
arg_1
,
arg_2
]
,
[
"expr"
,
"ldelim"
,
"rdelim"
]
)
for
arg_7
,
arg_8
in
arg_6
:
if
not
isinstance
(
arg_7
,
str
)
:
raise
RuntimeError
(
"Argument `{0}` is not valid"
.
format
(
arg_8
)
)
if
(
len
(
arg_1
)
!=
1
)
or
(
(
len
(
arg_1
)
==
1
)
and
(
arg_1
in
arg_3
)
)
:
raise
RuntimeError
(
"Argument `ldelim` is not valid"
)
if
(
len
(
arg_2
)
!=
1
)
or
(
(
len
(
arg_2
)
==
1
)
and
(
arg_2
in
arg_3
)
)
:
raise
RuntimeError
(
"Argument `rdelim` is not valid"
)
if
arg_0
.
count
(
arg_1
)
!=
arg_0
.
count
(
arg_2
)
:
raise
RuntimeError
(
"Mismatched delimiters"
)
if
not
arg_0
:
return
arg_0
arg_9
=
(
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
".0123456789"
r"_()[]\{\}"
+
arg_2
+
arg_1
+
arg_3
)
if
any
(
[
arg_7
not
in
arg_9
for
arg_7
in
arg_0
]
)
or
(
"__"
in
arg_0
)
:
raise
RuntimeError
(
"Argument `expr` is not valid"
)
arg_0
=
_remove_consecutive_delims
(
arg_0
,
arg_1
=
arg_1
,
arg_2
=
arg_2
)
arg_0
=
arg_0
.
replace
(
arg_1
+
arg_2
,
""
)
return
_Func
(
arg_0
,
arg_1
=
arg_1
,
arg_2
=
arg_2
)

def Func(arg_0, arg_1="(", arg_2=")"):
    r"""
    Remove unnecessary delimiters in mathematical expressions.

    Delimiters (parenthesis, brackets, etc.) may be removed either because
    there are multiple consecutive delimiters enclosing a single expressions or
    because the delimiters are implied by operator precedence rules. Function
    names must start with a letter and then can contain alphanumeric characters
    and a maximum of one underscore

    :param expr: Mathematical expression
    :type  expr: string

    :param ldelim: Single character left delimiter
    :type  ldelim: string

    :param rdelim: Single character right delimiter
    :type  rdelim: string

    :rtype: string

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

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

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

     * RuntimeError (Function name `*[function_name]*` is not valid)

     * RuntimeError (Mismatched delimiters)
    """
    arg_3 = ""
    for arg_4 in _OP_PREC:
        if isinstance(arg_4, list):
            for arg_5 in arg_4:
                arg_3 += arg_5
        else:
            arg_3 += arg_4
    arg_6 = zip([arg_0, arg_1, arg_2], ["expr", "ldelim", "rdelim"])
    for arg_7, arg_8 in arg_6:
        if not isinstance(arg_7, str):
            raise RuntimeError("Argument `{0}` is not valid".format(arg_8))
    if (len(arg_1) != 1) or ((len(arg_1) == 1) and (arg_1 in arg_3)):
        raise RuntimeError("Argument `ldelim` is not valid")
    if (len(arg_2) != 1) or ((len(arg_2) == 1) and (arg_2 in arg_3)):
        raise RuntimeError("Argument `rdelim` is not valid")
    if arg_0.count(arg_1) != arg_0.count(arg_2):
        raise RuntimeError("Mismatched delimiters")
    if not arg_0:
        return arg_0
    arg_9 = (
        "abcdefghijklmnopqrstuvwxyz"
        "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        ".0123456789"
        r"_()[]\{\}" + arg_2 + arg_1 + arg_3
    )
    if any([arg_7 not in arg_9 for arg_7 in arg_0]) or ("__" in arg_0):
        raise RuntimeError("Argument `expr` is not valid")
    arg_0 = _remove_consecutive_delims(arg_0, arg_1=arg_1, arg_2=arg_2)
    arg_0 = arg_0.replace(arg_1 + arg_2, "")
    return _Func(arg_0, arg_1=arg_1, arg_2=arg_2)

r Remove unnecessary delimiters in mathematical expressions .


def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_3 = arg_0 . path with arg_0 . cd ( newdir = arg_3 ) : if arg_2 : arg_4 = sp . run ( arg_1 , stdout = sp . PIPE , stderr = sp . PIPE ) else : arg_4 = sp . run ( arg_1 ) return arg_4

def Func(arg_0, arg_1, arg_2=True):
        """
        subprocess run on here
        """
        arg_3 = arg_0.path
        with arg_0.cd(newdir=arg_3):
            if arg_2:
                arg_4 = sp.run(arg_1, stdout=sp.PIPE, stderr=sp.PIPE)
            else:
                arg_4 = sp.run(arg_1)
            return arg_4


def
Func
(
arg_0
,
arg_1
)
:
for
arg_2
in
arg_1
:
arg_2
=
arg_2
.
strip
(
)
if
"driverState"
in
arg_2
:
arg_0
.
_driver_status
=
arg_2
.
split
(
' : '
)
[
1
]
.
replace
(
','
,
''
)
.
replace
(
'\"'
,
''
)
.
strip
(
)
arg_0
.
log
.
debug
(
"spark driver status log: {}"
.
format
(
arg_2
)
)

def Func(arg_0, arg_1):
        """
        parses the logs of the spark driver status query process

        :param itr: An iterator which iterates over the input of the subprocess
        """
        # Consume the iterator
        for arg_2 in arg_1:
            arg_2 = arg_2.strip()

            # Check if the log line is about the driver status and extract the status.
            if "driverState" in arg_2:
                arg_0._driver_status = arg_2.split(' : ')[1] \
                    .replace(',', '').replace('\"', '').strip()

            arg_0.log.debug("spark driver status log: {}".format(arg_2))


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _perform_request ( url = '/um/users/%s' % arg_1 , method = 'DELETE' ) return arg_2

def Func(arg_0, arg_1):
        """
        Removes a user.

        :param      user_id: The unique ID of the user.
        :type       user_id: ``str``

        """
        arg_2 = arg_0._perform_request(
            url='/um/users/%s' % arg_1,
            method='DELETE')

        return arg_2


def Func(arg_0, arg_1):
    """
    Make a function imported from module A appear as if it is located
    in module B.

    >>> from pprint import pprint
    >>> pprint.__module__
    'pprint'
    >>> pp = Func(pprint, __name__)
    >>> pp.__module__
    'nose.util'

    The original function is not modified.

    >>> pprint.__module__
    'pprint'

    Calling the transplanted function calls the original.

    >>> pp([1, 2])
    [1, 2]
    >>> pprint([1,2])
    [1, 2]

    """
    from nose.tools import make_decorator
    def arg_4(*arg_2, **arg_3):
        return arg_0(*arg_2, **arg_3)

    arg_4 = make_decorator(arg_0)(arg_4)
    arg_4.__module__ = arg_1
    return arg_4

Make a function imported from module A appear as if it is located
    in module B.

    >>> from pprint import pprint
    >>> pprint.__module__
    'pprint'
    >>> pp = transplant_func(pprint, __name__)
    >>> pp.__module__
    'nose.util'

    The original function is not modified.

    >>> pprint.__module__
    'pprint'

    Calling the transplanted function calls the original.

    >>> pp([1, 2])
    [1, 2]
    >>> pprint([1,2])
    [1, 2]

Make a function imported from module A appear as if it is located in module B .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = np . linalg . eigh ( arg_0 ) return arg_3 . dot ( np . diag ( np . maximum ( arg_2 , 0 ) ) . dot ( arg_3 . T ) )

def Func(arg_0, arg_1):
    """Projection onto the semidefinite cone"""
    arg_2, arg_3 = np.linalg.eigh(arg_0)
    return arg_3.dot(np.diag(np.maximum(arg_2, 0)).dot(arg_3.T))


Obtain a sequence of all instances in the metamodel.

def Func ( arg_0 ) : for arg_1 in arg_0 . metaclasses . values ( ) : for arg_2 in arg_1 . storage : yield arg_2

def Func(arg_0):
        '''
        Obtain a sequence of all Func in the metamodel.
        '''
        for arg_1 in arg_0.metaclasses.values():
            for arg_2 in arg_1.storage:
                yield arg_2

Obtain a sequence of all instances in the metamodel .


def Func(arg_0, arg_1, arg_2):
  """Logs an error for each line containing bad characters.

  Two kinds of bad characters:

  1. Unicode replacement characters: These indicate that either the file
  contained invalid UTF-8 (likely) or Unicode replacement characters (which
  it shouldn't).  Note that it's possible for this to throw off line
  numbering if the invalid UTF-8 occurred adjacent to a newline.

  2. NUL bytes.  These are problematic for some tools.

  Args:
    filename: The name of the current file.
    lines: An array of strings, each representing a line of the file.
    error: The function to call with any errors found.
  """
  for arg_3, arg_4 in enumerate(arg_1):
    if unicode_escape_decode('\ufffd') in arg_4:
      arg_2(arg_0, arg_3, 'readability/utf8', 5,
            'Line contains invalid UTF-8 (or Unicode replacement character).')
    if '\0' in arg_4:
      arg_2(arg_0, arg_3, 'readability/nul', 5, 'Line contains NUL byte.')

Logs an error for each line containing bad characters .


return PersistentIdentifier.get(pid.pid_type,
                                        pid.pid_value)

def Func ( arg_0 ) : Func = arg_0 . deposit_fetcher ( arg_0 . id , arg_0 ) return PersistentIdentifier . get ( Func . pid_type , Func . pid_value )

def Func(arg_0):
        """Return an instance of deposit PID."""
        Func = arg_0.deposit_fetcher(arg_0.id, arg_0)
        return PersistentIdentifier.get(Func.pid_type,
                                        Func.pid_value)


def Func(arg_0):
    """
    Check and correct the structure of the record.

    :param record: the record data structure
    :return: a list of errors found
    """
    arg_1 = []

    for arg_2 in arg_0.keys():
        arg_3 = '999'
        arg_4 = len(arg_2)

        if arg_4 > 3:
            arg_5 = arg_4 - 3
            while arg_5 > 0:
                arg_3 = '%s%s' % ('0', arg_3)
                arg_5 -= 1

        # Missing tag. Replace it with dummy tag '000'.
        if arg_2 == '!':
            arg_1.append((1, '(field number(s): ' +
                              str([arg_6[4] for arg_6 in arg_0[arg_2]]) + ')'))
            arg_0['000'] = arg_0.pop(arg_2)
            arg_2 = '000'
        elif not ('001' <= arg_2 <= arg_3 or
                  arg_2 in ('FMT', 'FFT', 'BDR', 'BDM')):
            arg_1.append(2)
            arg_0['000'] = arg_0.pop(arg_2)
            arg_2 = '000'

        arg_7 = []
        for arg_8 in arg_0[arg_2]:
            # Datafield without any subfield.
            if arg_8[0] == [] and arg_8[3] == '':
                arg_1.append((8, '(field number: ' + str(arg_8[4]) + ')'))

            arg_9 = []
            for arg_10 in arg_8[0]:
                if arg_10[0] == '!':
                    arg_1.append((3, '(field number: ' + str(arg_8[4]) + ')'))
                    arg_11 = ('', arg_10[1])
                else:
                    arg_11 = arg_10
                arg_9.append(arg_11)

            if arg_8[1] == '!':
                arg_1.append((4, '(field number: ' + str(arg_8[4]) + ')'))
                arg_12 = " "
            else:
                arg_12 = arg_8[1]

            if arg_8[2] == '!':
                arg_1.append((5, '(field number: ' + str(arg_8[4]) + ')'))
                arg_13 = " "
            else:
                arg_13 = arg_8[2]

            arg_7.append((arg_9, arg_12, arg_13, arg_8[3], arg_8[4]))

        arg_0[arg_2] = arg_7

    return arg_1

Check and correct the structure of the record .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
=
arg_0
.
_get_and_update_setting
(
arg_1
,
arg_2
=
)
if
arg_3
in
[
,
""
]
:
bot
.
exit
(
'You must export %s'
%
arg_1
)
return
arg_3

def Func(arg_0, arg_1, arg_2=None):
    '''a wrapper to get_and_update, but if not successful, will print an
       error and exit.
    '''
    arg_3 = arg_0._get_and_update_setting(arg_1, arg_2=None)
    if arg_3 in [None, ""]:
        bot.exit('You must export %s' % arg_1)
    return arg_3

a wrapper to get_and_update but if not successful will print an error and exit .


Asserts that val is a path and that it exists.

def Func(arg_0):
        """Asserts that val is a path and that it Func."""
        if not isinstance(arg_0.val, str_types):
            raise TypeError('val is not a path')
        if not os.path.Func(arg_0.val):
            arg_0._err('Expected <%s> to exist, but was not found.' % arg_0.val)
        return arg_0

Asserts that val is a path and that it exists .


(self, old_text, new_text, move_param_from_idx)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Find the step with old_text and change it to new_text.The step function
        parameters are also changed according to move_param_from_idx.
        Each entry in this list should specify parameter position from old.
        """
        arg_4 = []
        arg_5, arg_6 = arg_0._find_step_node(arg_1)
        if arg_5 is None:
            return arg_4
        arg_7 = arg_0._Func_text(arg_5, arg_1, arg_2)
        arg_4.append(arg_7)
        arg_8 = arg_6.children[2]
        arg_9 = arg_0._move_param_nodes(
            arg_8.children, arg_3)
        if arg_8.children is not arg_9:
            # Record original parameter list span excluding braces
            arg_10 = arg_0._span_from_pos(
                arg_8.children[0].end_pos,
                arg_8.children[-1].start_pos)
            arg_8.children = arg_9
            # Get code for moved paramters excluding braces
            arg_12 = ''.join(p.get_code() for p in arg_9[1:-1])
            arg_4.append((arg_10, arg_12))
        return arg_4

Find the step with old_text and change it to new_text . The step function parameters are also changed according to move_param_from_idx . Each entry in this list should specify parameter position from old .


def Func ( ) : arg_0 = 50 arg_1 = 5 arg_2 = 2 arg_3 = 1 arg_4 = 2 * ( arg_2 + 3 * arg_3 ) arg_5 = arg_2 / ( 1 + math . tan ( math . radians ( 180 / arg_1 ) ) / math . tan ( math . radians ( 90 / arg_1 ) ) ) arg_6 = arg_5 * math . tan ( math . radians ( 180 / arg_1 ) ) arg_7 = arg_6 / math . tan ( math . radians ( 90 / arg_1 ) ) arg_8 = mlx . FilterScript ( file_out = "shield.ply" ) mlx . create . annulus ( arg_8 , radius = arg_2 , cir_segments = arg_0 , color = 'blue' ) mlx . create . annulus ( arg_8 , radius1 = arg_2 + arg_3 , radius2 = arg_2 , cir_segments = arg_0 , color = 'red' ) mlx . create . annulus ( arg_8 , radius1 = arg_2 + 2 * arg_3 , radius2 = arg_2 + arg_3 , cir_segments = arg_0 , color = 'white' ) mlx . create . annulus ( arg_8 , radius1 = arg_2 + 3 * arg_3 , radius2 = arg_2 + 2 * arg_3 , cir_segments = arg_0 , color = 'red' ) mlx . layers . join ( arg_8 ) mlx . subdivide . midpoint ( arg_8 , iterations = 2 ) mlx . create . annulus ( arg_8 , radius1 = arg_2 + 3 * arg_3 , cir_segments = arg_0 , color = 'silver' ) mlx . transform . rotate ( arg_8 , axis = 'y' , angle = 180 ) mlx . transform . translate ( arg_8 , value = [ 0 , 0 , - 0.005 ] ) mlx . subdivide . midpoint ( arg_8 , iterations = 4 ) mlx . create . grid ( arg_8 , size = math . sqrt ( 2 ) , x_segments = 10 , y_segments = 10 , center = True , color = 'white' ) mlx . transform . rotate ( arg_8 , axis = 'z' , angle = 45 ) mlx . transform . scale ( arg_8 , value = [ arg_6 , arg_7 , 1 ] ) mlx . transform . translate ( arg_8 , value = [ 0 , arg_5 , 0.001 ] ) for arg_9 in range ( 1 , arg_1 ) : mlx . layers . duplicate ( arg_8 ) mlx . transform . rotate ( arg_8 , axis = 'z' , angle = 360 / arg_1 ) mlx . layers . join ( arg_8 ) mlx . transform . vert_function ( arg_8 , z_func = 'sqrt(%s-x^2-y^2)-%s+z' % ( arg_4 ** 2 , arg_4 ) ) arg_8 . run_script ( ) return None

def Func():
    """Run Func script"""
    # segments = number of segments to use for circles
    arg_0 = 50
    # star_points = number of points (or sides) of the star
    arg_1 = 5
    # star_radius = radius of circle circumscribing the star
    arg_2 = 2
    # ring_thickness = thickness of the colored rings
    arg_3 = 1
    # sphere_radius = radius of sphere the shield will be deformed to
    arg_4 = 2 * (arg_2 + 3 * arg_3)

    # Star calculations:
    # Visually approximate a star by using multiple diamonds (i.e. scaled
    # squares) which overlap in the center. For the star calculations,
    # consider a central polygon with triangles attached to the edges, all
    # circumscribed by a circle.
    # polygon_radius = distance from center of circle to polygon edge midpoint
    arg_5 = arg_2 / \
        (1 + math.tan(math.radians(180 / arg_1)) /
         math.tan(math.radians(90 / arg_1)))
    # width = 1/2 width of polygon edge/outer triangle bottom
    arg_6 = arg_5 * math.tan(math.radians(180 / arg_1))
    # height = height of outer triangle
    arg_7 = arg_6 / math.tan(math.radians(90 / arg_1))

    arg_8 = mlx.FilterScript(file_out="shield.ply")

    # Create the colored front of the shield using several concentric
    # annuluses; combine them together and subdivide so we have more vertices
    # to give a smoother deformation later.
    mlx.create.annulus(arg_8, radius=arg_2, cir_segments=arg_0, color='blue')
    mlx.create.annulus(arg_8,
        radius1=arg_2 + arg_3,
        radius2=arg_2,
        cir_segments=arg_0,
        color='red')
    mlx.create.annulus(arg_8,
        radius1=arg_2 + 2 * arg_3,
        radius2=arg_2 + arg_3,
        cir_segments=arg_0,
        color='white')
    mlx.create.annulus(arg_8,
        radius1=arg_2 + 3 * arg_3,
        radius2=arg_2 + 2 * arg_3,
        cir_segments=arg_0,
        color='red')
    mlx.layers.join(arg_8)
    mlx.subdivide.midpoint(arg_8, iterations=2)

    # Create the inside surface of the shield & translate down slightly so it
    # doesn't overlap the front.
    mlx.create.annulus(arg_8,
        radius1=arg_2 + 3 * arg_3,
        cir_segments=arg_0,
        color='silver')
    mlx.transform.rotate(arg_8, axis='y', angle=180)
    mlx.transform.translate(arg_8, value=[0, 0, -0.005])
    mlx.subdivide.midpoint(arg_8, iterations=4)

    # Create a diamond for the center star. First create a plane, specifying
    # extra vertices to support the final deformation. The length from the
    # center of the plane to the corners should be 1 for ease of scaling, so
    # we use a side length of sqrt(2) (thanks Pythagoras!). Rotate the plane
    # by 45 degrees and scale it to stretch it out per the calculations above,
    # then translate it into place (including moving it up in z slightly so
    # that it doesn't overlap the shield front).
    mlx.create.grid(arg_8,
        size=math.sqrt(2),
        x_segments=10,
        y_segments=10,
        center=True,
        color='white')
    mlx.transform.rotate(arg_8, axis='z', angle=45)
    mlx.transform.scale(arg_8, value=[arg_6, arg_7, 1])
    mlx.transform.translate(arg_8, value=[0, arg_5, 0.001])

    # Duplicate the diamond and rotate the duplicates around, generating the
    # star.
    for arg_9 in range(1, arg_1):
        mlx.layers.duplicate(arg_8)
        mlx.transform.rotate(arg_8, axis='z', angle=360 / arg_1)

    # Combine everything together and deform using a spherical function.
    mlx.layers.join(arg_8)
    mlx.transform.vert_function(arg_8,
        z_func='sqrt(%s-x^2-y^2)-%s+z' %
        (arg_4**2, arg_4))

    # Run the script using meshlabserver and generate the model
    arg_8.run_script()
    return None


(name=None, email=None, affiliation=None, url=None)

def Func ( arg_0 = None , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_4 = NotebookNode ( ) if arg_0 is not None : arg_4 . name = unicode ( arg_0 ) if arg_1 is not None : arg_4 . email = unicode ( arg_1 ) if arg_2 is not None : arg_4 . affiliation = unicode ( arg_2 ) if arg_3 is not None : arg_4 . url = unicode ( arg_3 ) return arg_4

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=None):
    """Create a new author."""
    arg_4 = NotebookNode()
    if arg_0 is not None:
        arg_4.name = unicode(arg_0)
    if arg_1 is not None:
        arg_4.email = unicode(arg_1)
    if arg_2 is not None:
        arg_4.affiliation = unicode(arg_2)
    if arg_3 is not None:
        arg_4.url = unicode(arg_3)
    return arg_4


def Func ( arg_0 ) : arg_1 = '' if arg_0 . _url_parameters is not None : arg_1 = '?' + urllib . urlencode ( arg_0 . _url_parameters ) return arg_1

def Func(arg_0):
        """
        Encode URL parameters
        """
        arg_1 = ''
        if arg_0._url_parameters is not None:
            arg_1 = '?' + urllib.urlencode(arg_0._url_parameters)
        return arg_1


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 , arg_5 in enumerate ( arg_0 ) : if len ( arg_3 ) < arg_1 : arg_3 . append ( arg_5 / np . linalg . norm ( arg_5 ) ) continue arg_6 = arg_2 . randint ( arg_4 + 1 ) if arg_6 < arg_1 : arg_3 [ arg_6 ] = arg_5 / np . linalg . norm ( arg_5 ) arg_7 = len ( arg_3 ) arg_8 = np . std ( arg_3 , axis = 0 ) while len ( arg_3 ) < arg_1 : arg_5 = arg_3 [ arg_2 . randint ( arg_7 ) ] arg_3 . append ( arg_5 + arg_8 * arg_2 . randn ( * arg_5 . shape ) ) return np . array ( arg_3 , dtype = arg_3 [ 0 ] . dtype )

def Func(arg_0, arg_1, arg_2):
        '''Select a random sample of n items from xs.'''
        arg_3 = []
        for arg_4, arg_5 in enumerate(arg_0):
            if len(arg_3) < arg_1:
                arg_3.append(arg_5 / np.linalg.norm(arg_5))
                continue
            arg_6 = arg_2.randint(arg_4 + 1)
            if arg_6 < arg_1:
                arg_3[arg_6] = arg_5 / np.linalg.norm(arg_5)
        # if the pool still has fewer than n items, pad with distorted random
        # duplicates from the source data.
        arg_7 = len(arg_3)
        arg_8 = np.std(arg_3, axis=0)
        while len(arg_3) < arg_1:
            arg_5 = arg_3[arg_2.randint(arg_7)]
            arg_3.append(arg_5 + arg_8 * arg_2.randn(*arg_5.shape))
        return np.array(arg_3, dtype=arg_3[0].dtype)

Select a random sample of n items from xs .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_0 : if arg_3 . get ( "milestone" ) : if arg_3 [ "milestone" ] [ "title" ] == arg_1 : arg_4 = copy . deepcopy ( arg_3 ) arg_2 . append ( arg_4 ) return arg_2

def Func(arg_0, arg_1):
        """
        Add all issues, that should be in that tag, according to milestone.

        :param list(dict) all_issues: All issues.
        :param str tag_name: Name (title) of tag.
        :rtype: List[dict]
        :return: Issues filtered by milestone.
        """

        arg_2 = []
        for arg_3 in arg_0:
            if arg_3.get("milestone"):
                if arg_3["milestone"]["title"] == arg_1:
                    arg_4 = copy.deepcopy(arg_3)
                    arg_2.append(arg_4)
        return arg_2

Add all issues that should be in that tag according to milestone .


return resp.get('courses', {}).get(course_id, False)

def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = str ( CourseKey . from_string ( arg_2 ) ) except InvalidKeyError : arg_3 = None arg_4 = arg_0 . client . catalogs ( arg_1 ) . contains if arg_3 : arg_5 = arg_4 . get ( arg_3 = arg_3 ) else : arg_5 = arg_4 . get ( arg_2 = arg_2 ) return arg_5 . get ( 'courses' , { } ) . get ( arg_2 , False )

def Func(arg_0, arg_1, arg_2):
        """
        Determine if the given course or course run ID is contained in the catalog with the given ID.

        Args:
            catalog_id (int): The ID of the catalog
            course_id (str): The ID of the course or course run

        Returns:
            bool: Whether the course or course run is contained in the given catalog
        """
        try:
            # Determine if we have a course run ID, rather than a plain course ID
            arg_3 = str(CourseKey.from_string(arg_2))
        except InvalidKeyError:
            arg_3 = None

        arg_4 = arg_0.client.catalogs(arg_1).contains

        if arg_3:
            arg_5 = arg_4.get(arg_3=arg_3)
        else:
            arg_5 = arg_4.get(arg_2=arg_2)

        return arg_5.get('courses', {}).get(arg_2, False)

Determine if the given course or course run ID is contained in the catalog with the given ID .


Run a command and return its stripped captured output.

def
Func
(
arg_0
,
**
arg_1
)
:
arg_1
=
arg_1
.
copy
(
)
arg_1
[
'hide'
]
=
'out'
if
not
arg_1
.
get
(
'echo'
,
False
)
:
arg_1
[
'echo'
]
=
False
arg_2
=
arg_1
.
pop
(
'ignore_failures'
,
False
)
try
:
return
invoke_run
(
arg_0
,
**
arg_1
)
.
stdout
.
strip
(
)
except
exceptions
.
Failure
as
exc
:
if
not
arg_2
:
notify
.
error
(
"Command `{}` failed with RC={}!"
.
format
(
arg_0
,
exc
.
result
.
return_code
,
)
)
raise

def Func(arg_0, **arg_1):
    """Run a command and return its stripped Funcd output."""
    arg_1 = arg_1.copy()
    arg_1['hide'] = 'out'
    if not arg_1.get('echo', False):
        arg_1['echo'] = False
    arg_2 = arg_1.pop('ignore_failures', False)
    try:
        return invoke_run(arg_0, **arg_1).stdout.strip()
    except exceptions.Failure as exc:
        if not arg_2:
            notify.error("Command `{}` failed with RC={}!".format(arg_0, exc.result.return_code,))
            raise

Run a command and return its stripped captured output .


def Func(arg_0, arg_1, arg_2=False):
        """
        Read `nbytes` from the stack, increment the stack pointer, and return
        data.

        :param int nbytes: How many bytes to read
        :param force: whether to ignore memory permissions
        :return: Data read from the stack
        """
        arg_3 = arg_0.read_bytes(arg_0.STACK, arg_1, arg_2=arg_2)
        arg_0.STACK += arg_1
        return arg_3

Read nbytes from the stack increment the stack pointer and return data .


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

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = InvoiceController . for_id_or_404 ( arg_1 ) if not arg_3 . can_view ( user = arg_0 . user , arg_2 = arg_2 , ) : raise Http404 ( ) arg_4 = { "Func" : arg_3 . Func , } return render ( arg_0 , "registrasion/Func.html" , arg_4 )

def Func(arg_0, arg_1, arg_2=None):
    ''' Displays an Func.

    This view is not authenticated, but it will only allow access to either:
    the user the Func belongs to; staff; or a request made with the correct
    access code.

    Arguments:

        Func_id (castable to int): The Func_id for the Func you want
            to view.

        access_code (Optional[str]): The access code for the user who owns
            this Func.

    Returns:
        render:
            Renders ``registrasion/Func.html``, with the following
            data::

                {
                    "Func": models.commerce.Invoice(),
                }

    Raises:
        Http404: if the current user cannot view this Func and the correct
            access_code is not provided.

    '''

    arg_3 = InvoiceController.for_id_or_404(arg_1)

    if not arg_3.can_view(
            user=arg_0.user,
            arg_2=arg_2,
            ):
        raise Http404()

    arg_4 = {
        "Func": arg_3.Func,
    }

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

Displays an invoice.

    This view is not authenticated, but it will only allow access to either:
    the user the invoice belongs to; staff; or a request made with the correct
    access code.

    Arguments:

        invoice_id (castable to int): The invoice_id for the invoice you want
            to view.

        access_code (Optional[str]): The access code for the user who owns
            this invoice.

    Returns:
        render:
            Renders ``registrasion/invoice.html``, with the following
            data::

                {
                    "invoice": models.commerce.Invoice(),
                }

    Raises:
        Http404: if the current user cannot view this invoice and the correct
            access_code is not provided.


def Func ( arg_0 ) : arg_1 = arg_0 . nodes . keys ( ) for arg_2 in arg_0 . node_ids : if arg_2 not in arg_1 : yield arg_2

def Func(arg_0):
        """Get a list of nodes not found in OSM data."""
        arg_1 = arg_0.nodes.keys()
        for arg_2 in arg_0.node_ids:
            if arg_2 not in arg_1:
                yield arg_2

Get a list of nodes not found in OSM data .


def Func(arg_0):
        """
        Use multiple processes to parse and generate tasks for the
        DAGs in parallel. By processing them in separate processes,
        we can get parallelism and isolation from potentially harmful
        user code.
        """

        arg_0.log.info("Processing files using up to %s processes at a time ", arg_0._parallelism)
        arg_0.log.info("Process each file at most once every %s seconds", arg_0._file_process_interval)
        arg_0.log.info(
            "Checking for new files in %s every %s seconds", arg_0._dag_directory, arg_0.dag_dir_list_interval
        )

        if arg_0._async_mode:
            arg_0.log.debug("Starting DagFileProcessorManager in async mode")
            arg_0.Func_in_async()
        else:
            arg_0.log.debug("Starting DagFileProcessorManager in sync mode")
            arg_0.Func_in_sync()

Use multiple processes to parse and generate tasks for the DAGs in parallel . By processing them in separate processes we can get parallelism and isolation from potentially harmful user code .


def Func ( ) -> bool : if sys . stdout : sys . stdout . flush ( ) bool ( ctypes . windll . kernel32 . SetConsoleTextAttribute ( _ConsoleOutputHandle , _DefaultConsoleColor ) )

def Func() -> bool:
    """
    Reset to the default text color on console window.
    Return bool, True if succeed otherwise False.
    """
    if sys.stdout:
        sys.stdout.flush()
    bool(ctypes.windll.kernel32.SetConsoleTextAttribute(_ConsoleOutputHandle, _DefaultConsoleColor))

Reset to the default text color on console window . Return bool True if succeed otherwise False .


def Func ( arg_0 ) : arg_0 . _output . write ( '\r' ) arg_1 = 'avg' arg_2 = { } for arg_3 , arg_4 in arg_0 . _latencies_by_method . items ( ) : arg_5 = { } arg_5 [ 'count' ] = len ( arg_4 ) arg_5 [ 'avg' ] = sum ( arg_4 ) / len ( arg_4 ) arg_5 [ 'min' ] = min ( arg_4 ) arg_5 [ 'max' ] = max ( arg_4 ) arg_4 = sorted ( arg_4 ) arg_5 [ 'p90' ] = percentile ( arg_4 , 0.90 ) arg_5 [ 'p95' ] = percentile ( arg_4 , 0.95 ) arg_5 [ 'p99' ] = percentile ( arg_4 , 0.99 ) arg_5 [ 'p999' ] = percentile ( arg_4 , 0.999 ) arg_2 [ arg_3 ] = arg_5 arg_6 = [ 'method' , 'count' , 'avg' , 'min' , 'max' , 'p90' , 'p95' , 'p99' , 'p999' ] arg_7 = [ ] arg_2 = sorted ( arg_2 . items ( ) , arg_3 = lambda it : it [ 1 ] [ arg_1 ] , reverse = True ) def row ( arg_3 , arg_8 ) : arg_7 = [ arg_3 ] + [ arg_8 [ header ] for header in arg_6 [ 1 : ] ] return tuple ( arg_7 ) arg_7 = [ row ( arg_3 , arg_5 ) for arg_3 , arg_5 in arg_2 ] arg_0 . _output . write ( '%s\n' % tabulate ( arg_7 , arg_6 = arg_6 ) ) arg_0 . _output . flush ( )

def Func(arg_0):
        """ get stats & show them """
        arg_0._output.write('\r')

        arg_1 = 'avg'
        arg_2 = {}
        for arg_3, arg_4 in arg_0._latencies_by_method.items():
            arg_5 = {}
            arg_5['count'] = len(arg_4)
            arg_5['avg'] = sum(arg_4) / len(arg_4)
            arg_5['min'] = min(arg_4)
            arg_5['max'] = max(arg_4)
            arg_4 = sorted(arg_4)
            arg_5['p90'] = percentile(arg_4, 0.90)
            arg_5['p95'] = percentile(arg_4, 0.95)
            arg_5['p99'] = percentile(arg_4, 0.99)
            arg_5['p999'] = percentile(arg_4, 0.999)
            arg_2[arg_3] = arg_5

        arg_6 = ['method', 'count', 'avg', 'min', 'max', 'p90', 'p95', 'p99', 'p999']
        arg_7 = []
        arg_2 = sorted(arg_2.items(), arg_3=lambda it: it[1][arg_1], reverse=True)

        def row(arg_3, arg_8):
            arg_7 = [arg_3] + [arg_8[header] for header in arg_6[1:]]
            return tuple(arg_7)

        arg_7 = [row(arg_3, arg_5) for arg_3, arg_5 in arg_2]

        arg_0._output.write('%s\n' % tabulate(arg_7, arg_6=arg_6))
        arg_0._output.flush()


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . values ( ) : arg_3 = arg_2 . formula . parameters for arg_4 in range ( min ( len ( arg_1 ) , len ( arg_3 ) ) ) : if arg_3 [ arg_4 ] != arg_1 [ arg_4 ] : return None for arg_4 in range ( len ( arg_1 ) , len ( arg_3 ) ) : arg_1 . append ( arg_3 [ arg_4 ] ) return arg_1

def Func(arg_0):
    """Return parameter names if the parameters are shareable among cells.

    Parameters are shareable among multiple cells when all the cells
    have the parameters in the same order if they ever have any.

    For example, if cells are foo(), bar(x), baz(x, y), then
    ('x', 'y') are shareable parameters amounts them, as 'x' and 'y'
    appear in the same order in the parameter list if they ever appear.

    Args:
        cells: An iterator yielding cells.

    Returns:
        None if parameters are not share,
        tuple of shareable parameter names,
        () if cells are all scalars.
    """
    arg_1 = []
    for arg_2 in arg_0.values():
        arg_3 = arg_2.formula.parameters

        for arg_4 in range(min(len(arg_1), len(arg_3))):
            if arg_3[arg_4] != arg_1[arg_4]:
                return None

        for arg_4 in range(len(arg_1), len(arg_3)):
            arg_1.append(arg_3[arg_4])

    return arg_1

Return parameter names if the parameters are shareable among cells .


return re.sub(r'{{{}\:(?P<option>[^}}]*)}}'.format(option),
                      '\g<option>' if active else '', cmd)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : return re . sub ( r'{{{}\:(?P<option>[^}}]*)}}' . format ( arg_2 ) , '\g<option>' if arg_3 else '' , arg_1 )

def Func(arg_0, arg_1, arg_2, arg_3=True):
        """Apply a command-line option."""
        return re.sub(r'{{{}\:(?P<option>[^}}]*)}}'.format(arg_2),
                      '\g<option>' if arg_3 else '', arg_1)


return self.new_with_array(array=array_util.extracted_array_2d_from_array_2d_and_coordinates(
            array_2d=self,  y0=mask.zoom_region[0]-buffer, y1=mask.zoom_region[1]+buffer,
            x0=mask.zoom_region[2]-buffer, x1=mask.zoom_region[3]+buffer))

def Func(arg_0, arg_1, arg_2=1):
        """Extract the 2D region of an array corresponding to the rectangle encompassing all unmasked values.

        This is used to extract and visualize only the region of an image that is used in an analysis.

        Parameters
        ----------
        mask : mask.Mask
            The mask around which the scaled array is extracted.
        buffer : int
            The buffer of pixels around the extraction.
        """
        return arg_0.new_with_array(array=array_util.extracted_array_2d_from_array_2d_and_coordinates(
            array_2d=arg_0,  y0=arg_1.zoom_region[0]-arg_2, y1=arg_1.zoom_region[1]+arg_2,
            x0=arg_1.zoom_region[2]-arg_2, x1=arg_1.zoom_region[3]+arg_2))

Extract the 2D region of an array corresponding to the rectangle encompassing all unmasked values .


extend list by appending elements from the iterable

def
Func
(
arg_0
,
arg_1
)
:
if
not
hasattr
(
arg_0
,
"_dict"
)
or
arg_0
.
_dict
is
:
arg_0
.
_dict
=
{
}
arg_2
=
arg_0
.
_dict
arg_3
=
len
(
arg_0
)
list
.
Func
(
arg_0
,
arg_1
)
for
arg_4
,
arg_5
in
enumerate
(
islice
(
arg_0
,
arg_3
,
)
,
arg_3
)
:
arg_6
=
arg_5
.
id
if
arg_6
not
in
arg_2
:
arg_2
[
arg_6
]
=
arg_4
else
:
arg_0
=
arg_0
[
:
arg_3
]
arg_0
.
_check
(
arg_6
)
raise
ValueError
(
"id '%s' at index %d is non-unique. "
"Is it present twice?"
%
(
str
(
arg_6
)
,
arg_4
)
)

def Func(arg_0, arg_1):
        """Func list by appending elements from the iterable"""
        # Sometimes during initialization from an older pickle, _dict
        # will not have initialized yet, because the initialization class was
        # left unspecified. This is an issue because unpickling calls
        # DictList.Func, which requires the presence of _dict. Therefore,
        # the issue is caught and addressed here.
        if not hasattr(arg_0, "_dict") or arg_0._dict is None:
            arg_0._dict = {}
        arg_2 = arg_0._dict
        arg_3 = len(arg_0)
        list.Func(arg_0, arg_1)
        for arg_4, arg_5 in enumerate(islice(arg_0, arg_3, None),
                                arg_3):
            arg_6 = arg_5.id
            if arg_6 not in arg_2:
                arg_2[arg_6] = arg_4
            else:
                # undo the Func and raise an error
                arg_0 = arg_0[:arg_3]
                arg_0._check(arg_6)
                # if the above succeeded, then the id must be present
                # twice in the list being added
                raise ValueError("id '%s' at index %d is non-unique. "
                                 "Is it present twice?" % (str(arg_6), arg_4))


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
.
split
(
','
)
:
arg_2
=
arg_1
.
split
(
'-'
)
if
len
(
arg_2
)
==
1
:
yield
int
(
arg_2
[
0
]
)
elif
len
(
arg_2
)
==
2
:
arg_3
,
arg_4
=
list
(
map
(
int
,
arg_2
)
)
for
arg_5
in
range
(
arg_3
,
arg_4
+
1
)
:
yield
arg_5
else
:
raise
ValueError
(
'format error in %s'
%
arg_1
)

def Func(arg_0):
    """Yield each integer from a complex range string like "1-9,12,15-20,23"

    >>> list(Func('1-9,12,15-20,23'))
    [1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 23]

    >>> list(Func('1-9,12,15-20,2-3-4'))
    Traceback (most recent call last):
        ...
    ValueError: format error in 2-3-4
    """
    for arg_1 in arg_0.split(','):
        arg_2 = arg_1.split('-')
        if len(arg_2) == 1: # a number
            yield int(arg_2[0])
        elif len(arg_2) == 2: # a range inclusive
            arg_3, arg_4 = list(map(int, arg_2))
            for arg_5 in range(arg_3, arg_4+1):
                yield arg_5
        else: # more than one hyphen
            raise ValueError('format error in %s' % arg_1)

Yield each integer from a complex range string like "1-9,12,15-20,23"

    >>> list(parse_address_list('1-9,12,15-20,23'))
    [1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 23]

    >>> list(parse_address_list('1-9,12,15-20,2-3-4'))
    Traceback (most recent call last):
        ...
    ValueError: format error in 2-3-4


(self,
                     connection_certificate=None,
                     connection_info=None,
                     request_credentials=None)

def Func(arg_0,
                     arg_1=None,
                     arg_2=None,
                     arg_3=None):
        """
        Query the configured SLUGS service with the provided credentials.

        Args:
            connection_certificate (cryptography.x509.Certificate): An X.509
                certificate object obtained from the connection being
                Funcd. Required for SLUGS authentication.
            connection_info (tuple): A tuple of information pertaining to the
                connection being Funcd, including the source IP address
                and a timestamp (e.g., ('127.0.0.1', 1519759267.467451)).
                Optional, defaults to None. Ignored for SLUGS authentication.
            request_credentials (list): A list of KMIP Credential structures
                containing credential information to use for authentication.
                Optional, defaults to None. Ignored for SLUGS authentication.
        """
        if (arg_0.users_url is None) or (arg_0.groups_url is None):
            raise exceptions.ConfigurationError(
                "The SLUGS URL must be specified."
            )

        arg_4 = utils.get_client_identity_from_certificate(
            arg_1
        )

        try:
            arg_5 = requests.get(arg_0.users_url.format(arg_4))
        except Exception:
            raise exceptions.ConfigurationError(
                "A connection could not be established using the SLUGS URL."
            )
        if arg_5.status_code == 404:
            raise exceptions.PermissionDenied(
                "Unrecognized user ID: {}".format(arg_4)
            )

        arg_5 = requests.get(arg_0.groups_url.format(arg_4))
        if arg_5.status_code == 404:
            raise exceptions.PermissionDenied(
                "Group information could not be retrieved for user ID: "
                "{}".format(arg_4)
            )

        return arg_4, arg_5.json().get('groups')

Query the configured SLUGS service with the provided credentials.

        Args:
            connection_certificate (cryptography.x509.Certificate): An X.509
                certificate object obtained from the connection being
                authenticated. Required for SLUGS authentication.
            connection_info (tuple): A tuple of information pertaining to the
                connection being authenticated, including the source IP address
                and a timestamp (e.g., ('127.0.0.1', 1519759267.467451)).
                Optional, defaults to None. Ignored for SLUGS authentication.
            request_credentials (list): A list of KMIP Credential structures
                containing credential information to use for authentication.
                Optional, defaults to None. Ignored for SLUGS authentication.

Query the configured SLUGS service with the provided credentials .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = Func . Func ( arg_0 ) if arg_1 is not None : arg_3 . keypoints = arg_1 if arg_2 is not None : arg_3 . shape = arg_2 return arg_3

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Create a shallow Func of the KeypointsOnImage object.

        Parameters
        ----------
        keypoints : None or list of imgaug.Keypoint, optional
            List of keypoints on the image. If ``None``, the instance's
            keypoints will be copied.

        shape : tuple of int, optional
            The shape of the image on which the keypoints are placed.
            If ``None``, the instance's shape will be copied.

        Returns
        -------
        imgaug.KeypointsOnImage
            Shallow Func.

        """
        arg_3 = Func.Func(arg_0)
        if arg_1 is not None:
            arg_3.keypoints = arg_1
        if arg_2 is not None:
            arg_3.shape = arg_2
        return arg_3

Create a shallow copy of the KeypointsOnImage object.

        Parameters
        ----------
        keypoints : None or list of imgaug.Keypoint, optional
            List of keypoints on the image. If ``None``, the instance's
            keypoints will be copied.

        shape : tuple of int, optional
            The shape of the image on which the keypoints are placed.
            If ``None``, the instance's shape will be copied.

        Returns
        -------
        imgaug.KeypointsOnImage
            Shallow copy.

Create a shallow copy of the KeypointsOnImage object .


(name, docstring, remove_methods, base=SlackApi)

return type(name, (base,), dict(API_METHODS=methods, __doc__=docstring))

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = arg_4 ) : arg_5 = deepcopy ( arg_3 . API_METHODS ) for arg_6 , arg_7 in arg_2 . items ( ) : if arg_7 is ALL : del arg_5 [ arg_6 ] else : for arg_8 in arg_7 : del arg_5 [ arg_6 ] [ arg_8 ] return type ( arg_0 , ( arg_3 , ) , dict ( API_METHODS = arg_5 , __doc__ = arg_1 ) )

def Func(arg_0, arg_1, arg_2, arg_3=arg_4):
    """Create an API subclass with fewer methods than its base class.

    Arguments:
      name (:py:class:`str`): The name of the new class.
      docstring (:py:class:`str`): The docstring for the new class.
      remove_methods (:py:class:`dict`): The methods to remove from
        the base class's :py:attr:`API_METHODS` for the subclass. The
        key is the name of the root method (e.g. ``'auth'`` for
        ``'auth.test'``, the value is either a tuple of child method
        names (e.g. ``('test',)``) or, if all children should be
        removed, the special value :py:const:`ALL`.
      base (:py:class:`type`, optional): The base class (defaults to
        :py:class:`SlackApi`).

    Returns:
      :py:class:`type`: The new subclass.

    Raises:
      :py:class:`KeyError`: If the method wasn't in the superclass.

    """
    arg_5 = deepcopy(arg_3.API_METHODS)
    for arg_6, arg_7 in arg_2.items():
        if arg_7 is ALL:
            del arg_5[arg_6]
        else:
            for arg_8 in arg_7:
                del arg_5[arg_6][arg_8]
    return type(arg_0, (arg_3,), dict(API_METHODS=arg_5, __doc__=arg_1))

Create an API subclass with fewer methods than its base class .


(loop_fn,
               initial_state,
               elems,
               trace_fn,
               parallel_iterations=10,
               name=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = 10 , arg_5 = None ) : with tf . compat . v1 . name_scope ( arg_5 , 'Func' , [ arg_1 , arg_2 ] ) , tf . compat . v1 . variable_scope ( tf . compat . v1 . get_variable_scope ( ) ) as vs : if vs . caching_device is None and not tf . executing_eagerly ( ) : vs . set_caching_device ( lambda op : op . device ) arg_1 = tf . nest . map_structure ( lambda arg_15 : tf . convert_to_tensor ( value = arg_15 , arg_5 = 'initial_state' ) , arg_1 ) arg_2 = tf . convert_to_tensor ( value = arg_2 , arg_5 = 'elems' ) arg_6 = arg_2 . shape [ 0 ] if tf . compat . dimension_value ( arg_6 ) is None : arg_7 = tf . shape ( input = arg_2 ) [ 0 ] else : arg_7 = tf . convert_to_tensor ( value = arg_6 , dtype = tf . int32 , arg_5 = 'length' ) arg_8 = tf . TensorArray ( arg_2 . dtype , size = arg_7 , element_shape = arg_2 . shape [ 1 : ] ) arg_8 = arg_8 . unstack ( arg_2 ) arg_9 = tf . nest . map_structure ( lambda arg_15 : tf . TensorArray ( arg_15 . dtype , size = arg_7 , element_shape = arg_15 . shape ) , arg_3 ( arg_1 ) ) def _body ( arg_10 , arg_11 , arg_9 ) : arg_11 = arg_0 ( arg_11 , arg_8 . read ( arg_10 ) ) arg_9 = tf . nest . pack_sequence_as ( arg_9 , [ a . write ( arg_10 , v ) for a , v in zip ( tf . nest . flatten ( arg_9 ) , tf . nest . flatten ( arg_3 ( arg_11 ) ) ) ] ) return arg_10 + 1 , arg_11 , arg_9 arg_12 , arg_13 , arg_9 = tf . while_loop ( cond = lambda arg_10 , * args : arg_10 < arg_7 , body = _body , loop_vars = ( 0 , arg_1 , arg_9 ) , arg_4 = arg_4 ) arg_14 = tf . nest . map_structure ( lambda arg_15 : arg_15 . stack ( ) , arg_9 ) def _merge_static_length ( arg_15 ) : arg_15 . set_shape ( tf . TensorShape ( arg_6 ) . concatenate ( arg_15 . shape [ 1 : ] ) ) return arg_15 arg_14 = tf . nest . map_structure ( _merge_static_length , arg_14 ) return arg_13 , arg_14

def Func(arg_0,
               arg_1,
               arg_2,
               arg_3,
               arg_4=10,
               arg_5=None):
  """A simplified version of `tf.scan` that has configurable tracing.

  This function repeatedly calls `loop_fn(state, elem)`, where `state` is the
  `initial_state` during the first iteration, and the return value of `loop_fn`
  for every iteration thereafter. `elem` is a slice of `elements` along the
  first dimension, accessed in order. Additionally, it calls `trace_fn` on the
  return value of `loop_fn`. The `Tensor`s in return values of `trace_fn` are
  stacked and returned from this function, such that the first dimension of
  those `Tensor`s matches the size of `elems`.

  Args:
    loop_fn: A callable that takes in a `Tensor` or a nested collection of
      `Tensor`s with the same structure as `initial_state`, a slice of `elems`
      and returns the same structure as `initial_state`.
    initial_state: A `Tensor` or a nested collection of `Tensor`s passed to
      `loop_fn` in the first iteration.
    elems: A `Tensor` that is split along the first dimension and each element
      of which is passed to `loop_fn`.
    trace_fn: A callable that takes in the return value of `loop_fn` and returns
      a `Tensor` or a nested collection of `Tensor`s.
    parallel_iterations: Passed to the internal `tf.while_loop`.
    name: Name scope used in this function. Default: 'Func'.

  Returns:
    final_state: The final return value of `loop_fn`.
    trace: The same structure as the return value of `trace_fn`, but with each
      `Tensor` being a stack of the corresponding `Tensors` in the return value
      of `trace_fn` for each slice of `elems`.
  """
  with tf.compat.v1.name_scope(
      arg_5, 'Func', [arg_1, arg_2]), tf.compat.v1.variable_scope(
          tf.compat.v1.get_variable_scope()) as vs:
    if vs.caching_device is None and not tf.executing_eagerly():
      vs.set_caching_device(lambda op: op.device)

    arg_1 = tf.nest.map_structure(
        lambda arg_15: tf.convert_to_tensor(value=arg_15, arg_5='initial_state'),
        arg_1)
    arg_2 = tf.convert_to_tensor(value=arg_2, arg_5='elems')

    arg_6 = arg_2.shape[0]
    if tf.compat.dimension_value(arg_6) is None:
      arg_7 = tf.shape(input=arg_2)[0]
    else:
      arg_7 = tf.convert_to_tensor(
          value=arg_6, dtype=tf.int32, arg_5='length')

    # This is an TensorArray in part because of XLA, which had trouble with
    # non-statically known indices. I.e. elems[i] errored, but
    # elems_array.read(i) worked.
    arg_8 = tf.TensorArray(
        arg_2.dtype, size=arg_7, element_shape=arg_2.shape[1:])
    arg_8 = arg_8.unstack(arg_2)

    arg_9 = tf.nest.map_structure(
        lambda arg_15: tf.TensorArray(arg_15.dtype, size=arg_7, element_shape=arg_15.shape),
        arg_3(arg_1))

    def _body(arg_10, arg_11, arg_9):
      arg_11 = arg_0(arg_11, arg_8.read(arg_10))
      arg_9 = tf.nest.pack_sequence_as(arg_9, [
          a.write(arg_10, v) for a, v in zip(
              tf.nest.flatten(arg_9), tf.nest.flatten(arg_3(arg_11)))
      ])
      return arg_10 + 1, arg_11, arg_9

    arg_12, arg_13, arg_9 = tf.while_loop(
        cond=lambda arg_10, *args: arg_10 < arg_7,
        body=_body,
        loop_vars=(0, arg_1, arg_9),
        arg_4=arg_4)

    arg_14 = tf.nest.map_structure(lambda arg_15: arg_15.stack(), arg_9)

    # Restore the static length if we know it.
    def _merge_static_length(arg_15):
      arg_15.set_shape(tf.TensorShape(arg_6).concatenate(arg_15.shape[1:]))
      return arg_15

    arg_14 = tf.nest.map_structure(_merge_static_length, arg_14)
    return arg_13, arg_14

A simplified version of `tf.scan` that has configurable tracing.

  This function repeatedly calls `loop_fn(state, elem)`, where `state` is the
  `initial_state` during the first iteration, and the return value of `loop_fn`
  for every iteration thereafter. `elem` is a slice of `elements` along the
  first dimension, accessed in order. Additionally, it calls `trace_fn` on the
  return value of `loop_fn`. The `Tensor`s in return values of `trace_fn` are
  stacked and returned from this function, such that the first dimension of
  those `Tensor`s matches the size of `elems`.

  Args:
    loop_fn: A callable that takes in a `Tensor` or a nested collection of
      `Tensor`s with the same structure as `initial_state`, a slice of `elems`
      and returns the same structure as `initial_state`.
    initial_state: A `Tensor` or a nested collection of `Tensor`s passed to
      `loop_fn` in the first iteration.
    elems: A `Tensor` that is split along the first dimension and each element
      of which is passed to `loop_fn`.
    trace_fn: A callable that takes in the return value of `loop_fn` and returns
      a `Tensor` or a nested collection of `Tensor`s.
    parallel_iterations: Passed to the internal `tf.while_loop`.
    name: Name scope used in this function. Default: 'trace_scan'.

  Returns:
    final_state: The final return value of `loop_fn`.
    trace: The same structure as the return value of `trace_fn`, but with each
      `Tensor` being a stack of the corresponding `Tensors` in the return value
      of `trace_fn` for each slice of `elems`.

A simplified version of tf . scan that has configurable tracing .


def
Func
(
arg_0
=
''
,
arg_1
=
'==> '
,
arg_2
=
'..> '
,
arg_3
=
'.'
)
:
try
:
if
arg_0
:
arg_0
+=
'\n'
arg_4
=
[
raw_input
(
arg_0
+
arg_1
)
]
except
EOFError
:
return
[
]
arg_5
=
[
arg_3
]
try
:
while
arg_4
[
1
:
]
!=
arg_5
:
arg_6
=
raw_input
(
arg_1
)
while
arg_6
.
endswith
(
'\\'
)
:
arg_6
=
arg_6
[
:
1
]
+
raw_input
(
arg_2
)
arg_4
.
append
(
arg_6
)
return
arg_4
[
:
1
]
except
EOFError
:
print
(
)
return
arg_4

def Func(arg_0='', arg_1='==> ', arg_2='..> ',arg_3 = '.'):
    """Take multiple lines of input.

    A list with each line of input as a separate element is returned when a
    termination string is entered (defaults to a single '.'). Input can also
    terminate via EOF (^D in Unix, ^Z-RET in Windows).

    Lines of input which end in \\ are joined into single entries (and a
    secondary continuation prompt is issued as long as the user terminates
    lines with \\). This allows entering very long strings which are still
    meant to be treated as single entities.
    """

    try:
        if arg_0:
            arg_0 += '\n'
        arg_4 = [raw_input(arg_0 + arg_1)]
    except EOFError:
        return []
    arg_5 = [arg_3]
    try:
        while arg_4[-1:] != arg_5:
            arg_6 = raw_input(arg_1)
            while arg_6.endswith('\\'):
                arg_6 = arg_6[:-1] + raw_input(arg_2)
            arg_4.append(arg_6)

        return arg_4[:-1]  # don't return the termination command
    except EOFError:
        print()
        return arg_4


def Func(arg_0, arg_1: arg_2):
    """Partition coll into groups of size n."""
    assert arg_1 > 0
    arg_3 = 0
    arg_4 = arg_1
    while arg_4 <= len(arg_0):
        yield tuple(arg_5 for arg_5 in arg_0[arg_3:arg_4])
        arg_3 += arg_1
        arg_4 += arg_1
    if arg_3 < len(arg_0) < arg_4:
        arg_4 = len(arg_0)
        yield tuple(arg_5 for arg_5 in arg_0[arg_3:arg_4])


Post processors are functions that receive file objects,
    performs necessary operations and return the results as file objects.

def Func ( arg_0 , arg_1 , ** arg_2 ) : from . import conf arg_3 = conf . SIZES [ arg_1 ] for arg_4 in arg_3 [ 'POST_PROCESSORS' ] : arg_4 [ 'Funcor' ] ( arg_0 , ** arg_4 [ 'kwargs' ] ) return arg_0

def Func(arg_0, arg_1, **arg_2):
    """
    Post Funcors are functions that receive file objects,
    performs necessary operations and return the results as file objects.
    """
    from . import conf

    arg_3 = conf.SIZES[arg_1]
    for arg_4 in arg_3['POST_PROCESSORS']:
        arg_4['Funcor'](arg_0, **arg_4['kwargs'])

    return arg_0

Post processors are functions that receive file objects performs necessary operations and return the results as file objects .


def Func(arg_0, arg_1=False):
    """
    Return output class of driver.

    Returns
    -------
    output : ``OutputData``
        output writer object
    """
    if not isinstance(arg_0, dict):
        raise TypeError("output_params must be a dictionary")
    arg_2 = arg_0["format"]
    for arg_3 in pkg_resources.iter_entry_points(DRIVERS_ENTRY_POINT):
        arg_4 = arg_3.load()
        if all(
            [hasattr(arg_4, arg_5) for arg_5 in ["OutputData", "METADATA"]]
            ) and (
            arg_4.METADATA["driver_name"] == arg_2
        ):
            return arg_4.OutputData(arg_0, arg_1=arg_1)
    raise MapcheteDriverError("no loader for driver '%s' could be found." % arg_2)


(self, output_dir, error_dir, tid_specs)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
[
]
arg_5
=
[
]
for
(
arg_6
,
arg_7
)
in
arg_3
:
arg_8
=
"%s_%s_tid_%d"
%
(
arg_0
.
batch_name
,
arg_0
.
job_timestamp
,
arg_6
)
arg_5
.
append
(
arg_8
)
arg_9
=
arg_0
.
command
(
arg_0
.
command
.
_formatter
(
arg_7
)
,
arg_6
,
arg_0
.
_launchinfo
)
arg_10
=
arg_0
.
_qsub_args
(
[
(
"-e"
,
arg_2
)
,
(
'-N'
,
arg_8
)
,
(
"-o"
,
arg_1
)
]
,
arg_9
)
arg_11
=
subprocess
.
Popen
(
arg_10
,
arg_12
=
subprocess
.
PIPE
)
(
arg_12
,
arg_13
)
=
arg_11
.
communicate
(
)
arg_0
.
debug
(
arg_12
)
if
arg_11
.
poll
(
)
!=
0
:
raise
EnvironmentError
(
"qsub command exit with code: %d"
%
arg_11
.
poll
(
)
)
arg_4
.
append
(
arg_11
)
arg_0
.
message
(
"Invoked qsub for %d commands"
%
len
(
arg_4
)
)
if
(
arg_0
.
reduction_fn
is
not
)
or
arg_0
.
dynamic
:
arg_0
.
_qsub_collate_and_launch
(
arg_1
,
arg_2
,
arg_5
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        This method handles static argument specifiers and cases where
        the dynamic specifiers cannot be queued before the arguments
        are known.
        """
        arg_4 = []
        arg_5 = []

        for (arg_6, arg_7) in arg_3:
            arg_8 = "%s_%s_tid_%d" % (arg_0.batch_name, arg_0.job_timestamp, arg_6)
            arg_5.append(arg_8)
            arg_9 = arg_0.command(
                    arg_0.command._formatter(arg_7),
                    arg_6, arg_0._launchinfo)

            arg_10 = arg_0._qsub_args([("-e",arg_2), ('-N',arg_8), ("-o",arg_1)],
                                        arg_9)
            arg_11 = subprocess.Popen(arg_10, arg_12=subprocess.PIPE)
            (arg_12, arg_13) = arg_11.communicate()

            arg_0.debug(arg_12)
            if arg_11.poll() != 0:
                raise EnvironmentError("qsub command exit with code: %d" % arg_11.poll())

            arg_4.append(arg_11)

        arg_0.message("Invoked qsub for %d commands" % len(arg_4))
        if (arg_0.reduction_fn is not None) or arg_0.dynamic:
            arg_0._qsub_collate_and_launch(arg_1, arg_2, arg_5)

This method handles static argument specifiers and cases where the dynamic specifiers cannot be queued before the arguments are known .


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

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

        Raises:
            InvalidKmipEncoding: Raised if the object type or attributes are
                missing from the encoding.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the ObjectDefaults structure.
        """
        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            raise exceptions.VersionNotSupported(
                "KMIP {} does not support the ObjectDefaults object.".format(
                    arg_2.value
                )
            )

        super(ObjectDefaults, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.OBJECT_TYPE, arg_6):
            arg_0._object_type = primitives.Enumeration(
                arg_3.ObjectType,
                tag=arg_3.Tags.OBJECT_TYPE
            )
            arg_0._object_type.Func(arg_6, arg_2=arg_2)
        else:
            raise exceptions.InvalidKmipEncoding(
                "The ObjectDefaults encoding is missing the object type "
                "enumeration."
            )

        if arg_0.is_tag_next(arg_3.Tags.ATTRIBUTES, arg_6):
            arg_0._attributes = Attributes()
            arg_0._attributes.Func(arg_6, arg_2=arg_2)
        else:
            raise exceptions.InvalidKmipEncoding(
                "The ObjectDefaults encoding is missing the attributes "
                "structure."
            )

        arg_0.is_oversized(arg_6)

Read the data encoding the ObjectDefaults structure and decode it into
        its constituent parts.

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

        Raises:
            InvalidKmipEncoding: Raised if the object type or attributes are
                missing from the encoding.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the ObjectDefaults structure.

Read the data encoding the ObjectDefaults structure and decode it into its constituent parts .


returns all items off the store as tuples

def
Func
(
arg_0
)
:
arg_1
=
"SELECT {}, {} from {}"
.
format
(
arg_0
.
__key__
,
arg_0
.
__value__
,
arg_0
.
__tablename__
)
arg_2
=
sqlite3
.
connect
(
arg_0
.
sqlite_file
)
arg_3
=
arg_2
.
cursor
(
)
arg_3
.
execute
(
arg_1
)
arg_4
=
[
]
for
arg_5
,
arg_6
in
arg_3
.
fetchall
(
)
:
arg_4
.
append
(
(
arg_5
,
arg_6
)
)
return
arg_4

def Func(arg_0):
        """ returns all Func off the store as tuples
        """
        arg_1 = "SELECT {}, {} from {}".format(
            arg_0.__key__, arg_0.__value__, arg_0.__tablename__
        )
        arg_2 = sqlite3.connect(arg_0.sqlite_file)
        arg_3 = arg_2.cursor()
        arg_3.execute(arg_1)
        arg_4 = []
        for arg_5, arg_6 in arg_3.fetchall():
            arg_4.append((arg_5, arg_6))
        return arg_4


(self, parent_node, name, type_name, instance, constructor,
                                    args, kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
                                    arg_6, arg_7):
        """Generically creates a novel parameter or result instance inferring from the `type_name`.

        If the instance is already supplied it is NOT constructed new.

        :param parent_node:

            Parent trajectory node

        :param name:

            Name of the new result or parameter. Here the name no longer contains colons.

        :param type_name:

            Whether it is a parameter below parameters, config, derived parameters or whether
            it is a result.

        :param instance:

            The instance if it has been constructed somewhere else, otherwise None.

        :param constructor:

            A constructor used if instance needs to be constructed. If None the current standard
            constructor is chosen.

        :param args:

            Additional arguments passed to the constructor

        :param kwargs:

            Additional keyword arguments passed to the constructor

        :return: The new instance

        """
        arg_8 = arg_0._root_instance
        arg_9 = arg_0._make_full_name(arg_1.v_full_name, arg_2)
        if arg_4 is None:
            if arg_5 is None:
                if arg_3 == RESULT:
                    arg_5 = arg_8._standard_result
                elif arg_3 in [PARAMETER, CONFIG, DERIVED_PARAMETER]:
                    arg_5 = arg_8._standard_parameter
                else:
                    arg_5 = arg_8._standard_leaf
            arg_4 = arg_8._construct_instance(arg_5, arg_9, *arg_6, **arg_7)
        else:
            arg_4._rename(arg_9)

        arg_0._set_details_tree_node(arg_1, arg_2, arg_4)

        arg_10 = arg_0._map_type_to_dict(arg_3)
        arg_9 = arg_4._full_name

        if arg_9 in arg_10:
            raise AttributeError(arg_9 + ' is already part of trajectory,')

        if arg_3 != RESULT and arg_9 in arg_8._changed_default_parameters:
            arg_0._logger.info(
                'You have marked parameter %s for change before, so here you go!' %
                arg_9)

            arg_11, arg_12 = arg_8._changed_default_parameters.pop(arg_9)
            arg_4.f_set(*arg_11, **arg_12)

        arg_10[arg_9] = arg_4
        arg_0._add_to_nodes_and_leaves(arg_4)
        arg_1._children[arg_2] = arg_4
        arg_1._leaves[arg_2] = arg_4

        if arg_9 in arg_0._root_instance._explored_parameters:
            arg_4._explored = True  # Mark this parameter as explored.
            arg_0._root_instance._explored_parameters[arg_9] = arg_4

        arg_0._logger.debug('Added `%s` to trajectory.' % arg_9)

        return arg_4

Generically creates a novel parameter or result instance inferring from the type_name .


(units,
                 n_hidden,
                 seq_lengths=None,
                 n_layers=1,
                 trainable_initial_states=False,
                 name='cudnn_bi_gru',
                 reuse=False)

return (h_fw, h_bw), (h_last_fw, h_last_bw)

def Func(arg_0,
                 arg_1,
                 arg_2=None,
                 arg_3=1,
                 arg_4=False,
                 arg_5='Func',
                 arg_6=False):
    """ Fast CuDNN Bi-GRU implementation

    Args:
        units: tf.Tensor with dimensions [B x T x F], where
            B - batch size
            T - number of tokens
            F - features
        n_hidden: dimensionality of hidden state
        seq_lengths: number of tokens in each sample in the batch
        n_layers: number of layers
        trainable_initial_states: whether to create a special trainable variable
                to initialize the hidden states of the network or use just zeros
        name: name of the variable scope to use
        reuse:whether to reuse already initialized variable

    Returns:
        h - all hidden states along T dimension,
            tf.Tensor with dimensionality [B x T x F]
        h_last - last hidden state, tf.Tensor with dimensionality [B x H * 2]
            where H - number of hidden units
    """

    with tf.variable_scope(arg_5, arg_6=arg_6):
        if arg_2 is None:
            arg_2 = tf.ones([tf.shape(arg_0)[0]], dtype=tf.int32) * tf.shape(arg_0)[1]
        with tf.variable_scope('Forward'):
            arg_7, arg_8 = cudnn_gru_wrapper(arg_0,
                                                arg_1,
                                                arg_3=arg_3,
                                                arg_4=arg_4,
                                                arg_2=arg_2,
                                                arg_6=arg_6)

        with tf.variable_scope('Backward'):
            arg_9 = tf.reverse_sequence(arg_0, arg_2=arg_2, seq_dim=1, batch_dim=0)
            arg_10, arg_11 = cudnn_gru_wrapper(arg_9,
                                                arg_1,
                                                arg_3=arg_3,
                                                arg_4=arg_4,
                                                arg_2=arg_2,
                                                arg_6=arg_6)
            arg_10 = tf.reverse_sequence(arg_10, arg_2=arg_2, seq_dim=1, batch_dim=0)

    return (arg_7, arg_10), (arg_8, arg_11)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_0
.
_syncObj
.
encryptor
and
not
arg_1
.
sendRandKey
:
arg_1
.
sendRandKey
=
arg_2
arg_1
.
recvRandKey
=
os
.
urandom
(
32
)
arg_1
.
send
(
arg_1
.
recvRandKey
)
return
if
isinstance
(
arg_2
,
list
)
:
arg_5
=
False
try
:
if
arg_2
[
0
]
==
'status'
:
arg_1
.
send
(
arg_0
.
_syncObj
.
getStatus
(
)
)
arg_5
=
True
elif
arg_2
[
0
]
==
'add'
:
arg_0
.
_syncObj
.
addNodeToCluster
(
arg_2
[
1
]
,
callback
=
functools
.
partial
(
arg_0
.
_utilityCallback
,
arg_1
=
arg_1
,
cmd
=
'ADD'
,
arg
=
arg_2
[
1
]
)
)
arg_5
=
True
elif
arg_2
[
0
]
==
'remove'
:
if
arg_2
[
1
]
==
arg_0
.
_selfNode
.
address
:
arg_1
.
send
(
'FAIL REMOVE '
+
arg_2
[
1
]
)
else
:
arg_0
.
_syncObj
.
removeNodeFromCluster
(
arg_2
[
1
]
,
callback
=
functools
.
partial
(
arg_0
.
_utilityCallback
,
arg_1
=
arg_1
,
cmd
=
'REMOVE'
,
arg
=
arg_2
[
1
]
)
)
arg_5
=
True
elif
arg_2
[
0
]
==
'set_version'
:
arg_0
.
_syncObj
.
setCodeVersion
(
arg_2
[
1
]
,
callback
=
functools
.
partial
(
arg_0
.
_utilityCallback
,
arg_1
=
arg_1
,
cmd
=
'SET_VERSION'
,
arg
=
str
(
arg_2
[
1
]
)
)
)
arg_5
=
True
except
Exception
as
e
:
arg_1
.
send
(
str
(
e
)
)
arg_5
=
True
if
arg_5
:
return
arg_6
=
arg_0
.
_nodeAddrToNode
[
arg_2
]
if
arg_2
in
arg_0
.
_nodeAddrToNode
else
if
arg_6
is
and
arg_2
!=
'readonly'
:
arg_1
.
disconnect
(
)
arg_0
.
_unknownConnections
.
discard
(
arg_1
)
return
arg_7
=
arg_6
is
if
arg_7
:
arg_8
=
str
(
arg_0
.
_readonlyNodesCounter
)
arg_6
=
Node
(
arg_8
)
arg_0
.
_readonlyNodes
.
add
(
arg_6
)
arg_0
.
_readonlyNodesCounter
+=
1
arg_0
.
_unknownConnections
.
discard
(
arg_1
)
arg_0
.
_connections
[
arg_6
]
=
arg_1
arg_1
.
setOnMessageReceivedCallback
(
functools
.
partial
(
arg_0
.
_onMessageReceived
,
arg_6
)
)
if
not
arg_7
:
arg_0
.
_onNodeConnected
(
arg_6
)
else
:
arg_0
.
_onReadonlyNodeConnected
(
arg_6
)

def Func(arg_0, arg_1, arg_2):
        """
        Callback for initial messages on incoming connections. Handles encryption, utility messages, and association of the connection with a Node.
        Once this initial setup is done, the relevant connected callback is executed, and further messages are deferred to the onMessageReceived callback.

        :param conn: connection object
        :type conn: TcpConnection
        :param message: received message
        :type message: any
        """

        if arg_0._syncObj.encryptor and not arg_1.sendRandKey:
            arg_1.sendRandKey = arg_2
            arg_1.recvRandKey = os.urandom(32)
            arg_1.send(arg_1.recvRandKey)
            return

        # Utility messages
        if isinstance(arg_2, list):
            arg_5 = False
            try:
                if arg_2[0] == 'status':
                    arg_1.send(arg_0._syncObj.getStatus())
                    arg_5 = True
                elif arg_2[0] == 'add':
                    arg_0._syncObj.addNodeToCluster(arg_2[1], callback = functools.partial(arg_0._utilityCallback, arg_1 = arg_1, cmd = 'ADD', arg = arg_2[1]))
                    arg_5 = True
                elif arg_2[0] == 'remove':
                    if arg_2[1] == arg_0._selfNode.address:
                        arg_1.send('FAIL REMOVE ' + arg_2[1])
                    else:
                        arg_0._syncObj.removeNodeFromCluster(arg_2[1], callback = functools.partial(arg_0._utilityCallback, arg_1 = arg_1, cmd = 'REMOVE', arg = arg_2[1]))
                    arg_5 = True
                elif arg_2[0] == 'set_version':
                    arg_0._syncObj.setCodeVersion(arg_2[1], callback = functools.partial(arg_0._utilityCallback, arg_1 = arg_1, cmd = 'SET_VERSION', arg = str(arg_2[1])))
                    arg_5 = True
            except Exception as e:
                arg_1.send(str(e))
                arg_5 = True
            if arg_5:
                return

        # At this point, message should be either a node ID (i.e. address) or 'readonly'
        arg_6 = arg_0._nodeAddrToNode[arg_2] if arg_2 in arg_0._nodeAddrToNode else None

        if arg_6 is None and arg_2 != 'readonly':
            arg_1.disconnect()
            arg_0._unknownConnections.discard(arg_1)
            return

        arg_7 = arg_6 is None
        if arg_7:
            arg_8 = str(arg_0._readonlyNodesCounter)
            arg_6 = Node(arg_8)
            arg_0._readonlyNodes.add(arg_6)
            arg_0._readonlyNodesCounter += 1

        arg_0._unknownConnections.discard(arg_1)
        arg_0._connections[arg_6] = arg_1
        arg_1.setOnMessageReceivedCallback(functools.partial(arg_0._onMessageReceived, arg_6))
        if not arg_7:
            arg_0._onNodeConnected(arg_6)
        else:
            arg_0._onReadonlyNodeConnected(arg_6)

Callback for initial messages on incoming connections . Handles encryption utility messages and association of the connection with a Node . Once this initial setup is done the relevant connected callback is executed and further messages are deferred to the onMessageReceived callback .


def Func(arg_0):
        """Loads all variables from CDF.

        Note this routine is called automatically
        upon instantiation.

        """

        arg_0.data = {}
        # need to add r variable names
        arg_2 = arg_0.z_variable_info.keys()
        # collect variable information for each
        # organize it neatly for fortran call
        arg_3 = []
        arg_4 = []
        arg_5 = []
        arg_6 = []
        for arg_7, arg_8 in enumerate(arg_2):
            arg_3.extend(arg_0.z_variable_info[arg_8]['dim_sizes'])
            arg_4.append(arg_0.z_variable_info[arg_8]['rec_num'])
            arg_5.append(arg_0.z_variable_info[arg_8]['data_type'])
            arg_6.append(arg_8.ljust(256))
        arg_3 = np.array(arg_3)
        arg_4 = np.array(arg_4)
        arg_5 = np.array(arg_5)
        # individually load all variables by each data type
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['real4'],
                                   fortran_cdf.get_multi_z_real4)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['float'],
                                   fortran_cdf.get_multi_z_real4)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['real8'],
                                   fortran_cdf.get_multi_z_real8)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['double'],
                                   fortran_cdf.get_multi_z_real8)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['int4'],
                                   fortran_cdf.get_multi_z_int4)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['uint4'],
                                   fortran_cdf.get_multi_z_int4,
                                   data_offset=2 ** 32)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['int2'],
                                   fortran_cdf.get_multi_z_int2)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['uint2'],
                                   fortran_cdf.get_multi_z_int2,
                                   data_offset=2 ** 16)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['int1'],
                                   fortran_cdf.get_multi_z_int1)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['uint1'],
                                   fortran_cdf.get_multi_z_int1,
                                   data_offset=2 ** 8)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['byte'],
                                   fortran_cdf.get_multi_z_int1)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['epoch'],
                                   fortran_cdf.get_multi_z_real8,
                                   epoch=True)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, 2 * arg_3,
                                   arg_0.cdf_data_types['epoch16'],
                                   fortran_cdf.get_multi_z_epoch16,
                                   epoch16=True)
        arg_0._call_multi_fortran_z(arg_6, arg_5, arg_4, arg_3,
                                   arg_0.cdf_data_types['TT2000'],
                                   fortran_cdf.get_multi_z_tt2000,
                                   epoch=True)
        # mark data has been loaded
        arg_0.data_loaded = True

Loads all variables from CDF . Note this routine is called automatically upon instantiation .


def Func(arg_0, arg_1=False):
        """Return the default set of request headers, which
        can later be expanded, based on the request type"""

        if arg_1:
            arg_2 = arg_0.deviceBuilder.getDeviceUploadHeaders()
        else:
            arg_2 = arg_0.deviceBuilder.getBaseHeaders()
        if arg_0.gsfId is not None:
            arg_2["X-DFE-Device-Id"] = "{0:x}".format(arg_0.gsfId)
        if arg_0.authSubToken is not None:
            arg_2["Authorization"] = "GoogleLogin auth=%s" % arg_0.authSubToken
        if arg_0.device_config_token is not None:
            arg_2["X-DFE-Device-Config-Token"] = arg_0.device_config_token
        if arg_0.deviceCheckinConsistencyToken is not None:
            arg_2["X-DFE-Device-Checkin-Consistency-Token"] = arg_0.deviceCheckinConsistencyToken
        if arg_0.dfeCookie is not None:
            arg_2["X-DFE-Cookie"] = arg_0.dfeCookie
        return arg_2

Return the default set of request headers which can later be expanded based on the request type


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_2 . append ( arg_1 [ 'name' ] ) arg_2 . append ( arg_1 [ 'date' ] ) arg_2 . append ( arg_1 [ 'magnitude' ] ) arg_3 = arg_1 . get ( 'comment_code' , 'na' ) if not arg_3 : arg_3 = 'na' arg_2 . append ( arg_3 ) arg_4 = arg_1 . get ( 'comp1' , 'na' ) if not arg_4 : arg_4 = 'na' arg_2 . append ( arg_4 ) arg_5 = arg_1 . get ( 'comp2' , 'na' ) if not arg_5 : arg_5 = 'na' arg_2 . append ( arg_5 ) arg_6 = arg_1 . get ( 'chart' , 'na' ) if not arg_6 : arg_6 = 'na' arg_2 . append ( arg_6 ) arg_7 = arg_1 . get ( 'notes' , 'na' ) if not arg_7 : arg_7 = 'na' arg_2 . append ( arg_7 ) return arg_2

def Func(arg_0, arg_1):
        """
        Takes a dictionary of observation data and converts it to a list
        of fields according to AAVSO visual format specification.

        :param cls: current class
        :param observation_data: a single observation as a dictionary
        """
        arg_2 = []
        arg_2.append(arg_1['name'])
        arg_2.append(arg_1['date'])
        arg_2.append(arg_1['magnitude'])
        arg_3 = arg_1.get('comment_code', 'na')
        if not arg_3:
            arg_3 = 'na'
        arg_2.append(arg_3)
        arg_4 = arg_1.get('comp1', 'na')
        if not arg_4:
            arg_4 = 'na'
        arg_2.append(arg_4)
        arg_5 = arg_1.get('comp2', 'na')
        if not arg_5:
            arg_5 = 'na'
        arg_2.append(arg_5)
        arg_6 = arg_1.get('chart', 'na')
        if not arg_6:
            arg_6 = 'na'
        arg_2.append(arg_6)
        arg_7 = arg_1.get('notes', 'na')
        if not arg_7:
            arg_7 = 'na'
        arg_2.append(arg_7)
        return arg_2

Takes a dictionary of observation data and converts it to a list of fields according to AAVSO visual format specification .


def Func ( arg_0 ) : if arg_0 is not None : if arg_0 . startswith ( 'task-' ) : return int ( arg_0 [ len ( 'task-' ) : ] ) else : return int ( arg_0 )

def Func(arg_0):
  """Converts a task-id to the numeric task-id.

  Args:
    task_id: task-id in either task-n or n format

  Returns:
    n
  """

  # This function exists to support the legacy "task-id" format in the "google"
  # provider. Google labels originally could not be numeric. When the google
  # provider is completely replaced by the google-v2 provider, this function can
  # go away.

  if arg_0 is not None:
    if arg_0.startswith('task-'):
      return int(arg_0[len('task-'):])
    else:
      return int(arg_0)

Converts a task - id to the numeric task - id .


def Func ( arg_0 ) : arg_1 , arg_2 = os . path . splitext ( arg_0 . filename ) if arg_2 . startswith ( '.py' ) : return True if not arg_2 : return True return False

def Func(arg_0):
        """Does it seem like this file should contain Python?

        This is used to decide if a file reported as part of the exection of
        a program was really likely to have contained Python in the first
        place.

        """
        # Get the file extension.
        arg_1, arg_2 = os.path.splitext(arg_0.filename)

        # Anything named *.py* should be Python.
        if arg_2.startswith('.py'):
            return True
        # A file with no extension should be Python.
        if not arg_2:
            return True
        # Everything else is probably not Python.
        return False


def Func ( arg_0 ) : arg_1 = { } arg_1 . update ( get_def_macros ( arg_0 ) ) arg_1 . update ( get_newcommand_macros ( arg_0 ) ) return arg_1

def Func(arg_0):
    r"""Get all macro definitions from TeX source, supporting multiple
    declaration patterns.

    Parameters
    ----------
    tex_source : `str`
        TeX source content.

    Returns
    -------
    macros : `dict`
        Keys are macro names (including leading ``\``) and values are the
        content (as `str`) of the macros.

    Notes
    -----
    This function uses the following function to scrape macros of different
    types:

    - `get_def_macros`
    - `get_newcommand_macros`

    This macro scraping has the following caveats:

    - Macro definition (including content) must all occur on one line.
    - Macros with arguments are not supported.
    """
    arg_1 = {}
    arg_1.update(get_def_macros(arg_0))
    arg_1.update(get_newcommand_macros(arg_0))
    return arg_1

r Get all macro definitions from TeX source supporting multiple declaration patterns .


(
    optimizer: PythonASTOptimizer,
    py_ast: GeneratedPyAST,
    mod: types.ModuleType,
    source_filename: str,
    collect_bytecode: Optional[BytecodeCollector] = None,
)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 , arg_4 : arg_5 . ModuleType , arg_7 : arg_8 , arg_9 : arg_10 [ arg_11 ] = None , ) -> None : arg_12 = list ( map ( _statementize , itertools . chain ( arg_2 . dependencies , [ arg_2 . node ] ) ) ) arg_13 = ast . Module ( body = list ( arg_12 ) ) arg_13 = arg_0 . visit ( arg_13 ) ast . fix_missing_locations ( arg_13 ) _emit_ast_string ( arg_13 ) arg_14 = compile ( arg_13 , arg_7 , "exec" ) if arg_9 : arg_9 ( arg_14 ) exec ( arg_14 , arg_4 . __dict__ )

def Func(
    arg_0: arg_1,
    arg_2: arg_3,
    arg_4: arg_5.ModuleType,
    arg_7: arg_8,
    arg_9: arg_10[arg_11] = None,
) -> None:
    """Incrementally compile a stream of AST nodes in module mod.

    The source_filename will be passed to Python's native compile.

    Incremental compilation is an integral part of generating a Python module
    during the same process as macro-expansion."""
    arg_12 = list(
        map(_statementize, itertools.chain(arg_2.dependencies, [arg_2.node]))
    )

    arg_13 = ast.Module(body=list(arg_12))
    arg_13 = arg_0.visit(arg_13)
    ast.fix_missing_locations(arg_13)

    _emit_ast_string(arg_13)

    arg_14 = compile(arg_13, arg_7, "exec")
    if arg_9:
        arg_9(arg_14)
    exec(arg_14, arg_4.__dict__)

Incrementally compile a stream of AST nodes in module mod .


def Func ( arg_0 ) : try : return str ( EnterpriseCustomerCatalog . objects . get ( pk = arg_0 ) . enterprise_customer . uuid ) except EnterpriseCustomerCatalog . DoesNotExist : return None

def Func(arg_0):
    """
    Get the enterprise customer id given an enterprise customer catalog id.
    """
    try:
        return str(EnterpriseCustomerCatalog.objects.get(pk=arg_0).enterprise_customer.uuid)
    except EnterpriseCustomerCatalog.DoesNotExist:
        return None

Get the enterprise customer id given an enterprise customer catalog id .


def Func ( arg_0 ) : import vaex . file . other return vaex . file . other . DatasetAstropyTable ( arg_0 = arg_0 )

def Func(arg_0):
    """Create a vaex DataFrame from an Astropy Table."""
    import vaex.file.other
    return vaex.file.other.DatasetAstropyTable(arg_0=arg_0)

Create a vaex DataFrame from an Astropy Table .


def Func ( arg_0 ) : def compressed_file_type ( arg_1 ) : arg_2 = { b'\x1f\x8b\x08' : 'gz' , b'\x42\x5a\x68' : 'bz2' , b'PK\x03\x04' : 'zip' } for arg_3 , arg_4 in arg_2 . items ( ) : if arg_1 . startswith ( arg_3 ) : return arg_4 return None with open ( arg_0 , mode = 'rb' ) as f : arg_5 = f . read ( 4 ) return compressed_file_type ( arg_5 )

def Func(arg_0):
    """Check if filename is a compressed file supported by the tool.

    This function uses magic numbers (first four bytes) to determine
    the type of the file. Supported types are 'gz' and 'bz2'. When
    the filetype is not supported, the function returns `None`.

    :param filepath: path to the file

    :returns: 'gz' or 'bz2'; `None` if the type is not supported
    """
    def compressed_file_type(arg_1):
        arg_2 = {
            b'\x1f\x8b\x08': 'gz',
            b'\x42\x5a\x68': 'bz2',
            b'PK\x03\x04': 'zip'
        }

        for arg_3, arg_4 in arg_2.items():
            if arg_1.startswith(arg_3):
                return arg_4

        return None

    with open(arg_0, mode='rb') as f:
        arg_5 = f.read(4)
    return compressed_file_type(arg_5)

Check if filename is a compressed file supported by the tool .


def
Func
(
arg_0
)
:
import
inspect
def
extract
(
arg_1
)
:
arg_2
=
""
arg_3
=
inspect
.
getargspec
(
arg_1
)
for
arg_4
,
arg_5
in
enumerate
(
arg_3
.
args
)
:
if
arg_4
<
(
len
(
arg_3
)
len
(
arg_3
.
defaults
)
)
:
arg_2
+=
str
(
arg_5
)
+
", "
else
:
arg_6
=
arg_3
.
defaults
[
arg_4
len
(
arg_3
.
defaults
)
]
if
hasattr
(
arg_6
,
"__name__"
)
:
arg_6
=
arg_6
.
__name__
else
:
arg_6
=
str
(
arg_6
)
arg_2
+=
str
(
arg_5
)
+
"="
+
arg_6
+
", "
arg_2
=
arg_2
[
:
2
]
+
")"
return
arg_2
arg_7
=
arg_0
.
__doc__
+
"\n"
arg_7
+=
"    local -> array("
+
extract
(
getattr
(
ConstructLocal
,
arg_0
.
__name__
)
)
+
"\n"
arg_7
+=
"    spark -> array("
+
extract
(
getattr
(
ConstructSpark
,
arg_0
.
__name__
)
)
+
"\n"
arg_0
.
__doc__
=
arg_7
return
arg_0

def Func(arg_0):
    """
    Decorator to append routed docstrings
    """
    import inspect

    def extract(arg_1):
        arg_2 = ""
        arg_3 = inspect.getargspec(arg_1)
        for arg_4, arg_5 in enumerate(arg_3.args):
            if arg_4 < (len(arg_3) - len(arg_3.defaults)):
                arg_2 += str(arg_5) + ", "
            else:
                arg_6 = arg_3.defaults[arg_4-len(arg_3.defaults)]
                if hasattr(arg_6, "__name__"):
                    arg_6 = arg_6.__name__
                else:
                    arg_6 = str(arg_6)
                arg_2 += str(arg_5) + "=" + arg_6 + ", "
        arg_2 = arg_2[:-2] + ")"
        return arg_2

    arg_7 = arg_0.__doc__ + "\n"
    arg_7 += "    local -> array(" + extract(getattr(ConstructLocal, arg_0.__name__)) + "\n"
    arg_7 += "    spark -> array(" + extract(getattr(ConstructSpark, arg_0.__name__)) + "\n"
    arg_0.__doc__ = arg_7
    return arg_0


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : def _make_row ( arg_4 ) : arg_5 = ( arg_4 [ 'idx' ] , arg_4 [ 'name' ] , arg_4 [ 'time' ] , arg_4 [ 'timestamp' ] , arg_4 [ 'finish_timestamp' ] , arg_4 [ 'runtime' ] , arg_4 [ 'parameter_summary' ] , arg_4 [ 'short_environment_hexsha' ] , arg_4 [ 'completed' ] ) return arg_5 arg_6 = getattr ( arg_0 . _overview_group , 'runs' ) arg_7 = [ ] arg_8 = arg_1 . _updated_run_information for arg_9 in range ( arg_2 , arg_3 ) : arg_4 = arg_1 . _run_information [ arg_1 . _single_run_ids [ arg_9 ] ] arg_7 . append ( _make_row ( arg_4 ) ) arg_8 . discard ( arg_9 ) if arg_7 : arg_6 . append ( arg_7 ) arg_6 . flush ( ) arg_7 = [ ] arg_10 = [ ] for arg_9 in arg_8 : arg_4 = arg_1 . f_get_run_information ( arg_9 , copy = False ) arg_7 . append ( _make_row ( arg_4 ) ) arg_10 . append ( arg_9 ) if arg_7 : arg_6 . modify_coordinates ( arg_10 , arg_7 ) arg_1 . _updated_run_information = set ( )

def Func(arg_0, arg_1, arg_2, arg_3):
        """Fills the `run` overview table with information.

        Will also update new information.

        """

        def _make_row(arg_4):
            arg_5 = (arg_4['idx'],
                   arg_4['name'],
                   arg_4['time'],
                   arg_4['timestamp'],
                   arg_4['finish_timestamp'],
                   arg_4['runtime'],
                   arg_4['parameter_summary'],
                   arg_4['short_environment_hexsha'],
                   arg_4['completed'])
            return arg_5

        arg_6 = getattr(arg_0._overview_group, 'runs')

        arg_7 = []
        arg_8 = arg_1._updated_run_information
        for arg_9 in range(arg_2, arg_3):
            arg_4 = arg_1._run_information[arg_1._single_run_ids[arg_9]]
            arg_7.append(_make_row(arg_4))
            arg_8.discard(arg_9)

        if arg_7:
            arg_6.append(arg_7)
            arg_6.flush()

        # Store all runs that are updated and that have not been stored yet
        arg_7 = []
        arg_10 = []
        for arg_9 in arg_8:
            arg_4 = arg_1.f_get_run_information(arg_9, copy=False)
            arg_7.append(_make_row(arg_4))
            arg_10.append(arg_9)

        if arg_7:
            arg_6.modify_coordinates(arg_10, arg_7)

        arg_1._updated_run_information = set()

Fills the run overview table with information .


return bool(last_line and not last_line.isspace())

def Func ( arg_0 ) : if not arg_0 . _is_complete : return True if arg_0 . indent_spaces == 0 : if arg_0 . input_mode == 'line' : if not arg_0 . _full_dedent : return False else : try : arg_1 = ast . parse ( u'' . join ( arg_0 . _buffer ) ) except Exception : return False else : if len ( arg_1 . body ) == 1 : return False arg_2 = arg_0 . source . splitlines ( ) [ - 1 ] return bool ( arg_2 and not arg_2 . isspace ( ) )

def Func(arg_0):
        """Return whether a block of interactive input can accept more input.

        This method is meant to be used by line-oriented frontends, who need to
        guess whether a block is complete or not based solely on prior and
        current input lines.  The InputSplitter considers it has a complete
        interactive block and will not accept more input only when either a
        SyntaxError is raised, or *all* of the following are true:

        1. The input compiles to a complete statement.

        2. The indentation level is flush-left (because if we are indented,
           like inside a function definition or for loop, we need to keep
           reading new input).

        3. There is one extra line consisting only of whitespace.

        Because of condition #3, this method should be used only by
        *line-oriented* frontends, since it means that intermediate blank lines
        are not allowed in function definitions (or any other indented block).

        If the current input produces a syntax error, this method immediately
        returns False but does *not* raise the syntax error exception, as
        typically clients will want to send invalid syntax to an execution
        backend which might convert the invalid syntax into valid Python via
        one of the dynamic IPython mechanisms.
        """

        # With incomplete input, unconditionally accept more
        if not arg_0._is_complete:
            return True

        # If we already have complete input and we're flush left, the answer
        # depends.  In line mode, if there hasn't been any indentation,
        # that's it. If we've come back from some indentation, we need
        # the blank final line to finish.
        # In cell mode, we need to check how many blocks the input so far
        # compiles into, because if there's already more than one full
        # independent block of input, then the client has entered full
        # 'cell' mode and is feeding lines that each is complete.  In this
        # case we should then keep accepting. The Qt terminal-like console
        # does precisely this, to provide the convenience of terminal-like
        # input of single expressions, but allowing the user (with a
        # separate keystroke) to switch to 'cell' mode and type multiple
        # expressions in one shot.
        if arg_0.indent_spaces==0:
            if arg_0.input_mode=='line':
                if not arg_0._full_dedent:
                    return False
            else:
                try:
                    arg_1 = ast.parse(u''.join(arg_0._buffer))
                except Exception:
                    return False
                else:
                    if len(arg_1.body) == 1:
                        return False

        # When input is complete, then termination is marked by an extra blank
        # line at the end.
        arg_2 = arg_0.source.splitlines()[-1]
        return bool(arg_2 and not arg_2.isspace())

Return whether a block of interactive input can accept more input .