(self, distance, category, num_pois=1, max_distance=None,
                     imp_name=None, include_poi_ids=False)

def Func(arg_0, arg_1, arg_2, arg_3=1, arg_4=None,
                     arg_5=None, arg_6=False):
        """
        Find the distance to the nearest pois from each source node.  The
        bigger values in this case mean less accessibility.

        Parameters
        ----------
        distance : float
            The maximum distance to look for pois. This will usually be a
            distance unit in meters however if you have customized the
            impedance this could be in other units such as utility or time
            etc.
        category : string
            The name of the category of poi to look for
        num_pois : int
            The number of pois to look for, this also sets the number of
            columns in the DataFrame that gets returned
        max_distance : float, optional
            The value to set the distance to if there is NO poi within the
            specified distance - if not specified, gets set to distance. This
            will usually be a distance unit in meters however if you have
            customized the impedance this could be in other units such as
            utility or time etc.
        imp_name : string, optional
            The impedance name to use for the aggregation on this network.
            Must be one of the impedance names passed in the constructor of
            this object.  If not specified, there must be only one impedance
            passed in the constructor, which will be used.
        include_poi_ids : bool, optional
            If this flag is set to true, the call will add columns to the
            return DataFrame - instead of just returning the distance for
            the nth POI, it will also return the id of that POI.  The names
            of the columns with the poi ids will be poi1, poi2, etc - it
            will take roughly twice as long to include these ids as to not
            include them

        Returns
        -------
        d : Pandas DataFrame
            Like aggregate, this series has an index of all the node ids for
            the network.  Unlike aggregate, this method returns a dataframe
            with the number of columns equal to the distances to the Nth
            closest poi.  For instance, if you ask for the 10 closest poi to
            each node, column d[1] wil be the distance to the 1st closest poi
            of that category while column d[2] will be the distance to the 2nd
            closest poi, and so on.
        """
        if arg_4 is None:
            arg_4 = arg_1

        if arg_2 not in arg_0.poi_category_names:
            assert 0, "Need to call set_pois for this category"

        if arg_3 > arg_0.max_pois:
            assert 0, "Asking for more pois than set in init_pois"

        arg_7 = arg_0._imp_name_to_num(arg_5)

        arg_8, arg_9 = arg_0.net.find_all_Func(
            arg_1,
            arg_3,
            arg_2.encode('utf-8'),
            arg_7)
        arg_8[arg_8 == -1] = arg_4

        arg_10 = pd.DataFrame(arg_8, index=arg_0.node_ids)
        arg_10.columns = list(range(1, arg_3+1))

        if arg_6:
            arg_12 = pd.DataFrame(arg_9, index=arg_0.node_ids)
            arg_12.columns = ["poi%d" % i for i in range(1, arg_3+1)]
            for arg_13 in arg_12.columns:
                # if this is still all working according to plan at this point
                # the great magic trick is now to turn the integer position of
                # the poi, which is painstakingly returned from the c++ code,
                # and turn it into the actual index that was used when it was
                # initialized as a pandas series - this really is pandas-like
                # thinking.  it's complicated on the inside, but quite
                # intuitive to the user I think
                arg_14 = arg_12[arg_13].astype('int')
                arg_12[arg_13] = arg_0.poi_category_indexes[arg_2].values[arg_14]
                arg_12.loc[arg_14 == -1, arg_13] = np.nan

            arg_10 = pd.concat([arg_10, arg_12], axis=1)

        return arg_10

Find the distance to the nearest pois from each source node . The bigger values in this case mean less accessibility .


def Func(arg_0):
		"""
		Calculate the margin in pixels above the plot area, setting
		border_top.
		"""
		arg_0.border_top = 5
		if arg_0.show_graph_title:
			arg_0.border_top += arg_0.title_font_size
		arg_0.border_top += 5
		if arg_0.show_graph_subtitle:
			arg_0.border_top += arg_0.subtitle_font_size

Calculate the margin in pixels above the plot area setting border_top .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . get_conn ( ) . instances ( ) . insert ( project = arg_2 , arg_1 = arg_1 ) . execute ( num_retries = arg_0 . num_retries ) arg_4 = arg_3 [ "name" ] arg_0 . _wait_for_operation_to_complete ( arg_2 = arg_2 , arg_4 = arg_4 )

def Func(arg_0, arg_1, arg_2=None):
        """
        Creates a new Cloud SQL instance.

        :param body: Body required by the Cloud SQL insert API, as described in
            https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/instances/insert#request-body.
        :type body: dict
        :param project_id: Project ID of the project that contains the instance. If set
            to None or missing, the default project_id from the GCP connection is used.
        :type project_id: str
        :return: None
        """
        arg_3 = arg_0.get_conn().instances().insert(
            project=arg_2,
            arg_1=arg_1
        ).execute(num_retries=arg_0.num_retries)
        arg_4 = arg_3["name"]
        arg_0._wait_for_operation_to_complete(arg_2=arg_2,
                                             arg_4=arg_4)


