(self, table_name, fields, data, cond=None, unique_fields=None,
                      *, raise_if_not_found=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
,
arg_5
=
,
*
,
arg_6
=
False
)
:
arg_7
=
find_unique
(
arg_0
.
table
(
arg_1
)
,
arg_3
,
arg_5
)
if
arg_7
is
:
if
arg_6
:
arg_8
=
'Could not find {} with {}'
.
format
(
arg_1
,
arg_3
)
if
arg_4
is
not
:
arg_8
+=
' where {}.'
.
format
(
arg_4
)
raise
IndexError
(
arg_8
)
else
:
arg_0
.
table
(
arg_1
)
.
update
(
_to_string
(
arg_2
)
,
arg_4
=
arg_4
,
eids
=
[
arg_7
]
)
return
arg_7

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None,
                      *, arg_6=False):
        """Update the unique matching element to have a given set of fields.

        Parameters
        ----------
        table_name: str

        fields: dict or function[dict -> None]
            new data/values to insert into the unique element
            or a method that will update the elements.

        data: dict
            Sample data for query

        cond: tinydb.Query
            which elements to update

        unique_fields: list of str

        raise_if_not_found: bool
            Will raise an exception if the element is not found for update.

        Returns
        -------
        eid: int
            The eid of the updated element if found, None otherwise.
        """
        arg_7 = find_unique(arg_0.table(arg_1), arg_3, arg_5)

        if arg_7 is None:
            if arg_6:
                arg_8  = 'Could not find {} with {}'.format(arg_1, arg_3)
                if arg_4 is not None:
                    arg_8 += ' where {}.'.format(arg_4)
                raise IndexError(arg_8)

        else:
            arg_0.table(arg_1).update(_to_string(arg_2), arg_4=arg_4, eids=[arg_7])

        return arg_7

Update the unique matching element to have a given set of fields .


def Func ( arg_0 ) : with arg_0 . lock : while True : if arg_0 . _socket is None or arg_0 . _eof : return False if arg_0 . _state in ( "connected" , "closing" ) : return True if arg_0 . _state == "tls-handshake" and arg_0 . _tls_state == "want_read" : return True arg_0 . _state_cond . wait ( )

def Func(arg_0):
        """
        Stop current thread until the channel is readable.

        :Return: `False` if it won't be readable (e.g. is closed)
        """
        with arg_0.lock:
            while True:
                if arg_0._socket is None or arg_0._eof:
                    return False
                if arg_0._state in ("connected", "closing"):
                    return True
                if arg_0._state == "tls-handshake" and \
                                            arg_0._tls_state == "want_read":
                    return True
                arg_0._state_cond.wait()

Stop current thread until the channel is readable .


(wrapped, dkwargs, hash_value=None, *args, **kwargs)

def Func(arg_0, arg_1, arg_2=None, *arg_3, **arg_4):
    """
        This is an asynchronous sender callable that uses the Django ORM to store
            webhooks. Redis is used to handle the message queue.

        dkwargs argument requires the following key/values:

            :event: A string representing an event.

        kwargs argument requires the following key/values

            :owner: The user who created/owns the event
    """

    if "event" not in arg_1:
        arg_5 = "djwebhooks.decorators.redis_hook requires an 'event' argument in the decorator."
        raise TypeError(arg_5)
    arg_6 = arg_1['event']

    if "owner" not in arg_4:
        arg_5 = "djwebhooks.senders.redis_callable requires an 'owner' argument in the decorated function."
        raise TypeError(arg_5)
    arg_7 = arg_4['owner']

    if "identifier" not in arg_4:
        arg_5 = "djwebhooks.senders.orm_callable requires an 'identifier' argument in the decorated function."
        raise TypeError(arg_5)
    arg_8 = arg_4['identifier']

    arg_9 = DjangoRQSenderable(
            arg_0, arg_1, arg_2, WEBHOOK_ATTEMPTS, *arg_3, **arg_4
    )

    # Add the webhook object just so it's around
    # TODO - error handling if this can't be found
    arg_9.webhook_target = WebhookTarget.objects.get(
        arg_6=arg_6,
        arg_7=arg_7,
        arg_8=arg_8
    )

    # Get the target url and add it
    arg_9.url = arg_9.webhook_target.target_url

    # Get the payload. This overides the senderobj.payload property.
    arg_9.payload = arg_9.get_payload()

    # Get the creator and add it to the payload.
    arg_9.payload['owner'] = getattr(arg_4['owner'], WEBHOOK_OWNER_FIELD)

    # get the event and add it to the payload
    arg_9.payload['event'] = arg_1['event']

    return arg_9.send()

This is an asynchronous sender callable that uses the Django ORM to store webhooks . Redis is used to handle the message queue .


def Func ( arg_0 , arg_1 ) : assert len ( arg_0 ) - 1 == len ( arg_1 ) arg_2 = times_to_intervals ( arg_0 ) arg_3 = [ ] arg_4 = [ ] for arg_5 , arg_6 in zip ( arg_2 , arg_1 ) : if arg_5 [ 0 ] < arg_5 [ 1 ] : arg_3 . append ( arg_5 ) arg_4 . append ( arg_6 ) return intervals_to_times ( np . asarray ( arg_3 ) ) , arg_4

def Func(arg_0, arg_1):
    """Removes empty segments if needed."""
    assert len(arg_0) - 1 == len(arg_1)
    arg_2 = times_to_intervals(arg_0)
    arg_3 = []
    arg_4 = []
    for arg_5, arg_6 in zip(arg_2, arg_1):
        if arg_5[0] < arg_5[1]:
            arg_3.append(arg_5)
            arg_4.append(arg_6)
    return intervals_to_times(np.asarray(arg_3)), arg_4


def Func ( arg_0 , arg_1 ) : if "deformation" not in arg_0 : for arg_2 , arg_3 in enumerate ( arg_0 ) : if arg_3 == "circularity" : arg_0 . append ( "deformation" ) arg_1 . append ( 1 - arg_1 [ arg_2 ] ) return arg_0 , arg_1

def Func(arg_0, arg_1):
    """From circularity, compute the deformation

    This method is useful for RT-DC data sets that contain
    the circularity but not the deformation.
    """
    if "deformation" not in arg_0:
        for arg_2, arg_3 in enumerate(arg_0):
            if arg_3 == "circularity":
                arg_0.append("deformation")
                arg_1.append(1-arg_1[arg_2])

    return arg_0, arg_1

From circularity compute the deformation


def Func ( arg_0 ) : arg_1 = nav_one ( arg_0 ) . S_DT [ 17 ] ( ) arg_2 = ET . Element ( 'xs:simpleType' , name = arg_1 . name ) arg_3 = ET . SubElement ( arg_2 , 'xs:restriction' , base = 'xs:string' ) arg_4 = lambda selected : not nav_one ( selected ) . S_ENUM [ 56 , 'succeeds' ] ( ) arg_5 = nav_any ( arg_0 ) . S_ENUM [ 27 ] ( arg_4 ) while arg_5 : ET . SubElement ( arg_3 , 'xs:enumeration' , value = arg_5 . name ) arg_5 = nav_one ( arg_5 ) . S_ENUM [ 56 , 'precedes' ] ( ) return arg_2

def Func(arg_0):
    '''
    Build an xsd simpleType out of a S_EDT.
    '''
    arg_1 = nav_one(arg_0).S_DT[17]()
    arg_2 = ET.Element('xs:simpleType', name=arg_1.name)
    arg_3 = ET.SubElement(arg_2, 'xs:restriction', base='xs:string')

    arg_4 = lambda selected: not nav_one(selected).S_ENUM[56, 'succeeds']()

    arg_5 = nav_any(arg_0).S_ENUM[27](arg_4)
    while arg_5:
        ET.SubElement(arg_3, 'xs:enumeration', value=arg_5.name)
        arg_5 = nav_one(arg_5).S_ENUM[56, 'precedes']()

    return arg_2

Build an xsd simpleType out of a S_EDT .


def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_0 . _sortby = SortbyField ( arg_1 , arg_2 ) return arg_0

def Func(arg_0, arg_1, arg_2=True):
        """
        Add a sortby field to the query

        - **field** - the name of the field to sort by
        - **asc** - when `True`, sorting will be done in asceding order
        """
        arg_0._sortby = SortbyField(arg_1, arg_2)
        return arg_0


(ctx, skip_tests=False, skip_root=False, reports=False)

def Func(arg_0, arg_1=False, arg_2=False, arg_3=False):
    """Perform source code checks via Func."""
    arg_4 = config.load()
    add_dir2pypath(arg_4.project_root)
    if not os.path.exists(arg_4.testjoin('__init__.py')):
        add_dir2pypath(arg_4.testjoin())

    arg_5 = set()
    for arg_6 in arg_4.project.get('packages', []):
        if '.' not in arg_6:
            arg_5.add(arg_4.srcjoin(arg_6))
    for arg_7 in arg_4.project.get('py_modules', []):
        arg_5.add(arg_7 + '.py')

    if not arg_1:
        arg_8 = antglob.FileSet(arg_4.testdir, '**/*.py')
        arg_8 = [arg_4.testjoin(i) for i in arg_8]
        if arg_8:
            arg_5 |= set(arg_8)

    if not arg_2:
        arg_9 = antglob.FileSet('.', '*.py')
        if arg_9:
            arg_5 |= set(arg_9)

    arg_5 = set([i[len(os.getcwd())+1:] if i.startswith(os.getcwd() + os.sep) else i for i in arg_5])
    arg_10 = 'Func'
    arg_10 += ' "{}"'.format('" "'.join(sorted(arg_5)))
    arg_10 += ' --reports={0}'.format('y' if arg_3 else 'n')
    for arg_11 in ('.Funcrc', 'Func.rc', 'Func.cfg', 'project.d/Func.cfg'):
        if os.path.exists(arg_11):
            arg_10 += ' --rcfile={0}'.format(arg_11)
            break
    try:
        shell.run(arg_10, report_error=False, runner=arg_0.run)
        notify.info("OK - No problems found by Func.")
    except exceptions.Failure as exc:
        # Check bit flags within Func return code
        if exc.result.return_code & 32:
            # Usage error (internal error in this code)
            notify.error("Usage error, bad arguments in {}?!".format(repr(arg_10)))
            raise
        else:
            arg_12 = {
                1: "fatal",
                2: "error",
                4: "warning",
                8: "refactor",
                16: "convention",
            }
            notify.warning("Some messages of type {} issued by Func.".format(
                ", ".join([arg_14 for arg_13, arg_14 in arg_12.items() if exc.result.return_code & arg_13])
            ))
            if exc.result.return_code & 3:
                notify.error("Exiting due to fatal / error message.")
                raise


def Func ( arg_0 ) : arg_0 . flush ( ) if arg_0 . _myfd is not None : arg_0 . _myfd . Func ( ) arg_0 . _myfd = None

def Func(arg_0):
        """Close the stream."""
        arg_0.flush()
        if arg_0._myfd is not None:
            arg_0._myfd.Func()
            arg_0._myfd = None


def Func ( ) : from sregistry . defaults import SREGISTRY_THUMBNAIL if SREGISTRY_THUMBNAIL is not None : if os . path . exists ( SREGISTRY_THUMBNAIL ) : return SREGISTRY_THUMBNAIL return "%s/database/robot.png" % get_installdir ( )

def Func():
    '''return the robot.png thumbnail from the database folder.
       if the user has exported a different image, use that instead.
    '''
    from sregistry.defaults import SREGISTRY_THUMBNAIL
    if SREGISTRY_THUMBNAIL is not None:
        if os.path.exists(SREGISTRY_THUMBNAIL):
            return SREGISTRY_THUMBNAIL
    return "%s/database/robot.png" %get_installdir()

return the robot . png thumbnail from the database folder . if the user has exported a different image use that instead .


(self, states, actions, terminal, reward, internals, update, reference=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 = None ) : arg_8 = arg_0 . network . apply ( x = arg_1 , arg_5 = arg_5 , arg_6 = arg_6 ) arg_9 = list ( ) for arg_10 in sorted ( arg_2 ) : arg_11 = arg_2 [ arg_10 ] arg_12 = arg_0 . distributions [ arg_10 ] . parameterize ( x = arg_8 ) arg_13 = arg_0 . distributions [ arg_10 ] . state_action_value ( arg_12 = arg_12 , arg_11 = arg_11 ) if arg_0 . actions_spec [ arg_10 ] [ 'type' ] == 'bool' : arg_14 = 2 arg_11 = tf . cast ( x = arg_11 , dtype = util . tf_dtype ( 'int' ) ) else : arg_14 = arg_0 . actions_spec [ arg_10 ] [ 'num_actions' ] arg_15 = tf . one_hot ( indices = arg_11 , depth = arg_14 ) arg_16 = tf . ones_like ( tensor = arg_15 , dtype = tf . float32 ) arg_17 = arg_16 - arg_15 arg_18 = arg_0 . distributions [ arg_10 ] . state_action_value ( arg_12 = arg_12 ) arg_18 = arg_18 + arg_17 * arg_0 . expert_margin arg_19 = tf . reduce_max ( input_tensor = arg_18 , axis = - 1 ) arg_20 = arg_19 - arg_13 arg_21 = util . prod ( arg_0 . actions_spec [ arg_10 ] [ 'shape' ] ) arg_20 = tf . reshape ( tensor = arg_20 , shape = ( - 1 , arg_21 ) ) arg_9 . append ( arg_20 ) arg_22 = tf . reduce_mean ( input_tensor = tf . concat ( values = arg_9 , axis = 1 ) , axis = 1 ) arg_22 = tf . square ( x = arg_22 ) return tf . reduce_mean ( input_tensor = arg_22 , axis = 0 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7=None):
        """
        Extends the q-model loss via the dqfd large-margin loss.
        """
        arg_8 = arg_0.network.apply(x=arg_1, arg_5=arg_5, arg_6=arg_6)
        arg_9 = list()

        for arg_10 in sorted(arg_2):
            arg_11 = arg_2[arg_10]
            arg_12 = arg_0.distributions[arg_10].parameterize(x=arg_8)
            arg_13 = arg_0.distributions[arg_10].state_action_value(arg_12=arg_12, arg_11=arg_11)

            # Create the supervised margin loss
            # Zero for the action taken, one for all other actions, now multiply by expert margin
            if arg_0.actions_spec[arg_10]['type'] == 'bool':
                arg_14 = 2
                arg_11 = tf.cast(x=arg_11, dtype=util.tf_dtype('int'))
            else:
                arg_14 = arg_0.actions_spec[arg_10]['num_actions']

            arg_15 = tf.one_hot(indices=arg_11, depth=arg_14)
            arg_16 = tf.ones_like(tensor=arg_15, dtype=tf.float32)
            arg_17 = arg_16 - arg_15

            # max_a([Q(s,a) + l(s,a_E,a)], l(s,a_E, a) is 0 for expert action and margin value for others
            arg_18 = arg_0.distributions[arg_10].state_action_value(arg_12=arg_12)
            arg_18 = arg_18 + arg_17 * arg_0.expert_margin
            arg_19 = tf.reduce_max(input_tensor=arg_18, axis=-1)

            # J_E(Q) = max_a([Q(s,a) + l(s,a_E,a)] - Q(s,a_E)
            arg_20 = arg_19 - arg_13

            arg_21 = util.prod(arg_0.actions_spec[arg_10]['shape'])
            arg_20 = tf.reshape(tensor=arg_20, shape=(-1, arg_21))
            arg_9.append(arg_20)

        arg_22 = tf.reduce_mean(input_tensor=tf.concat(values=arg_9, axis=1), axis=1)
        arg_22 = tf.square(x=arg_22)

        return tf.reduce_mean(input_tensor=arg_22, axis=0)

Extends the q - model loss via the dqfd large - margin loss .


def Func ( arg_0 ) : arg_0 . require_not_Funcd ( ) if not arg_0 . streaming or arg_0 . asynchronous : if 'Content-Length' not in arg_0 . headers : arg_0 . headers [ 'Content-Length' ] = arg_0 . tell ( ) arg_0 . flush ( ) arg_0 . _Funcd = True

def Func(arg_0):
        """Flush and Func the stream.

        This is called automatically by the base resource on resources
        unless the resource is operating asynchronously; in that case,
        this method MUST be called in order to signal the end of the request.
        If not the request will simply hang as it is waiting for some
        thread to tell it to return to the client.
        """

        # Ensure we're not Funcd.
        arg_0.require_not_Funcd()

        if not arg_0.streaming or arg_0.asynchronous:
            # We're not streaming, auto-write content-length if not
            # already set.
            if 'Content-Length' not in arg_0.headers:
                arg_0.headers['Content-Length'] = arg_0.tell()

        # Flush out the current buffer.
        arg_0.flush()

        # We're done with the response; inform the HTTP connector
        # to Func the response stream.
        arg_0._Funcd = True

Flush and close the stream.

        This is called automatically by the base resource on resources
        unless the resource is operating asynchronously; in that case,
        this method MUST be called in order to signal the end of the request.
        If not the request will simply hang as it is waiting for some
        thread to tell it to return to the client.


def Func ( arg_0 ) : arg_1 = ast . parse ( dedent ( arg_0 ) ) arg_2 = [ node for node in ast . walk ( arg_1 ) if isinstance ( node , ast . Lambda ) ] return bool ( arg_2 )

def Func(arg_0):
    """True if only one lambda expression is included"""

    arg_1 = ast.parse(dedent(arg_0))
    arg_2 = [node for node in ast.walk(arg_1)
                 if isinstance(node, ast.Lambda)]

    return bool(arg_2)