(self, subject, reply, payload, payload_size)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if arg_1 == "" : raise ErrBadSubject arg_5 = ( "%d" % arg_4 ) . encode ( ) arg_6 = b'' . join ( [ PUB_OP , _SPC_ , arg_1 . encode ( ) , _SPC_ , arg_2 , _SPC_ , arg_5 , _CRLF_ , arg_3 , _CRLF_ ] ) arg_0 . stats [ 'out_msgs' ] += 1 arg_0 . stats [ 'out_bytes' ] += arg_4 yield from arg_0 . _send_command ( arg_6 ) if arg_0 . _flush_queue . empty ( ) : yield from arg_0 . _flush_pending ( )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        Sends PUB command to the NATS server.
        """
        if arg_1 == "":
            # Avoid sending messages with empty replies.
            raise ErrBadSubject

        arg_5 = ("%d" % arg_4).encode()
        arg_6 = b''.join([PUB_OP, _SPC_, arg_1.encode(
        ), _SPC_, arg_2, _SPC_, arg_5, _CRLF_, arg_3, _CRLF_])
        arg_0.stats['out_msgs'] += 1
        arg_0.stats['out_bytes'] += arg_4
        yield from arg_0._send_command(arg_6)
        if arg_0._flush_queue.empty():
            yield from arg_0._flush_pending()


def Func ( arg_0 , arg_1 ) : arg_2 = make_post_request ( arg_0 , 'reviews' , arg_3 = arg_1 ) arg_3 = arg_2 . json ( ) if arg_2 . status_code == 200 : return arg_3 [ 'status' ] else : raise ReviewNotPostedException ( message = arg_3 [ 'message' ] , error_code = arg_3 [ 'error_code' ] , request_id = arg_3 [ 'request_id' ] )

def Func(arg_0, arg_1):
    """
    Post a review
    """
    # POST /api/projects/0.1/reviews/
    arg_2 = make_post_request(arg_0, 'reviews', arg_3=arg_1)
    arg_3 = arg_2.json()
    if arg_2.status_code == 200:
        return arg_3['status']
    else:
        raise ReviewNotPostedException(
            message=arg_3['message'],
            error_code=arg_3['error_code'],
            request_id=arg_3['request_id'])


def Func(arg_0, arg_1):
        """ Remove a patch from the patches list """
        arg_0._check_patch(arg_1)
        arg_2 = arg_0.patch2line[arg_1]
        del arg_0.patch2line[arg_1]
        arg_0.patchlines.remove(arg_2)


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
prepickle
:
arg_1
=
pickle
.
dumps
(
arg_1
)
if
arg_1
not
in
arg_0
.
keys
:
raise
ValueError
(
"The given key does not exist"
)
for
arg_2
,
arg_3
in
zip
(
arg_0
.
keys
[
arg_1
]
,
arg_0
.
hashtables
)
:
arg_3
.
Func_val
(
arg_2
,
arg_1
)
if
not
arg_3
.
get
(
arg_2
)
:
arg_3
.
Func
(
arg_2
)
arg_0
.
keys
.
Func
(
arg_1
)

def Func(arg_0, arg_1):
        '''
        Remove the key from the index.

        Args:
            key (hashable): The unique identifier of a set.

        '''
        if arg_0.prepickle:
            arg_1 = pickle.dumps(arg_1)
        if arg_1 not in arg_0.keys:
            raise ValueError("The given key does not exist")
        for arg_2, arg_3 in zip(arg_0.keys[arg_1], arg_0.hashtables):
            arg_3.Func_val(arg_2, arg_1)
            if not arg_3.get(arg_2):
                arg_3.Func(arg_2)
        arg_0.keys.Func(arg_1)


def Func ( arg_0 ) : try : if arg_0 . config . strong_fuzz : arg_1 = PJFMutators ( arg_0 . config ) if arg_0 . config . url_encode : if sys . version_info >= ( 3 , 0 ) : return urllib . parse . quote ( arg_1 . fuzz ( json . dumps ( arg_0 . config . json ) ) ) else : return urllib . quote ( arg_1 . fuzz ( json . dumps ( arg_0 . config . json ) ) ) else : if type ( arg_0 . config . json ) in [ list , dict ] : return arg_1 . fuzz ( json . dumps ( arg_0 . config . json ) ) else : return arg_1 . fuzz ( arg_0 . config . json ) else : if arg_0 . config . url_encode : if sys . version_info >= ( 3 , 0 ) : return urllib . parse . quote ( arg_0 . get_Func ( arg_0 . config . indent , arg_0 . config . utf8 ) ) else : return urllib . quote ( arg_0 . get_Func ( arg_0 . config . indent , arg_0 . config . utf8 ) ) else : return arg_0 . get_Func ( arg_0 . config . indent , arg_0 . config . utf8 ) except Exception as e : raise PJFBaseException ( e . message if hasattr ( e , "message" ) else str ( e ) )

def Func(arg_0):
        """
        Get a printable Func object
        """
        try:
            if arg_0.config.strong_fuzz:
                arg_1 = PJFMutators(arg_0.config)
                if arg_0.config.url_encode:
                    if sys.version_info >= (3, 0):
                        return urllib.parse.quote(arg_1.fuzz(json.dumps(arg_0.config.json)))
                    else:
                        return urllib.quote(arg_1.fuzz(json.dumps(arg_0.config.json)))
                else:
                    if type(arg_0.config.json) in [list, dict]:
                        return arg_1.fuzz(json.dumps(arg_0.config.json))
                    else:
                        return arg_1.fuzz(arg_0.config.json)
            else:
                if arg_0.config.url_encode:
                    if sys.version_info >= (3, 0):
                        return urllib.parse.quote(arg_0.get_Func(arg_0.config.indent, arg_0.config.utf8))
                    else:
                        return urllib.quote(arg_0.get_Func(arg_0.config.indent, arg_0.config.utf8))
                else:
                    return arg_0.get_Func(arg_0.config.indent, arg_0.config.utf8)
        except Exception as e:
            raise PJFBaseException(e.message if hasattr(e, "message") else str(e))


(arrays, steps=100, batch_size=64, rng=None)

def
Func
(
arg_0
,
arg_1
=
100
,
arg_2
=
64
,
arg_3
=
)
:
assert
arg_2
>=
2
,
'batch_size must be at least 2!'
assert
isinstance
(
arg_0
,
(
tuple
,
list
)
)
,
'arrays must be a tuple or list!'
if
arg_3
is
or
isinstance
(
arg_3
,
int
)
:
arg_3
=
np
.
random
.
RandomState
(
arg_3
)
def
sample
(
)
:
arg_4
=
[
np
.
zeros
(
(
arg_2
,
arg_1
,
arg_8
.
shape
[
1
]
)
,
arg_8
.
dtype
)
for
arg_8
in
arg_0
]
for
arg_5
in
range
(
arg_2
)
:
arg_6
=
arg_3
.
randint
(
len
(
arg_0
[
0
]
)
arg_1
)
for
arg_7
,
arg_8
in
zip
(
arg_4
,
arg_0
)
:
arg_7
[
arg_5
]
=
arg_8
[
arg_6
:
arg_6
+
arg_1
]
return
arg_4
return
sample

def Func(arg_0, arg_1=100, arg_2=64, arg_3=None):
    '''Create a callable that generates samples from a dataset.

    Parameters
    ----------
    arrays : list of ndarray (time-steps, data-dimensions)
        Arrays of data. Rows in these arrays are assumed to correspond to time
        steps, and columns to variables. Multiple arrays can be given; in such
        a case, these arrays usually correspond to [input, output]---for
        example, for a recurrent regression problem---or [input, output,
        weights]---for a weighted regression or classification problem.
    steps : int, optional
        Generate samples of this many time steps. Defaults to 100.
    batch_size : int, optional
        Generate this many samples per call. Defaults to 64. This must match the
        batch_size parameter that was used when creating the recurrent network
        that will process the data.
    rng : :class:`numpy.random.RandomState` or int, optional
        A random number generator, or an integer seed for a random number
        generator. If not provided, the random number generator will be created
        with an automatically chosen seed.

    Returns
    -------
    callable :
        A callable that can be used inside a dataset for training a recurrent
        network.
    '''
    assert arg_2 >= 2, 'batch_size must be at least 2!'
    assert isinstance(arg_0, (tuple, list)), 'arrays must be a tuple or list!'

    if arg_3 is None or isinstance(arg_3, int):
        arg_3 = np.random.RandomState(arg_3)

    def sample():
        arg_4 = [np.zeros((arg_2, arg_1, arg_8.shape[1]), arg_8.dtype) for arg_8 in arg_0]
        for arg_5 in range(arg_2):
            arg_6 = arg_3.randint(len(arg_0[0]) - arg_1)
            for arg_7, arg_8 in zip(arg_4, arg_0):
                arg_7[arg_5] = arg_8[arg_6:arg_6+arg_1]
        return arg_4

    return sample

Create a callable that generates samples from a dataset .


(fourierparams,
                      phase,
                      mags)

def Func(arg_0,
                      arg_1,
                      arg_2):
    '''
    This is the residual objective function to be minimized by `scipy.leastsq`.

    The parameters are the same as `_fourier_func` above.

    '''

    arg_3 = _fourier_func(arg_0, arg_1, arg_2)
    arg_4 = arg_2 - arg_3

    return arg_4

This is the residual objective function to be minimized by scipy . leastsq .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 2 ** 16 ) : assert 0 < arg_1 assert 0 <= arg_2 arg_4 = False arg_0 . seek ( 0 , 2 ) arg_5 = arg_0 . tell ( ) arg_6 = arg_5 - arg_2 arg_0 . write ( b'\x00' * arg_1 ) arg_0 . flush ( ) try : try : import mmap arg_7 = mmap . mmap ( arg_0 . fileno ( ) , arg_5 + arg_1 ) try : arg_7 . move ( arg_2 + arg_1 , arg_2 , arg_6 ) finally : arg_7 . close ( ) except ( ValueError , EnvironmentError , ImportError ) : arg_4 = lock ( arg_0 ) arg_0 . truncate ( arg_5 ) arg_0 . seek ( 0 , 2 ) arg_8 = arg_1 while arg_8 : arg_9 = min ( arg_3 , arg_8 ) arg_0 . write ( b"\x00" * arg_9 ) arg_8 -= arg_9 arg_0 . seek ( arg_5 , 0 ) while arg_6 : arg_10 = min ( arg_3 , arg_6 ) arg_0 . seek ( - arg_10 , 1 ) arg_11 = arg_0 . tell ( ) arg_12 = arg_0 . read ( arg_10 ) arg_0 . seek ( - arg_10 + arg_1 , 1 ) arg_0 . write ( arg_12 ) arg_0 . seek ( arg_11 ) arg_6 -= arg_10 arg_0 . flush ( ) finally : if arg_4 : unlock ( arg_0 )

def Func(arg_0, arg_1, arg_2, arg_3=2**16):
    """Insert size bytes of empty space starting at offset.

    fobj must be an open file object, open rb+ or
    equivalent. Mutagen tries to use mmap to resize the file, but
    falls back to a significantly slower method if mmap fails.
    """

    assert 0 < arg_1
    assert 0 <= arg_2
    arg_4 = False
    arg_0.seek(0, 2)
    arg_5 = arg_0.tell()
    arg_6 = arg_5 - arg_2
    arg_0.write(b'\x00' * arg_1)
    arg_0.flush()
    try:
        try:
            import mmap
            arg_7 = mmap.mmap(arg_0.fileno(), arg_5 + arg_1)
            try:
                arg_7.move(arg_2 + arg_1, arg_2, arg_6)
            finally:
                arg_7.close()
        except (ValueError, EnvironmentError, ImportError):
            # handle broken mmap scenarios
            arg_4 = lock(arg_0)
            arg_0.truncate(arg_5)

            arg_0.seek(0, 2)
            arg_8 = arg_1
            # Don't generate an enormous string if we need to pad
            # the file out several megs.
            while arg_8:
                arg_9 = min(arg_3, arg_8)
                arg_0.write(b"\x00" * arg_9)
                arg_8 -= arg_9

            arg_0.seek(arg_5, 0)
            while arg_6:
                # At the start of this loop, fobj is pointing at the end
                # of the data we need to move, which is of movesize length.
                arg_10 = min(arg_3, arg_6)
                # Seek back however much we're going to read this frame.
                arg_0.seek(-arg_10, 1)
                arg_11 = arg_0.tell()
                # Read it, so we're back at the end.
                arg_12 = arg_0.read(arg_10)
                # Seek back to where we need to write it.
                arg_0.seek(-arg_10 + arg_1, 1)
                # Write it.
                arg_0.write(arg_12)
                # And seek back to the end of the unmoved data.
                arg_0.seek(arg_11)
                arg_6 -= arg_10

            arg_0.flush()
    finally:
        if arg_4:
            unlock(arg_0)

Insert size bytes of empty space starting at offset .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . parent while arg_3 : if isinstance ( arg_3 , ( astroid . For , astroid . While ) ) : if arg_1 not in arg_3 . orelse : return if isinstance ( arg_3 , ( astroid . ClassDef , astroid . FunctionDef ) ) : break if ( isinstance ( arg_3 , astroid . TryFinally ) and arg_1 in arg_3 . finalbody and isinstance ( arg_1 , astroid . Continue ) ) : arg_0 . add_message ( "continue-in-finally" , arg_1 = arg_1 ) arg_3 = arg_3 . parent arg_0 . add_message ( "not-in-loop" , arg_1 = arg_1 , args = arg_2 )

def Func(arg_0, arg_1, arg_2):
        """check that a node is inside a for or while loop"""
        arg_3 = arg_1.parent
        while arg_3:
            if isinstance(arg_3, (astroid.For, astroid.While)):
                if arg_1 not in arg_3.orelse:
                    return

            if isinstance(arg_3, (astroid.ClassDef, astroid.FunctionDef)):
                break
            if (
                isinstance(arg_3, astroid.TryFinally)
                and arg_1 in arg_3.finalbody
                and isinstance(arg_1, astroid.Continue)
            ):
                arg_0.add_message("continue-in-finally", arg_1=arg_1)

            arg_3 = arg_3.parent

        arg_0.add_message("not-in-loop", arg_1=arg_1, args=arg_2)


(self, category, maxdist, maxitems, x_col, y_col)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """
        Set the location of all the pois of this category. The pois are
        connected to the closest node in the Pandana network which assumes
        no impedance between the location of the variable and the location
        of the closest network node.

        Parameters
        ----------
        category : string
            The name of the category for this set of pois
        maxdist - the maximum distance that will later be used in
            find_all_nearest_pois
        maxitems - the maximum number of items that will later be requested
            in find_all_nearest_pois
        x_col : Pandas Series (float)
            The x location (longitude) of pois in this category
        y_col : Pandas Series (Float)
            The y location (latitude) of pois in this category

        Returns
        -------
        Nothing
        """
        if arg_1 not in arg_0.poi_category_names:
            arg_0.poi_category_names.append(arg_1)

        arg_0.max_pois = arg_3

        arg_7 = arg_0.get_node_ids(arg_4, arg_5)

        arg_0.poi_category_indexes[arg_1] = arg_7.index

        arg_9 = arg_0._node_indexes(arg_7)

        arg_0.net.initialize_category(arg_2, arg_3, arg_1.encode('utf-8'), arg_9.values)

Set the location of all the pois of this category . The pois are connected to the closest node in the Pandana network which assumes no impedance between the location of the variable and the location of the closest network node .


def Func(arg_0):
        '''Resolve the names of outputs for this layer into shape tuples.'''
        arg_1 = None
        for arg_2, arg_3 in enumerate(arg_0._input_shapes.values()):
            if arg_2 == 0:
                arg_1 = arg_3
            if len(arg_1) != len(arg_3) or any(
                    arg_4 is not None and arg_5 is not None and arg_4 != arg_5
                    for arg_4, arg_5 in zip(arg_1[:-1], arg_3[:-1])):
                raise util.ConfigurationError(
                    'layer "{}" incompatible input shapes {}'
                    .format(arg_0.name, arg_0._input_shapes))
        arg_6 = arg_0.kwargs.get('size')
        arg_3 = arg_0.kwargs.get('shape')
        if arg_3 is not None:
            pass
        elif arg_6 is not None:
            arg_3 = tuple(arg_1[:-1]) + (arg_6, )
        else:
            raise util.ConfigurationError(
                'layer "{}" does not specify a size'.format(arg_0.name))
        arg_0._output_shapes['out'] = arg_3

Resolve the names of outputs for this layer into shape tuples .


def Func(arg_0):
    """ Close the policy instance. """
    arg_0._logger.info("Closing")

    if arg_0._opened:
      arg_0._opened = False
    else:
      arg_0._logger.warning(
        "Func() called, but connection policy was alredy Funcd")

    return


(inputs, model, samples=1, batch_size=3,
                                   length=8)

def Func ( arg_0 , arg_1 , arg_2 = 1 , arg_3 = 3 , arg_4 = 8 ) : arg_5 = lambda dist : tf . reduce_mean ( input_tensor = dist . mean ( ) , axis = 0 ) with tf . compat . v1 . name_scope ( "val_reconstruction" ) : arg_6 = functools . partial ( arg_1 . reconstruct , arg_0 = arg_0 , arg_2 = arg_2 ) visualize_reconstruction ( arg_0 , arg_5 ( arg_6 ( ) ) ) visualize_reconstruction ( arg_0 , arg_5 ( arg_6 ( sample_static = True ) ) , name = "static_prior" ) visualize_reconstruction ( arg_0 , arg_5 ( arg_6 ( sample_dynamic = True ) ) , name = "dynamic_prior" ) visualize_reconstruction ( arg_0 , arg_5 ( arg_6 ( swap_static = True ) ) , name = "swap_static" ) visualize_reconstruction ( arg_0 , arg_5 ( arg_6 ( swap_dynamic = True ) ) , name = "swap_dynamic" ) with tf . compat . v1 . name_scope ( "generation" ) : arg_7 = functools . partial ( arg_1 . generate , arg_3 = arg_3 , arg_4 = arg_4 , arg_2 = arg_2 ) image_summary ( arg_5 ( arg_7 ( fix_static = True ) ) , "fix_static" ) image_summary ( arg_5 ( arg_7 ( fix_dynamic = True ) ) , "fix_dynamic" )

def Func(arg_0, arg_1, arg_2=1, arg_3=3,
                                   arg_4=8):
  """Visualizes a qualitative analysis of a given model.

  Args:
    inputs: A tensor of the original inputs, of shape [batch, timesteps,
      h, w, c].
    model: A DisentangledSequentialVAE model.
    samples: Number of samples to draw from the latent distributions.
    batch_size: Number of sequences to generate.
    length: Number of timesteps to generate for each sequence.
  """
  arg_5 = lambda dist: tf.reduce_mean(
      input_tensor=dist.mean(), axis=0)  # avg over samples
  with tf.compat.v1.name_scope("val_reconstruction"):
    arg_6 = functools.partial(arg_1.reconstruct, arg_0=arg_0,
                                    arg_2=arg_2)
    visualize_reconstruction(arg_0, arg_5(arg_6()))
    visualize_reconstruction(arg_0, arg_5(arg_6(sample_static=True)),
                             name="static_prior")
    visualize_reconstruction(arg_0, arg_5(arg_6(sample_dynamic=True)),
                             name="dynamic_prior")
    visualize_reconstruction(arg_0, arg_5(arg_6(swap_static=True)),
                             name="swap_static")
    visualize_reconstruction(arg_0, arg_5(arg_6(swap_dynamic=True)),
                             name="swap_dynamic")

  with tf.compat.v1.name_scope("generation"):
    arg_7 = functools.partial(arg_1.generate, arg_3=arg_3,
                                 arg_4=arg_4, arg_2=arg_2)
    image_summary(arg_5(arg_7(fix_static=True)), "fix_static")
    image_summary(arg_5(arg_7(fix_dynamic=True)), "fix_dynamic")

Visualizes a qualitative analysis of a given model .


def
Func
(
arg_0
)
:
if
arg_0
.
options
.
verbose
:
print
(
"Fetching dates for {} tags..."
.
format
(
len
(
arg_0
.
filtered_tags
)
)
)
def
worker
(
arg_1
)
:
arg_0
.
get_time_of_tag
(
arg_1
)
arg_2
=
[
]
arg_3
=
50
arg_4
=
len
(
arg_0
.
filtered_tags
)
for
arg_5
in
range
(
0
,
(
arg_4
//
arg_3
)
+
1
)
:
for
arg_6
in
range
(
arg_3
)
:
arg_7
=
arg_5
*
50
+
arg_6
if
arg_7
==
arg_4
:
break
arg_8
=
threading
.
Thread
(
target
=
worker
,
args
=
(
arg_0
.
filtered_tags
[
arg_7
]
,
)
)
arg_2
.
append
(
arg_8
)
arg_8
.
start
(
)
if
arg_0
.
options
.
verbose
>
2
:
print
(
"."
,
end
=
""
)
for
arg_8
in
arg_2
:
arg_8
.
join
(
)
if
arg_0
.
options
.
verbose
>
2
:
print
(
"."
)
if
arg_0
.
options
.
verbose
>
1
:
print
(
"Fetched dates for {} tags."
.
format
(
len
(
arg_0
.
tag_times_dict
)
)
)

def Func(arg_0):
        """ Async fetching of all tags dates. """

        if arg_0.options.verbose:
            print(
                "Fetching dates for {} tags...".format(len(arg_0.filtered_tags))
            )

        def worker(arg_1):
            arg_0.get_time_of_tag(arg_1)

        # Async fetching tags:
        arg_2 = []
        arg_3 = 50
        arg_4 = len(arg_0.filtered_tags)
        for arg_5 in range(0, (arg_4 // arg_3) + 1):
            for arg_6 in range(arg_3):
                arg_7 = arg_5 * 50 + arg_6
                if arg_7 == arg_4:
                    break
                arg_8 = threading.Thread(target=worker,
                                     args=(arg_0.filtered_tags[arg_7],))
                arg_2.append(arg_8)
                arg_8.start()
                if arg_0.options.verbose > 2:
                    print(".", end="")
            for arg_8 in arg_2:
                arg_8.join()
        if arg_0.options.verbose > 2:
            print(".")
        if arg_0.options.verbose > 1:
            print("Fetched dates for {} tags.".format(
                len(arg_0.tag_times_dict))
            )


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
toytree
.
tree
(
newick
=
arg_0
.
results
.
tree
)
arg_2
.
Func
(
arg_1
=
arg_1
,
use_edge_lengths
=
True
,
tree_style
=
'c'
,
tip_labels_align
=
True
,
edge_align_style
=
{
"stroke-width"
:
1
}
)
for
arg_3
in
arg_0
.
results
.
admixture
:
arg_4
,
arg_5
,
arg_6
,
arg_7
,
arg_8
=
arg_3
arg_9
=
_get_admix_point
(
arg_2
,
arg_4
,
arg_5
)
arg_10
=
_get_admix_point
(
arg_2
,
arg_6
,
arg_7
)
arg_11
=
arg_1
.
plot
(
arg_9
=
(
arg_9
[
0
]
,
arg_10
[
0
]
)
,
arg_10
=
(
arg_9
[
1
]
,
arg_10
[
1
]
)
,
style
=
{
"stroke-width"
:
10
*
arg_8
,
"stroke-opacity"
:
0.95
,
"stroke-linecap"
:
"round"
}
)
arg_1
.
scatterplot
(
arg_9
=
(
arg_10
[
0
]
)
,
arg_10
=
(
arg_10
[
1
]
)
,
size
=
8
,
title
=
"weight: {}"
.
format
(
arg_8
)
,
)
arg_1
.
y
.
show
=
False
arg_1
.
x
.
ticks
.
show
=
True
arg_1
.
x
.
label
.
text
=
"Drift parameter"
return
arg_1

def Func(arg_0, arg_1):
        """
        Returns a treemix plot on a toyplot.axes object.
        """
        ## create a toytree object from the treemix tree result
        arg_2 = toytree.tree(newick=arg_0.results.tree)
        arg_2.Func(
            arg_1=arg_1,
            use_edge_lengths=True,
            tree_style='c',
            tip_labels_align=True,
            edge_align_style={"stroke-width": 1}
        );

        ## get coords
        for arg_3 in arg_0.results.admixture:
            ## parse admix event
            arg_4, arg_5, arg_6, arg_7, arg_8 = arg_3
            arg_9 = _get_admix_point(arg_2, arg_4, arg_5)
            arg_10 = _get_admix_point(arg_2, arg_6, arg_7)

            ## add line for admixture edge
            arg_11 = arg_1.plot(
                arg_9 = (arg_9[0], arg_10[0]),
                arg_10 = (arg_9[1], arg_10[1]),
                style={"stroke-width": 10*arg_8,
                       "stroke-opacity": 0.95,
                       "stroke-linecap": "round"}
            )

            ## add points at admixture sink
            arg_1.scatterplot(
                arg_9 = (arg_10[0]),
                arg_10 = (arg_10[1]),
                size=8,
                title="weight: {}".format(arg_8),
            )

        ## add scale bar for edge lengths
        arg_1.y.show=False
        arg_1.x.ticks.show=True
        arg_1.x.label.text = "Drift parameter"
        return arg_1

Returns a treemix plot on a toyplot . axes object .


def Func(arg_0, Func):
        """
        Sets the classification of this CompanyDetailCompany.
        Classification of Company

        :param classification: The classification of this CompanyDetailCompany.
        :type: str
        """
        arg_2 = ["Public Limited Indian Non-Government Company", "Private Limited Indian Non-Government Company", "One Person Company", "Private Limited Foreign Company Incorporated in India", "Public Limited Foreign Company Incorporated in India", "Union Government Company", "State Government Company", "Guarantee & Association Public", "Guarantee & Association Private", "Not For Profit Company", "Unlimited Liabilities Public", "Unlimited Liabilities Private", "Undefined"]
        if Func not in arg_2:
            raise ValueError(
                "Invalid value for `classification`, must be one of {0}"
                .format(arg_2)
            )
        arg_0._classification = Func

Sets the classification of this CompanyDetailCompany . Classification of Company


def Func ( arg_0 , arg_1 , arg_2 ) : def decorator ( arg_3 ) : arg_0 . _Funcr . add ( arg_1 , arg_2 , arg_3 ) return arg_3 return decorator

def Func(arg_0, arg_1, arg_2):
        """Decorator to add Func for a request with any HTTP method.

        Arguments:
          method (str): HTTP method name, e.g. GET, POST, etc.
          pattern (str): Routing pattern the path must match.

        Returns:
          function: Decorator function to add Func.
        """
        def decorator(arg_3):
            arg_0._Funcr.add(arg_1, arg_2, arg_3)
            return arg_3
        return decorator

Decorator to add route for a request with any HTTP method.

        Arguments:
          method (str): HTTP method name, e.g. GET, POST, etc.
          pattern (str): Routing pattern the path must match.

        Returns:
          function: Decorator function to add route.

Decorator to add route for a request with any HTTP method .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = ( arg_0 [ 0 ] + arg_0 [ 1 ] * npsin ( 2 * MPI * arg_2 ) + arg_0 [ 2 ] * npcos ( 2 * MPI * arg_2 ) + arg_0 [ 3 ] * npsin ( 2 * MPI * arg_3 ) + arg_0 [ 4 ] * npcos ( 2 * MPI * arg_3 ) + arg_0 [ 5 ] * npsin ( 4 * MPI * arg_2 ) + arg_0 [ 6 ] * npcos ( 4 * MPI * arg_2 ) + arg_0 [ 7 ] * npsin ( 4 * MPI * arg_3 ) + arg_0 [ 8 ] * npcos ( 4 * MPI * arg_3 ) + arg_0 [ 9 ] * arg_4 + arg_0 [ 10 ] * arg_5 ) return arg_6

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    '''This is the EPD function to fit.

    Parameters
    ----------

    coeffs : array-like of floats
        Contains the EPD coefficients that will be used to generate the EPD fit
        function.

    fluxes : array-like
        The flux measurement array being used.

    xcc,ycc : array-like
        Arrays of the x and y coordinates associated with each measurement in
        `fluxes`.

    bgv,bge : array-like
        Arrays of the flux background value and the flux background error
        associated with each measurement in `fluxes`.

    Returns
    -------

    np.array
        Contains the fit function evaluated at each flux measurement value.

    '''

    arg_6 = (
        arg_0[0] +
        arg_0[1]*npsin(2*MPI*arg_2) + arg_0[2]*npcos(2*MPI*arg_2) +
        arg_0[3]*npsin(2*MPI*arg_3) + arg_0[4]*npcos(2*MPI*arg_3) +
        arg_0[5]*npsin(4*MPI*arg_2) + arg_0[6]*npcos(4*MPI*arg_2) +
        arg_0[7]*npsin(4*MPI*arg_3) + arg_0[8]*npcos(4*MPI*arg_3) +
        arg_0[9]*arg_4 +
        arg_0[10]*arg_5
    )

    return arg_6


(self, option, opt_unused, value_unused, parser)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_4 . values . actions . append ( arg_1 . action_code )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Callback for an option that adds to the `actions` list."""
        arg_4.values.actions.append(arg_1.action_code)