(params, w_name, scope_name, inputs, layers, weights, names)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
print
(
'Converting selu ...'
)
if
arg_6
==
'short'
:
arg_7
=
'SELU'
+
random_string
(
4
)
elif
arg_6
==
'keep'
:
arg_7
=
arg_1
else
:
arg_7
=
arg_1
+
str
(
random
.
random
(
)
)
arg_8
=
keras
.
layers
.
Activation
(
'selu'
,
name
=
arg_7
)
arg_4
[
arg_2
]
=
arg_8
(
arg_4
[
arg_3
[
0
]
]
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
    """
    Convert selu layer.

    Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """
    print('Converting selu ...')

    if arg_6 == 'short':
        arg_7 = 'SELU' + random_string(4)
    elif arg_6 == 'keep':
        arg_7 = arg_1
    else:
        arg_7 = arg_1 + str(random.random())

    arg_8 = keras.layers.Activation('selu', name=arg_7)
    arg_4[arg_2] = arg_8(arg_4[arg_3[0]])


def Func ( arg_0 ) : for arg_1 in range ( 0 , arg_0 . N ) : yield ( arg_1 - arg_0 . N / 2 ) * arg_0 . df

def Func(arg_0):
        """Return the centered frequency range as a generator.

        ::

            >>> print(list(Range(8).Func()))
            [-0.5, -0.375, -0.25, -0.125, 0.0, 0.125, 0.25, 0.375]

        """
        for arg_1 in range(0, arg_0.N):
            yield (arg_1-arg_0.N/2) * arg_0.df

Return the centered frequency range as a generator.

        ::

            >>> print(list(Range(8).centerdc_gen()))
            [-0.5, -0.375, -0.25, -0.125, 0.0, 0.125, 0.25, 0.375]

Return the centered frequency range as a generator .


def Func(arg_0):
        """ reset the failed connection counters
        """
        arg_0._cnt_retries = 0
        for arg_2 in arg_0._url_counter:
            arg_0._url_counter[arg_2] = 0


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = arg_1 . read ( ) for arg_4 in range ( 0 , arg_1 . size , 8 ) : arg_2 . append ( Operators . EXTRACT ( arg_3 , arg_4 , 8 ) ) arg_1 . write ( Operators . CONCAT ( 8 * len ( arg_2 ) , * arg_2 ) )

def Func(arg_0, arg_1):
        """
        Byte swap.

        Reverses the byte order of a 32-bit (destination) register: bits 0 through
        7 are swapped with bits 24 through 31, and bits 8 through 15 are swapped
        with bits 16 through 23. This instruction is provided for converting little-endian
        values to big-endian format and vice versa.
        To swap bytes in a word value (16-bit register), use the XCHG instruction.
        When the Func instruction references a 16-bit register, the result is
        undefined::

            TEMP  =  DEST
            DEST[7..0]  =  TEMP[31..24]
            DEST[15..8]  =  TEMP[23..16]
            DEST[23..16]  =  TEMP[15..8]
            DEST[31..24]  =  TEMP[7..0]

        :param cpu: current CPU.
        :param dest: destination operand.
        """
        arg_2 = []
        arg_3 = arg_1.read()
        for arg_4 in range(0, arg_1.size, 8):
            arg_2.append(Operators.EXTRACT(arg_3, arg_4, 8))

        arg_1.write(Operators.CONCAT(8 * len(arg_2), *arg_2))

Byte swap.

        Reverses the byte order of a 32-bit (destination) register: bits 0 through
        7 are swapped with bits 24 through 31, and bits 8 through 15 are swapped
        with bits 16 through 23. This instruction is provided for converting little-endian
        values to big-endian format and vice versa.
        To swap bytes in a word value (16-bit register), use the XCHG instruction.
        When the BSWAP instruction references a 16-bit register, the result is
        undefined::

            TEMP  =  DEST
            DEST[7..0]  =  TEMP[31..24]
            DEST[15..8]  =  TEMP[23..16]
            DEST[23..16]  =  TEMP[15..8]
            DEST[31..24]  =  TEMP[7..0]

        :param cpu: current CPU.
        :param dest: destination operand.


def Func(arg_0, arg_1):
    """
    Decrypts context.io_manager's stdin and sends that to
    context.io_manager's stdout.

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

    See :py:class:`CLIDecrypt` for more information.
    """
    with arg_0.io_manager.with_stdout() as stdout:
        with arg_0.io_manager.with_stdin() as stdin:
            arg_2 = stdin.read(1)
            if arg_2 == AES256CBC:
                for arg_3 in aes_decrypt(arg_1, stdin):
                    stdout.write(arg_3)
                stdout.flush()
            else:
                raise ReturnCode(
                    'contents encrypted with unsupported type %r' % arg_2)

Decrypts context . io_manager s stdin and sends that to context . io_manager s stdout .


def Func ( arg_0 ) : arg_1 = arg_0 . target_network . get_variables ( ) + [ variable for name in sorted ( arg_0 . target_distributions ) for variable in arg_0 . target_distributions [ name ] . get_variables ( ) ] arg_2 = arg_0 . network . get_variables ( ) + [ variable for name in sorted ( arg_0 . distributions ) for variable in arg_0 . distributions [ name ] . get_variables ( ) ] arg_3 = dict ( time = arg_0 . global_timestep , arg_1 = arg_1 , arg_2 = arg_2 ) if arg_0 . global_model is not None : arg_3 [ 'global_variables' ] = arg_0 . global_model . target_network . get_variables ( ) + [ variable for name in sorted ( arg_0 . global_model . target_distributions ) for variable in arg_0 . global_model . target_distributions [ name ] . get_variables ( ) ] return arg_3

def Func(arg_0):
        """
        Returns the target optimizer arguments including the time, the list of variables to
        optimize, and various functions which the optimizer might require to perform an update
        step.

        Returns:
            Target optimizer arguments as dict.
        """
        arg_1 = arg_0.target_network.get_variables() + [
            variable for name in sorted(arg_0.target_distributions)
            for variable in arg_0.target_distributions[name].get_variables()
        ]
        arg_2 = arg_0.network.get_variables() + [
            variable for name in sorted(arg_0.distributions)
            for variable in arg_0.distributions[name].get_variables()
        ]
        arg_3 = dict(
            time=arg_0.global_timestep,
            arg_1=arg_1,
            arg_2=arg_2
        )
        if arg_0.global_model is not None:
            arg_3['global_variables'] = arg_0.global_model.target_network.get_variables() + [
                variable for name in sorted(arg_0.global_model.target_distributions)
                for variable in arg_0.global_model.target_distributions[name].get_variables()
            ]
        return arg_3

Returns the target optimizer arguments including the time the list of variables to optimize and various functions which the optimizer might require to perform an update step .


return self._execute(Command.FIND_ELEMENTS, {
            'using': using,
            'value': value
        })

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . _execute ( Command . FIND_ELEMENTS , { 'using' : arg_1 , 'value' : arg_2 } )

def Func(arg_0, arg_1, arg_2):
        """Find Func in the current context.

        Support:
            Android iOS Web(WebView)

        Args:
            using(str): The element location strategy.
            value(str): The value of the location strategy.

        Returns:
            Return a List<Element | None>, if no element matched, the list is empty.

        Raises:
            WebDriverException.
        """
        return arg_0._execute(Command.FIND_ELEMENTS, {
            'using': arg_1,
            'value': arg_2
        })

Find elements in the current context.

        Support:
            Android iOS Web(WebView)

        Args:
            using(str): The element location strategy.
            value(str): The value of the location strategy.

        Returns:
            Return a List<Element | None>, if no element matched, the list is empty.

        Raises:
            WebDriverException.


def Func(arg_0, arg_1, arg_2, arg_3):
        """Builds the neuron groups from `traj`.

        Adds the neuron groups to `brian_list` and `network_dict`.

        """

        arg_4 = arg_1.parameters.model

        # Create the equations for both models
        arg_5 = arg_0.Func_eqs(arg_1)

        # Create inhibitory neurons
        arg_6 = arg_5['i']
        arg_7 = NeuronGroup(N=arg_4.N_i,
                              arg_4 = arg_6,
                              threshold=arg_4.V_th,
                              reset=arg_4.reset_func,
                              refractory=arg_4.refractory,
                              method='Euler')

        # Create excitatory neurons
        arg_8 = arg_5['e']
        arg_9 = NeuronGroup(N=arg_4.N_e,
                              arg_4 = arg_8,
                              threshold=arg_4.V_th,
                              reset=arg_4.reset_func,
                              refractory=arg_4.refractory,
                              method='Euler')

        # Set the bias terms
        arg_9.mu =rand(arg_4.N_e) * (arg_4.mu_e_max - arg_4.mu_e_min) + arg_4.mu_e_min
        arg_7.mu =rand(arg_4.N_i) * (arg_4.mu_i_max - arg_4.mu_i_min) + arg_4.mu_i_min

        # Set initial membrane potentials
        arg_9.V = rand(arg_4.N_e)
        arg_7.V = rand(arg_4.N_i)

        # Add both groups to the `brian_list` and the `network_dict`
        arg_2.append(arg_7)
        arg_2.append(arg_9)
        arg_3['neurons_e']=arg_9
        arg_3['neurons_i']=arg_7


def Func ( ) : if not arg_2 . _draw_called : return if InlineBackend . instance ( ) . close_figures : try : return arg_2 ( True ) except Exception as e : try : get_ipython except NameError : raise e else : get_ipython ( ) . showtraceback ( ) return try : arg_0 = set ( [ fm . canvas . figure for fm in Gcf . get_all_fig_managers ( ) ] ) for arg_1 in [ arg_1 for arg_1 in arg_2 . _to_draw if arg_1 in arg_0 ] : try : send_figure ( arg_1 ) except Exception as e : try : get_ipython except NameError : raise e else : get_ipython ( ) . showtraceback ( ) break finally : arg_2 . _to_draw = [ ] arg_2 . _draw_called = False

def Func():
    """Send all figures that changed

    This is meant to be called automatically and will call show() if, during
    prior code execution, there had been any calls to draw_if_interactive.

    This function is meant to be used as a post_execute callback in IPython,
    so user-caused errors are handled with showtraceback() instead of being
    allowed to raise.  If this function is not called from within IPython,
    then these exceptions will raise.
    """
    if not arg_2._draw_called:
        return

    if InlineBackend.instance().close_figures:
        # ignore the tracking, just draw and close all figures
        try:
            return arg_2(True)
        except Exception as e:
            # safely show traceback if in IPython, else raise
            try:
                get_ipython
            except NameError:
                raise e
            else:
                get_ipython().showtraceback()
                return
    try:
        # exclude any figures that were closed:
        arg_0 = set([fm.canvas.figure for fm in Gcf.get_all_fig_managers()])
        for arg_1 in [ arg_1 for arg_1 in arg_2._to_draw if arg_1 in arg_0 ]:
            try:
                send_figure(arg_1)
            except Exception as e:
                # safely show traceback if in IPython, else raise
                try:
                    get_ipython
                except NameError:
                    raise e
                else:
                    get_ipython().showtraceback()
                    break
    finally:
        # clear flags for next round
        arg_2._to_draw = []
        arg_2._draw_called = False


def Func ( arg_0 , arg_1 , arg_2 = 1 ) : if not arg_2 : return for arg_3 , arg_4 in arg_0 . items ( ) : arg_5 = [ ] for arg_6 in arg_4 : if arg_6 [ 4 ] < arg_1 : arg_5 . append ( arg_6 ) else : arg_5 . append ( tuple ( list ( arg_6 [ : 4 ] ) + [ arg_6 [ 4 ] + arg_2 ] ) ) arg_0 [ arg_3 ] = arg_5

def Func(arg_0, arg_1, arg_2=1):
    """
    Shift all global field positions.

    Shift all global field positions with global field positions
    higher or equal to 'start' from the value 'delta'.
    """
    if not arg_2:
        return

    for arg_3, arg_4 in arg_0.items():
        arg_5 = []
        for arg_6 in arg_4:
            if arg_6[4] < arg_1:
                arg_5.append(arg_6)
            else:
                # Increment the global field position by delta.
                arg_5.append(tuple(list(arg_6[:4]) + [arg_6[4] + arg_2]))
        arg_0[arg_3] = arg_5


(
        cls, variable, custom=False
    )

def Func(
        arg_0, arg_1, arg_2=False
    ):  # pylint: disable=inconsistent-return-statements
        """
        Switch PyFunceble.CONFIGURATION variables to their opposite.

        :param variable:
            The variable name to Func.
            The variable should be an index our configuration system.
            If we want to Func a bool variable, we should parse
            it here.
        :type variable: str|bool

        :param custom:
            Let us know if have to Func the parsed variable instead
            of our configuration index.
        :type custom: bool

        :return:
            The opposite of the configuration index or the given variable.
        :rtype: bool

        :raises:
            :code:`Exception`
                When the configuration is not valid. In other words,
                if the PyFunceble.CONFIGURATION[variable_name] is not a bool.
        """

        if not arg_2:
            # We are not working with custom variable which is not into
            # the configuration.

            # We get the current state.
            arg_3 = dict.get(PyFunceble.CONFIGURATION, arg_1)
        else:
            # We are working with a custom variable which is not into the
            # configuration
            arg_3 = arg_1

        if isinstance(arg_3, bool):
            # The current state is a boolean.

            if arg_3:
                # The current state is equal to True.

                # We return False.
                return False

            # The current state is equal to False.

            # We return True.
            return True

        # The current state is not a boolean.

        # We set the message to raise.
        arg_4 = "Impossible to Func %s. Please post an issue to %s"

        # We raise an exception inviting the user to report an issue.
        raise Exception(
            arg_4 % (repr(arg_1), PyFunceble.LINKS["repo"] + "/issues.")
        )

Switch PyFunceble.CONFIGURATION variables to their opposite.

        :param variable:
            The variable name to switch.
            The variable should be an index our configuration system.
            If we want to switch a bool variable, we should parse
            it here.
        :type variable: str|bool

        :param custom:
            Let us know if have to switch the parsed variable instead
            of our configuration index.
        :type custom: bool

        :return:
            The opposite of the configuration index or the given variable.
        :rtype: bool

        :raises:
            :code:`Exception`
                When the configuration is not valid. In other words,
                if the PyFunceble.CONFIGURATION[variable_name] is not a bool.

Switch PyFunceble . CONFIGURATION variables to their opposite .


def Func(arg_0):
  ''' normalize raw result to table '''
  arg_1 = 20
  arg_2, arg_3 = [], 0
  for arg_4, arg_5 in arg_0.items():
    for arg_6, arg_7 in arg_5.items():
      for arg_8 in arg_7:
        arg_3 += 1
        if arg_3 > arg_1:
          continue
        else:
          arg_2.append([arg_4, arg_6, arg_8])
  arg_9 = ['role', 'env', 'topology']
  arg_10 = 0 if arg_3 <= arg_1 else arg_3 - arg_1
  return arg_2, arg_9, arg_10


def Func(arg_0, arg_1=None, arg_2=None):
    """From the list of absolute paths to nifti files, creates a Numpy array
    with the masked data.

    Parameters
    ----------
    img_filelist: list of str
        List of absolute file paths to nifti files. All nifti files must have
        the same shape.

    mask_file: str
        Path to a Nifti mask file.
        Should be the same shape as the files in nii_filelist.

    outdtype: dtype
        Type of the elements of the array, if not set will obtain the dtype from
        the first nifti file.

    Returns
    -------
    outmat:
        Numpy array with shape N x prod(vol.shape) containing the N files as flat vectors.

    mask_indices:
        Tuple with the 3D spatial indices of the masking voxels, for reshaping
        with vol_shape and remapping.

    vol_shape:
        Tuple with shape of the volumes, for reshaping.

    """
    arg_3 = check_img(arg_0[0])
    if not arg_2:
        arg_2 = arg_3.dtype

    arg_4, arg_5 = load_mask_data(arg_1)
    arg_6      = np.where      (arg_4)

    arg_7 = check_img(arg_1)

    arg_8 = np.zeros((len(arg_0), np.count_nonzero(arg_4)),
                      dtype=arg_2)

    for arg_9, arg_10 in enumerate(arg_0):
        arg_3 = check_img(arg_10)
        if not are_compatible_imgs(arg_3, arg_7):
            raise NiftiFilesNotCompatible(repr_imgs(arg_3), repr_imgs(arg_1))

        arg_11 = get_img_data(arg_3)
        arg_8[arg_9, :] = arg_11[arg_6]

    return arg_8, arg_4

From the list of absolute paths to nifti files creates a Numpy array with the masked data .


def Func ( arg_0 , arg_1 = None ) : if not arg_0 : return None arg_0 = totz ( arg_0 , arg_1 ) return calendar . timegm ( arg_0 . timetuple ( ) )

def Func(arg_0, arg_1=None):
    """
    Return a Unix timestamp in seconds for the provided datetime. The `totz` function is called
    on the datetime to convert it to the provided timezone. It will be converted to UTC if no
    timezone is provided.
    """
    if not arg_0:
        return None
    arg_0 = totz(arg_0, arg_1)
    return calendar.timegm(arg_0.timetuple())

Return a Unix timestamp in seconds for the provided datetime . The totz function is called on the datetime to convert it to the provided timezone . It will be converted to UTC if no timezone is provided .


(self, fields, no_term_offsets=False,
                     no_field_flags=False, stopwords = None)

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = False , arg_4 = None ) : arg_5 = [ arg_0 . CREATE_CMD , arg_0 . index_name ] if arg_2 : arg_5 . append ( arg_0 . NOOFFSETS ) if arg_3 : arg_5 . append ( arg_0 . NOFIELDS ) if arg_4 is not None and isinstance ( arg_4 , ( list , tuple , set ) ) : arg_5 += [ arg_0 . STOPWORDS , len ( arg_4 ) ] if len ( arg_4 ) > 0 : arg_5 += list ( arg_4 ) arg_5 . append ( 'SCHEMA' ) arg_5 += list ( itertools . chain ( * ( arg_6 . redis_args ( ) for arg_6 in arg_1 ) ) ) return arg_0 . redis . execute_command ( * arg_5 )

def Func(arg_0, arg_1, arg_2=False,
                     arg_3=False, arg_4 = None):
        """
        Create the search index. The index must not already exist.

        ### Parameters:

        - **fields**: a list of TextField or NumericField objects
        - **no_term_offsets**: If true, we will not save term offsets in the index
        - **no_field_flags**: If true, we will not save field flags that allow searching in specific fields
        - **stopwords**: If not None, we create the index with this custom stopword list. The list can be empty
        """

        arg_5 = [arg_0.CREATE_CMD, arg_0.index_name]
        if arg_2:
            arg_5.append(arg_0.NOOFFSETS)
        if arg_3:
            arg_5.append(arg_0.NOFIELDS)
        if arg_4 is not None and isinstance(arg_4, (list, tuple, set)):
            arg_5 += [arg_0.STOPWORDS, len(arg_4)]
            if len(arg_4) > 0:
                arg_5 += list(arg_4)

        arg_5.append('SCHEMA')

        arg_5 += list(itertools.chain(*(arg_6.redis_args() for arg_6 in arg_1)))

        return arg_0.redis.execute_command(*arg_5)

Create the search index . The index must not already exist .


def Func(arg_0, arg_1, arg_2):
    """Select first block delimited by start_tag and end_tag"""
    arg_3 = arg_0.find(arg_1)
    if arg_3 < 0:
        raise ValueError('start_tag not found')
    arg_4 = 0
    for arg_5 in range(arg_3, len(arg_0)):
        if arg_0[arg_5] == arg_1:
            arg_4 += 1
        elif arg_0[arg_5] == arg_2:
            arg_4 -= 1

        if arg_4 == 0:
            break
    arg_6 = arg_0[arg_3 + 1:arg_5]
    return arg_6