Callback for an option that adds to the actions list .


(hostname, exc_info, preceding_stack=None, error_threshold=None, additional_info=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
    ''' Helper function to record errors to the flawless backend '''
    arg_5 = []
    arg_6, arg_7, arg_8 = arg_1

    while arg_8 is not None:
        arg_5.append(arg_8)
        arg_8 = arg_8.tb_next

    arg_9 = []
    for arg_10 in arg_2 or []:
        arg_9.append(
            api_ttypes.StackLine(arg_13=os.path.abspath(arg_10[0]), line_number=arg_10[1],
                                 function_name=arg_10[2], text=arg_10[3])
        )

    for arg_11, arg_12 in enumerate(arg_5):
        arg_13 = arg_12.tb_frame.f_code.co_filename
        arg_14 = arg_12.tb_frame.f_code.co_name
        arg_15 = arg_12.tb_lineno
        arg_16 = linecache.getline(arg_13, arg_15, arg_12.tb_frame.f_globals)
        arg_17 = None
        if arg_11 >= (len(arg_5) - NUM_FRAMES_TO_SAVE):
            # Include some limits on max string length & number of variables to keep things from getting
            # out of hand
            arg_17 = dict((arg_18, _myrepr(arg_18, arg_19)) for arg_18, arg_19 in
                                list(arg_12.tb_frame.f_locals.items())[:MAX_LOCALS] if arg_18 != "self")
            if "self" in arg_12.tb_frame.f_locals and hasattr(arg_12.tb_frame.f_locals["self"], "__dict__"):
                arg_17.update(dict(("self." + arg_18, _myrepr(arg_18, arg_19)) for arg_18, arg_19 in
                                         list(arg_12.tb_frame.f_locals["self"].__dict__.items())[:MAX_LOCALS]
                                         if arg_18 != "self"))

        arg_9.append(
            api_ttypes.StackLine(arg_13=os.path.abspath(arg_13), line_number=arg_15,
                                 function_name=arg_14, text=arg_16, arg_17=arg_17)
        )

    # Check LRU cache & potentially do not send error report if this client has already reported this error
    # several times.
    arg_20 = CachedErrorInfo.get_hash_key(arg_9)
    arg_21 = arg_22.get(arg_20) or CachedErrorInfo()
    arg_21.increment()
    arg_22[arg_20] = arg_21
    if arg_21.should_report():
        arg_23 = arg_21.mark_reported()
        _send_request(
            api_ttypes.RecordErrorRequest(
                traceback=arg_9,
                exception_message=repr(arg_7),
                exception_type=arg_6.__module__ + "." + arg_6.__name__,
                arg_0=arg_0,
                arg_3=arg_3,
                arg_4=arg_4,
                arg_23=arg_23,
            )
        )


def Func(arg_0, arg_1, arg_2):
    """Extract the objects to be saved in the clinvar database collection.
       object_type param specifies if these objects are variant or casedata objects

       Args:
        variant_ids(list): list of database variant ids
        form_fields(dict): it's the submission form dictionary. Keys have the same names as CLINVAR_HEADER and CASEDATA_HEADER
        object_type(str): either 'variant' or 'case_data'

       Returns:
        submission_objects(list): list of submission objects of either type 'variant' or 'casedata'
    """
    arg_3 = []
    if arg_2 == 'variant':
        arg_3 = CLINVAR_HEADER
    else: #collect casedata objects
        arg_3 = CASEDATA_HEADER

    # A list of objects (variants of casedata info) to be saved into clinvar database collection
    arg_4 = []

    # Loop over the form fields and collect the data:
    for arg_5 in arg_0: # loop over the variants

        arg_6 = {} # A new submission object for each

        # Don't included casedata for a variant unless specified by user
        if arg_2 == 'casedata' and 'casedata_'+arg_5 not in arg_1:
            continue

        arg_6['csv_type'] = arg_2
        arg_6['case_id'] = arg_1.get('case_id')
        arg_6['category'] = arg_1.get('category@'+arg_5)

        for arg_7, arg_8 in arg_3.items(): # loop over the form info fields
            arg_9 = arg_1.get(arg_7+'@'+arg_5)
            if arg_9 and not arg_9 == '-':
                if arg_7 == 'ref_seq': # split this field into
                    arg_10 = arg_9.split('|')
                    arg_6['ref_seq'] = arg_10[0]
                    arg_6['hgvs'] = arg_10[1]
                else:
                    arg_6[arg_7] = arg_9

        # Create a unique ID for the database
        # For casedata : = caseID_sampleID_variantID
        # For variants : ID = caseID_variantID
        if arg_2 == 'casedata':
            arg_6['_id'] = str(arg_6['case_id']) + '_' + arg_5 + '_' + str(arg_6['individual_id'])
        else:
            arg_6['_id'] = str(arg_6['case_id']) + '_' + arg_5

        arg_4.append(arg_6)

    return arg_4

Extract the objects to be saved in the clinvar database collection . object_type param specifies if these objects are variant or casedata objects


(self, query, language=None, entities=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """ Call the disambiguation service in order to disambiguate a search query.

        Args:
            text (str): Query to be disambiguated.
            language (str): language of text (if known)
            entities (list): list of entities or mentions to be supplied by
                the user.

        Returns:
            dict, int: API response and API status.
        """

        arg_4 = {
            "shortText": arg_1,
            "entities": [],
            "onlyNER": "false",
            "customisation": "generic"
        }

        if arg_2:
            arg_4['language'] = {"lang": arg_2}

        if arg_3:
            arg_4['entities'] = arg_3

        arg_5 = {'query': str(arg_4)}

        logger.debug('About to submit the following query {}'.format(arg_4))

        arg_6, arg_7 = arg_0.post(
            arg_0.disambiguate_service,
            arg_5=arg_5,
            headers={'Accept': 'application/json'},
        )

        if arg_7 == 200:
            return arg_0.decode(arg_6), arg_7
        else:
            logger.debug('Disambiguation failed.')
            return None, arg_7

Call the disambiguation service in order to disambiguate a search query .


(self, type=None, service=None, list_only=0, **kwargs)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
0
,
**
arg_4
)
:
arg_5
=
arg_0
.
local_renderer
arg_3
=
int
(
arg_3
)
arg_1
=
(
arg_1
or
''
)
.
lower
(
)
.
strip
(
)
assert
not
arg_1
or
arg_1
in
PACKAGE_TYPES
,
'Unknown package type: %s'
%
(
arg_1
,
)
arg_6
=
[
]
if
arg_1
:
arg_7
=
[
arg_1
]
else
:
arg_7
=
PACKAGE_TYPES
for
arg_8
in
arg_7
:
if
arg_8
==
SYSTEM
:
arg_9
=
'\n'
.
join
(
arg_0
.
list_required
(
arg_1
=
arg_8
,
arg_2
=
arg_2
)
)
if
arg_3
:
arg_6
.
extend
(
arg_10
for
arg_10
in
arg_9
.
split
(
'\n'
)
if
arg_10
.
strip
(
)
)
if
arg_0
.
verbose
:
print
(
'content:'
,
arg_9
)
break
arg_11
,
arg_12
=
tempfile
.
mkstemp
(
)
arg_13
=
open
(
arg_12
,
'w'
)
arg_13
.
write
(
arg_9
)
arg_13
.
close
(
)
arg_0
.
install_custom
(
arg_12
=
arg_12
)
else
:
raise
NotImplementedError
return
arg_6

def Func(arg_0, arg_1=None, arg_2=None, arg_3=0, **arg_4): # pylint: disable=redefined-builtin
        """
        Installs system packages listed as required by services this host uses.
        """
        arg_5 = arg_0.local_renderer
        arg_3 = int(arg_3)
        arg_1 = (arg_1 or '').lower().strip()
        assert not arg_1 or arg_1 in PACKAGE_TYPES, 'Unknown package type: %s' % (arg_1,)
        arg_6 = []
        if arg_1:
            arg_7 = [arg_1]
        else:
            arg_7 = PACKAGE_TYPES
        for arg_8 in arg_7:
            if arg_8 == SYSTEM:
                arg_9 = '\n'.join(arg_0.list_required(arg_1=arg_8, arg_2=arg_2))
                if arg_3:
                    arg_6.extend(arg_10 for arg_10 in arg_9.split('\n') if arg_10.strip())
                    if arg_0.verbose:
                        print('content:', arg_9)
                    break
                arg_11, arg_12 = tempfile.mkstemp()
                arg_13 = open(arg_12, 'w')
                arg_13.write(arg_9)
                arg_13.close()
                arg_0.install_custom(arg_12=arg_12)
            else:
                raise NotImplementedError
        return arg_6

Installs system packages listed as required by services this host uses .


(filename, clean_lines, linenum, cast_type, pattern, error)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
  """Checks for a C-style cast by looking for the pattern.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    cast_type: The string for the C++ cast to recommend.  This is either
      reinterpret_cast, static_cast, or const_cast, depending.
    pattern: The regular expression used to find C-style casts.
    error: The function to call with any errors found.

  Returns:
    True if an error was emitted.
    False otherwise.
  """
  arg_6 = arg_1.elided[arg_2]
  arg_7 = Search(arg_4, arg_6)
  if not arg_7:
    return False

  # Exclude lines with keywords that tend to look like casts
  arg_8 = arg_6[0:arg_7.start(1) - 1]
  if Match(r'.*\b(?:sizeof|alignof|alignas|[_A-Z][_A-Z0-9]*)\s*$', arg_8):
    return False

  # Try expanding current context to see if we one level of
  # parentheses inside a macro.
  if arg_2 > 0:
    for arg_9 in xrange(arg_2 - 1, max(0, arg_2 - 5), -1):
      arg_8 = arg_1.elided[arg_9] + arg_8
  if Match(r'.*\b[_A-Z][_A-Z0-9]*\s*\((?:\([^()]*\)|[^()])*$', arg_8):
    return False

  # operator++(int) and operator--(int)
  if arg_8.endswith(' operator++') or arg_8.endswith(' operator--'):
    return False

  # A single unnamed argument for a function tends to look like old style cast.
  # If we see those, don't issue warnings for deprecated casts.
  arg_10 = arg_6[arg_7.end(0):]
  if Match(r'^\s*(?:;|const\b|throw\b|final\b|override\b|[=>{),]|->)',
           arg_10):
    return False

  # At this point, all that should be left is actual casts.
  arg_5(arg_0, arg_2, 'readability/casting', 4,
        'Using C-style cast.  Use %s<%s>(...) instead' %
        (arg_3, arg_7.group(1)))

  return True

Checks for a C - style cast by looking for the pattern .


(self, filename: str, new_filename: str)

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_2 ) -> None : arg_4 = os . path . join ( arg_0 . name + ':' + SANDBOX_WORKING_DIR_NAME , arg_3 ) subprocess . check_call ( [ 'docker' , 'cp' , arg_1 , arg_4 ] ) arg_0 . _chown_files ( [ arg_3 ] )

def Func(arg_0, arg_1: arg_2, arg_3: arg_2) -> None:
        """
        Copies the specified file into the working directory of this
        sandbox and renames it to new_filename.
        """
        arg_4 = os.path.join(
            arg_0.name + ':' + SANDBOX_WORKING_DIR_NAME,
            arg_3)
        subprocess.check_call(['docker', 'cp', arg_1, arg_4])
        arg_0._chown_files([arg_3])

Copies the specified file into the working directory of this sandbox and renames it to new_filename .


def Func ( arg_0 , arg_1 ) : from string import maketrans arg_2 = maketrans ( alphabet + alphabet . upper ( ) , arg_1 + arg_1 . upper ( ) ) return arg_0 . translate ( arg_2 )

def Func(arg_0, arg_1):
    "Encodes text, using a code which is a permutation of the alphabet."
    from string import maketrans
    arg_2 = maketrans(alphabet + alphabet.upper(), arg_1 + arg_1.upper())
    return arg_0.translate(arg_2)

Encodes text using a code which is a permutation of the alphabet .


(self, container_name, blob_name, **kwargs)

return self.connection.get_blob_to_text(container_name,
                                                blob_name,
                                                **kwargs).content

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : return arg_0 . connection . get_blob_to_text ( arg_1 , arg_2 , ** arg_3 ) . content