def Func(arg_0, arg_1 = None):
        """Request roster from server.

        :Parameters:
            - `version`: if not `None` versioned roster will be requested
              for given local version. Use "" to request full roster.
        :Types:
            - `version`: `unicode`
        """
        arg_2 = arg_0.stanza_processor
        arg_3 = Iq(stanza_type = "get")
        arg_3.set_payload(RosterPayload(arg_1 = arg_1))
        arg_2.set_response_handlers(arg_3,
                                    arg_0._get_success, arg_0._get_error)
        arg_2.send(arg_3)


def Func ( arg_0 , arg_1 ) : if not arg_1 : return None try : arg_2 = client . Credentials . new_from_json ( arg_1 ) except ValueError : arg_2 = None return arg_2

def Func(arg_0, arg_1):
        """Converts our stored JSON string back to the desired type.

        Args:
            value: A value from the datastore to be converted to the
                   desired type.

        Returns:
            A deserialized Credentials (or subclass) object, else None if
            the value can't be parsed.
        """
        if not arg_1:
            return None
        try:
            # Uses the from_json method of the implied class of value
            arg_2 = client.Credentials.new_from_json(arg_1)
        except ValueError:
            arg_2 = None
        return arg_2

Converts our stored JSON string back to the desired type .


def Func(arg_0, **arg_1):
        """
        EXPERIMENTAL GLOBAL OPTIMIZATION
        """

        arg_0.logger("TreeAnc.Func: running branch length optimization...",1)

        def neg_log(arg_2):
            for arg_3, arg_4 in zip(arg_2, arg_0.tree.find_clades(order='preorder')):
                arg_4.branch_length = arg_3**2

            arg_0.infer_ancestral_sequences(marginal=True)

            arg_6 = []
            for arg_3, arg_4 in zip(arg_2, arg_0.tree.find_clades(order='preorder')):
                if arg_4.up:
                    arg_7, arg_8 = arg_0.marginal_branch_profile(arg_4)
                    arg_9 = arg_0.gtr.expQsds(arg_3).T
                    arg_10 = arg_0.gtr.expQs(arg_3).T

                    arg_11 = arg_7.dot(arg_10)
                    arg_12 = np.sum(arg_11*arg_8, axis=1)

                    arg_13 = arg_7.dot(arg_9)
                    arg_14 = np.sum(arg_13*arg_8, axis=1)
                    arg_15 = np.sum(arg_0.multiplicity*arg_14/arg_12)

                    arg_6.append(arg_15)
                else:
                    arg_6.append(2*(arg_3**2-0.001))

            print(-arg_0.tree.sequence_marginal_LH)
            return (-arg_0.tree.sequence_marginal_LH + (arg_2[0]**2-0.001)**2, -1.0*np.array(arg_6))

        from scipy.optimize import minimize
        arg_16 = np.sqrt([arg_4.branch_length for arg_4 in arg_0.tree.find_clades(order='preorder')])
        arg_17 = minimize(neg_log, arg_16, jac=True)

        for arg_18, arg_19 in zip(arg_17['x'], arg_0.tree.find_clades()):
            arg_0.logger("Optimization results: old_len=%.4f, new_len=%.4f "
                   " Updating branch length..."%(arg_19.branch_length, arg_18), 5)

            arg_19.branch_length = arg_18**2
            arg_19.mutation_length=arg_18**2

        # as branch lengths changed, the params must be fixed
        arg_0.tree.root.up = None
        arg_0.tree.root.dist2root = 0.0
        arg_0._prepare_nodes()


(self, client_id, request, *args, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
*
arg_3
,
**
arg_4
)
:
log
.
debug
(
'Validate client %r'
,
arg_1
)
arg_5
=
arg_2
.
client
or
arg_0
.
_clientgetter
(
arg_1
)
if
arg_5
:
arg_2
.
client
=
arg_5
return
True
return
False

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """Ensure client_id belong to a valid and active client."""
        log.debug('Validate client %r', arg_1)
        arg_5 = arg_2.client or arg_0._clientgetter(arg_1)
        if arg_5:
            # attach client to request object
            arg_2.client = arg_5
            return True
        return False

Ensure client_id belong to a valid and active client .


def Func(arg_0, arg_1, arg_2):
        """
        Returns the integer value of the usage mask bitmask. This value is
        stored in the database.

        Args:
            value(list<enums.CryptographicUsageMask>): list of enums in the
            usage mask
            dialect(string): SQL dialect
        """
        arg_3 = 0x00
        for arg_4 in arg_1:
            arg_3 = arg_3 | arg_4.value
        return arg_3

Returns the integer value of the usage mask bitmask . This value is stored in the database .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_0 . parent = arg_1 arg_0 . previous = arg_2 arg_0 . next = None arg_0 . previousSibling = None arg_0 . nextSibling = None if arg_0 . parent and arg_0 . parent . contents : arg_0 . previousSibling = arg_0 . parent . contents [ - 1 ] arg_0 . previousSibling . nextSibling = arg_0

def Func(arg_0, arg_1=None, arg_2=None):
        """Sets up the initial relations between this element and
        other elements."""
        arg_0.parent = arg_1
        arg_0.previous = arg_2
        arg_0.next = None
        arg_0.previousSibling = None
        arg_0.nextSibling = None
        if arg_0.parent and arg_0.parent.contents:
            arg_0.previousSibling = arg_0.parent.contents[-1]
            arg_0.previousSibling.nextSibling = arg_0

Sets up the initial relations between this element and other elements .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = '' ) : if not arg_2 : return arg_1 = int ( arg_1 ) if arg_1 < arg_0 . level : return if arg_1 not in stored_messages_settings . STORE_LEVELS or arg_0 . user . is_anonymous ( ) : return super ( StorageMixin , arg_0 ) . Func ( arg_1 , arg_2 , arg_3 ) arg_0 . Funced_new = True arg_5 = arg_0 . backend . create_message ( arg_1 , arg_2 , arg_3 ) arg_0 . backend . archive_store ( [ arg_0 . user ] , arg_5 ) arg_0 . _queued_messages . append ( arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3=''):
        """
        If the message level was configured for being stored and request.user
        is not anonymous, save it to the database. Otherwise, let some other
        class handle the message.

        Notice: controls like checking the message is not empty and the level
        is above the filter need to be performed here, but it could happen
        they'll be performed again later if the message does not need to be
        stored.
        """
        if not arg_2:
            return
        # Check that the message level is not less than the recording level.
        arg_1 = int(arg_1)
        if arg_1 < arg_0.level:
            return
        # Check if the message doesn't have a level that needs to be persisted
        if arg_1 not in stored_messages_settings.STORE_LEVELS or arg_0.user.is_anonymous():
            return super(StorageMixin, arg_0).Func(arg_1, arg_2, arg_3)

        arg_0.Funced_new = True
        arg_5 = arg_0.backend.create_message(arg_1, arg_2, arg_3)
        arg_0.backend.archive_store([arg_0.user], arg_5)
        arg_0._queued_messages.append(arg_5)

If the message level was configured for being stored and request . user is not anonymous save it to the database . Otherwise let some other class handle the message .


(self, id, drain_spec, mark_eligible=None)