def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Read a file from Azure Blob Storage and return as a string.

        :param container_name: Name of the container.
        :type container_name: str
        :param blob_name: Name of the blob.
        :type blob_name: str
        :param kwargs: Optional keyword arguments that
            `BlockBlobService.create_blob_from_path()` takes.
        :type kwargs: object
        """
        return arg_0.connection.get_blob_to_text(arg_1,
                                                arg_2,
                                                **arg_3).content

Read a file from Azure Blob Storage and return as a string .


(y, frame_length=2048, hop_length=512, top_db=60,
                               ref=np.max)

return (core.power_to_db(mse.squeeze(),
                             ref=ref,
                             top_db=None) > - top_db)

def Func(arg_0, arg_1=2048, arg_2=512, arg_3=60,
                               arg_4=arg_5.max):
    '''Frame-wise non-silent indicator for audio input.

    This is a helper function for `trim` and `split`.

    Parameters
    ----------
    y : np.ndarray, shape=(n,) or (2,n)
        Audio signal, mono or stereo

    frame_length : int > 0
        The number of samples per frame

    hop_length : int > 0
        The number of samples between frames

    top_db : number > 0
        The threshold (in decibels) below reference to consider as
        silence

    ref : callable or float
        The reference power

    Returns
    -------
    non_silent : np.ndarray, shape=(m,), dtype=bool
        Indicator of non-silent frames
    '''
    # Convert to mono
    arg_7 = core.to_mono(arg_0)

    # Compute the MSE for the signal
    arg_8 = feature.rms(arg_0=arg_7,
                      arg_1=arg_1,
                      arg_2=arg_2)**2

    return (core.power_to_db(arg_8.squeeze(),
                             arg_4=arg_4,
                             arg_3=None) > - arg_3)

Frame - wise non - silent indicator for audio input .


def Func ( arg_0 ) : arg_0 = arg_0 . strip ( '.' ) arg_1 = [ ] for arg_2 in FILE_FORMATS : if arg_0 in FILE_FORMATS [ arg_2 ] : arg_1 . append ( arg_2 ) if arg_1 == [ ] or len ( arg_1 ) > 1 : return False return arg_1 [ 0 ]

def Func(arg_0):
    """
    Guess the appropriate data type from file extension.

    Arguments:
        ext:        The file extension (period optional)

    Returns:
        String. The format (without leading period),
                or False if none was found or couldn't be guessed
    """
    arg_0 = arg_0.strip('.')

    # We look through FILE_FORMATS for this extension.
    # - If it appears zero times, return False. We can't guess.
    # - If it appears once, we can simply return that format.
    # - If it appears more than once, we can't guess (it's ambiguous,
    #   e.g .m = RAMON or MATLAB)

    arg_1 = []
    for arg_2 in FILE_FORMATS:
        if arg_0 in FILE_FORMATS[arg_2]:
            arg_1.append(arg_2)

    if arg_1 == [] or len(arg_1) > 1:
        return False

    return arg_1[0]

Guess the appropriate data type from file extension .


(self, expression_x, expression_y, xsequence, ysequence, mode="replace", name="default", executor=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = "replace" , arg_6 = "default" , arg_7 = None ) : def create ( arg_8 ) : return selections . SelectionLasso ( arg_1 , arg_2 , arg_3 , arg_4 , arg_8 , arg_5 ) arg_0 . _selection ( create , arg_6 , arg_7 = arg_7 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5="replace", arg_6="default", arg_7=None):
        """For performance reasons, a lasso selection is handled differently.

        :param str expression_x: Name/expression for the x coordinate
        :param str expression_y: Name/expression for the y coordinate
        :param xsequence: list of x numbers defining the lasso, together with y
        :param ysequence:
        :param str mode: Possible boolean operator: replace/and/or/xor/subtract
        :param str name:
        :param executor:
        :return:
        """

        def create(arg_8):
            return selections.SelectionLasso(arg_1, arg_2, arg_3, arg_4, arg_8, arg_5)
        arg_0._selection(create, arg_6, arg_7=arg_7)

For performance reasons a lasso selection is handled differently .


def Func(arg_0):
        """
        Send stream tail via the transport.
        """
        with arg_0.lock:
            if not arg_0._socket or arg_0._hup:
                logger.debug(u"Cannot send stream closing tag: already closed")
                return
            arg_1 = arg_0._serializer.emit_tail()
            try:
                arg_0._write(arg_1.encode("utf-8"))
            except (IOError, SystemError, socket.error), err:
                logger.debug(u"Sending stream closing tag failed: {0}"
                                                                .format(err))
            arg_0._serializer = None
            arg_0._hup = True
            if arg_0._tls_state is None:
                try:
                    arg_0._socket.shutdown(socket.SHUT_WR)
                except socket.error:
                    pass
            arg_0._set_state("closing")
            arg_0._write_queue.clear()
            arg_0._write_queue_cond.notify()


def Func ( arg_0 , arg_1 = None ) : @ llrule ( arg_1 , lambda arg_2 : [ arg_0 ] ) def rule ( arg_2 ) : return arg_2 . _accept ( arg_0 ) return rule

def Func(arg_0, arg_1=None):
    """A rule that accepts a token of kind ``kind`` and returns it, or returns None."""
    @llrule(arg_1, lambda arg_2: [arg_0])
    def rule(arg_2):
        return arg_2._accept(arg_0)
    return rule

A rule that accepts a token of kind kind and returns it or returns None .


def Func(arg_0):
        """
        Select best remaining CNOT in the hardware for the next program edge.
        """
        arg_1 = []
        for arg_2 in arg_0.gate_list:
            arg_3 = arg_2[0] in arg_0.available_hw_qubits
            arg_4 = arg_2[1] in arg_0.available_hw_qubits
            if arg_3 and arg_4:
                arg_1.append(arg_2)
        arg_5 = 0
        arg_6 = None
        for arg_7 in arg_1:
            if arg_0.gate_cost[arg_7] > arg_5:
                arg_5 = arg_0.gate_cost[arg_7]
                arg_6 = arg_7
        return arg_6

Select best remaining CNOT in the hardware for the next program edge .


def Func ( arg_0 , arg_1 ) : for arg_2 in xrange ( arg_1 , max ( - 1 , arg_1 - 10 ) , - 1 ) : if Match ( r'^([^()]*\w+)\(' , arg_0 . elided [ arg_2 ] ) : return Match ( r'^[^()]*\w+::\w+\(' , arg_0 . elided [ arg_2 ] ) is not None return False

def Func(arg_0, arg_1):
  """Check if current line contains an out-of-line method definition.

  Args:
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
  Returns:
    True if current line contains an out-of-line method definition.
  """
  # Scan back a few lines for start of current function
  for arg_2 in xrange(arg_1, max(-1, arg_1 - 10), -1):
    if Match(r'^([^()]*\w+)\(', arg_0.elided[arg_2]):
      return Match(r'^[^()]*\w+::\w+\(', arg_0.elided[arg_2]) is not None
  return False

Check if current line contains an out - of - line method definition .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
if
not
isinstance
(
arg_1
,
Thing
)
:
arg_1
=
Agent
(
arg_1
)
assert
arg_1
not
in
arg_0
.
things
,
"Don't add the same thing twice"
arg_1
.
location
=
arg_2
or
arg_0
.
default_location
(
arg_1
)
arg_0
.
things
.
append
(
arg_1
)
if
isinstance
(
arg_1
,
Agent
)
:
arg_1
.
performance
=
0
arg_0
.
agents
.
append
(
arg_1
)

def Func(arg_0, arg_1, arg_2=None):
        """Add a thing to the environment, setting its location. For
        convenience, if thing is an agent program we make a new agent
        for it. (Shouldn't need to override this."""
        if not isinstance(arg_1, Thing):
            arg_1 = Agent(arg_1)
        assert arg_1 not in arg_0.things, "Don't add the same thing twice"
        arg_1.location = arg_2 or arg_0.default_location(arg_1)
        arg_0.things.append(arg_1)
        if isinstance(arg_1, Agent):
            arg_1.performance = 0
            arg_0.agents.append(arg_1)

Add a thing to the environment setting its location . For convenience if thing is an agent program we make a new agent for it . ( Shouldn t need to override this .


def Func ( arg_0 , arg_1 , arg_2 = 1 ) : if arg_1 . parent is None : return arg_1 if arg_2 <= 1 : return arg_1 . parent return arg_0 . Func ( arg_1 . parent , arg_2 = arg_2 - 1 )

def Func(arg_0, arg_1, arg_2=1):
        """Returns ancestor of level `deep` recursively

        :param TreeItemBase current_item:
        :param int depth:
        :rtype: TreeItemBase
        """
        if arg_1.parent is None:
            return arg_1

        if arg_2 <= 1:
            return arg_1.parent

        return arg_0.Func(arg_1.parent, arg_2=arg_2-1)

Returns ancestor of level deep recursively


def
Func
(
)
:
arg_0
=
{
'agentid'
:
config
(
)
[
'agent'
]
[
'name'
]
.
encode
(
'utf8'
)
}
arg_1
=
config
(
)
[
'agent'
]
[
'cal_lookahead'
]
*
24
*
60
*
60
if
arg_1
:
arg_0
[
'cutoff'
]
=
str
(
(
timestamp
(
)
+
arg_1
)
*
1000
)
arg_2
=
'%s/calendars?%s'
%
(
config
(
)
[
'service-scheduler'
]
[
0
]
,
urlencode
(
arg_0
)
)
try
:
arg_3
=
http_request
(
arg_2
)
except
pycurl
.
error
as
arg_7
:
logger
.
error
(
'Could not get schedule: %s'
%
arg_7
)
return
try
:
arg_4
=
parse_ical
(
arg_3
.
decode
(
'utf-8'
)
)
except
Exception
:
logger
.
error
(
'Could not parse ical'
)
logger
.
error
(
traceback
.
format_exc
(
)
)
return
arg_5
=
get_session
(
)
arg_5
.
query
(
UpcomingEvent
)
.
delete
(
)
for
arg_6
in
arg_4
:
if
arg_6
[
'dtend'
]
<=
timestamp
(
)
:
continue
arg_7
=
UpcomingEvent
(
)
arg_7
.
start
=
arg_6
[
'dtstart'
]
arg_7
.
end
=
arg_6
[
'dtend'
]
arg_7
.
uid
=
arg_6
.
get
(
'uid'
)
arg_7
.
title
=
arg_6
.
get
(
'summary'
)
arg_7
.
set_data
(
arg_6
)
arg_5
.
add
(
arg_7
)
arg_5
.
commit
(
)

def Func():
    '''Try to load schedule from the Matterhorn core. Returns a valid schedule
    or None on failure.
    '''
    arg_0 = {'agentid': config()['agent']['name'].encode('utf8')}
    arg_1 = config()['agent']['cal_lookahead'] * 24 * 60 * 60
    if arg_1:
        arg_0['cutoff'] = str((timestamp() + arg_1) * 1000)
    arg_2 = '%s/calendars?%s' % (config()['service-scheduler'][0],
                               urlencode(arg_0))
    try:
        arg_3 = http_request(arg_2)
    except pycurl.error as arg_7:
        logger.error('Could not get schedule: %s' % arg_7)
        return

    try:
        arg_4 = parse_ical(arg_3.decode('utf-8'))
    except Exception:
        logger.error('Could not parse ical')
        logger.error(traceback.format_exc())
        return
    arg_5 = get_session()
    arg_5.query(UpcomingEvent).delete()
    for arg_6 in arg_4:
        # Ignore events that have already ended
        if arg_6['dtend'] <= timestamp():
            continue
        arg_7 = UpcomingEvent()
        arg_7.start = arg_6['dtstart']
        arg_7.end = arg_6['dtend']
        arg_7.uid = arg_6.get('uid')
        arg_7.title = arg_6.get('summary')
        arg_7.set_data(arg_6)
        arg_5.add(arg_7)
    arg_5.commit()

Try to load schedule from the Matterhorn core . Returns a valid schedule or None on failure .


def Func(arg_0, arg_1, arg_2=None):
        '''
        Sends a batch of messages into the specified queue. The limit to the number of
        messages which may be present in the topic is governed by the message
        size the MaxTopicSizeInMegaBytes. If this message will cause the queue
        to exceed its quota, a quota exceeded error is returned and the
        message will be rejected.

        queue_name:
            Name of the queue.
        messages:
            List of message objects containing message body and properties.
        '''
        _validate_not_none('queue_name', arg_1)
        _validate_not_none('messages', arg_2)
        arg_3 = HTTPRequest()
        arg_3.method = 'POST'
        arg_3.host = arg_0._get_host()
        arg_3.path = '/' + _str(arg_1) + '/messages'
        arg_3.headers.append(('Content-Type', 'application/vnd.microsoft.servicebus.json'))
        arg_3.body = _get_request_body(json.dumps([m.as_batch_body() for m in arg_2]))
        arg_3.path, arg_3.query = arg_0._httpclient._update_request_uri_query(arg_3)  # pylint: disable=protected-access
        arg_3.headers = arg_0._update_service_bus_header(arg_3)
        arg_0._perform_request(arg_3)

Sends a batch of messages into the specified queue . The limit to the number of messages which may be present in the topic is governed by the message size the MaxTopicSizeInMegaBytes . If this message will cause the queue to exceed its quota a quota exceeded error is returned and the message will be rejected .


def Func ( arg_0 , ** arg_1 ) : arg_2 = { k : v for k , v in six . iteritems ( arg_0 . __json__ ) if v } arg_3 = json . dumps ( arg_2 , ** arg_1 ) arg_3 = re . sub ( r'[{}"]' , '' , arg_3 ) arg_3 = re . sub ( r',\n' , '\n' , arg_3 ) arg_3 = re . sub ( r'^\s*$' , '' , arg_3 ) return arg_3

def Func(arg_0, **arg_1):
    '''Pretty-print a jobject.

    Parameters
    ----------
    obj : jams.JObject

    kwargs
        additional parameters to `json.dumps`

    Returns
    -------
    string
        A simplified display of `obj` contents.
    '''

    arg_2 = {k: v for k, v in six.iteritems(arg_0.__json__) if v}

    arg_3 = json.dumps(arg_2, **arg_1)

    # Suppress braces and quotes
    arg_3 = re.sub(r'[{}"]', '', arg_3)

    # Kill trailing commas
    arg_3 = re.sub(r',\n', '\n', arg_3)

    # Kill blank lines
    arg_3 = re.sub(r'^\s*$', '', arg_3)

    return arg_3


def
Func
(
arg_0
,
arg_1
=
arg_2
,
arg_3
=
''
)
:
arg_4
=
0
if
isinstance
(
arg_1
,
str
)
:
arg_5
=
docopt
(
arg_1
,
version
=
arg_3
)
elif
isinstance
(
arg_1
,
dict
)
:
arg_5
=
arg_1
else
:
raise
ValueError
(
'unknown configuration object ({})'
.
format
(
type
(
arg_1
)
)
)
arg_6
=
arg_5
.
get
(
'--log'
,
'debug'
)
arg_7
=
arg_5
.
get
(
'--debug'
,
False
)
arg_8
=
'stdout'
if
arg_7
else
'apy.log'
arg_9
=
arg_5
.
get
(
'--bind'
,
'127.0.0.1'
)
arg_10
=
int
(
arg_5
.
get
(
'--port'
,
5000
)
)
arg_11
=
dna
.
logging
.
setup
(
level
=
arg_6
,
output
=
arg_8
)
with
arg_11
.
applicationbound
(
)
:
try
:
log
.
info
(
'Funcr ready'
,
version
=
arg_3
,
log
=
arg_6
,
debug
=
arg_7
,
bind
=
'{}:{}'
.
format
(
arg_9
,
arg_10
)
)
arg_0
.
app
.
run
(
host
=
arg_9
,
port
=
arg_10
,
debug
=
arg_7
)
except
Exception
as
error
:
if
arg_7
:
raise
log
.
error
(
'{}: {}'
.
format
(
type
(
error
)
.
__name__
,
str
(
error
)
)
)
arg_4
=
1
finally
:
log
.
info
(
'session ended with status {}'
.
format
(
arg_4
)
)
return
arg_4

def Func(arg_0, arg_1=arg_2, arg_3=''):
        ''' Configure from cli and run the Funcr '''

        arg_4 = 0
        if isinstance(arg_1, str):
            arg_5 = docopt(arg_1, version=arg_3)
        elif isinstance(arg_1, dict):
            arg_5 = arg_1
        else:
            raise ValueError('unknown configuration object ({})'
                             .format(type(arg_1)))
        arg_6 = arg_5.get('--log', 'debug')
        arg_7 = arg_5.get('--debug', False)
        # TODO More serious default
        arg_8 = 'stdout' if arg_7 else 'apy.log'
        arg_9 = arg_5.get('--bind', '127.0.0.1')
        arg_10 = int(arg_5.get('--port', 5000))
        arg_11 = dna.logging.setup(level=arg_6, output=arg_8)

        with arg_11.applicationbound():
            try:
                log.info('Funcr ready',
                         version=arg_3,
                         log=arg_6,
                         debug=arg_7,
                         bind='{}:{}'.format(arg_9, arg_10))

                arg_0.app.run(host=arg_9,
                             port=arg_10,
                             debug=arg_7)

            except Exception as error:
                if arg_7:
                    raise
                log.error('{}: {}'.format(type(error).__name__, str(error)))
                arg_4 = 1

            finally:
                log.info('session ended with status {}'.format(arg_4))

        return arg_4


(reader, writer, n, start=None, stop=None, tsCol=None,
           writeSampleOnly=True)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None,
           arg_6=True):
  """Samples n rows.

  Args:
    reader: A FileRecordStream object with input data.
    writer: A FileRecordStream object to write output data to.
    n: The number of elements to Func.
    start: The first row in the range to Func from.
    stop: The last row in the range to Func from.
    tsCol: If specified, the timestamp column to update.
    writeSampleOnly: If False, the rows before start are written before the
        Func and the rows after stop are written after the Func.
  """
  arg_7 = list(arg_0)
  if arg_5 is not None:
    arg_8 = arg_7[0][arg_5]
    arg_9 = arg_7[1][arg_5] - arg_8
  if arg_3 is None:
    arg_3 = 0
  if arg_4 is None:
    arg_4 = len(arg_7) - 1
  arg_10 = arg_4 - arg_3 + 1
  # Select random rows in the Func range to delete until the desired number
  # of rows are left.
  arg_11 =  arg_10 - arg_2
  for arg_12 in xrange(arg_11):
    arg_13 = random.randint(arg_3, arg_4 - arg_12)
    del arg_7[arg_13]
  # Remove outside rows if specified.
  if arg_6:
    arg_7 = arg_7[arg_3:arg_3 + arg_2]
  # Rewrite columns if tsCol is given.
  if arg_5 is not None:
    arg_8 = arg_7[0][arg_5]
  # Write resulting rows.
  for arg_14 in arg_7:
    if arg_5 is not None:
      arg_14[arg_5] = arg_8
      arg_8 += arg_9
    arg_1.appendRecord(arg_14)

Samples n rows.

  Args:
    reader: A FileRecordStream object with input data.
    writer: A FileRecordStream object to write output data to.
    n: The number of elements to sample.
    start: The first row in the range to sample from.
    stop: The last row in the range to sample from.
    tsCol: If specified, the timestamp column to update.
    writeSampleOnly: If False, the rows before start are written before the
        sample and the rows after stop are written after the sample.


(self, url,
                 headers=None,
                 return_json=True,
                 default_headers=True)

return self._call(url,
                      headers=headers,
                      func=requests.delete,
                      return_json=return_json,
                      default_headers=default_headers)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
True
,
arg_4
=
True
)
:
bot
.
debug
(
'DELETE %s'
%
arg_1
)
return
arg_0
.
_call
(
arg_1
,
arg_2
=
arg_2
,
func
=
requests
.
Func
,
arg_3
=
arg_3
,
arg_4
=
arg_4
)

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

    '''Func request, use with caution
    '''
    bot.debug('DELETE %s' %arg_1)
    return arg_0._call(arg_1,
                      arg_2=arg_2,
                      func=requests.Func,
                      arg_3=arg_3,
                      arg_4=arg_4)


return self._perform_get(
            '/' + self.subscription_id +
            '/services/hostedservices/operations/isavailable/' +
            _str(service_name) + '',
            AvailabilityResponse)

def Func(arg_0, arg_1):
        '''
        Checks to see if the specified hosted service name is available, or if
        it has already been taken.

        service_name:
            Name of the hosted service.
        '''
        _validate_not_none('service_name', arg_1)
        return arg_0._perform_get(
            '/' + arg_0.subscription_id +
            '/services/hostedservices/operations/isavailable/' +
            _str(arg_1) + '',
            AvailabilityResponse)

Checks to see if the specified hosted service name is available or if it has already been taken .


def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_4 = arg_0 . render ( arg_2 , ** arg_3 ) with open ( arg_1 , 'w' ) as f : f . write ( arg_4 . encode ( charset ) )

def Func(arg_0, arg_1, arg_2, **arg_3):
        """Render data with template and then write to path"""
        arg_4 = arg_0.render(arg_2, **arg_3)
        with open(arg_1, 'w') as f:
            f.write(arg_4.encode(charset))


def Func ( arg_0 , arg_1 = True ) : arg_2 = deepcopy ( arg_0 . get_array_declarations ( ) ) arg_3 = [ ] for arg_4 in arg_2 : arg_3 . append ( transform_multidim_to_1d_decl ( arg_4 ) ) transform_array_decl_to_malloc ( arg_4 , arg_1 = arg_1 ) return arg_2 , dict ( arg_3 )

def Func(arg_0, arg_1=True):
        """
        Generate declaration statements for arrays.

        Also transforming multi-dim to 1d arrays and initializing with malloc.

        :param with_init: ommit malloc initialization

        :return: list of declarations nodes, dictionary of array names and original dimensions
        """
        # copy array declarations from from kernel ast
        arg_2 = deepcopy(arg_0.get_array_declarations())
        arg_3 = []
        for arg_4 in arg_2:
            # We need to transform
            arg_3.append(transform_multidim_to_1d_decl(arg_4))
            transform_array_decl_to_malloc(arg_4, arg_1=arg_1)
        return arg_2, dict(arg_3)

Generate declaration statements for arrays .


def Func ( arg_0 ) : arg_1 = { } for arg_2 in arg_0 : if len ( arg_2 ) == 0 : continue arg_2 = arg_2 . rstrip ( ) if arg_2 == '[Term]' : if arg_1 : yield arg_1 arg_1 = { } elif arg_2 . startswith ( 'id' ) : arg_1 [ 'hpo_id' ] = arg_2 [ 4 : ] elif arg_2 . startswith ( 'name' ) : arg_1 [ 'description' ] = arg_2 [ 6 : ] elif arg_2 . startswith ( 'alt_id' ) : if 'aliases' not in arg_1 : arg_1 [ 'aliases' ] = [ ] arg_1 [ 'aliases' ] . append ( arg_2 [ 8 : ] ) elif arg_2 . startswith ( 'is_a' ) : if 'ancestors' not in arg_1 : arg_1 [ 'ancestors' ] = [ ] arg_1 [ 'ancestors' ] . append ( arg_2 [ 6 : 16 ] ) if arg_1 : yield arg_1

def Func(arg_0):
    """Parse a .obo formated hpo line"""
    arg_1 = {}
    for arg_2 in arg_0:
        if len(arg_2) == 0:
            continue
        arg_2 = arg_2.rstrip()
        # New term starts with [Term]
        if arg_2 == '[Term]':
            if arg_1:
                yield arg_1
            arg_1 = {}

        elif arg_2.startswith('id'):
            arg_1['hpo_id'] = arg_2[4:]

        elif arg_2.startswith('name'):
            arg_1['description'] = arg_2[6:]

        elif arg_2.startswith('alt_id'):
            if 'aliases' not in arg_1:
                arg_1['aliases'] = []
            arg_1['aliases'].append(arg_2[8:])

        elif arg_2.startswith('is_a'):
            if 'ancestors' not in arg_1:
                arg_1['ancestors'] = []
            arg_1['ancestors'].append(arg_2[6:16])

    if arg_1:
        yield arg_1


def Func ( arg_0 , arg_1 ) : arg_2 = ( ( i - j ) for i , j in zip ( arg_0 , arg_1 ) ) return sum ( arg_3 * arg_3 for arg_3 in arg_2 )

def Func(arg_0, arg_1):
    """Square of the Func distance"""
    arg_2 = ((i - j) for i, j in zip(arg_0, arg_1))
    return sum(arg_3 * arg_3 for arg_3 in arg_2)


return _MinidomXmlToObject.parse_service_resources_response(
            response, FirewallRule)

def Func(arg_0, arg_1):
        '''
        Retrieves the set of firewall rules for an Azure SQL Database Server.

        server_name:
            Name of the server.
        '''
        _validate_not_none('server_name', arg_1)
        arg_2 = arg_0._perform_get(arg_0._get_firewall_rules_path(arg_1),
                                     None)
        return _MinidomXmlToObject.parse_service_resources_response(
            arg_2, FirewallRule)

Retrieves the set of firewall rules for an Azure SQL Database Server .


(graph: BELGraph, percentage: Optional[str] = None)

def Func(arg_0: arg_1, arg_2: arg_3[arg_4] = None) -> arg_1:
    """Shuffle the relations.

    Useful for permutation testing.

    :param graph: A BEL graph
    :param percentage: What percentage of possible swaps to make
    """
    arg_2 = arg_2 or 0.3
    assert 0 < arg_2 <= 1

    arg_5 = arg_0.number_of_edges()
    arg_6 = int(arg_2 * arg_5 * (arg_5 - 1) / 2)

    arg_7: arg_1 = arg_0.copy()

    arg_8 = arg_7.edges(keys=True)

    for arg_9 in range(arg_6):
        (arg_10, arg_11, arg_12), (arg_13, arg_14, arg_15) = random.sample(arg_8, 2)
        arg_7[arg_10][arg_11][arg_12], arg_7[arg_13][arg_14][arg_15] = arg_7[arg_13][arg_14][arg_15], arg_7[arg_10][arg_11][arg_12]

    return arg_7


def Func ( arg_0 ) : arg_1 = { } @ wraps ( arg_0 ) def wrap ( * arg_2 , ** arg_3 ) : arg_4 = '{0}{1}' . format ( arg_2 , arg_3 ) if arg_4 not in arg_1 : arg_1 [ arg_4 ] = arg_0 ( * arg_2 , ** arg_3 ) return arg_1 [ arg_4 ] return wrap

def Func(arg_0):
    """Cache for heavy function calls."""
    arg_1 = {}

    @wraps(arg_0)
    def wrap(*arg_2, **arg_3):
        arg_4 = '{0}{1}'.format(arg_2, arg_3)
        if arg_4 not in arg_1:
            arg_1[arg_4] = arg_0(*arg_2, **arg_3)
        return arg_1[arg_4]
    return wrap


def Func ( arg_0 ) : log . info ( 'Heap' ) arg_1 = arg_0 . __exchange ( 'print(node.heap())' ) log . info ( arg_1 ) return int ( arg_1 . split ( '\r\n' ) [ 1 ] )

def Func(arg_0):
        """Show device heap size"""
        log.info('Heap')
        arg_1 = arg_0.__exchange('print(node.heap())')
        log.info(arg_1)
        return int(arg_1.split('\r\n')[1])


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
ord
(
arg_1
[
0
]
)
if
arg_2
not
in
arg_0
.
VERSIONS
:
raise
Exception
(
'Version not defined: %d'
%
arg_2
)
return
arg_2

def Func(arg_0, arg_1):
        '''Read header version from data'''

        arg_2 = ord(arg_1[0])
        if arg_2 not in arg_0.VERSIONS:
            raise Exception('Version not defined: %d' % arg_2)
        return arg_2


def Func ( arg_0 ) : arg_1 = hashlib . md5 ( uuid . uuid4 ( ) . bytes + six . b ( arg_0 ) ) . hexdigest ( ) arg_2 = 5 arg_3 = random . randint ( 0 , arg_2 ) return arg_1 [ arg_3 : arg_3 - arg_2 - 1 ]

def Func(arg_0):
        """
        Generates CSRF token.

        Inspired by this article:
        http://blog.ptsecurity.com/2012/10/random-number-security-in-python.html

        :returns:
            :class:`str` Random unguessable string.

        """

        # Create hash from random string plus salt.
        arg_1 = hashlib.md5(uuid.uuid4().bytes + six.b(arg_0)).hexdigest()

        # Each time return random portion of the hash.
        arg_2 = 5
        arg_3 = random.randint(0, arg_2)
        return arg_1[arg_3:arg_3 - arg_2 - 1]


def Func ( arg_0 ) : arg_0 . id = ( arg_0 . id + 1 ) % 65536 arg_0 . id = arg_0 . id or 1 return arg_0 . id

def Func(arg_0):
        '''Produce ids for Protocol packets, outliving their sessions'''
        arg_0.id = (arg_0.id + 1) % 65536
        arg_0.id = arg_0.id or 1   # avoid id 0
        return arg_0.id

Produce ids for Protocol packets outliving their sessions


def Func ( arg_0 , arg_1 ) : arg_2 = normalize_shape ( arg_1 ) if arg_2 [ 0 : 2 ] == arg_0 . shape [ 0 : 2 ] : return arg_0 . deepcopy ( ) arg_3 = [ poly . project ( arg_0 . shape , arg_2 ) for poly in arg_0 . polygFuncs ] return PolygFuncsOnImage ( arg_3 , arg_2 )