return self.request(id, "drain", json=payload, method="post").json()

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = { } if arg_2 and arg_3 is not None : arg_4 = { "NodeID" : arg_1 , "DrainSpec" : arg_2 , "MarkEligible" : arg_3 } elif arg_2 and arg_3 is None : arg_4 = { "NodeID" : arg_1 , "DrainSpec" : arg_2 } elif not arg_2 and arg_3 is not None : arg_4 = { "NodeID" : arg_1 , "DrainSpec" : None , "MarkEligible" : arg_3 } elif not arg_2 and arg_3 is None : arg_4 = { "NodeID" : arg_1 , "DrainSpec" : None , } return arg_0 . request ( arg_1 , "drain" , json = arg_4 , method = "post" ) . json ( )

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """ This endpoint toggles the drain mode of the node. When draining is enabled,
            no further allocations will be assigned to this node, and existing allocations
            will be migrated to new nodes.

            If an empty dictionary is given as drain_spec this will disable/toggle the drain.

            https://www.nomadproject.io/docs/http/node.html

            arguments:
              - id (str uuid): node id
              - drain_spec (dict): https://www.nomadproject.io/api/nodes.html#drainspec
              - mark_eligible (bool): https://www.nomadproject.io/api/nodes.html#markeligible
            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_4 = {}

        if arg_2 and arg_3 is not None:
            arg_4 = {
                "NodeID": arg_1,
                "DrainSpec": arg_2,
                "MarkEligible": arg_3
            }
        elif arg_2 and arg_3 is None:
            arg_4 = {
                "NodeID": arg_1,
                "DrainSpec": arg_2
            }
        elif not arg_2 and arg_3 is not None:
            arg_4 = {
                "NodeID": arg_1,
                "DrainSpec": None,
                "MarkEligible": arg_3
            }
        elif not arg_2 and arg_3 is None:
            arg_4 = {
                "NodeID": arg_1,
                "DrainSpec": None,
            }

        return arg_0.request(arg_1, "drain", json=arg_4, method="post").json()

This endpoint toggles the drain mode of the node . When draining is enabled no further allocations will be assigned to this node and existing allocations will be migrated to new nodes .


def Func ( arg_0 ) : if arg_0 . show_x_labels : arg_1 = arg_0 . get_x_labels ( ) arg_2 = len ( arg_1 ) arg_1 = enumerate ( iter ( arg_1 ) ) arg_3 = int ( not arg_0 . step_include_first_x_label ) arg_1 = itertools . islice ( arg_1 , arg_3 , None , arg_0 . step_x_labels ) list ( map ( arg_0 . draw_x_label , arg_1 ) ) arg_0 . draw_x_guidelines ( arg_0 . field_width ( ) , arg_2 )

def Func(arg_0):
		"Draw the X axis labels"
		if arg_0.show_x_labels:
			arg_1 = arg_0.get_x_labels()
			arg_2 = len(arg_1)

			arg_1 = enumerate(iter(arg_1))
			arg_3 = int(not arg_0.step_include_first_x_label)
			arg_1 = itertools.islice(arg_1, arg_3, None, arg_0.step_x_labels)
			list(map(arg_0.draw_x_label, arg_1))
			arg_0.draw_x_guidelines(arg_0.field_width(), arg_2)


Render preferences page && save user preferences

return render('preferences.html',
                  locales=settings['locales'],
                  current_locale=get_locale(),
                  image_proxy=image_proxy,
                  engines_by_category=categories,
                  stats=stats,
                  answerers=[{'info': a.self_info(), 'keywords': a.keywords} for a in answerers],
                  disabled_engines=disabled_engines,
                  autocomplete_backends=autocomplete_backends,
                  shortcuts={y: x for x, y in engine_shortcuts.items()},
                  themes=themes,
                  plugins=plugins,
                  doi_resolvers=settings['doi_resolvers'],
                  current_doi_resolver=get_doi_resolver(request.args, request.preferences.get_value('doi_resolver')),
                  allowed_plugins=allowed_plugins,
                  theme=get_current_theme_name(),
                  preferences_url_params=request.preferences.get_as_url_params(),
                  base_url=get_base_url(),
                  preferences=True)

def Func():
    """Render Func page && save user Func"""

    # save Func
    if request.method == 'POST':
        arg_0 = make_response(redirect(urljoin(settings['server']['base_url'], url_for('index'))))
        try:
            request.Func.parse_form(request.form)
        except ValidationException:
            request.errors.append(gettext('Invalid settings, please edit your Func'))
            return arg_0
        return request.Func.save(arg_0)

    # render Func
    arg_1 = request.Func.get_value('image_proxy')
    arg_2 = request.Func.get_value('language')
    arg_3 = request.Func.engines.get_disabled()
    arg_4 = request.Func.plugins.get_enabled()

    # stats for Func page
    arg_5 = {}

    for arg_6 in categories:
        for arg_7 in categories[arg_6]:
            arg_5[arg_7.name] = {'time': None,
                             'warn_timeout': False,
                             'warn_time': False}
            if arg_7.timeout > settings['outgoing']['request_timeout']:
                arg_5[arg_7.name]['warn_timeout'] = True
            arg_5[arg_7.name]['supports_selected_language'] = _is_selected_language_supported(arg_7, request.Func)

    # get first element [0], the engine time,
    # and then the second element [1] : the time (the first one is the label)
    for arg_9 in get_engines_stats()[0][1]:
        arg_5[arg_9.get('name')]['time'] = round(arg_9.get('avg'), 3)
        if arg_9.get('avg') > settings['outgoing']['request_timeout']:
            arg_5[arg_9.get('name')]['warn_time'] = True
    # end of stats

    return render('Func.html',
                  locales=settings['locales'],
                  current_locale=get_locale(),
                  arg_1=arg_1,
                  engines_by_category=categories,
                  arg_5=arg_5,
                  answerers=[{'info': arg_11.self_info(), 'keywords': arg_11.keywords} for arg_11 in answerers],
                  arg_3=arg_3,
                  autocomplete_backends=autocomplete_backends,
                  shortcuts={arg_13: arg_12 for arg_12, arg_13 in engine_shortcuts.items()},
                  themes=themes,
                  plugins=plugins,
                  doi_resolvers=settings['doi_resolvers'],
                  current_doi_resolver=get_doi_resolver(request.args, request.Func.get_value('doi_resolver')),
                  arg_4=arg_4,
                  theme=get_current_theme_name(),
                  Func_url_params=request.Func.get_as_url_params(),
                  base_url=get_base_url(),
                  Func=True)


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = arg_0 . _get_object_handle ( arg_1 , arg_2 ) if arg_3 . AXEnabled : return 1 except LdtpServerException : pass return 0

def Func(arg_0, arg_1, arg_2):
        """
        Check whether an object state is enabled or not

        @param window_name: Window name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string

        @return: 1 on success 0 on failure.
        @rtype: integer
        """
        try:
            arg_3 = arg_0._get_object_handle(arg_1, arg_2)
            if arg_3.AXEnabled:
                return 1
        except LdtpServerException:
            pass
        return 0


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 , arg_4 = [ ] , [ ] , [ ] for arg_5 , arg_6 , arg_7 in arg_1 : try : arg_2 . append ( arg_0 . _format_line ( 0 , arg_7 , * arg_5 ) ) arg_3 . append ( arg_0 . _format_line ( 1 , arg_7 , * arg_6 ) ) except TypeError : arg_2 . append ( None ) arg_3 . append ( None ) arg_4 . append ( arg_7 ) return arg_2 , arg_3 , arg_4

def Func(arg_0,arg_1):
        """Collects mdiff output into separate lists

        Before storing the mdiff from/to data into a list, it is converted
        into a single line of text with HTML markup.
        """

        arg_2,arg_3,arg_4 = [],[],[]
        # pull from/to data and flags from mdiff style iterator
        for arg_5,arg_6,arg_7 in arg_1:
            try:
                # store HTML markup of the lines into the lists
                arg_2.append(arg_0._format_line(0,arg_7,*arg_5))
                arg_3.append(arg_0._format_line(1,arg_7,*arg_6))
            except TypeError:
                # exceptions occur for lines where context separators go
                arg_2.append(None)
                arg_3.append(None)
            arg_4.append(arg_7)
        return arg_2,arg_3,arg_4


(self, states, internals, actions, terminal, reward, next_states, next_internals, update, reference=None)

return q_model_loss + self.supervised_weight * demo_loss

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9=None):
        """
        Combines Q-loss and demo loss.
        """
        arg_10 = arg_0.fn_loss(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=arg_6,
            arg_7=arg_7,
            arg_8=arg_8,
            arg_9=arg_9
        )

        arg_11 = arg_0.fn_demo_loss(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_8=arg_8,
            arg_9=arg_9
        )

        return arg_10 + arg_0.supervised_weight * arg_11


def Func ( arg_0 , arg_1 , arg_2 = "train" ) : from deepy . core . neural_var import NeuralVariable arg_3 = [ ] if arg_2 == "valid" : arg_4 = arg_1 . valid_set ( ) elif arg_2 == "test" : arg_4 = arg_1 . test_set ( ) else : arg_4 = arg_1 . train_set ( ) arg_5 = list ( arg_4 ) [ 0 ] for arg_6 , arg_7 in enumerate ( arg_5 ) : if arg_7 . dtype == "int64" : arg_7 = arg_7 . astype ( "int32" ) if arg_7 . dtype == "float64" : arg_7 = arg_7 . astype ( env . FLOATX ) arg_8 = { 0 : "scalar" , 1 : "vector" , 2 : "matrix" , 3 : "tensor3" , 4 : "tensor4" , 5 : "tensor5" , } arg_9 = arg_8 [ arg_7 . ndim ] if arg_7 . ndim in arg_8 else arg_8 [ 0 ] if arg_7 . dtype . kind == "i" : arg_9 = "i" + arg_9 arg_10 = getattr ( TT , arg_9 ) ( "input_{}_{}" . format ( arg_6 + 1 , arg_9 ) ) arg_11 = arg_7 . shape [ - 1 ] arg_12 = NeuralVariable ( arg_10 , dim = arg_11 ) arg_12 . set_test_value ( arg_7 ) arg_3 . append ( arg_12 ) return arg_3

def Func(arg_0, arg_1, arg_2="train"):
        """
        Create vars given a dataset and set test values.
        Useful when dataset is already defined.
        """
        from deepy.core.neural_var import NeuralVariable
        arg_3 = []
        if arg_2 == "valid":
            arg_4 = arg_1.valid_set()
        elif arg_2 == "test":
            arg_4 = arg_1.test_set()
        else:
            arg_4 = arg_1.train_set()
        arg_5 = list(arg_4)[0]
        for arg_6, arg_7 in enumerate(arg_5):
            if arg_7.dtype == "int64":
                arg_7 = arg_7.astype("int32")
            if arg_7.dtype == "float64":
                arg_7 = arg_7.astype(env.FLOATX)
            arg_8 = {
                0: "scalar",
                1: "vector",
                2: "matrix",
                3: "tensor3",
                4: "tensor4",
                5: "tensor5",
            }
            arg_9 = arg_8[arg_7.ndim] if arg_7.ndim in arg_8 else arg_8[0]
            if arg_7.dtype.kind == "i":
                arg_9 = "i" + arg_9
            arg_10 = getattr(TT, arg_9)("input_{}_{}".format(arg_6 + 1, arg_9))
            arg_11 = arg_7.shape[-1]
            arg_12 = NeuralVariable(arg_10, dim=arg_11)
            arg_12.set_test_value(arg_7)
            arg_3.append(arg_12)
        return arg_3

Create vars given a dataset and set test values . Useful when dataset is already defined .


def Func ( arg_0 ) : while arg_0 . SyntaxTB . last_syntax_error : arg_1 = arg_0 . SyntaxTB . clear_err_state ( ) if not arg_0 . _should_recompile ( arg_1 ) : return try : arg_0 . safe_execfile ( arg_1 . filename , arg_0 . user_ns ) except : arg_0 . showtraceback ( ) else : try : arg_2 = open ( arg_1 . filename ) try : sys . displayhook ( arg_2 . read ( ) ) finally : arg_2 . close ( ) except : arg_0 . showtraceback ( )

def Func(arg_0):
        """The bottom half of the syntax error handler called in the main loop.

        Loop until syntax error is fixed or user cancels.
        """

        while arg_0.SyntaxTB.last_syntax_error:
            # copy and clear last_syntax_error
            arg_1 = arg_0.SyntaxTB.clear_err_state()
            if not arg_0._should_recompile(arg_1):
                return
            try:
                # may set last_syntax_error again if a SyntaxError is raised
                arg_0.safe_execfile(arg_1.filename,arg_0.user_ns)
            except:
                arg_0.showtraceback()
            else:
                try:
                    arg_2 = open(arg_1.filename)
                    try:
                        # This should be inside a display_trap block and I
                        # think it is.
                        sys.displayhook(arg_2.read())
                    finally:
                        arg_2.close()
                except:
                    arg_0.showtraceback()

The bottom half of the syntax error handler called in the main loop .


def Func ( arg_0 , arg_1 , arg_2 = None ) : for arg_3 in arg_1 : arg_4 = arg_3 [ 'name' ] if 'group' in arg_3 : for arg_5 in Func ( arg_0 [ arg_4 ] if arg_4 in arg_0 else { } , arg_3 [ 'group' ] , None if arg_2 is None else '{}.{}' . format ( arg_2 , arg_4 ) ) : yield arg_5 else : if arg_2 is None : yield ( arg_3 , arg_0 ) else : yield ( arg_3 , arg_0 , '{}.{}' . format ( arg_2 , arg_4 ) )

def Func(arg_0, arg_1, arg_2=None):
    """Recursively iterate over all schema sub-fields.

    :param fields: Field instance (e.g. input)
    :type fields: dict
    :param schema: Schema instance (e.g. input_schema)
    :type schema: dict
    :path schema: Field path
    :path schema: string

    """
    for arg_3 in arg_1:
        arg_4 = arg_3['name']
        if 'group' in arg_3:
            for arg_5 in Func(arg_0[arg_4] if arg_4 in arg_0 else {},
                                        arg_3['group'],
                                        None if arg_2 is None else '{}.{}'.format(arg_2, arg_4)):
                yield arg_5
        else:
            if arg_2 is None:
                yield (arg_3, arg_0)
            else:
                yield (arg_3, arg_0, '{}.{}'.format(arg_2, arg_4))

Recursively iterate over all schema sub - fields .


def Func ( arg_0 , arg_1 ) : try : return parse . parse_qs ( parse . urlparse ( arg_0 ) . query ) [ arg_1 ] [ 0 ] except : return None

def Func(arg_0, arg_1):
    """Parses the query string of a URL and returns the value of a parameter.

    Args:
        url: A URL.
        param: A string representing the name of the parameter.

    Returns:
        The value of the parameter.
    """

    try:
        return parse.parse_qs(parse.urlparse(arg_0).query)[arg_1][0]
    except:
        return None

Parses the query string of a URL and returns the value of a parameter .


(self, dep_time, first_leg_can_be_walk=True, connection_arrival_time=None)

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = None ) : arg_4 = list ( ) if arg_2 and arg_0 . _walk_to_target_duration != float ( 'inf' ) : if arg_3 is not None : arg_4 . append ( arg_0 . _get_label_to_target ( arg_3 ) ) else : arg_4 . append ( arg_0 . _get_label_to_target ( arg_1 ) ) if arg_1 in arg_0 . dep_times_to_index : assert ( arg_1 != float ( 'inf' ) ) arg_5 = arg_0 . dep_times_to_index [ arg_1 ] arg_6 = arg_0 . _label_bags [ arg_5 ] arg_7 = merge_pareto_frontiers ( arg_6 , arg_4 ) else : arg_7 = arg_4 if not arg_2 : arg_7 = [ label for label in arg_7 if not label . first_leg_is_walk ] return arg_7

def Func(arg_0, arg_1, arg_2=True, arg_3=None):

        """
        Get the pareto_optimal set of Labels, given a departure time.

        Parameters
        ----------
        dep_time : float, int
            time in unix seconds
        first_leg_can_be_walk : bool, optional
            whether to allow walking to target to be included into the profile
            (I.e. whether this function is called when scanning a pseudo-connection:
            "double" walks are not allowed.)
        connection_arrival_time: float, int, optional
            used for computing the walking label if dep_time, i.e., connection.arrival_stop_next_departure_time, is infinity)
        connection: connection object

        Returns
        -------
        pareto_optimal_labels : set
            Set of Labels
        """
        arg_4 = list()
        # walk label towards target
        if arg_2 and arg_0._walk_to_target_duration != float('inf'):
            # add walk_label
            if arg_3 is not None:
                arg_4.append(arg_0._get_label_to_target(arg_3))
            else:
                arg_4.append(arg_0._get_label_to_target(arg_1))

        # if dep time is larger than the largest dep time -> only walk labels are possible
        if arg_1 in arg_0.dep_times_to_index:
            assert (arg_1 != float('inf'))
            arg_5 = arg_0.dep_times_to_index[arg_1]
            arg_6 = arg_0._label_bags[arg_5]
            arg_7 = merge_pareto_frontiers(arg_6, arg_4)
        else:
            arg_7 = arg_4

        if not arg_2:
            arg_7 = [label for label in arg_7 if not label.first_leg_is_walk]
        return arg_7

Get the pareto_optimal set of Labels given a departure time .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = requests . post ( arg_0 . endpoint + arg_1 , arg_2 = arg_2 , arg_3 = arg_3 ) return arg_4 . text

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Sends the POST request to the Route53 endpoint.

        :param str path: The path to tack on to the endpoint URL for
            the query.
        :param data: Either a dict, or bytes.
        :type data: dict or bytes
        :param dict headers: A dict of headers to send with the request.
        :rtype: str
        :returns: The body of the response.
        """

        arg_4 = requests.post(arg_0.endpoint + arg_1, arg_2=arg_2, arg_3=arg_3)
        return arg_4.text

Sends the POST request to the Route53 endpoint .