def Func(arg_0, arg_1):
        """
        Project polygFuncs from Funce image to a new Funce.

        Parameters
        ----------
        image : ndarray or tuple of int
            New image Functo which the polygFuncs are to be projected.
            May also simply be that new image's shape tuple.

        Returns
        -------
        imgaug.PolygFuncsOnImage
            Object cFunctaining all projected polygFuncs.

        """
        arg_2 = normalize_shape(arg_1)
        if arg_2[0:2] == arg_0.shape[0:2]:
            return arg_0.deepcopy()
        arg_3 = [poly.project(arg_0.shape, arg_2) for poly in arg_0.polygFuncs]
        # TODO use deepcopy() here
        return PolygFuncsOnImage(arg_3, arg_2)

Project polygons from one image to a new one.

        Parameters
        ----------
        image : ndarray or tuple of int
            New image onto which the polygons are to be projected.
            May also simply be that new image's shape tuple.

        Returns
        -------
        imgaug.PolygonsOnImage
            Object containing all projected polygons.

Project polygons from one image to a new one .


def Func(arg_0, arg_1):
        """
        Set the subject of this certificate.

        :param subject: The subject.
        :type subject: :py:class:`X509Name`

        :return: ``None``
        """
        arg_0._set_name(_lib.X509_Func_name, arg_1)
        arg_0._subject_invalidator.clear()


def Func ( arg_0 ) : try : arg_1 = arg_0 . _element . get ( 'from' ) if arg_1 : arg_0 . _from_jid = JID ( arg_1 ) arg_3 = arg_0 . _element . get ( 'to' ) if arg_3 : arg_0 . _to_jid = JID ( arg_3 ) except ValueError : raise JIDMalformedProtocolError arg_0 . _stanza_type = arg_0 . _element . get ( 'type' ) arg_0 . _stanza_id = arg_0 . _element . get ( 'id' ) arg_7 = arg_0 . _element . get ( XML_LANG_QNAME ) if arg_7 : arg_0 . _language = arg_7

def Func(arg_0):
        """Decode attributes of the stanza XML element
        and put them into the stanza properties."""
        try:
            arg_1 = arg_0._element.get('from')
            if arg_1:
                arg_0._from_jid = JID(arg_1)
            arg_3 = arg_0._element.get('to')
            if arg_3:
                arg_0._to_jid = JID(arg_3)
        except ValueError:
            raise JIDMalformedProtocolError
        arg_0._stanza_type = arg_0._element.get('type')
        arg_0._stanza_id = arg_0._element.get('id')
        arg_7 = arg_0._element.get(XML_LANG_QNAME)
        if arg_7:
            arg_0._language = arg_7

Decode attributes of the stanza XML element and put them into the stanza properties .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 . get ( "mode" , "" ) == "base64" : return 0 if arg_0 . contentparams [ "type" ] . startswith ( "text/" ) : return 0 if arg_0 . contentparams [ "type" ] . endswith ( "+xml" ) : return 0 if arg_0 . contentparams [ "type" ] . endswith ( "/xml" ) : return 0 if arg_0 . contentparams [ "type" ] . endswith ( "/json" ) : return 0 return 0

def Func(arg_0, arg_1, arg_2):
    """ Patch isBase64 to prevent Base64 encoding of JSON content
    """
    if arg_1.get("mode", "") == "base64":
        return 0
    if arg_0.contentparams["type"].startswith("text/"):
        return 0
    if arg_0.contentparams["type"].endswith("+xml"):
        return 0
    if arg_0.contentparams["type"].endswith("/xml"):
        return 0
    if arg_0.contentparams["type"].endswith("/json"):
        return 0
    return 0


def Func ( arg_0 ) : arg_1 = store . panel ( arg_0 ) arg_2 = request . form . get ( 'version' , None ) arg_3 = store . apply_pending ( arg_1 , arg_2 ) return redirect ( url_for ( 'panels.panel' , arg_0 = arg_3 ) )

def Func(arg_0):
    """Update panel to a new version."""
    arg_1 = store.panel(arg_0)
    arg_2 = request.form.get('version', None)
    arg_3 = store.apply_pending(arg_1, arg_2)
    return redirect(url_for('panels.panel', arg_0=arg_3))


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
open
(
arg_0
,
'w'
)
arg_3
.
write
(
arg_2
+
'\n'
)
arg_3
.
write
(
'msgid ""'
+
'\nmsgstr ""'
+
'\n"MIME-Version: '
+
settings
.
METADATA
[
'MIME-Version'
]
+
r'\n"'
'\n"Content-Type: '
+
settings
.
METADATA
[
'Content-Type'
]
+
r'\n"'
'\n"Content-Transfer-Encoding: '
+
settings
.
METADATA
[
'Content-Transfer-Encoding'
]
+
r'\n"'
'\n"Language: '
+
arg_1
+
r'\n"'
+
'\n'
)
arg_3
.
close
(
)

def Func(arg_0, arg_1, arg_2):
    """
    Write header into po file for specific lang.
    Metadata are read from settings file.
    """
    arg_3 = open(arg_0, 'w')
    arg_3.write(arg_2 + '\n')
    arg_3.write(
        'msgid ""' +
        '\nmsgstr ""' +
        '\n"MIME-Version: ' + settings.METADATA['MIME-Version'] + r'\n"'
        '\n"Content-Type: ' + settings.METADATA['Content-Type'] + r'\n"'
        '\n"Content-Transfer-Encoding: ' +
        settings.METADATA['Content-Transfer-Encoding'] + r'\n"'
        '\n"Language: ' + arg_1 + r'\n"' + '\n')
    arg_3.close()

Write header into po file for specific lang . Metadata are read from settings file .


def Func(arg_0, arg_1):
        """
        Start executing in Unicorn from this point until we hit a syscall or reach break_unicorn_at

        :param capstone.CsInsn insn: The instruction object to emulate
        """

        if not arg_0.emu:
            arg_0.emu = ConcreteUnicornEmulator(arg_0)
            arg_0.emu._stop_at = arg_0._break_unicorn_at
        try:
            arg_0.emu.emulate(arg_1)
        except unicorn.UcError as e:
            if e.errno == unicorn.UC_ERR_INSN_INVALID:
                arg_4 = ' '.join('%02x' % x for x in arg_1.bytes)
                logger.error("Unimplemented instruction: 0x%016x:\t%s\t%s\t%s",
                             arg_1.address, arg_4, arg_1.mnemonic, arg_1.op_str)
            raise InstructionEmulationError(str(e))


def Func ( arg_0 ) : if arg_0 . _Func is None : arg_1 = arg_0 . processes if arg_1 is not None and arg_1 < 0 : try : arg_1 = multiprocessing . cpu_count ( ) - abs ( arg_1 ) arg_1 = max ( arg_1 , 1 ) except ( ImportError , NotImplementedError ) : arg_1 = None arg_0 . _Func = multiprocessing . Pool ( arg_1 , initializer = _Pool_initialize_worker , initargs = ( arg_0 . augseq , arg_0 . seed ) , maxtasksperchild = arg_0 . maxtasksperchild ) return arg_0 . _Func

def Func(arg_0):
        """Return the multiprocessing.Pool instance or create it if not done yet.

        Returns
        -------
        multiprocessing.Pool
            The multiprocessing.Pool used internally by this imgaug.multicore.Pool.

        """
        if arg_0._Func is None:
            arg_1 = arg_0.processes
            if arg_1 is not None and arg_1 < 0:
                try:
                    # cpu count includes the hyperthreads, e.g. 8 for 4 cores + hyperthreading
                    arg_1 = multiprocessing.cpu_count() - abs(arg_1)
                    arg_1 = max(arg_1, 1)
                except (ImportError, NotImplementedError):
                    arg_1 = None

            arg_0._Func = multiprocessing.Pool(arg_1,
                                              initializer=_Pool_initialize_worker,
                                              initargs=(arg_0.augseq, arg_0.seed),
                                              maxtasksperchild=arg_0.maxtasksperchild)
        return arg_0._Func

Return the multiprocessing . Pool instance or create it if not done yet .


Makes the HTTP request using RESTClient.

(self, method, url, query_params=None, headers=None,
                post_params=None, body=None)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None,
                arg_5=None, arg_6=None):
        """
        Makes the HTTP Func using RESTClient.
        """
        if arg_1 == "GET":
            return arg_0.rest_client.GET(arg_2,
                                        arg_3=arg_3,
                                        arg_4=arg_4)
        elif arg_1 == "HEAD":
            return arg_0.rest_client.HEAD(arg_2,
                                         arg_3=arg_3,
                                         arg_4=arg_4)
        elif arg_1 == "OPTIONS":
            return arg_0.rest_client.OPTIONS(arg_2,
                                            arg_3=arg_3,
                                            arg_4=arg_4,
                                            arg_5=arg_5,
                                            arg_6=arg_6)
        elif arg_1 == "POST":
            return arg_0.rest_client.POST(arg_2,
                                         arg_3=arg_3,
                                         arg_4=arg_4,
                                         arg_5=arg_5,
                                         arg_6=arg_6)
        elif arg_1 == "PUT":
            return arg_0.rest_client.PUT(arg_2,
                                        arg_3=arg_3,
                                        arg_4=arg_4,
                                        arg_5=arg_5,
                                        arg_6=arg_6)
        elif arg_1 == "PATCH":
            return arg_0.rest_client.PATCH(arg_2,
                                          arg_3=arg_3,
                                          arg_4=arg_4,
                                          arg_5=arg_5,
                                          arg_6=arg_6)
        elif arg_1 == "DELETE":
            return arg_0.rest_client.DELETE(arg_2,
                                           arg_3=arg_3,
                                           arg_4=arg_4)
        else:
            raise ValueError(
                "http method must be `GET`, `HEAD`,"
                " `POST`, `PATCH`, `PUT` or `DELETE`."
            )

Makes the HTTP request using RESTClient .


def Func ( arg_0 ) : try : arg_1 = arg_0 . Func ( ) except Exception : pass else : if isinstance ( arg_1 , basestring ) : return inspect . cleandoc ( arg_1 ) try : return inspect . Func ( arg_0 ) except Exception : return None

def Func(arg_0):
    """Stable wrapper around inspect.Func.

    This can't crash because of attribute problems.

    It also attempts to call a Func() method on the given object.  This
    allows objects which provide their docstrings via non-standard mechanisms
    (like Pyro proxies) to still be inspected by ipython's ? system."""
    # Allow objects to offer customized documentation via a Func method:
    try:
        arg_1 = arg_0.Func()
    except Exception:
        pass
    else:
        # if we get extra info, we add it to the normal docstring.
        if isinstance(arg_1, basestring):
            return inspect.cleandoc(arg_1)

    try:
        return inspect.Func(arg_0)
    except Exception:
        # Harden against an inspect failure, which can occur with
        # SWIG-wrapped extensions.
        return None

Stable wrapper around inspect.getdoc.

    This can't crash because of attribute problems.

    It also attempts to call a getdoc() method on the given object.  This
    allows objects which provide their docstrings via non-standard mechanisms
    (like Pyro proxies) to still be inspected by ipython's ? system.

Stable wrapper around inspect . getdoc .


def Func ( arg_0 , arg_1 : arg_2 , arg_3 = True ) : arg_4 = datetime . strptime ( arg_1 , '%Y%m%dT%H%M%S.%fZ' ) if arg_3 : return int ( arg_4 . timestamp ( ) ) else : return arg_4

def Func(arg_0, arg_1: arg_2, arg_3=True):
        """Converts a %Y%m%dT%H%M%S.%fZ to a UNIX timestamp
        or a datetime.datetime object

        Parameters
        ---------
        timestamp: str
            A timstamp in the %Y%m%dT%H%M%S.%fZ format, usually returned by the API
            in the ``created_time`` field for example (eg. 20180718T145906.000Z)
        unix: Optional[bool] = True
            Whether to return a POSIX timestamp (seconds since epoch) or not

        Returns int or datetime.datetime
        """
        arg_4 = datetime.strptime(arg_1, '%Y%m%dT%H%M%S.%fZ')
        if arg_3:
            return int(arg_4.timestamp())
        else:
            return arg_4

Converts a %Y%m%dT%H%M%S . %fZ to a UNIX timestamp or a datetime . datetime object


return [itemParse(i) for i in rc.get('players', ())]

def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
)
:
arg_3
=
'GET'
arg_4
=
'Func/%s/user/%s'
%
(
arg_1
,
arg_2
or
arg_0
.
persona_id
)
arg_5
=
[
arg_0
.
pin
.
event
(
'page_view'
,
'Hub - Squads'
)
]
arg_0
.
pin
.
send
(
arg_5
)
arg_6
=
arg_0
.
__request__
(
arg_3
,
arg_4
)
arg_5
=
[
arg_0
.
pin
.
event
(
'page_view'
,
'Squad Details'
)
,
arg_0
.
pin
.
event
(
'page_view'
,
'Squads - Squad Overview'
)
]
arg_0
.
pin
.
send
(
arg_5
)
return
[
itemParse
(
arg_7
)
for
arg_7
in
arg_6
.
get
(
'players'
,
(
)
)
]

def Func(arg_0, arg_1=0, arg_2=None):
        """Return a Func.

        :params Func_id: Squad id.
        """
        arg_3 = 'GET'
        arg_4 = 'Func/%s/user/%s' % (arg_1, arg_2 or arg_0.persona_id)

        # pinEvents
        arg_5 = [arg_0.pin.event('page_view', 'Hub - Squads')]
        arg_0.pin.send(arg_5)

        # TODO: ability to return other info than players only
        arg_6 = arg_0.__request__(arg_3, arg_4)

        # pinEvents
        arg_5 = [arg_0.pin.event('page_view', 'Squad Details'), arg_0.pin.event('page_view', 'Squads - Squad Overview')]
        arg_0.pin.send(arg_5)

        return [itemParse(arg_7) for arg_7 in arg_6.get('players', ())]

Return a squad.

        :params squad_id: Squad id.


def Func ( arg_0 ) : if 'TSP_EMAIL' in os . environ : arg_0 . _email = os . environ [ 'TSP_EMAIL' ] if 'TSP_API_TOKEN' in os . environ : arg_0 . _api_token = os . environ [ 'TSP_API_TOKEN' ] if 'TSP_API_HOST' in os . environ : arg_0 . _api_host = os . environ [ 'TSP_API_HOST' ] else : arg_0 . _api_host = 'api.truesight.bmc.com'

def Func(arg_0):
        """
        Gets the configuration stored in environment variables
        """
        if 'TSP_EMAIL' in os.environ:
            arg_0._email = os.environ['TSP_EMAIL']
        if 'TSP_API_TOKEN' in os.environ:
            arg_0._api_token = os.environ['TSP_API_TOKEN']
        if 'TSP_API_HOST' in os.environ:
            arg_0._api_host = os.environ['TSP_API_HOST']
        else:
            arg_0._api_host = 'api.truesight.bmc.com'


def Func ( arg_0 , arg_1 = None , arg_2 = 'json' ) : if arg_1 : arg_3 = "tiingo/news/bulk_download/{}" . format ( arg_1 ) else : arg_3 = "tiingo/news/bulk_download" arg_4 = arg_0 . _request ( 'GET' , arg_3 ) arg_5 = arg_4 . json ( ) if arg_2 == 'json' : return arg_5 elif arg_2 == 'object' : return dict_to_object ( arg_5 , "BulkNews" )

def Func(arg_0, arg_1=None, arg_2='json'):
        """Only available to institutional clients.
            If ID is NOT provided, return array of available file_ids.
            If ID is provided, provides URL which you can use to download your
            file, as well as some metadata about that file.
        """
        if arg_1:
            arg_3 = "tiingo/news/bulk_download/{}".format(arg_1)
        else:
            arg_3 = "tiingo/news/bulk_download"

        arg_4 = arg_0._request('GET', arg_3)
        arg_5 = arg_4.json()
        if arg_2 == 'json':
            return arg_5
        elif arg_2 == 'object':
            return dict_to_object(arg_5, "BulkNews")

Only available to institutional clients . If ID is NOT provided return array of available file_ids . If ID is provided provides URL which you can use to download your file as well as some metadata about that file .


def Func ( arg_0 , ** arg_1 : arg_2 ) : arg_3 = arg_0 . api . CONSTANTS return arg_0 . _get_model ( arg_3 , ** arg_1 )

def Func(arg_0, **arg_1: arg_2):
        """Get the CR Constants

        Parameters
        ----------
        \*\*keys: Optional[list] = None
            Filter which keys should be included in the
            response
        \*\*exclude: Optional[list] = None
            Filter which keys should be excluded from the
            response
        \*\*timeout: Optional[int] = None
            Custom timeout that overwrites Client.timeout
        """
        arg_3 = arg_0.api.CONSTANTS
        return arg_0._get_model(arg_3, **arg_1)


def
Func
(
)
:
arg_0
=
argparse
.
ArgumentParser
(
description
=
Func
.
__doc__
)
arg_0
.
add_argument
(
'--device'
,
default
=
'/dev/ttyUSB0'
,
help
=
'port to read DSMR data from'
)
arg_0
.
add_argument
(
'--host'
,
default
=
,
help
=
'alternatively connect using TCP host.'
)
arg_0
.
add_argument
(
'--port'
,
default
=
,
help
=
'TCP port to use for connection'
)
arg_0
.
add_argument
(
'--version'
,
default
=
'2.2'
,
choices
=
[
'2.2'
,
'4'
]
,
help
=
'DSMR version (2.2, 4)'
)
arg_0
.
add_argument
(
'--verbose'
,
'-v'
,
action
=
'count'
)
arg_1
=
arg_0
.
parse_args
(
)
if
arg_1
.
verbose
:
arg_2
=
logging
.
DEBUG
else
:
arg_2
=
logging
.
ERROR
logging
.
basicConfig
(
arg_2
=
arg_2
)
arg_3
=
asyncio
.
get_event_loop
(
)
def
print_callback
(
arg_4
)
:
for
arg_5
,
arg_6
in
arg_4
.
items
(
)
:
if
arg_6
:
print
(
arg_6
.
value
,
arg_6
.
unit
)
print
(
)
if
arg_1
.
host
and
arg_1
.
port
:
arg_7
=
partial
(
create_tcp_dsmr_reader
,
arg_1
.
host
,
arg_1
.
port
,
arg_1
.
version
,
print_callback
,
arg_3
=
arg_3
)
else
:
arg_7
=
partial
(
create_dsmr_reader
,
arg_1
.
device
,
arg_1
.
version
,
print_callback
,
arg_3
=
arg_3
)
try
:
while
True
:
arg_8
=
arg_7
(
)
arg_9
,
arg_10
=
arg_3
.
run_until_complete
(
arg_8
)
arg_3
.
run_until_complete
(
arg_10
.
wait_closed
(
)
)
arg_3
.
run_until_complete
(
asyncio
.
sleep
(
5
)
)
except
KeyboardInterrupt
:
arg_9
.
close
(
)
arg_3
.
run_until_complete
(
asyncio
.
sleep
(
0
)
)
finally
:
arg_3
.
close
(
)

def Func():
    """Output DSMR data to Func."""

    arg_0 = argparse.ArgumentParser(description=Func.__doc__)
    arg_0.add_argument('--device', default='/dev/ttyUSB0',
                        help='port to read DSMR data from')
    arg_0.add_argument('--host', default=None,
                        help='alternatively connect using TCP host.')
    arg_0.add_argument('--port', default=None,
                        help='TCP port to use for connection')
    arg_0.add_argument('--version', default='2.2', choices=['2.2', '4'],
                        help='DSMR version (2.2, 4)')
    arg_0.add_argument('--verbose', '-v', action='count')

    arg_1 = arg_0.parse_args()

    if arg_1.verbose:
        arg_2 = logging.DEBUG
    else:
        arg_2 = logging.ERROR
    logging.basicConfig(arg_2=arg_2)

    arg_3 = asyncio.get_event_loop()

    def print_callback(arg_4):
        """Callback that prints telegram values."""
        for arg_5, arg_6 in arg_4.items():
            if arg_6:
                print(arg_6.value, arg_6.unit)
        print()

    # create tcp or serial connection depending on args
    if arg_1.host and arg_1.port:
        arg_7 = partial(create_tcp_dsmr_reader,
                                    arg_1.host, arg_1.port, arg_1.version,
                                    print_callback, arg_3=arg_3)
    else:
        arg_7 = partial(create_dsmr_reader,
                                    arg_1.device, arg_1.version,
                                    print_callback, arg_3=arg_3)

    try:
        # connect and keep connected until interrupted by ctrl-c
        while True:
            # create serial or tcp connection
            arg_8 = arg_7()
            arg_9, arg_10 = arg_3.run_until_complete(arg_8)
            # wait until connection it closed
            arg_3.run_until_complete(arg_10.wait_closed())
            # wait 5 seconds before attempting reconnect
            arg_3.run_until_complete(asyncio.sleep(5))
    except KeyboardInterrupt:
        # cleanup connection after user initiated shutdown
        arg_9.close()
        arg_3.run_until_complete(asyncio.sleep(0))
    finally:
        arg_3.close()


def Func(arg_0, arg_1, arg_2):
        """
        Sets the new size and buffer size internally
        """
        arg_0.width = arg_1
        arg_0.height = arg_2
        arg_0.buffer_width, arg_0.buffer_height = glfw.get_framebuffer_size(arg_0.window)
        arg_0.set_default_viewport()


return GeneratedPyAST(
        node=ast.Call(func=ast.Name(id=throw_fn, ctx=ast.Load()), args=[], keywords=[]),
        dependencies=[
            ast.FunctionDef(
                name=throw_fn,
                args=ast.arguments(
                    args=[],
                    kwarg=None,
                    vararg=None,
                    kwonlyargs=[],
                    defaults=[],
                    kw_defaults=[],
                ),
                body=list(chain(exc_ast.dependencies, [raise_body])),
                decorator_list=[],
                returns=None,
            )
        ],
    )

def Func ( arg_0 : arg_1 , arg_2 : arg_3 ) -> GeneratedPyAST : assert arg_2 . op == NodeOp . THROW arg_4 = genname ( _THROW_PREFIX ) arg_5 = gen_py_ast ( arg_0 , arg_2 . exception ) arg_6 = ast . Raise ( exc = arg_5 . node , cause = None ) return GeneratedPyAST ( arg_2 = ast . Call ( func = ast . Name ( id = arg_4 , arg_0 = ast . Load ( ) ) , args = [ ] , keywords = [ ] ) , dependencies = [ ast . FunctionDef ( name = arg_4 , args = ast . arguments ( args = [ ] , kwarg = None , vararg = None , kwonlyargs = [ ] , defaults = [ ] , kw_defaults = [ ] , ) , body = list ( chain ( arg_5 . dependencies , [ arg_6 ] ) ) , decorator_list = [ ] , returns = None , ) ] , )

def Func(arg_0: arg_1, arg_2: arg_3) -> GeneratedPyAST:
    """Return a Python AST Node for a `throw` expression."""
    assert arg_2.op == NodeOp.THROW

    arg_4 = genname(_THROW_PREFIX)
    arg_5 = gen_py_ast(arg_0, arg_2.exception)
    arg_6 = ast.Raise(exc=arg_5.node, cause=None)

    return GeneratedPyAST(
        arg_2=ast.Call(func=ast.Name(id=arg_4, arg_0=ast.Load()), args=[], keywords=[]),
        dependencies=[
            ast.FunctionDef(
                name=arg_4,
                args=ast.arguments(
                    args=[],
                    kwarg=None,
                    vararg=None,
                    kwonlyargs=[],
                    defaults=[],
                    kw_defaults=[],
                ),
                body=list(chain(arg_5.dependencies, [arg_6])),
                decorator_list=[],
                returns=None,
            )
        ],
    )

Return a Python AST Node for a throw expression .


(cls, group, user, state=MembershipState.ACTIVE)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = arg_4 . ACTIVE ) : with db . session . begin_nested ( ) : arg_6 = arg_0 ( user_id = arg_2 . get_id ( ) , id_group = arg_1 . id , arg_3 = arg_3 , ) db . session . add ( arg_6 ) return arg_6

def Func(arg_0, arg_1, arg_2, arg_3=arg_4.ACTIVE):
        """Create a new membership."""
        with db.session.begin_nested():
            arg_6 = arg_0(
                user_id=arg_2.get_id(),
                id_group=arg_1.id,
                arg_3=arg_3,
            )
            db.session.add(arg_6)
        return arg_6


def Func ( arg_0 , arg_1 = 20 ) : arg_2 = dict ( ) arg_2 [ 'limit' ] = arg_1 arg_3 = arg_0 . request ( 'midas.user.list' , arg_2 ) return arg_3

def Func(arg_0, arg_1=20):
        """
        List the public users in the system.

        :param limit: (optional) The number of users to fetch.
        :type limit: int | long
        :returns: The list of users.
        :rtype: list[dict]
        """
        arg_2 = dict()
        arg_2['limit'] = arg_1
        arg_3 = arg_0.request('midas.user.list', arg_2)
        return arg_3


def Func ( arg_0 , arg_1 ) : arg_0 . used_temps . remove ( arg_1 ) arg_0 . Funcs . add ( arg_1 )

def Func(arg_0, arg_1):
    """Release the GeneratedTempVar v so it can be reused."""
    arg_0.used_temps.remove(arg_1)
    arg_0.Funcs.add(arg_1)

Release the GeneratedTempVar v so it can be reused .