def Func ( arg_0 ) : arg_1 = defaultdict ( list ) for arg_2 in arg_0 . classes : arg_3 = arg_2 . __name__ for arg_4 in arg_2 . mro ( ) [ 1 : - 3 ] : arg_1 [ arg_4 . __name__ ] . append ( arg_3 ) arg_5 = { } for arg_6 , arg_7 in arg_0 . aliases . iteritems ( ) : arg_2 , arg_8 = arg_7 . split ( '.' , 1 ) arg_9 = arg_1 [ arg_2 ] if len ( arg_9 ) == 1 : arg_2 = arg_9 [ 0 ] arg_5 [ arg_6 ] = '.' . join ( [ arg_2 , arg_8 ] ) arg_10 = { } for arg_11 , ( arg_12 , arg_13 ) in arg_0 . flags . iteritems ( ) : arg_14 = { } for arg_2 , arg_15 in arg_12 . iteritems ( ) : arg_9 = arg_1 [ arg_2 ] if len ( arg_9 ) == 1 : arg_2 = arg_9 [ 0 ] arg_14 [ arg_2 ] = arg_15 arg_10 [ arg_11 ] = ( arg_14 , arg_13 ) return arg_10 , arg_5

def Func(arg_0):
        """flatten flags and aliases, so cl-args override as expected.

        This prevents issues such as an alias pointing to InteractiveShell,
        but a config file setting the same trait in TerminalInteraciveShell
        getting inappropriate priority over the command-line arg.

        Only aliases with exactly one descendent in the class list
        will be promoted.

        """
        # build a tree of classes in our list that inherit from a particular
        # it will be a dict by parent classname of classes in our list
        # that are descendents
        arg_1 = defaultdict(list)
        for arg_2 in arg_0.classes:
            arg_3 = arg_2.__name__
            for arg_4 in arg_2.mro()[1:-3]:
                # exclude cls itself and Configurable,HasTraits,object
                arg_1[arg_4.__name__].append(arg_3)
        # flatten aliases, which have the form:
        # { 'alias' : 'Class.trait' }
        arg_5 = {}
        for arg_6, arg_7 in arg_0.aliases.iteritems():
            arg_2,arg_8 = arg_7.split('.',1)
            arg_9 = arg_1[arg_2]
            if len(arg_9) == 1:
                # exactly one descendent, promote alias
                arg_2 = arg_9[0]
            arg_5[arg_6] = '.'.join([arg_2,arg_8])

        # flatten flags, which are of the form:
        # { 'key' : ({'Cls' : {'trait' : value}}, 'help')}
        arg_10 = {}
        for arg_11, (arg_12, arg_13) in arg_0.flags.iteritems():
            arg_14 = {}
            for arg_2, arg_15 in arg_12.iteritems():
                arg_9 = arg_1[arg_2]
                # exactly one descendent, promote flag section
                if len(arg_9) == 1:
                    arg_2 = arg_9[0]
                arg_14[arg_2] = arg_15
            arg_10[arg_11] = (arg_14, arg_13)
        return arg_10, arg_5

flatten flags and aliases so cl - args override as expected . This prevents issues such as an alias pointing to InteractiveShell but a config file setting the same trait in TerminalInteraciveShell getting inappropriate priority over the command - line arg .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
if
arg_1
.
tzinfo
is
:
raise
ValueError
(
'Naive time - no tzinfo set'
)
return
arg_1
.
replace
(
tzinfo
=
arg_0
)

def Func(arg_0, arg_1, arg_2=False):
        '''Correct the timezone information on the given datetime'''
        if arg_1.tzinfo is None:
            raise ValueError('Naive time - no tzinfo set')
        return arg_1.replace(tzinfo=arg_0)


def
Func
(
arg_0
)
:
if
arg_0
.
__cdb
is
:
logging
.
debug
(
"Logger: Connecting to "
+
arg_0
.
serverurl
)
arg_0
.
__cdb
=
ConnectorDB
(
arg_0
.
apikey
,
url
=
arg_0
.
serverurl
)
return
arg_0
.
__cdb

def Func(arg_0):
        """Returns the ConnectorDB object that the logger uses. Raises an error if Logger isn't able to connect"""
        if arg_0.__cdb is None:
            logging.debug("Logger: Connecting to " + arg_0.serverurl)
            arg_0.__cdb = ConnectorDB(arg_0.apikey, url=arg_0.serverurl)
        return arg_0.__cdb

Returns the ConnectorDB object that the logger uses . Raises an error if Logger isn t able to connect


(self, stdout=True, stderr=True, other=True)

def Func ( arg_0 , arg_1 = True , arg_2 = True , arg_3 = True ) : if arg_1 : print ( '\033[2K\r' , file = io . stdout , end = '' ) io . stdout . flush ( ) if arg_2 : print ( '\033[2K\r' , file = io . stderr , end = '' ) io . stderr . flush ( )

def Func(arg_0, arg_1=True, arg_2=True, arg_3=True):
        """Clear the output of the cell receiving output."""
        if arg_1:
            print('\033[2K\r', file=io.stdout, end='')
            io.stdout.flush()
        if arg_2:
            print('\033[2K\r', file=io.stderr, end='')
            io.stderr.flush()

Clear the output of the cell receiving output .


def Func(arg_0, arg_1=False):
    """Calculate base id and version from a resource id.

    :params resource_id: Resource id.
    :params return_version: (optional) True if You need version, returns (resource_id, version).
    """
    arg_2 = 0
    arg_0 = arg_0 + 0xC4000000  # 3288334336
    # TODO: version is broken due ^^, needs refactoring

    while arg_0 > 0x01000000:  # 16777216
        arg_2 += 1
        if arg_2 == 1:
            arg_0 -= 0x80000000  # 2147483648  # 0x50000000  # 1342177280 ?  || 0x2000000  # 33554432
        elif arg_2 == 2:
            arg_0 -= 0x03000000  # 50331648
        else:
            arg_0 -= 0x01000000  # 16777216

    if arg_1:
        return arg_0, arg_2 - 67  # just correct "magic number"

    return arg_0

Calculate base id and version from a resource id .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
arg_3
.
BILINEAR
)
:
if
not
_is_pil_image
(
arg_0
)
:
raise
TypeError
(
'img should be PIL Image. Got {}'
.
format
(
type
(
arg_0
)
)
)
if
not
(
isinstance
(
arg_1
,
int
)
or
(
isinstance
(
arg_1
,
Iterable
)
and
len
(
arg_1
)
==
2
)
)
:
raise
TypeError
(
'Got inappropriate size arg: {}'
.
format
(
arg_1
)
)
if
isinstance
(
arg_1
,
int
)
:
arg_5
,
arg_6
=
arg_0
.
size
if
(
arg_5
<=
arg_6
and
arg_5
==
arg_1
)
or
(
arg_6
<=
arg_5
and
arg_6
==
arg_1
)
:
return
arg_0
if
arg_5
<
arg_6
:
arg_7
=
arg_1
arg_8
=
int
(
arg_1
*
arg_6
/
arg_5
)
return
arg_0
.
Func
(
(
arg_7
,
arg_8
)
,
arg_2
)
else
:
arg_8
=
arg_1
arg_7
=
int
(
arg_1
*
arg_5
/
arg_6
)
return
arg_0
.
Func
(
(
arg_7
,
arg_8
)
,
arg_2
)
else
:
return
arg_0
.
Func
(
arg_1
[
:
:
1
]
,
arg_2
)

def Func(arg_0, arg_1, arg_2=arg_3.BILINEAR):
    r"""Resize the input PIL Image to the given size.

    Args:
        img (PIL Image): Image to be Funcd.
        size (sequence or int): Desired output size. If size is a sequence like
            (h, w), the output size will be matched to this. If size is an int,
            the smaller edge of the image will be matched to this number maintaing
            the aspect ratio. i.e, if height > width, then image will be rescaled to
            :math:`\left(\text{size} \times \frac{\text{height}}{\text{width}}, \text{size}\right)`
        interpolation (int, optional): Desired interpolation. Default is
            ``PIL.Image.BILINEAR``

    Returns:
        PIL Image: Resized image.
    """
    if not _is_pil_image(arg_0):
        raise TypeError('img should be PIL Image. Got {}'.format(type(arg_0)))
    if not (isinstance(arg_1, int) or (isinstance(arg_1, Iterable) and len(arg_1) == 2)):
        raise TypeError('Got inappropriate size arg: {}'.format(arg_1))

    if isinstance(arg_1, int):
        arg_5, arg_6 = arg_0.size
        if (arg_5 <= arg_6 and arg_5 == arg_1) or (arg_6 <= arg_5 and arg_6 == arg_1):
            return arg_0
        if arg_5 < arg_6:
            arg_7 = arg_1
            arg_8 = int(arg_1 * arg_6 / arg_5)
            return arg_0.Func((arg_7, arg_8), arg_2)
        else:
            arg_8 = arg_1
            arg_7 = int(arg_1 * arg_5 / arg_6)
            return arg_0.Func((arg_7, arg_8), arg_2)
    else:
        return arg_0.Func(arg_1[::-1], arg_2)

r"""Resize the input PIL Image to the given size.

    Args:
        img (PIL Image): Image to be resized.
        size (sequence or int): Desired output size. If size is a sequence like
            (h, w), the output size will be matched to this. If size is an int,
            the smaller edge of the image will be matched to this number maintaing
            the aspect ratio. i.e, if height > width, then image will be rescaled to
            :math:`\left(\text{size} \times \frac{\text{height}}{\text{width}}, \text{size}\right)`
        interpolation (int, optional): Desired interpolation. Default is
            ``PIL.Image.BILINEAR``

    Returns:
        PIL Image: Resized image.

r Resize the input PIL Image to the given size .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
' | '
.
join
(
field
)
for
field
in
zip
(
arg_0
,
arg_1
)
]
return
'\n'
.
join
(
arg_2
)

def Func(arg_0, arg_1):
    """Format a row."""
    arg_2 = [' | '.join(field) for field in zip(arg_0, arg_1)]
    return '\n'.join(arg_2)


(self,
                       configs: Iterable[MetricConfig])

def Func ( arg_0 , arg_1 : arg_2 [ arg_3 ] ) -> Dict [ str , Metric ] : arg_4 : Dict [ str , Metric ] = { config . name : arg_0 . _register_metric ( config ) for config in arg_1 } arg_0 . _metrics . update ( arg_4 ) return arg_4

def Func(arg_0,
                       arg_1: arg_2[arg_3]) -> Dict[str, Metric]:
        """Create Prometheus metrics from a list of MetricConfigs."""
        arg_4: Dict[str, Metric] = {
            config.name: arg_0._register_metric(config)
            for config in arg_1
        }
        arg_0._metrics.update(arg_4)
        return arg_4

Create Prometheus metrics from a list of MetricConfigs .


Yield unique values in iterable, preserving order.

def Func ( arg_0 ) : arg_1 = set ( ) for arg_2 in arg_0 : if not arg_2 in arg_1 : arg_1 . add ( arg_2 ) yield arg_2

def Func(arg_0):
    """
    Yield Func values in iterable, preserving order.
    """
    arg_1 = set()
    for arg_2 in arg_0:
        if not arg_2 in arg_1:
            arg_1.add(arg_2)
            yield arg_2

Yield unique values in iterable preserving order .


(self, service_name, deployment_name, role_name, lun,
                      host_caching=None, media_link=None, disk_label=None,
                      disk_name=None, logical_disk_size_in_gb=None,
                      source_media_link=None)

return self._perform_post(
            self._get_data_disk_path(service_name, deployment_name, role_name),
            _XmlSerializer.data_virtual_hard_disk_to_xml(
                host_caching,
                disk_label,
                disk_name,
                lun,
                logical_disk_size_in_gb,
                media_link,
                source_media_link),
            as_async=True)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                      arg_5=None, arg_6=None, arg_7=None,
                      arg_8=None, arg_9=None,
                      arg_10=None):
        '''
        Adds a data disk to a virtual machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        lun:
            Specifies the Logical Unit Number (LUN) for the disk. The LUN
            specifies the slot in which the data drive appears when mounted
            for usage by the virtual machine. Valid LUN values are 0 through 15.
        host_caching:
            Specifies the platform caching behavior of data disk blob for
            read/write efficiency. The default vault is ReadOnly. Possible
            values are: None, ReadOnly, ReadWrite
        media_link:
            Specifies the location of the blob in Windows Azure blob store
            where the media for the disk is located. The blob location must
            belong to the storage account in the subscription specified by the
            <subscription-id> value in the operation call. Example:
            http://example.blob.core.windows.net/disks/mydisk.vhd
        disk_label:
            Specifies the description of the data disk. When you attach a disk,
            either by directly referencing a media using the MediaLink element
            or specifying the target disk size, you can use the DiskLabel
            element to customize the name property of the target data disk.
        disk_name:
            Specifies the name of the disk. Windows Azure uses the specified
            disk to create the data disk for the machine and populates this
            field with the disk name.
        logical_disk_size_in_gb:
            Specifies the size, in GB, of an empty disk to be attached to the
            role. The disk can be created as part of disk attach or create VM
            role call by specifying the value for this property. Windows Azure
            creates the empty disk based on size preference and attaches the
            newly created disk to the Role.
        source_media_link:
            Specifies the location of a blob in account storage which is
            mounted as a data disk when the virtual machine is created.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        _validate_not_none('lun', arg_4)
        return arg_0._perform_post(
            arg_0._get_data_disk_path(arg_1, arg_2, arg_3),
            _XmlSerializer.data_virtual_hard_disk_to_xml(
                arg_5,
                arg_7,
                arg_8,
                arg_4,
                arg_9,
                arg_6,
                arg_10),
            as_async=True)


def Func(arg_0):
        """ Called if trajectory is expanded, deletes all explored parameters from disk """
        for arg_1 in arg_0._explored_parameters.values():
            if arg_1._stored:
                try:
                    arg_0.f_delete_item(arg_1)
                except Exception:
                    arg_0._logger.exception('Could not delete expanded parameter `%s` '
                                           'from disk.' % arg_1.v_full_name)

Called if trajectory is expanded deletes all explored parameters from disk


(preference, field=None, verbose_name=None, help_text='', static=True, readonly=False)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = '' , arg_4 = True , arg_5 = False ) : try : arg_6 = bind_proxy ( ( arg_0 , ) , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , ) return arg_6 [ 0 ] except IndexError : return

def Func(arg_0, arg_1=None, arg_2=None, arg_3='', arg_4=True, arg_5=False):
    """Marks a Funcerence.

    :param Funcerence: Preference variable.

    :param Field field: Django model field to represent this Funcerence.

    :param str|unicode verbose_name: Field verbose name.

    :param str|unicode help_text: Field help text.

    :param bool static: Leave this Funcerence static (do not store in DB).

    :param bool readonly: Make this field read only.

    :rtype: PrefProxy|None
    """
    try:
        arg_6 = bind_proxy(
            (arg_0,),
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
        )
        return arg_6[0]

    except IndexError:
        return

Marks a preference.

    :param preference: Preference variable.

    :param Field field: Django model field to represent this preference.

    :param str|unicode verbose_name: Field verbose name.

    :param str|unicode help_text: Field help text.

    :param bool static: Leave this preference static (do not store in DB).

    :param bool readonly: Make this field read only.

    :rtype: PrefProxy|None


def Func ( arg_0 , arg_1 = True , arg_2 = None ) : return arg_0 . _in_queue . get ( arg_1 , arg_2 )

def Func(arg_0, arg_1=True, arg_2=None):
        "Gets a message if there is one that is ready."
        return arg_0._in_queue.get(arg_1, arg_2)

Gets a message if there is one that is ready .


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

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

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

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

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

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

Generates square wave `SamplePulse`.

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

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


def Func(arg_0, arg_1=None, arg_2=None):
    """colorize message by wrapping it with ansi escape codes

    :type msg: str or unicode
    :param msg: the message string to colorize

    :type color: str or None
    :param color:
      the color identifier (see `ANSI_COLORS` for available values)

    :type style: str or None
    :param style:
      style string (see `ANSI_COLORS` for available values). To get
      several style effects at the same time, use a coma as separator.

    :raise KeyError: if an unexistent color or style identifier is given

    :rtype: str or unicode
    :return: the ansi escaped string
    """
    # If both color and style are not defined, then leave the text as is
    if arg_1 is None and arg_2 is None:
        return arg_0
    arg_3 = _get_ansi_code(arg_1, arg_2)
    # If invalid (or unknown) color, don't wrap msg with ansi codes
    if arg_3:
        return "%s%s%s" % (arg_3, arg_0, ANSI_RESET)
    return arg_0


(self, queues=None, edge=None, edge_type=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """Tells the queues to stop collecting data on agents.

        If none of the parameters are given then every
        :class:`.QueueServer` will stop collecting data.

        Parameters
        ----------
        queues : int, *array_like* (optional)
            The edge index (or an iterable of edge indices) identifying
            the :class:`QueueServer(s)<.QueueServer>` that will stop
            collecting data.
        edge : 2-tuple of int or *array_like* (optional)
            Explicitly specify which queues will stop collecting data.
            Must be either:

            * A 2-tuple of the edge's source and target vertex
              indices, or
            * An iterable of 2-tuples of the edge's source and
              target vertex indices.

        edge_type : int or an iterable of int (optional)
            A integer, or a collection of integers identifying which
            edge types will stop collecting data.
        """
        arg_1 = _get_queues(arg_0.g, arg_1, arg_2, arg_3)

        for arg_4 in arg_1:
            arg_0.edge2queue[arg_4].collect_data = False

Tells the queues to stop collecting data on agents .


def Func ( arg_0 , ** arg_1 ) : for arg_2 in arg_0 . _generateChildren ( ) : if arg_2 . _match ( ** arg_1 ) : yield arg_2

def Func(arg_0, **arg_1):
        """Generator which yields matches on AXChildren."""
        for arg_2 in arg_0._generateChildren():
            if arg_2._match(**arg_1):
                yield arg_2

Generator which yields matches on AXChildren .


def
Func
(
arg_0
)
:
with
arg_0
.
_lock
:
logger
.
debug
(
"expdict.Func. timeouts: {0!r}"
.
format
(
arg_0
.
_timeouts
)
)
arg_1
=
for
arg_2
in
arg_0
.
_timeouts
.
keys
(
)
:
arg_3
=
arg_0
.
_Func_item
(
arg_2
)
if
arg_3
is
not
:
if
arg_1
is
:
arg_1
=
arg_3
else
:
arg_1
=
min
(
arg_1
,
arg_3
)
return
arg_1

def Func(arg_0):
        """Do the expiration of dictionary items.

        Remove items that Funcd by now from the dictionary.

        :Return: time, in seconds, when the next item Funcs or `None`
        :returntype: `float`
        """
        with arg_0._lock:
            logger.debug("expdict.Func. timeouts: {0!r}"
                                                    .format(arg_0._timeouts))
            arg_1 = None
            for arg_2 in arg_0._timeouts.keys():
                arg_3 = arg_0._Func_item(arg_2)
                if arg_3 is not None:
                    if arg_1 is None:
                        arg_1 = arg_3
                    else:
                        arg_1 = min(arg_1, arg_3)
            return arg_1

Do the expiration of dictionary items.

        Remove items that expired by now from the dictionary.

        :Return: time, in seconds, when the next item expires or `None`
        :returntype: `float`


def Func(arg_0, arg_1, arg_2=None):
        """
        Stores a transition in replay memory.

        If the memory is full, the oldest entry is replaced.
        """
        if not arg_0._isfull():
            arg_0._memory.append(None)
        arg_3 = arg_0._next_position_then_increment()
        arg_4 = 0 if arg_0._memory[arg_3] is None \
            else (arg_0._memory[arg_3].priority or 0)
        arg_5 = _SumRow(arg_1, arg_2)
        arg_0._memory[arg_3] = arg_5
        arg_0._update_internal_nodes(
            arg_3, (arg_5.priority or 0) - arg_4)


def Func ( arg_0 , arg_1 ) : arg_2 = urllib . parse . urlparse ( arg_0 ) arg_3 = parse_unique_urlencoded ( arg_2 . query ) arg_3 . update ( arg_1 ) arg_4 = urllib . parse . urlencode ( arg_3 ) arg_5 = arg_2 . _replace ( query = arg_4 ) return urllib . parse . urlunparse ( arg_5 )

def Func(arg_0, arg_1):
    """Updates a URI with new query parameters.

    If a given key from ``params`` is repeated in the ``uri``, then
    the URI will be considered invalid and an error will occur.

    If the URI is valid, then each value from ``params`` will
    replace the corresponding value in the query parameters (if
    it exists).

    Args:
        uri: string, A valid URI, with potential existing query parameters.
        params: dict, A dictionary of query parameters.

    Returns:
        The same URI but with the new query parameters added.
    """
    arg_2 = urllib.parse.urlparse(arg_0)
    arg_3 = parse_unique_urlencoded(arg_2.query)
    arg_3.update(arg_1)
    arg_4 = urllib.parse.urlencode(arg_3)
    arg_5 = arg_2._replace(query=arg_4)
    return urllib.parse.urlunparse(arg_5)

Updates a URI with new query parameters .


(parser: Union[Parser, Sequence[Input]], separator: Union[Parser, Sequence[Input]])

def Func ( arg_0 : arg_1 [ arg_2 , arg_3 [ arg_4 ] ] , arg_5 : arg_1 [ arg_2 , arg_3 [ arg_4 ] ] ) -> RepeatedOnceSeparatedParser : if isinstance ( arg_0 , str ) : arg_0 = lit ( arg_0 ) if isinstance ( arg_5 , str ) : arg_5 = lit ( arg_5 ) return RepeatedOnceSeparatedParser ( arg_0 , arg_5 )

def Func(arg_0: arg_1[arg_2, arg_3[arg_4]], arg_5: arg_1[arg_2, arg_3[arg_4]]) \
        -> RepeatedOnceSeparatedParser:
    """Match a parser one or more times separated by another parser.

    This matches repeated sequences of ``parser`` separated by ``separator``.
    If there is at least one match, a list containing the values of the
    ``parser`` matches is returned. The values from ``separator`` are discarded.
    If it does not match ``parser`` at all, it fails.

    Args:
        parser: Parser or literal
        separator: Parser or literal
    """
    if isinstance(arg_0, str):
        arg_0 = lit(arg_0)
    if isinstance(arg_5, str):
        arg_5 = lit(arg_5)
    return RepeatedOnceSeparatedParser(arg_0, arg_5)

Match a parser one or more times separated by another parser .


def Func ( arg_0 , arg_1 = '' , arg_2 = None ) : arg_3 = arg_0 . input . Func ( ) if not arg_3 : raise EOFError return arg_3 . rstrip ( "\n" )

def Func(arg_0, arg_1='', arg_2=None):
        """Read a line of input. Prompt and use_raw exist to be
        compatible with other input routines and are ignored.
        EOFError will be raised on EOF.
        """
        arg_3 = arg_0.input.Func()
        if not arg_3: raise EOFError
        return arg_3.rstrip("\n")

Read a line of input . Prompt and use_raw exist to be compatible with other input routines and are ignored . EOFError will be raised on EOF .


return gaussian_kernel_1d / numpy.sum(gaussian_kernel_1d)

def Func ( arg_0 = 11 , arg_1 = 1.5 ) : arg_2 = numpy . ndarray ( ( arg_0 ) ) arg_3 = int ( arg_0 / 2 ) for arg_4 in range ( arg_0 ) : arg_2 [ arg_4 ] = ( exp ( - ( ( ( arg_4 - arg_3 ) ** 2 ) ) / ( 2 * ( arg_1 ** 2 ) ) ) ) return arg_2 / numpy . sum ( arg_2 )

def Func(arg_0=11, arg_1=1.5):
    """Generate a gaussian kernel."""
    # 1D Gaussian kernel definition
    arg_2 = numpy.ndarray((arg_0))
    arg_3 = int(arg_0 / 2)

    # Fill Gaussian kernel
    for arg_4 in range(arg_0):
        arg_2[arg_4] = (exp(-(((arg_4 - arg_3) ** 2)) /
                                     (2 * (arg_1 ** 2))))
    return arg_2 / numpy.sum(arg_2)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . getInferenceType ( ) arg_2 = arg_2 [ : 1 ] . lower ( ) + arg_2 [ 1 : ] arg_1 . inferenceType = arg_2 arg_1 . numPredictions = arg_0 . _numPredictions arg_1 . learningEnabled = arg_0 . __learningEnabled arg_1 . inferenceEnabled = arg_0 . __inferenceEnabled arg_1 . inferenceArgs = json . dumps ( arg_0 . __inferenceArgs )

def Func(arg_0, arg_1):
    """Save the state maintained by the Model base class

    :param proto: capnp ModelProto message builder
    """
    arg_2 = arg_0.getInferenceType()
    # lower-case first letter to be compatible with capnproto enum naming
    arg_2 = arg_2[:1].lower() + arg_2[1:]
    arg_1.inferenceType = arg_2

    arg_1.numPredictions = arg_0._numPredictions

    arg_1.learningEnabled = arg_0.__learningEnabled
    arg_1.inferenceEnabled = arg_0.__inferenceEnabled
    arg_1.inferenceArgs = json.dumps(arg_0.__inferenceArgs)


def Func ( arg_0 ) : arg_1 = ( 10 , 9.5 , 8.5 , 7.5 , 5 ) for arg_2 in range ( len ( arg_1 ) ) : if arg_0 >= arg_1 [ arg_2 ] : return BADGE_COLORS [ arg_2 ] return BADGE_COLORS [ - 1 ]

def Func(arg_0):
    """Return Pylint badge color.

    Parameters
    ----------
    score : float
        A Pylint score

    Returns
    -------
    str
        Badge color

    """
    # These are the score cutoffs for each color above.
    # I.e. score==10 -> brightgreen, down to 7.5 > score >= 5 -> orange
    arg_1 = (10, 9.5, 8.5, 7.5, 5)
    for arg_2 in range(len(arg_1)):
        if arg_0 >= arg_1[arg_2]:
            return BADGE_COLORS[arg_2]
    # and score < 5 -> red
    return BADGE_COLORS[-1]


def Func(arg_0):
    """Return the largest connected component of a 3D array.

    Parameters
    -----------
    volume: numpy.array
        3D boolean array.

    Returns
    --------
    volume: numpy.array
        3D boolean array with only one connected component.
    """
    # We use asarray to be able to work with masked arrays.
    arg_0 = np.asarray(arg_0)
    arg_1, arg_2 = scn.label(arg_0)
    if not arg_2:
        raise ValueError('No non-zero values: no connected components found.')

    if arg_2 == 1:
        return arg_0.astype(np.bool)

    arg_3 = np.bincount(arg_1.ravel().astype(np.int))
    # discard the 0 label
    arg_3[0] = 0
    return arg_1 == arg_3.argmax()

Return the largest connected component of a 3D array .


remove records from collection whose parameters match kwargs

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_2 . pop ( 'callback' ) yield Op ( arg_0 . db [ arg_1 ] . Func , arg_2 ) arg_3 ( )

def Func(arg_0, arg_1, **arg_2):
        '''
        Func records from collection whose parameters match kwargs
        '''
        arg_3 = arg_2.pop('callback')
        yield Op(arg_0.db[arg_1].Func, arg_2)
        arg_3()


def Func ( arg_0 ) : with rasterio . open ( arg_0 . path , "r" ) as src : return deepcopy ( src . meta )

def Func(arg_0):
        """Return raster metadata."""
        with rasterio.open(arg_0.path, "r") as src:
            return deepcopy(src.meta)


def Func ( arg_0 , arg_1 ) : if arg_0 in [ 'less' , 'more' ] : if arg_1 : arg_2 = '+' + str ( arg_1 ) else : arg_2 = '' else : arg_2 = '' return arg_2

def Func(arg_0, arg_1):
    """Return the string for paging files with an offset.

    This is the '+N' argument which less and more (under Unix) accept.
    """

    if arg_0 in ['less','more']:
        if arg_1:
            arg_2 = '+' + str(arg_1)
        else:
            arg_2 = ''
    else:
        arg_2 = ''
    return arg_2

Return the string for paging files with an offset .


def
Func
(
arg_0
,
arg_1
)
:
ekm_log
(
"(Func | "
+
arg_0
.
getContext
(
)
+
") "
+
arg_1
)
arg_0
.
m_command_msg
=
arg_1

def Func(arg_0, arg_1):
        """ Internal method to set the command result string.

        Args:
            msg (str): Message built during command.
        """
        ekm_log("(Func | " + arg_0.getContext() + ") " + arg_1)
        arg_0.m_command_msg = arg_1

Internal method to set the command result string .


(current_state: State,
                             proposed_state: State,
                             energy_change: FloatTensor,
                             seed=None)

return next_state, is_accepted, log_uniform

def Func ( arg_0 : arg_1 , arg_2 : arg_1 , arg_3 : arg_4 , arg_5 = None ) -> Tuple [ arg_1 , tf . Tensor , tf . Tensor ] : arg_6 = tf . nest . flatten ( arg_0 ) arg_7 = nest . flatten_up_to ( arg_0 , arg_2 ) arg_6 = [ p if c is None else c for p , c in zip ( arg_7 , arg_6 ) ] arg_0 = tf . nest . pack_sequence_as ( arg_0 , arg_6 ) arg_0 = tf . nest . map_structure ( tf . convert_to_tensor , arg_0 ) arg_2 = tf . nest . map_structure ( tf . convert_to_tensor , arg_2 ) arg_3 = tf . convert_to_tensor ( value = arg_3 ) arg_8 = - arg_3 arg_9 = tf . math . log ( tf . random . uniform ( shape = tf . shape ( input = arg_8 ) , dtype = arg_8 . dtype . base_dtype , arg_5 = arg_5 ) ) arg_10 = arg_9 < arg_8 arg_11 = mcmc_util . choose ( arg_10 , arg_2 , arg_0 , name = 'choose_next_state' ) return arg_11 , arg_10 , arg_9

def Func(arg_0: arg_1,
                             arg_2: arg_1,
                             arg_3: arg_4,
                             arg_5=None) -> Tuple[arg_1, tf.Tensor, tf.Tensor]:
  """Metropolis-Hastings step.

  This probabilistically chooses between `current_state` and `proposed_state`
  based on the `energy_change` so as to preserve detailed balance.

  Energy change is the negative of `log_accept_ratio`.

  Args:
    current_state: Current state.
    proposed_state: Proposed state.
    energy_change: E(proposed_state) - E(previous_state).
    seed: For reproducibility.

  Returns:
    new_state: The chosen state.
    is_accepted: Whether the proposed state was accepted.
    log_uniform: The random number that was used to select between the two
      states.
  """
  arg_6 = tf.nest.flatten(arg_0)
  arg_7 = nest.flatten_up_to(arg_0, arg_2)
  # Impute the None's in the current state.
  arg_6 = [
      p if c is None else c for p, c in zip(arg_7, arg_6)
  ]
  arg_0 = tf.nest.pack_sequence_as(arg_0, arg_6)

  arg_0 = tf.nest.map_structure(tf.convert_to_tensor, arg_0)
  arg_2 = tf.nest.map_structure(tf.convert_to_tensor, arg_2)
  arg_3 = tf.convert_to_tensor(value=arg_3)

  arg_8 = -arg_3

  arg_9 = tf.math.log(
      tf.random.uniform(
          shape=tf.shape(input=arg_8),
          dtype=arg_8.dtype.base_dtype,
          arg_5=arg_5))
  arg_10 = arg_9 < arg_8

  arg_11 = mcmc_util.choose(
      arg_10, arg_2, arg_0, name='choose_next_state')
  return arg_11, arg_10, arg_9


return filter(lambda x: isinstance(x, element), source)

def Func ( arg_0 ) : if isinstance ( arg_0 , element ) : arg_0 = arg_0 . xml_children return filter ( lambda x : isinstance ( x , element ) , arg_0 )

def Func(arg_0):
    '''
    Yields all the elements from the source
    source - if an element, yields all child elements in order; if any other iterator yields the elements from that iterator
    '''
    if isinstance(arg_0, element):
        arg_0 = arg_0.xml_children
    return filter(lambda x: isinstance(x, element), arg_0)

Yields all the elements from the source source - if an element yields all child elements in order ; if any other iterator yields the elements from that iterator


def Func(arg_0):
    """Checks that the given widget contains the required fields"""

    if not has_valid_id(arg_0):
        raise InvalidWidget("%s must contain a valid 'id' attribute" % arg_0.__name__)

    if not has_valid_name(arg_0):
        raise InvalidWidget("%s must contain a valid 'name' attribute" % arg_0.__name__)

    if not has_valid_template(arg_0):
        raise InvalidWidget("%s must contain a valid 'template' attribute" % arg_0.__name__)

    if not hasattr(arg_0, 'zones') or not arg_0.zones:
        raise InvalidWidget("%s must be compatible with at least one zone" % arg_0.__name__)


return tuple(_to_int(part) for part in version.split('.'))

def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
local_renderer
with
arg_0
.
settings
(
hide
(
'running'
,
'warnings'
)
,
warn_only
=
True
)
:
arg_2
=
arg_1
.
local
(
'vagrant --version'
,
capture
=
True
)
if
arg_2
.
failed
:
return
arg_3
=
arg_2
.
splitlines
(
)
[
1
]
Func
=
re
.
match
(
r'Vagrant (?:v(?:ersion )?)?(.*)'
,
arg_3
)
.
group
(
1
)
return
tuple
(
_to_int
(
arg_5
)
for
arg_5
in
Func
.
split
(
'.'
)
)

def Func(arg_0):
        """
        Get the Vagrant version.
        """
        arg_1 = arg_0.local_renderer
        with arg_0.settings(hide('running', 'warnings'), warn_only=True):
            arg_2 = arg_1.local('vagrant --version', capture=True)
        if arg_2.failed:
            return None
        arg_3 = arg_2.splitlines()[-1]
        Func = re.match(r'Vagrant (?:v(?:ersion )?)?(.*)', arg_3).group(1)
        return tuple(_to_int(arg_5) for arg_5 in Func.split('.'))


def Func ( arg_0 , arg_1 ) : if arg_1 : return sum ( map ( lambda g : g . intensities_from_grid ( arg_0 ) , arg_1 ) ) else : return np . full ( ( arg_0 . shape [ 0 ] ) , 0.0 )

def Func(arg_0, arg_1):
    """Compute the intensities of a list of galaxies from an input grid, by summing the individual intensities \
    of each galaxy's light profile.

    If the input grid is a *grids.SubGrid*, the intensites is calculated on the sub-grid and binned-up to the \
    original regular grid by taking the mean value of every set of sub-pixels.

    If no galaxies are entered into the function, an array of all zeros is returned.

    Parameters
    -----------
    grid : RegularGrid
        The grid (regular or sub) of (y,x) arc-second coordinates at the centre of every unmasked pixel which the \
        intensities are calculated on.
    galaxies : [galaxy.Galaxy]
        The galaxies whose light profiles are used to compute the surface densities.
    """
    if arg_1:
        return sum(map(lambda g: g.intensities_from_grid(arg_0), arg_1))
    else:
        return np.full((arg_0.shape[0]), 0.0)

Compute the intensities of a list of galaxies from an input grid by summing the individual intensities \ of each galaxy s light profile .


def
Func
(
arg_0
)
:
arg_0
.
MLEN
=
arg_0
.
verboseRead
(
MetablockLengthAlphabet
(
)
)
if
arg_0
.
MLEN
:
return
False
arg_0
.
verboseRead
(
ReservedAlphabet
(
)
)
arg_2
=
arg_0
.
verboseRead
(
SkipLengthAlphabet
(
)
)
arg_0
.
verboseRead
(
FillerAlphabet
(
streamPos
=
arg_0
.
stream
.
pos
)
)
arg_0
.
stream
.
pos
+=
8
*
arg_2
print
(
"Skipping to {:x}"
.
format
(
arg_0
.
stream
.
pos
>>
3
)
)
return
True

def Func(arg_0):
        """Read MNIBBLES and meta block length;
        if empty block, skip block and return true.
        """
        arg_0.MLEN = arg_0.verboseRead(MetablockLengthAlphabet())
        if arg_0.MLEN:
            return False
        #empty block; skip and return False
        arg_0.verboseRead(ReservedAlphabet())
        arg_2 = arg_0.verboseRead(SkipLengthAlphabet())
        arg_0.verboseRead(FillerAlphabet(streamPos=arg_0.stream.pos))
        arg_0.stream.pos += 8*arg_2
        print("Skipping to {:x}".format(arg_0.stream.pos>>3))
        return True

Read MNIBBLES and meta block length ; if empty block skip block and return true .


def Func ( arg_0 , ** arg_1 ) : arg_2 = list_group_policies ( arg_0 [ 'GroupName' ] ) arg_3 = { } for arg_4 in arg_2 : arg_3 [ arg_4 ] = get_group_policy_document ( arg_0 [ 'GroupName' ] , arg_4 , ** arg_1 ) return arg_3

def Func(arg_0, **arg_1):
    """Get the inline policies for the group."""
    arg_2 = list_group_policies(arg_0['GroupName'])

    arg_3 = {}

    for arg_4 in arg_2:
        arg_3[arg_4] = get_group_policy_document(arg_0['GroupName'], arg_4, **arg_1)

    return arg_3