def Func(arg_0, arg_1=None):
    '''This function is mostly about managing configuration, and then
    finally returns a boto.Bucket object.

    AWS credentials come first from config keys
    aws_access_key_id_path, aws_secret_access_key_path (paths to one
    line files); secondly from environment variables
    AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY; also from $HOME/.aws/credentials
    or the magic Amazon http://169.254.169.254/ service.  If credentials
    are not set in the config then behavior is the same as other AWS-based
    command-line tools.

    '''
    if not arg_1:
        if 'bucket' not in arg_0:
            raise ConfigurationError(
                'The "bucket" parameter is required for the s3 stages.')
        arg_1 = arg_0['bucket']

    # get AWS credentials. first, from config; else, from env vars.
    # (boto will read environment variables and other normal places.)
    arg_2 = arg_0.get('aws_access_key_id_path')
    arg_3 = arg_0.get('aws_secret_access_key_path')

    arg_4 = ()
    if arg_2 and arg_3:
        try:
            arg_5 = open(arg_2).read().strip()
            arg_6 = open(arg_3).read().strip()
            arg_4 = (arg_5, arg_6)
        except:
            logger.error('failed reading aws credentials from configured file', exc_info=True)
            raise

    arg_7 = S3Connection(*arg_4)
    arg_8 = arg_7.Func(arg_1)
    return arg_8

This function is mostly about managing configuration and then finally returns a boto . Bucket object .


def Func ( arg_0 ) : if not arg_0 . _is_completly_event_dependent : arg_0 . _is_completly_event_dependent = True for arg_2 in arg_0 . _iter_stms ( ) : arg_2 . Func ( )

def Func(arg_0):
        """
        After parrent statement become event dependent
        propagate event dependency flag to child statements
        """
        if not arg_0._is_completly_event_dependent:
            arg_0._is_completly_event_dependent = True
            for arg_2 in arg_0._iter_stms():
                arg_2.Func()


def Func ( arg_0 ) : arg_0 = arg_0 . upper ( ) arg_1 = [ ] for arg_2 in arg_0 : iso_reference_valid_char ( arg_2 ) if arg_2 in ISO_REFERENCE_VALID_NUMERIC : arg_1 . append ( arg_2 ) else : arg_1 . append ( str ( iso_reference_char2int ( arg_2 ) ) ) return int ( '' . join ( arg_1 ) )

def Func(arg_0):
    """Creates the huge number from ISO alphanumeric ISO reference"""
    arg_0 = arg_0.upper()
    arg_1 = []
    for arg_2 in arg_0:
        iso_reference_valid_char(arg_2)
        if arg_2 in ISO_REFERENCE_VALID_NUMERIC:
            arg_1.append(arg_2)
        else:
            arg_1.append(str(iso_reference_char2int(arg_2)))
    return int(''.join(arg_1))


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _knnclassifier . getParameter ( 'categoryRecencyList' ) arg_3 = ( [ r . ROWID for r in arg_1 if not r . setByUser and r . ROWID in arg_2 ] ) arg_4 = arg_0 . _knnclassifier . _knn . _numPatterns arg_0 . _knnclassifier . _knn . removeIds ( arg_3 ) assert arg_0 . _knnclassifier . _knn . _numPatterns == arg_4 - len ( arg_3 )

def Func(arg_0, arg_1):
    """
    Removes the given records from the classifier.

    parameters
    ------------
    recordsToDelete - list of records to delete from the classififier
    """
    arg_2 = arg_0._knnclassifier.getParameter('categoryRecencyList')

    arg_3 = ([r.ROWID for r in arg_1 if
      not r.setByUser and r.ROWID in arg_2])

    arg_4 = arg_0._knnclassifier._knn._numPatterns
    arg_0._knnclassifier._knn.removeIds(arg_3)
    assert arg_0._knnclassifier._knn._numPatterns == arg_4 - len(arg_3)

Removes the given records from the classifier .


return _MinidomXmlToObject.convert_response_to_feeds(
            response,
            partial(
                _MinidomXmlToObject.convert_xml_to_azure_object,
                azure_type=RelayDescription
            )
        )

def Func(arg_0, arg_1):
        '''
        Retrieves the relays in the service namespace.

        name:
            Name of the service bus namespace.
        '''
        arg_2 = arg_0._perform_get(
            arg_0._get_Func_path(arg_1),
            None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            arg_2,
            partial(
                _MinidomXmlToObject.convert_xml_to_azure_object,
                azure_type=RelayDescription
            )
        )

Retrieves the relays in the service namespace .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = Route ( 'GET' , '/artists/{spotify_id}/top-tracks' , arg_1 = arg_1 ) arg_4 = { 'country' : arg_2 } return arg_0 . request ( arg_3 , params = arg_4 )

def Func(arg_0, arg_1, arg_2):
        """Get an artists top tracks per country with their ID.

        Parameters
        ----------
        spotify_id : str
            The spotify_id to search by.
        country : COUNTRY_TP
            COUNTRY
        """
        arg_3 = Route('GET', '/artists/{spotify_id}/top-tracks', arg_1=arg_1)
        arg_4 = {'country': arg_2}
        return arg_0.request(arg_3, params=arg_4)

Get an artists top tracks per country with their ID .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 . type_errors ( ) : arg_0 . add_message ( "invalid-unary-operand-type" , args = str ( arg_2 ) , arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """Detect TypeErrors for unary operands."""

        for arg_2 in arg_1.type_errors():
            # Let the error customize its output.
            arg_0.add_message("invalid-unary-operand-type", args=str(arg_2), arg_1=arg_1)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = np . zeros ( arg_1 , dtype = int ) arg_4 [ : ] = - 2 arg_4 [ arg_2 ] = arg_3 return arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Translate cluster identity back to original data size.

        Parameters
        ----------
        size : int
            size of original dataset
        sampled : array-like
            integer array describing location of finite values
            in original data.
        clusters : array-like
            integer array of cluster identities

        Returns
        -------
        list of cluster identities the same length as original
        data. Where original data are non-finite, returns -2.

        """
        arg_4 = np.zeros(arg_1, dtype=int)
        arg_4[:] = -2

        arg_4[arg_2] = arg_3

        return arg_4

Translate cluster identity back to original data size .


def Func ( arg_0 ) : arg_1 = arg_0 . split ( ':' ) for arg_2 in arg_1 : if not valid_path ( arg_2 . strip ( ) ) : return False return True

def Func(arg_0):
  '''
  Given a java classpath, check whether the path entries are valid or not
  '''
  arg_1 = arg_0.split(':')
  for arg_2 in arg_1:
    if not valid_path(arg_2.strip()):
      return False
  return True

Given a java classpath check whether the path entries are valid or not


def Func ( arg_0 ) : arg_1 = { arg_0 . key_name : arg_0 . key_value } arg_0 . model_class . objects . filter ( ** arg_1 ) . delete ( )

def Func(arg_0):
        """Delete Credentials from the datastore."""
        arg_1 = {arg_0.key_name: arg_0.key_value}
        arg_0.model_class.objects.filter(**arg_1).delete()


(func_or_workspace_id, workspace_id_or_token = None, workspace_token_or_none = None, files=(), endpoint=None)

return _publish_worker(func_or_workspace_id, files, workspace_id_or_token, workspace_token_or_none, endpoint)

def Func(arg_0, arg_1 = None, arg_2 = None, arg_3=(), arg_4=None):
    '''Funces a callable function or decorates a function to be Funced.

Returns a callable, iterable object.  Calling the object will invoke the Funced service.
Iterating the object will give the API URL, API key, and API help url.

To define a function which will be Funced to Azure you can simply decorate it with
the @Func decorator.  This will Func the service, and then future calls to the
function will run against the operationalized version of the service in the cloud.

>>> @Func(workspace_id, workspace_token)
>>> def func(a, b):
>>>    return a + b

After Funcing you can then invoke the function using:
func.service(1, 2)

Or continue to invoke the function locally:
func(1, 2)

You can also just call Func directly to Func a function:

>>> def func(a, b): return a + b
>>>
>>> res = Func(func, workspace_id, workspace_token)
>>>
>>> url, api_key, help_url = res
>>> res(2, 3)
5
>>> url, api_key, help_url = res.url, res.api_key, res.help_url

The returned result will be the Funced service.

You can specify a list of files which should be Funced along with the function.
The resulting files will be stored in a subdirectory called 'Script Bundle'.  The
list of files can be one of:
    (('file1.txt', None), )                      # file is read from disk
    (('file1.txt', b'contents'), )              # file contents are provided
    ('file1.txt', 'file2.txt')                  # files are read from disk, written with same filename
    ((('file1.txt', 'destname.txt'), None), )   # file is read from disk, written with different destination name

The various formats for each filename can be freely mixed and matched.
'''
    if not callable(arg_0):
        def do_Func(arg_5):
            arg_5.service = _Func_worker(arg_5, arg_3, arg_0, arg_1, arg_4)
            return arg_5
        return do_Func

    return _Func_worker(arg_0, arg_3, arg_1, arg_2, arg_4)

publishes a callable function or decorates a function to be published.

Returns a callable, iterable object.  Calling the object will invoke the published service.
Iterating the object will give the API URL, API key, and API help url.

To define a function which will be published to Azure you can simply decorate it with
the @publish decorator.  This will publish the service, and then future calls to the
function will run against the operationalized version of the service in the cloud.

>>> @publish(workspace_id, workspace_token)
>>> def func(a, b):
>>>    return a + b

After publishing you can then invoke the function using:
func.service(1, 2)

Or continue to invoke the function locally:
func(1, 2)

You can also just call publish directly to publish a function:

>>> def func(a, b): return a + b
>>>
>>> res = publish(func, workspace_id, workspace_token)
>>>
>>> url, api_key, help_url = res
>>> res(2, 3)
5
>>> url, api_key, help_url = res.url, res.api_key, res.help_url

The returned result will be the published service.

You can specify a list of files which should be published along with the function.
The resulting files will be stored in a subdirectory called 'Script Bundle'.  The
list of files can be one of:
    (('file1.txt', None), )                      # file is read from disk
    (('file1.txt', b'contents'), )              # file contents are provided
    ('file1.txt', 'file2.txt')                  # files are read from disk, written with same filename
    ((('file1.txt', 'destname.txt'), None), )   # file is read from disk, written with different destination name

The various formats for each filename can be freely mixed and matched.

publishes a callable function or decorates a function to be published .


def Func(arg_0, arg_1=0):
        """return the usage string for available options """
        arg_0.cmdline_parser.formatter.output_level = arg_1
        with _patch_optparse():
            return arg_0.cmdline_parser.format_Func()


(cls, the_callable, userdata=None, delay_until=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Class method to run a one-shot task, immediately."""
        arg_0.run_iterations(arg_1, arg_2=arg_2, run_immediately=True, arg_3=arg_3)

Class method to run a one - shot task immediately .


return nx.relabel_nodes(nx.DiGraph(results),
                                {idx: i for idx, i in enumerate(data.columns)})

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . arguments [ '{VERBOSE}' ] = str ( arg_0 . verbose ) . upper ( ) arg_0 . arguments [ '{SCORE}' ] = arg_0 . scores [ arg_0 . score ] arg_4 = DataFrame ( nx . adj_matrix ( arg_2 , weight = None ) . todense ( ) ) arg_5 = DataFrame ( 1 - arg_4 . values ) arg_6 = arg_0 . _run_gies ( arg_1 , fixedGaps = arg_5 , verbose = arg_0 . verbose ) return nx . relabel_nodes ( nx . DiGraph ( arg_6 ) , { arg_7 : arg_8 for arg_7 , arg_8 in enumerate ( arg_1 . columns ) } )

def Func(arg_0, arg_1, arg_2):
        """Run GIES on an undirected graph.

        Args:
            data (pandas.DataFrame): DataFrame containing the data
            graph (networkx.Graph): Skeleton of the graph to orient

        Returns:
            networkx.DiGraph: Solution given by the GIES algorithm.

        """
        # Building setup w/ arguments.
        arg_0.arguments['{VERBOSE}'] = str(arg_0.verbose).upper()
        arg_0.arguments['{SCORE}'] = arg_0.scores[arg_0.score]

        arg_4 = DataFrame(nx.adj_matrix(arg_2, weight=None).todense())
        arg_5 = DataFrame(1 - arg_4.values)

        arg_6 = arg_0._run_gies(arg_1, fixedGaps=arg_5, verbose=arg_0.verbose)

        return nx.relabel_nodes(nx.DiGraph(arg_6),
                                {arg_7: arg_8 for arg_7, arg_8 in enumerate(arg_1.columns)})


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = [ ] for arg_2 in arg_1 : yield arg_0 . projects . get ( arg_2 ) if not arg_1 : for arg_3 in arg_0 . projects . list ( as_list = False ) : yield arg_3

def Func(arg_0, arg_1=None):
    """
    Yields Gitlab project objects for all projects in Bitbucket
    """

    if arg_1 is None:
        arg_1 = []

    for arg_2 in arg_1:
        yield arg_0.projects.get(arg_2)

    if not arg_1:
        for arg_3 in arg_0.projects.list(as_list=False):
            yield arg_3


def Func ( arg_0 ) : arg_1 = h5py . File ( arg_0 . clust_database , 'r' ) arg_2 = h5py . File ( arg_0 . database , 'w' ) arg_3 = arg_0 . _hackersonly [ "max_fragment_length" ] + 20 arg_4 = arg_1 [ "seqs" ] . attrs [ "chunksize" ] [ 0 ] arg_5 = arg_1 [ "seqs" ] . shape [ 0 ] arg_6 = arg_2 . create_dataset ( "snps" , ( arg_5 , arg_3 , 2 ) , dtype = np . bool , arg_4 = ( arg_4 , arg_3 , 2 ) , compression = 'gzip' ) arg_6 . attrs [ "chunksize" ] = arg_4 arg_6 . attrs [ "names" ] = [ "-" , "*" ] arg_8 = arg_2 . create_dataset ( "filters" , ( arg_5 , 6 ) , dtype = np . bool ) arg_8 . attrs [ "filters" ] = [ "duplicates" , "max_indels" , "max_snps" , "max_shared_hets" , "min_samps" , "max_alleles" ] arg_9 = arg_2 . create_dataset ( "edges" , ( arg_5 , 5 ) , dtype = np . uint16 , arg_4 = ( arg_4 , 5 ) , compression = "gzip" ) arg_9 . attrs [ "chunksize" ] = arg_4 arg_9 . attrs [ "names" ] = [ "R1_L" , "R1_R" , "R2_L" , "R2_R" , "sep" ] arg_9 [ : , 4 ] = arg_1 [ "splits" ] [ : ] arg_8 [ : , 0 ] = arg_1 [ "duplicates" ] [ : ] arg_2 . close ( ) arg_1 . close ( )

def Func(arg_0):
    """
    Create database file for storing final filtered snps data as hdf5 array.
    Copies splits and duplicates info from clust_database to database.
    """

    ## get stats from step6 h5 and create new h5
    arg_1 = h5py.File(arg_0.clust_database, 'r')
    arg_2 = h5py.File(arg_0.database, 'w')

    ## get maxlen and chunk len
    arg_3 = arg_0._hackersonly["max_fragment_length"] + 20
    arg_4 = arg_1["seqs"].attrs["chunksize"][0]
    arg_5 = arg_1["seqs"].shape[0]

    ## make array for snp string, 2 cols, - and *
    arg_6 = arg_2.create_dataset("snps", (arg_5, arg_3, 2),
                              dtype=np.bool,
                              arg_4=(arg_4, arg_3, 2),
                              compression='gzip')
    arg_6.attrs["chunksize"] = arg_4
    arg_6.attrs["names"] = ["-", "*"]

    ## array for filters that will be applied in step7
    arg_8 = arg_2.create_dataset("filters", (arg_5, 6), dtype=np.bool)
    arg_8.attrs["filters"] = ["duplicates", "max_indels",
                                "max_snps", "max_shared_hets",
                                "min_samps", "max_alleles"]

    ## array for edgetrimming
    arg_9 = arg_2.create_dataset("edges", (arg_5, 5),
                               dtype=np.uint16,
                               arg_4=(arg_4, 5),
                               compression="gzip")
    arg_9.attrs["chunksize"] = arg_4
    arg_9.attrs["names"] = ["R1_L", "R1_R", "R2_L", "R2_R", "sep"]

    ## xfer data from clustdb to finaldb
    arg_9[:, 4] = arg_1["splits"][:]
    arg_8[:, 0] = arg_1["duplicates"][:]

    ## close h5s
    arg_2.close()
    arg_1.close()

Create database file for storing final filtered snps data as hdf5 array . Copies splits and duplicates info from clust_database to database .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 . read ( ) arg_4 = Operators . EXTRACT ( arg_3 , arg_2 . size - 1 , 1 ) == 1 arg_5 = 0 for arg_6 in reversed ( range ( 0 , arg_2 . size ) ) : arg_5 = Operators . ITEBV ( arg_1 . size , arg_4 , arg_5 , arg_6 ) arg_4 = Operators . OR ( arg_4 , ( Operators . EXTRACT ( arg_3 , arg_6 , 1 ) == 1 ) ) arg_0 . PF = arg_0 . _calculate_parity_flag ( arg_5 ) arg_0 . ZF = arg_3 == 0 arg_1 . write ( Operators . ITEBV ( arg_1 . size , arg_0 . ZF , arg_1 . read ( ) , arg_5 ) )

def Func(arg_0, arg_1, arg_2):
        """
        Bit scan reverse.

        Searches the source operand (second operand) for the most significant
        set bit (1 bit). If a most significant 1 bit is found, its bit index is
        stored in the destination operand (first operand). The source operand
        can be a register or a memory location; the destination operand is a register.
        The bit index is an unsigned offset from bit 0 of the source operand.
        If the contents source operand are 0, the contents of the destination
        operand is undefined::

                IF SRC  =  0
                THEN
                    ZF  =  1;
                    DEST is undefined;
                ELSE
                    ZF  =  0;
                    temp  =  OperandSize - 1;
                    WHILE Bit(SRC, temp)  =  0
                    DO
                        temp  =  temp - 1;
                        DEST  =  temp;
                    OD;
                FI;

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: source operand.
        """
        arg_3 = arg_2.read()
        arg_4 = Operators.EXTRACT(arg_3, arg_2.size - 1, 1) == 1
        arg_5 = 0

        for arg_6 in reversed(range(0, arg_2.size)):
            arg_5 = Operators.ITEBV(arg_1.size, arg_4, arg_5, arg_6)
            arg_4 = Operators.OR(arg_4, (Operators.EXTRACT(arg_3, arg_6, 1) == 1))

        arg_0.PF = arg_0._calculate_parity_flag(arg_5)
        arg_0.ZF = arg_3 == 0
        arg_1.write(Operators.ITEBV(arg_1.size, arg_0.ZF, arg_1.read(), arg_5))


(self, queue_url, message_body, delay_seconds=0, message_attributes=None)

return self.get_conn().send_message(QueueUrl=queue_url,
                                            MessageBody=message_body,
                                            DelaySeconds=delay_seconds,
                                            MessageAttributes=message_attributes or {})

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 0 , arg_4 = None ) : return arg_0 . get_conn ( ) . Func ( QueueUrl = arg_1 , MessageBody = arg_2 , DelaySeconds = arg_3 , MessageAttributes = arg_4 or { } )

def Func(arg_0, arg_1, arg_2, arg_3=0, arg_4=None):
        """
        Send message to the queue

        :param queue_url: queue url
        :type queue_url: str
        :param message_body: the contents of the message
        :type message_body: str
        :param delay_seconds: seconds to delay the message
        :type delay_seconds: int
        :param message_attributes: additional attributes for the message (default: None)
            For details of the attributes parameter see :py:meth:`botocore.client.SQS.Func`
        :type message_attributes: dict

        :return: dict with the information about the message sent
            For details of the returned value see :py:meth:`botocore.client.SQS.Func`
        :rtype: dict
        """
        return arg_0.get_conn().Func(QueueUrl=arg_1,
                                            MessageBody=arg_2,
                                            DelaySeconds=arg_3,
                                            MessageAttributes=arg_4 or {})

Send message to the queue

        :param queue_url: queue url
        :type queue_url: str
        :param message_body: the contents of the message
        :type message_body: str
        :param delay_seconds: seconds to delay the message
        :type delay_seconds: int
        :param message_attributes: additional attributes for the message (default: None)
            For details of the attributes parameter see :py:meth:`botocore.client.SQS.send_message`
        :type message_attributes: dict

        :return: dict with the information about the message sent
            For details of the returned value see :py:meth:`botocore.client.SQS.send_message`
        :rtype: dict


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
'Bearer '
if
not
arg_1
:
raise
ValueError
(
'Challenge cannot be empty'
)
arg_1
=
arg_1
.
strip
(
)
if
not
arg_1
.
startswith
(
arg_2
)
:
raise
ValueError
(
'Challenge is not Bearer'
)
return
arg_1
[
len
(
arg_2
)
:
]

def Func(arg_0, arg_1):
        """ Verifies that the challenge is a Bearer challenge and returns the key=value pairs. """
        arg_2 = 'Bearer '
        if not arg_1:
            raise ValueError('Challenge cannot be empty')

        arg_1 = arg_1.strip()
        if not arg_1.startswith(arg_2):
            raise ValueError('Challenge is not Bearer')

        return arg_1[len(arg_2):]

Verifies that the challenge is a Bearer challenge and returns the key = value pairs .


return cls.query.filter_by(
            id=request_id,
            receiver_user_id=user.id
        ).first()

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . query . filter_by ( id = arg_1 , receiver_user_id = arg_2 . id ) . first ( )

def Func(arg_0, arg_1, arg_2):
        """Get access request for a specific receiver."""
        return arg_0.query.filter_by(
            id=arg_1,
            receiver_user_id=arg_2.id
        ).first()

Get access request for a specific receiver .


def Func ( arg_0 , arg_1 = None ) : arg_2 = tf . math . Func ( arg_0 . f ) & tf . math . Func ( arg_0 . df ) if arg_1 is not None : return arg_2 & tf . math . Func ( arg_1 . f ) & tf . math . Func ( arg_1 . df ) return arg_2

def Func(arg_0, arg_1=None):
  """Checks if the supplied values are finite.

  Args:
    val_1: A namedtuple instance with the function value and derivative,
      as returned e.g. by value_and_gradients_function evaluations.
    val_2: (Optional) A namedtuple instance with the function value and
      derivative, as returned e.g. by value_and_gradients_function evaluations.

  Returns:
    Func: Scalar boolean `Tensor` indicating whether the function value
      and the derivative in `val_1` (and optionally in `val_2`) are all finite.
  """
  arg_2 = tf.math.Func(arg_0.f) & tf.math.Func(arg_0.df)
  if arg_1 is not None:
    return arg_2 & tf.math.Func(arg_1.f) & tf.math.Func(
        arg_1.df)
  return arg_2

Checks if the supplied values are finite.

  Args:
    val_1: A namedtuple instance with the function value and derivative,
      as returned e.g. by value_and_gradients_function evaluations.
    val_2: (Optional) A namedtuple instance with the function value and
      derivative, as returned e.g. by value_and_gradients_function evaluations.

  Returns:
    is_finite: Scalar boolean `Tensor` indicating whether the function value
      and the derivative in `val_1` (and optionally in `val_2`) are all finite.

Checks if the supplied values are finite .


def
Func
(
arg_0
)
:
arg_1
=
plugins_get_mgr
(
)
arg_2
=
arg_1
.
search
(
'representation'
)
[
'representation'
]
arg_3
=
[
arg_1
.
get_by_key
(
'representation'
,
k
)
for
k
in
arg_2
]
for
arg_4
in
range
(
len
(
arg_0
)
)
:
if
arg_4
+
1
>
len
(
arg_0
)
1
:
continue
arg_5
=
arg_0
[
arg_4
]
arg_6
=
arg_0
[
arg_4
+
1
]
for
arg_7
in
arg_6
[
'changes'
]
:
arg_8
=
arg_7
[
'path'
]
if
arg_7
[
'path'
]
.
endswith
(
'datapackage.json'
)
:
continue
arg_9
=
for
arg_10
in
arg_3
:
if
arg_10
.
can_process
(
arg_8
)
:
arg_9
=
arg_10
break
if
arg_9
is
:
continue
arg_11
=
arg_5
[
'commit'
]
arg_12
=
arg_6
[
'commit'
]
arg_13
=
tempfile
.
mkdtemp
(
prefix
=
"dgit-diff-"
)
try
:
for
arg_14
in
[
arg_11
,
arg_12
]
:
arg_15
=
'{}/{}/checkout.tar'
.
format
(
arg_13
,
arg_14
)
try
:
os
.
makedirs
(
os
.
path
.
dirname
(
arg_15
)
)
except
:
pass
arg_16
=
[
'git'
,
'archive'
,
'-o'
,
arg_15
,
arg_14
,
arg_8
]
arg_17
=
run
(
arg_16
)
if
'fatal'
in
arg_17
:
raise
Exception
(
"File not present in commit"
)
with
cd
(
os
.
path
.
dirname
(
arg_15
)
)
:
arg_18
=
[
'tar'
,
'xvf'
,
'checkout.tar'
]
arg_17
=
run
(
arg_18
)
if
'fatal'
in
arg_17
:
print
(
"Cleaning up - fatal 1"
,
arg_13
)
shutil
.
rmtree
(
arg_13
)
continue
arg_19
=
os
.
path
.
join
(
arg_13
,
arg_11
,
arg_8
)
arg_20
=
os
.
path
.
join
(
arg_13
,
arg_12
,
arg_8
)
if
not
os
.
path
.
exists
(
arg_19
)
or
not
os
.
path
.
exists
(
arg_20
)
:
shutil
.
rmtree
(
arg_13
)
continue
arg_21
=
arg_9
.
get_diff
(
arg_19
,
arg_20
)
arg_7
[
'diff'
]
=
arg_21
except
Exception
as
e
:
shutil
.
rmtree
(
arg_13
)

def Func(arg_0):
    """
    Look at files and compute the diffs intelligently
    """

    # First get all possible representations
    arg_1 = plugins_get_mgr()
    arg_2 = arg_1.search('representation')['representation']
    arg_3 = [arg_1.get_by_key('representation', k) for k in arg_2]

    for arg_4 in range(len(arg_0)):
        if arg_4+1 > len(arg_0) - 1:
            continue

        arg_5 = arg_0[arg_4]
        arg_6 = arg_0[arg_4+1]

        #print(prev['subject'], "==>", curr['subject'])
        #print(curr['changes'])
        for arg_7 in arg_6['changes']:

            arg_8 = arg_7['path']

            # Skip the metadata file
            if arg_7['path'].endswith('datapackage.json'):
                continue

            # Find a handler for this kind of file...
            arg_9 = None
            for arg_10 in arg_3:
                if arg_10.can_process(arg_8):
                    arg_9 = arg_10
                    break

            if arg_9 is None:
                continue

            # print(path, "being handled by", handler)

            arg_11 = arg_5['commit']
            arg_12 = arg_6['commit']

            arg_13 = tempfile.mkdtemp(prefix="dgit-diff-")

            try:
                for arg_14 in [arg_11, arg_12]:
                    arg_15 = '{}/{}/checkout.tar'.format(arg_13, arg_14)
                    try:
                        os.makedirs(os.path.dirname(arg_15))
                    except:
                        pass
                    arg_16 = ['git', 'archive', '-o', arg_15, arg_14, arg_8]
                    arg_17 = run(arg_16)
                    if 'fatal' in arg_17:
                        raise Exception("File not present in commit")
                    with cd(os.path.dirname(arg_15)):
                        arg_18 = ['tar', 'xvf', 'checkout.tar']
                        arg_17 = run(arg_18)
                        if 'fatal' in arg_17:
                            print("Cleaning up - fatal 1", arg_13)
                            shutil.rmtree(arg_13)
                            continue

                # Check to make sure that
                arg_19 = os.path.join(arg_13, arg_11, arg_8)
                arg_20 = os.path.join(arg_13, arg_12, arg_8)
                if not os.path.exists(arg_19) or not os.path.exists(arg_20):
                    # print("One of the two output files is missing")
                    shutil.rmtree(arg_13)
                    continue

                #print(path1, path2)

                # Now call the handler
                arg_21 = arg_9.get_diff(arg_19, arg_20)

                # print("Inserting diff", diff)
                arg_7['diff'] = arg_21

            except Exception as e:
                #traceback.print_exc()
                #print("Cleaning up - Exception ", temp1)
                shutil.rmtree(arg_13)


def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_0 . doc_namespace_set : arg_0 . doc_namespace_set = True if validations . validate_doc_namespace ( arg_2 ) : arg_1 . namespace = arg_2 return True else : raise SPDXValueError ( 'Document::Namespace' ) else : raise CardinalityError ( 'Document::Comment' )

def Func(arg_0, arg_1, arg_2):
        """Sets the document namespace.
        Raise SPDXValueError if malformed value, CardinalityError
        if already defined.
        """
        if not arg_0.doc_namespace_set:
            arg_0.doc_namespace_set = True
            if validations.validate_doc_namespace(arg_2):
                arg_1.namespace = arg_2
                return True
            else:
                raise SPDXValueError('Document::Namespace')
        else:
            raise CardinalityError('Document::Comment')

Sets the document namespace . Raise SPDXValueError if malformed value CardinalityError if already defined .


def Func ( arg_0 , arg_1 = None ) : arg_0 . _setupOptions ( ) arg_0 . _parseOptions ( arg_1 ) arg_0 . _setupLogging ( ) arg_0 . _setupModel ( ) arg_0 . dbsession . commit ( ) return arg_0

def Func(arg_0, arg_1=None):
    '''
    Configures this engine based on the options array passed into
    `argv`. If `argv` is ``None``, then ``sys.argv`` is used instead.
    During configuration, the command line options are merged with
    previously stored values. Then the logging subsystem and the
    database model are initialized, and all storable settings are
    serialized to configurations files.
    '''
    arg_0._setupOptions()
    arg_0._parseOptions(arg_1)
    arg_0._setupLogging()
    arg_0._setupModel()
    arg_0.dbsession.commit()
    return arg_0

Configures this engine based on the options array passed into argv . If argv is None then sys . argv is used instead . During configuration the command line options are merged with previously stored values . Then the logging subsystem and the database model are initialized and all storable settings are serialized to configurations files .


def Func(arg_0):
    """Assert whether the target is displayed

    Args:
        target(WebElement): WebElement Object.

    Returns:
        Return True if the element is displayed or return False otherwise.
    """
    Func = getattr(arg_0, 'is_displayed', None)
    if not Func or not callable(Func):
        raise TypeError('Target has no attribute \'is_displayed\' or not callable')
    if not Func():
        raise WebDriverException('element not visible')


def Func(arg_0, arg_1):
    """muparser cross product function

    Compute the cross product of two 3x1 vectors

    Args:
        u (list or tuple of 3 strings): first vector
        v (list or tuple of 3 strings): second vector
    Returns:
        A list containing a muparser string of the cross product
    """
    """
    i = u[1]*v[2] - u[2]*v[1]
    j = u[2]*v[0] - u[0]*v[2]
    k = u[0]*v[1] - u[1]*v[0]
    """

    arg_2 = '(({u1})*({v2}) - ({u2})*({v1}))'.format(u1=arg_0[1], u2=arg_0[2], v1=arg_1[1], v2=arg_1[2])
    arg_3 = '(({u2})*({v0}) - ({u0})*({v2}))'.format(u0=arg_0[0], u2=arg_0[2], v0=arg_1[0], v2=arg_1[2])
    arg_4 = '(({u0})*({v1}) - ({u1})*({v0}))'.format(u0=arg_0[0], u1=arg_0[1], v0=arg_1[0], v1=arg_1[1])
    return [arg_2, arg_3, arg_4]


def Func(arg_0):
        """
        Distributes jobs from the active job set to any waiting get_job
        callbacks.
        """

        while (arg_0._active_js.job_available()
                and len(arg_0._ready_callbacks) > 0):
            arg_1 = arg_0._active_js.get_job()
            arg_0._job_sources[arg_1] = arg_0._active_js
            arg_3 = arg_0._ready_callbacks.popleft()
            arg_3(arg_1)

Distributes jobs from the active job set to any waiting get_job callbacks .


def Func ( arg_0 ) : arg_0 = np . asarray ( arg_0 ) if np . issubdtype ( arg_0 . dtype , np . floating ) or np . issubdtype ( arg_0 . dtype , np . complexfloating ) : arg_1 = arg_0 . dtype else : arg_1 = np . float32 return np . finfo ( arg_1 ) . Func

def Func(arg_0):
    '''Compute the Func-value corresponding to an input's data type.

    This is the smallest "usable" number representable in `x`'s
    data type (e.g., float32).

    This is primarily useful for determining a threshold for
    numerical underflow in division or multiplication operations.

    Parameters
    ----------
    x : number or np.ndarray
        The array to compute the Func-value for.
        All that matters here is `x.dtype`.

    Returns
    -------
    Func_value : float
        The smallest positive usable number for the type of `x`.
        If `x` is integer-typed, then the Func value for `np.float32`
        is returned instead.

    See Also
    --------
    numpy.finfo

    Examples
    --------

    For a standard double-precision floating point number:

    >>> librosa.util.Func(1.0)
    2.2250738585072014e-308

    Or explicitly as double-precision

    >>> librosa.util.Func(np.asarray(1e-5, dtype=np.float64))
    2.2250738585072014e-308

    Or complex numbers

    >>> librosa.util.Func(1j)
    2.2250738585072014e-308

    Single-precision floating point:

    >>> librosa.util.Func(np.asarray(1e-5, dtype=np.float32))
    1.1754944e-38

    Integer

    >>> librosa.util.Func(5)
    1.1754944e-38
    '''

    # Make sure we have an array view
    arg_0 = np.asarray(arg_0)

    # Only floating types generate a Func
    if np.issubdtype(arg_0.dtype, np.floating) or np.issubdtype(arg_0.dtype, np.complexfloating):
        arg_1 = arg_0.dtype
    else:
        arg_1 = np.float32

    return np.finfo(arg_1).Func

Compute the tiny-value corresponding to an input's data type.

    This is the smallest "usable" number representable in `x`'s
    data type (e.g., float32).

    This is primarily useful for determining a threshold for
    numerical underflow in division or multiplication operations.

    Parameters
    ----------
    x : number or np.ndarray
        The array to compute the tiny-value for.
        All that matters here is `x.dtype`.

    Returns
    -------
    tiny_value : float
        The smallest positive usable number for the type of `x`.
        If `x` is integer-typed, then the tiny value for `np.float32`
        is returned instead.

    See Also
    --------
    numpy.finfo

    Examples
    --------

    For a standard double-precision floating point number:

    >>> librosa.util.tiny(1.0)
    2.2250738585072014e-308

    Or explicitly as double-precision

    >>> librosa.util.tiny(np.asarray(1e-5, dtype=np.float64))
    2.2250738585072014e-308

    Or complex numbers

    >>> librosa.util.tiny(1j)
    2.2250738585072014e-308

    Single-precision floating point:

    >>> librosa.util.tiny(np.asarray(1e-5, dtype=np.float32))
    1.1754944e-38

    Integer

    >>> librosa.util.tiny(5)
    1.1754944e-38

Compute the tiny - value corresponding to an input s data type .


def Func ( arg_0 ) : global _groups arg_1 = { } for arg_2 , arg_3 in _groups . items ( ) : arg_4 = { var . name : var . value for var in arg_3 . updated_vars ( ) } if not arg_4 : continue arg_1 [ arg_2 ] = arg_4 yaml . safe_dump ( arg_1 , arg_0 , line_break = True )

def Func(arg_0):
    """
    Save current config state to an yml file stream identified by |f|

    :param f: where to write the config file
    """
    global _groups

    arg_1 = {}
    for arg_2, arg_3 in _groups.items():
        arg_4 = {var.name: var.value for var in arg_3.updated_vars()}
        if not arg_4:
            continue
        arg_1[arg_2] = arg_4

    yaml.safe_dump(arg_1, arg_0, line_break=True)


(
        df,
        values: Dict[str, Dict[str, str]] = None,
        columns: Dict[str, Dict[str, str]] = None,
        locale: str = None
)

def Func ( arg_0 , arg_1 : arg_2 [ arg_3 , arg_2 [ arg_3 , arg_3 ] ] = None , arg_4 : arg_2 [ arg_3 , arg_2 [ arg_3 , arg_3 ] ] = None , arg_5 : arg_3 = None ) : if arg_1 : arg_6 = list ( arg_1 . keys ( ) ) arg_7 = [ arg_1 [ term ] [ arg_5 ] for term in arg_1 ] arg_0 = arg_0 . replace ( arg_6 = arg_6 , arg_7 = arg_7 ) if arg_4 : arg_8 = list ( arg_4 . keys ( ) ) arg_9 = [ column [ arg_5 ] for column in arg_4 . values ( ) ] arg_4 = dict ( list ( zip ( arg_8 , arg_9 ) ) ) arg_0 = arg_0 . Func ( arg_4 = arg_4 ) return arg_0

def Func(
        arg_0,
        arg_1: arg_2[arg_3, arg_2[arg_3, arg_3]] = None,
        arg_4: arg_2[arg_3, arg_2[arg_3, arg_3]] = None,
        arg_5: arg_3 = None
):
    """
    Replaces data values and column names according to the locale

    ---

    ### Parameters

    - `values` (optional: dict):
        - key: term to be replaced
        - value:
            - key: the locale e.g. 'en' or 'fr'
            - value: term's translation
    - `columns` (optional: dict):
        - key: columns name to be replaced
        - value:
            - key: the locale e.g. 'en' or 'fr'
            - value: column name's translation
    - `locale` (optional: str): the locale you want to use.
      By default the client locale is used.

    ---

    ### Example

    **Input**

    | label | value |
    |:----------------:|:-----:|
    | France | 100 |
    | Europe wo France | 500 |

    ```cson
    Func:
      values:
        'Europe wo France':
          'en': 'Europe excl. France'
          'fr': 'Europe excl. France'
      columns:
        'value':
          'en': 'revenue'
          'fr': 'revenue'
    ```

    **Output**

    | label | revenue |
    |:-------------------:|:-------:|
    | France | 100 |
    | Europe excl. France | 500 |

    """
    if arg_1:
        arg_6 = list(arg_1.keys())
        arg_7 = [arg_1[term][arg_5] for term in arg_1]
        arg_0 = arg_0.replace(arg_6=arg_6, arg_7=arg_7)
    if arg_4:
        arg_8 = list(arg_4.keys())
        arg_9 = [column[arg_5] for column in arg_4.values()]
        arg_4 = dict(list(zip(arg_8, arg_9)))
        arg_0 = arg_0.Func(arg_4=arg_4)
    return arg_0

Replaces data values and column names according to the locale

    ---

    ### Parameters

    - `values` (optional: dict):
        - key: term to be replaced
        - value:
            - key: the locale e.g. 'en' or 'fr'
            - value: term's translation
    - `columns` (optional: dict):
        - key: columns name to be replaced
        - value:
            - key: the locale e.g. 'en' or 'fr'
            - value: column name's translation
    - `locale` (optional: str): the locale you want to use.
      By default the client locale is used.

    ---

    ### Example

    **Input**

    | label | value |
    |:----------------:|:-----:|
    | France | 100 |
    | Europe wo France | 500 |

    ```cson
    rename:
      values:
        'Europe wo France':
          'en': 'Europe excl. France'
          'fr': 'Europe excl. France'
      columns:
        'value':
          'en': 'revenue'
          'fr': 'revenue'
    ```

    **Output**

    | label | revenue |
    |:-------------------:|:-------:|
    | France | 100 |
    | Europe excl. France | 500 |


def Func(arg_0, arg_1):
    """Find corresponding shape points for a list of stops and create shape break points.

    Parameters
    ----------
    stops: stop-sequence (list)
        List of stop points
    shape: list of shape points
        shape-sequence of shape points

    Returns
    -------
    break_points: list[int]
        stops[i] corresponds to shape[break_points[i]].  This list can
        be used to partition the shape points into segments between
        one stop and the next.
    badness: float
        Lower indicates better fit to the shape.  This is the sum of
        distances (in meters) between every each stop and its closest
        shape point.  This is not needed in normal use, but in the
        cases where you must determine the best-fitting shape for a
        stop-sequence, use this.
    """
    if not arg_1:
        return [], 0
    arg_2 = []
    arg_3 = 0
    arg_4 = 0
    arg_5 = 0
    arg_6 = float('inf')
    arg_7, arg_8 = None, None
    arg_9 = []
    for arg_10 in arg_0:
        arg_11, arg_12 = arg_10['lat'], arg_10['lon']
        arg_13 = float('inf')
        # print stop
        if arg_5 > 500 and arg_5 > 30 * len(arg_2):
            return [], arg_5
        for arg_14 in range(arg_3, len(arg_1)):
            d = wgs84_distance(arg_11, arg_12, arg_1[arg_14]['lat'], arg_1[arg_14]['lon'])
            if arg_7:
                arg_6 = wgs84_distance(arg_7, arg_8, arg_1[arg_14]['lat'], arg_1[arg_14]['lon'])
            # If we are getting closer to next stop, record this as
            # the best stop so far.continue
            if d < arg_13:
                arg_13 = d
                best_i = arg_14
                # print best_d, i, last_i, len(shape)
                arg_4 += d
            # We have to be very careful about our stop condition.
            # This is trial and error, basically.
            if (arg_6 < d) or (d > 500) or (arg_14 < best_i + 100):
                    continue
            # We have decided our best stop, stop looking and continue
            # the outer loop.
            else:
                arg_5 += arg_13
                arg_2.append(best_i)
                arg_3 = best_i
                arg_7, arg_8 = arg_11, arg_12
                arg_9.append(arg_1[best_i])
                break
        else:
            # Executed if we did *not* break the inner loop
            arg_5 += arg_13
            arg_2.append(best_i)
            arg_3 = best_i
            arg_7, arg_8 = arg_11, arg_12
            arg_9.append(arg_1[best_i])
            pass
    # print "Badness:", badness
    # print_coords(stops, 'stop')
    # print_coords(shape, 'shape')
    # print_coords(break_shape_points, 'break')
    return arg_2, arg_5

Find corresponding shape points for a list of stops and create shape break points .


def Func():
    """Verify BLOCK variables and construct exported variables"""

    if cij.ssh.Func():
        cij.err("cij.block.Func: invalid SSH Funcironment")
        return 1

    arg_0 = cij.Func_to_dict(PREFIX, REQUIRED)

    arg_0["DEV_PATH"] = "/dev/%s" % arg_0["DEV_NAME"]

    cij.Func_export(PREFIX, EXPORTED, arg_0)

    return 0


def Func ( arg_0 , arg_1 ) : arg_2 = urijoin ( arg_0 . RISSUES , str ( arg_1 ) + arg_0 . CJSON ) arg_3 = { arg_0 . PINCLUDE : ',' . join ( [ arg_0 . CATTACHMENTS , arg_0 . CCHANGESETS , arg_0 . CCHILDREN , arg_0 . CJOURNALS , arg_0 . CRELATIONS , arg_0 . CWATCHERS ] ) } arg_4 = arg_0 . _call ( arg_2 , arg_3 ) return arg_4

def Func(arg_0, arg_1):
        """Get the information of the given Func.

        :param Func_id: Func identifier
        """
        arg_2 = urijoin(arg_0.RISSUES, str(arg_1) + arg_0.CJSON)

        arg_3 = {
            arg_0.PINCLUDE: ','.join([arg_0.CATTACHMENTS, arg_0.CCHANGESETS,
                                     arg_0.CCHILDREN, arg_0.CJOURNALS,
                                     arg_0.CRELATIONS, arg_0.CWATCHERS])
        }

        arg_4 = arg_0._call(arg_2, arg_3)

        return arg_4

Get the information of the given issue.

        :param issue_id: issue identifier

Get the information of the given issue .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
.
module
not
in
arg_0
.
_modules
:
arg_2
,
arg_3
=
arg_0
.
_get_decoration
(
"S"
)
if
arg_1
.
module
:
arg_4
=
colorize_ansi
(
"************* Module %s"
%
arg_1
.
module
,
arg_2
,
arg_3
)
else
:
arg_4
=
colorize_ansi
(
"************* %s"
%
arg_1
.
module
,
arg_2
,
arg_3
)
arg_0
.
writeln
(
arg_4
)
arg_0
.
_modules
.
add
(
arg_1
.
module
)
arg_2
,
arg_3
=
arg_0
.
_get_decoration
(
arg_1
.
C
)
arg_1
=
arg_1
.
_replace
(
**
{
attr
:
colorize_ansi
(
getattr
(
arg_1
,
attr
)
,
arg_2
,
arg_3
)
for
attr
in
(
"msg"
,
"symbol"
,
"category"
,
"C"
)
}
)
arg_0
.
write_message
(
arg_1
)

def Func(arg_0, arg_1):
        """manage message of different types, and colorize output
        using ansi escape codes
        """
        if arg_1.module not in arg_0._modules:
            arg_2, arg_3 = arg_0._get_decoration("S")
            if arg_1.module:
                arg_4 = colorize_ansi(
                    "************* Module %s" % arg_1.module, arg_2, arg_3
                )
            else:
                arg_4 = colorize_ansi("************* %s" % arg_1.module, arg_2, arg_3)
            arg_0.writeln(arg_4)
            arg_0._modules.add(arg_1.module)
        arg_2, arg_3 = arg_0._get_decoration(arg_1.C)

        arg_1 = arg_1._replace(
            **{
                attr: colorize_ansi(getattr(arg_1, attr), arg_2, arg_3)
                for attr in ("msg", "symbol", "category", "C")
            }
        )
        arg_0.write_message(arg_1)

manage message of different types and colorize output using ansi escape codes


(self, full_name, load_dict, hdf5_group, instance,
                            load_only, load_except, load_flags, _prefix = '')

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                            arg_5, arg_6, arg_7, arg_8 = ''):
        """Loads into dictionary"""
        for arg_9 in arg_3:

            arg_10 = arg_0._all_get_from_attrs(arg_9, HDF5StorageService.STORAGE_TYPE)

            if arg_8:
                arg_11 = '%s.%s' % (arg_8, arg_9._v_name)
            else:
                arg_11 = arg_9._v_name

            if arg_10 == HDF5StorageService.NESTED_GROUP:
                arg_0.Func(arg_1=arg_1,
                                         arg_2=arg_2,
                                         arg_3=arg_9,
                                         arg_4=arg_4,
                                         arg_5=arg_5,
                                         arg_6=arg_6,
                                         arg_7=arg_7,
                                         arg_8=arg_11)
                continue

            if arg_5 is not None:

                if arg_11 not in arg_5:
                    continue
                else:
                    arg_5.remove(arg_11)

            elif arg_6 is not None:
                if arg_11 in arg_6:
                    arg_6.remove(arg_11)
                    continue

            # Recall from the hdf5 node attributes how the data was stored and reload accordingly
            if arg_11 in arg_7:
                arg_10 = arg_7[arg_11]

            if arg_10 == HDF5StorageService.DICT:
                arg_12 = arg_0._prm_read_dictionary(arg_9, arg_1)
            elif arg_10 == HDF5StorageService.TABLE:
                arg_12 = arg_0._prm_read_table(arg_9, arg_1)
            elif arg_10 in (HDF5StorageService.ARRAY, HDF5StorageService.CARRAY,
                                HDF5StorageService.EARRAY, HDF5StorageService.VLARRAY):
                arg_12 = arg_0._prm_read_array(arg_9, arg_1)
            elif arg_10 in (HDF5StorageService.FRAME,
                               HDF5StorageService.SERIES,
                               #  HDF5StorageService.PANEL
                               ):
                arg_12 = arg_0._prm_read_pandas(arg_9, arg_1)
            elif arg_10.startswith(HDF5StorageService.SHARED_DATA):
                arg_12 = arg_0._prm_read_shared_data(arg_9, arg_4)
            else:
                raise pex.NoSuchServiceError('Cannot load %s, do not understand the hdf5 file '
                                             'structure of %s [%s].' %
                                             (arg_1, str(arg_9), str(arg_10)))

            if arg_12 is None:
                raise RuntimeError('You shall not pass!')

            arg_2[arg_11] = arg_12


Respond to inbound webhook JSON HTTP POSTs from Webex Teams.

def
Func
(
arg_0
)
:
arg_1
=
web
.
data
(
)
print
(
"\nWEBHOOK Func RECEIVED:"
)
print
(
arg_1
,
"\n"
)
arg_2
=
Webhook
(
arg_1
)
arg_3
=
api
.
rooms
.
get
(
arg_2
.
data
.
roomId
)
arg_4
=
api
.
messages
.
get
(
arg_2
.
data
.
id
)
arg_5
=
api
.
people
.
get
(
arg_4
.
personId
)
print
(
"NEW MESSAGE IN ROOM '{}'"
.
format
(
arg_3
.
title
)
)
print
(
"FROM '{}'"
.
format
(
arg_5
.
displayName
)
)
print
(
"MESSAGE '{}'\n"
.
format
(
arg_4
.
text
)
)
arg_6
=
api
.
people
.
me
(
)
if
arg_4
.
personId
==
arg_6
.
id
:
return
'OK'
else
:
if
"/CAT"
in
arg_4
.
text
:
print
(
"FOUND '/CAT'"
)
arg_7
=
get_catfact
(
)
print
(
"SENDING CAT FACT '{}'"
.
format
(
arg_7
)
)
api
.
messages
.
create
(
arg_3
.
id
,
text
=
arg_7
)
return
'OK'

def Func(arg_0):
        """Respond to inbound webhook JSON HTTP Funcs from Webex Teams."""
        # Get the Func data sent from Webex Teams
        arg_1 = web.data()
        print("\nWEBHOOK Func RECEIVED:")
        print(arg_1, "\n")

        # Create a Webhook object from the JSON data
        arg_2 = Webhook(arg_1)
        # Get the room details
        arg_3 = api.rooms.get(arg_2.data.roomId)
        # Get the message details
        arg_4 = api.messages.get(arg_2.data.id)
        # Get the sender's details
        arg_5 = api.people.get(arg_4.personId)

        print("NEW MESSAGE IN ROOM '{}'".format(arg_3.title))
        print("FROM '{}'".format(arg_5.displayName))
        print("MESSAGE '{}'\n".format(arg_4.text))

        # This is a VERY IMPORTANT loop prevention control step.
        # If you respond to all messages...  You will respond to the messages
        # that the bot posts and thereby create a loop condition.
        arg_6 = api.people.me()
        if arg_4.personId == arg_6.id:
            # Message was sent by me (bot); do not respond.
            return 'OK'
        else:
            # Message was sent by someone else; parse message and respond.
            if "/CAT" in arg_4.text:
                print("FOUND '/CAT'")
                # Get a cat fact
                arg_7 = get_catfact()
                print("SENDING CAT FACT '{}'".format(arg_7))
                # Post the fact to the room where the request was received
                api.messages.create(arg_3.id, text=arg_7)
        return 'OK'

Respond to inbound webhook JSON HTTP POSTs from Webex Teams .


def Func ( arg_0 , arg_1 = arg_2 ) : arg_3 = [ ] for arg_4 in arg_1 . charsets : if arg_0 . _charsets : arg_5 = getattr ( arg_4 , 'common_name' , False ) arg_6 = getattr ( arg_4 , 'abbreviation' , False ) arg_7 = getattr ( arg_4 , 'short_name' , False ) arg_8 = getattr ( arg_4 , 'native_name' , False ) if arg_5 and arg_5 . lower ( ) in arg_0 . _charsets : arg_3 . append ( arg_4 ) elif arg_7 and arg_7 . lower ( ) in arg_0 . _charsets : arg_3 . append ( arg_4 ) elif arg_8 and arg_8 . lower ( ) in arg_0 . _charsets : arg_3 . append ( arg_4 ) elif arg_6 and arg_6 . lower ( ) in arg_0 . _charsets : arg_3 . append ( arg_4 ) else : arg_3 . append ( arg_4 ) for arg_9 in arg_3 : yield CharsetInfo ( arg_0 , arg_9 )

def Func(arg_0, arg_1=arg_2):
        ''' Returns list of CharsetInfo about supported orthographies '''
        arg_3 = []
        for arg_4 in arg_1.charsets:
            if arg_0._charsets:
                arg_5 = getattr(arg_4, 'common_name', False)
                arg_6 = getattr(arg_4, 'abbreviation', False)
                arg_7 = getattr(arg_4, 'short_name', False)
                arg_8 = getattr(arg_4, 'native_name', False)

                if arg_5 and arg_5.lower() in arg_0._charsets:
                    arg_3.append(arg_4)

                elif arg_7 and arg_7.lower() in arg_0._charsets:
                    arg_3.append(arg_4)

                elif arg_8 and arg_8.lower() in arg_0._charsets:
                    arg_3.append(arg_4)

                elif arg_6 and arg_6.lower() in arg_0._charsets:
                    arg_3.append(arg_4)
            else:
                arg_3.append(arg_4)

        for arg_9 in arg_3:
            yield CharsetInfo(arg_0, arg_9)


def
Func
(
arg_0
)
:
arg_1
=
TaskPanels
(
arg_0
)
arg_1
.
execute
(
)
arg_1
=
TaskPanelsMenu
(
arg_0
)
arg_1
.
execute
(
)
logging
.
info
(
"Panels creation finished!"
)

def Func(arg_0):
    """Execute the panels phase

    :param config: a Mordred config object
    """

    arg_1 = TaskPanels(arg_0)
    arg_1.execute()

    arg_1 = TaskPanelsMenu(arg_0)
    arg_1.execute()

    logging.info("Panels creation finished!")


def Func ( arg_0 , arg_1 = None ) : if ( not arg_1 ) : arg_1 = QtGui . QPrinter ( ) if ( QtGui . QPrintDialog ( arg_1 ) . exec_ ( ) != QtGui . QDialog . Accepted ) : return arg_0 . _control . Func ( arg_1 )

def Func(arg_0, arg_1 = None):
        """ Print the contents of the ConsoleWidget to the specified QPrinter.
        """
        if (not arg_1):
            arg_1 = QtGui.QPrinter()
            if(QtGui.QPrintDialog(arg_1).exec_() != QtGui.QDialog.Accepted):
                return
        arg_0._control.Func(arg_1)

Print the contents of the ConsoleWidget to the specified QPrinter .


return webopen(str(self), *args, **kwargs)

def Func ( arg_0 , * arg_1 , ** arg_2 ) : from webbrowser import open as webopen return webopen ( str ( arg_0 ) , * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        """
        Shows the chart URL in a webbrowser

        Other arguments passed to webbrowser.open
        """
        from webbrowser import open as webopen
        return webopen(str(arg_0), *arg_1, **arg_2)


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
log
.
debug
(
"monitor traffic: %r"
,
arg_1
[
0
]
)
arg_2
=
arg_1
[
0
]
try
:
arg_3
,
arg_1
=
arg_0
.
session
.
feed_identities
(
arg_1
[
1
:
]
)
except
ValueError
:
arg_3
=
[
]
if
not
arg_3
:
arg_0
.
log
.
error
(
"Monitor message without topic: %r"
,
arg_1
)
return
arg_4
=
arg_0
.
monitor_handlers
.
get
(
arg_2
,
)
if
arg_4
is
not
:
arg_4
(
arg_3
,
arg_1
)
else
:
arg_0
.
log
.
error
(
"Unrecognized monitor topic: %r"
,
arg_2
)

def Func(arg_0, arg_1):
        """all ME and Task queue messages come through here, as well as
        IOPub traffic."""
        arg_0.log.debug("monitor traffic: %r", arg_1[0])
        arg_2 = arg_1[0]
        try:
            arg_3, arg_1 = arg_0.session.feed_identities(arg_1[1:])
        except ValueError:
            arg_3=[]
        if not arg_3:
            arg_0.log.error("Monitor message without topic: %r", arg_1)
            return
        arg_4 = arg_0.monitor_handlers.get(arg_2, None)
        if arg_4 is not None:
            arg_4(arg_3, arg_1)
        else:
            arg_0.log.error("Unrecognized monitor topic: %r", arg_2)

all ME and Task queue messages come through here as well as IOPub traffic .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , UploadSet ) : arg_1 = ( arg_1 , ) if not hasattr ( arg_0 , 'upload_set_config' ) : arg_0 . upload_set_config = { } arg_3 = arg_0 . upload_set_config arg_4 = dict ( dest = arg_0 . config . get ( 'UPLOADS_DEFAULT_DEST' ) , url = arg_0 . config . get ( 'UPLOADS_DEFAULT_URL' ) ) for arg_5 in arg_1 : arg_6 = config_for_set ( arg_5 , arg_0 , arg_4 ) arg_3 [ arg_5 . name ] = arg_6 arg_8 = any ( s . base_url is None for s in arg_3 . values ( ) ) if '_uploads' not in arg_0 . blueprints and arg_8 : arg_0 . register_blueprint ( uploads_mod )

def Func(arg_0, arg_1):
    """
    Call this after the app has been configured. It will go through all the
    upload sets, get their configuration, and store the configuration on the
    app. It will also register the uploads module if it hasn't been set. This
    can be called multiple times with different upload sets.

    .. versionchanged:: 0.1.3
       The uploads module/blueprint will only be registered if it is needed
       to serve the upload sets.

    :param app: The `~flask.Flask` instance to get the configuration from.
    :param upload_sets: The `UploadSet` instances to configure.
    """
    if isinstance(arg_1, UploadSet):
        arg_1 = (arg_1,)

    if not hasattr(arg_0, 'upload_set_config'):
        arg_0.upload_set_config = {}
    arg_3 = arg_0.upload_set_config
    arg_4 = dict(dest=arg_0.config.get('UPLOADS_DEFAULT_DEST'),
                    url=arg_0.config.get('UPLOADS_DEFAULT_URL'))

    for arg_5 in arg_1:
        arg_6 = config_for_set(arg_5, arg_0, arg_4)
        arg_3[arg_5.name] = arg_6

    arg_8 = any(s.base_url is None for s in arg_3.values())
    if '_uploads' not in arg_0.blueprints and arg_8:
        arg_0.register_blueprint(uploads_mod)

Call this after the app has been configured . It will go through all the upload sets get their configuration and store the configuration on the app . It will also register the uploads module if it hasn t been set . This can be called multiple times with different upload sets .


def Func ( arg_0 , arg_1 , arg_2 = 'w' ) : with open ( arg_0 . path , arg_2 ) as f : f . Func ( arg_1 )

def Func(arg_0, arg_1, arg_2='w'):
        """
        Write data to the file.

        `data` is the data to Func
        `mode` is the mode argument to pass to `open()`
        """
        with open(arg_0.path, arg_2) as f:
            f.Func(arg_1)

Write data to the file.

        `data` is the data to write
        `mode` is the mode argument to pass to `open()`


def Func(arg_0, arg_1, arg_2="/", arg_3=None):
        """Deletes the cookie with the given name."""
        assert arg_0.cookie_monster, 'Cookie Monster not set'
        #, path=path, domain=domain)
        arg_0.cookie_monster.delete_cookie(arg_1)

Deletes the cookie with the given name .


def Func(arg_0, arg_1, arg_2=None) -> str:
    """
    Convert to tz

    Args:
        dt: date time
        to_tz: to tz
        from_tz: from tz - will be ignored if tz from dt is given

    Returns:
        str: date & time

    Examples:
        >>> dt_1 = pd.Timestamp('2018-09-10 16:00', tz='Asia/Hong_Kong')
        >>> Func(dt_1, to_tz='NY')
        '2018-09-10 04:00:00-04:00'
        >>> dt_2 = pd.Timestamp('2018-01-10 16:00')
        >>> Func(dt_2, to_tz='HK', from_tz='NY')
        '2018-01-11 05:00:00+08:00'
        >>> dt_3 = '2018-09-10 15:00'
        >>> Func(dt_3, to_tz='NY', from_tz='JP')
        '2018-09-10 02:00:00-04:00'
    """
    arg_3 = logs.get_logger(Func, level='info')
    arg_4, arg_5 = get_tz(arg_2), get_tz(arg_1)

    arg_6 = pd.Timestamp(str(arg_0), tz=arg_4)
    arg_3.debug(f'converting {str(from_dt)} from {f_tz} to {t_tz} ...')
    return str(pd.Timestamp(str(arg_6), tz=arg_5))


def Func ( arg_0 , arg_1 ) : if getattr ( request , '_tracy_exclude' , False ) : return arg_1 arg_2 = None if getattr ( request , '_tracy_start_time' , None ) : arg_2 = monotonic ( ) - request . _tracy_start_time arg_3 = None if getattr ( request , '_tracy_id' , None ) : arg_3 = request . _tracy_id arg_1 . headers [ arg_5 ] = arg_3 arg_6 = None if getattr ( request , '_tracy_client' , None ) : arg_6 = request . _tracy_client arg_7 = { 'status_code' : arg_1 . status_code , 'url' : request . base_url , 'client_ip' : request . remote_addr , 'trace_name' : arg_6 , 'trace_id' : arg_3 , 'trace_duration' : arg_2 } logger . info ( None , extra = arg_7 ) return arg_1

def Func(arg_0, arg_1):
        """Calculates the request duration, and adds a transaction
        ID to the header.
        """
        # Ignore excluded routes.
        if getattr(request, '_tracy_exclude', False):
            return arg_1

        arg_2 = None
        if getattr(request, '_tracy_start_time', None):
            arg_2 = monotonic() - request._tracy_start_time

        # Add Trace_ID header.
        arg_3 = None
        if getattr(request, '_tracy_id', None):
            arg_3 = request._tracy_id
            arg_1.headers[arg_5] = arg_3

        # Get the invoking client.
        arg_6 = None
        if getattr(request, '_tracy_client', None):
            arg_6 = request._tracy_client

        # Extra log kwargs.
        arg_7 = {'status_code': arg_1.status_code,
             'url': request.base_url,
             'client_ip': request.remote_addr,
             'trace_name': arg_6,
             'trace_id': arg_3,
             'trace_duration': arg_2}
        logger.info(None, extra=arg_7)
        return arg_1

Calculates the request duration and adds a transaction ID to the header .


def Func(arg_0, arg_1):
        """Checks the validity of the input.

        In case of an invalid input throws ValueError.
        """
        if isinstance(arg_1, str):
            return 'st'
        elif isinstance(arg_1, list):
            if all(isinstance(arg_2, str) for arg_2 in arg_1):
                return 'gst'

        raise ValueError("String argument should be of type String or"
                                     " a list of strings")


(cplist, cmdpkl,
                    require_cmd_magcolor=True,
                    save_cmd_pngs=False)

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = False ) : with open ( arg_1 , 'rb' ) as infd : arg_4 = pickle . load ( infd ) for arg_5 in arg_0 : add_cmd_to_checkplot ( arg_5 , arg_4 , arg_2 = arg_2 , arg_3 = arg_3 )

def Func(arg_0, arg_1,
                    arg_2=True,
                    arg_3=False):
    '''This adds CMDs for each object in cplist.

    Parameters
    ----------

    cplist : list of str
        This is the input list of checkplot pickles to add the CMDs to.

    cmdpkl : str
        This is the filename of the CMD pickle created previously.

    require_cmd_magcolor : bool
        If this is True, a CMD plot will not be made if the color and mag keys
        required by the CMD are not present or are nan in each checkplot's
        objectinfo dict.

    save_cmd_pngs : bool
        If this is True, then will save the CMD plots that were generated and
        added back to the checkplotdict as PNGs to the same directory as
        `cpx`.

    Returns
    -------

    Nothing.

    '''

    # load the CMD first to save on IO
    with open(arg_1,'rb') as infd:
        arg_4 = pickle.load(infd)

    for arg_5 in arg_0:

        add_cmd_to_checkplot(arg_5, arg_4,
                             arg_2=arg_2,
                             arg_3=arg_3)

This adds CMDs for each object in cplist .


def Func ( arg_0 , arg_1 = None ) : for arg_2 in arg_0 . _children : if arg_1 is None or arg_2 . tagname == arg_1 : yield arg_2 for arg_3 in arg_2 . find ( arg_1 ) : yield arg_3

def Func(arg_0, arg_1=None):
        """
        Recursively find any descendants of this node with the given tag name. If a tag name is omitted, this will
        yield every descendant node.

        :param name: If specified, only consider elements with this tag name
        :returns: A generator yielding descendants of this node
        """
        for arg_2 in arg_0._children:
            if arg_1 is None or arg_2.tagname == arg_1:
                yield arg_2
            for arg_3 in arg_2.find(arg_1):
                yield arg_3

Recursively find any descendants of this node with the given tag name . If a tag name is omitted this will yield every descendant node .


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = getattr ( arg_1 , arg_2 ) except AttributeError : return if not arg_3 . _sig . drivers : connect ( arg_0 , arg_3 )

def Func(arg_0, arg_1, arg_2):
    """
    Try connect src to interface of specified name on unit.
    Ignore if interface is not present or if it already has driver.
    """
    try:
        arg_3 = getattr(arg_1, arg_2)
    except AttributeError:
        return
    if not arg_3._sig.drivers:
        connect(arg_0, arg_3)

Try connect src to interface of specified name on unit . Ignore if interface is not present or if it already has driver .


def Func ( arg_0 ) : arg_1 = { } arg_2 = [ ] for arg_3 in arg_0 : arg_1 . setdefault ( arg_3 [ 1 : 3 ] , [ ] ) . append ( arg_3 ) arg_2 . append ( arg_3 [ 4 ] ) arg_4 = arg_1 . keys ( ) arg_4 . sort ( ) arg_5 = [ ] for arg_6 in arg_4 : for arg_3 in arg_1 [ arg_6 ] : arg_5 . append ( arg_3 [ : 4 ] + ( arg_2 . pop ( 0 ) , ) ) return arg_5

def Func(arg_0):
    """Sort a set of fields by their indicators.

    Return a sorted list with correct global field positions.
    """
    arg_1 = {}
    arg_2 = []
    for arg_3 in arg_0:
        arg_1.setdefault(arg_3[1:3], []).append(arg_3)
        arg_2.append(arg_3[4])

    arg_4 = arg_1.keys()
    arg_4.sort()

    arg_5 = []
    for arg_6 in arg_4:
        for arg_3 in arg_1[arg_6]:
            arg_5.append(arg_3[:4] + (arg_2.pop(0),))

    return arg_5

Sort a set of fields by their indicators .


def
Func
(
arg_0
,
arg_1
=
''
,
arg_2
=
arg_3
)
:
with
arg_0
.
_lock
:
if
not
arg_0
.
done
(
)
:
arg_4
=
False
logger
.
debug
(
'%s Func(%s) called'
,
arg_0
,
arg_1
)
arg_0
.
_exception
=
arg_2
(
arg_1
)
if
arg_0
.
_status
==
'not-started'
:
arg_4
=
True
arg_0
.
_status
=
'Funcled'
if
arg_4
:
arg_0
.
announce_done
(
)

def Func(arg_0, arg_1='', arg_2=arg_3):
        """Cancels the TransferFuture

        :param msg: The message to attach to the Funclation
        :param exc_type: The type of exception to set for the Funclation
        """
        with arg_0._lock:
            if not arg_0.done():
                arg_4 = False
                logger.debug('%s Func(%s) called', arg_0, arg_1)
                arg_0._exception = arg_2(arg_1)
                if arg_0._status == 'not-started':
                    arg_4 = True
                arg_0._status = 'Funcled'
                if arg_4:
                    arg_0.announce_done()

Cancels the TransferFuture

        :param msg: The message to attach to the cancellation
        :param exc_type: The type of exception to set for the cancellation


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . wait_for_environments ( arg_2 . environment , health = arg_2 . health )

def Func(arg_0, arg_1, arg_2):
    """
    Waits for an environment to be healthy
    """
    arg_0.wait_for_environments(arg_2.environment, health=arg_2.health)


return (current_state.state,
                current_state.exit_code,
                current_state.detail_status)

def Func(arg_0, arg_1, arg_2):
        """
        Get the state and exitcode of a container group

        :param resource_group: the name of the resource group
        :type resource_group: str
        :param name: the name of the container group
        :type name: str
        :return: A tuple with the state, exitcode, and details.
            If the exitcode is unknown 0 is returned.
        :rtype: tuple(state,exitcode,details)
        """
        arg_3 = arg_0._get_instance_view(arg_1, arg_2).current_state
        return (arg_3.state,
                arg_3.exit_code,
                arg_3.detail_status)


Property to be used for setting and getting the offset of the layer.

        Note that setting this property causes an immediate redraw.

def Func ( arg_0 ) : if callable ( arg_0 . _Func ) : return util . WatchingList ( arg_0 . _Func ( * ( arg_0 . widget . pos + arg_0 . widget . size ) ) , arg_0 . _wlredraw_Func ) else : return util . WatchingList ( arg_0 . _Func , arg_0 . _wlredraw_Func )

def Func(arg_0):
        """
        Property to be used for setting and getting the Func of the layer.

        Note that setting this property causes an immediate redraw.
        """
        if callable(arg_0._Func):
            return util.WatchingList(arg_0._Func(*(arg_0.widget.pos+arg_0.widget.size)),arg_0._wlredraw_Func)
        else:
            return util.WatchingList(arg_0._Func,arg_0._wlredraw_Func)

Property to be used for setting and getting the offset of the layer . Note that setting this property causes an immediate redraw .


def Func(arg_0):
        """returns the number of bytes that the cleansed attachments take up on disk"""
        arg_1 = 0
        for arg_2 in arg_0.fs_cleansed_attachments:
                arg_1 += stat(arg_2).st_size
        return arg_1


def Func ( arg_0 , arg_1 , arg_2 = 1 ) : if arg_0 . method : if arg_0 . test_method_validity ( arg_1 , arg_0 . method ) : try : return arg_0 . calculate_derivative ( arg_1 , arg_0 . method , arg_2 ) except : pass arg_3 = arg_0 . select_valid_methods ( arg_1 ) for arg_4 in arg_3 : try : return arg_0 . calculate_derivative ( arg_1 , arg_4 , arg_2 ) except : pass return None

def Func(arg_0, arg_1, arg_2=1):
        r'''Method to obtain a derivative of a property with respect to
        temperature, of a given order. Methods found valid by
        `select_valid_methods` are attempted until a method succeeds. If no
        methods are valid and succeed, None is returned.

        Calls `calculate_derivative` internally to perform the actual
        calculation.

        .. math::
            \text{derivative} = \frac{d (\text{property})}{d T}

        Parameters
        ----------
        T : float
            Temperature at which to calculate the derivative, [K]
        order : int
            Order of the derivative, >= 1

        Returns
        -------
        derivative : float
            Calculated derivative property, [`units/K^order`]
        '''
        if arg_0.method:
            # retest within range
            if arg_0.test_method_validity(arg_1, arg_0.method):
                try:
                    return arg_0.calculate_derivative(arg_1, arg_0.method, arg_2)
                except:  # pragma: no cover
                    pass
        arg_3 = arg_0.select_valid_methods(arg_1)
        for arg_4 in arg_3:
            try:
                return arg_0.calculate_derivative(arg_1, arg_4, arg_2)
            except:
                pass
        return None

r Method to obtain a derivative of a property with respect to temperature of a given order . Methods found valid by select_valid_methods are attempted until a method succeeds . If no methods are valid and succeed None is returned .


def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def trampoline ( * arg_1 , ** arg_2 ) : while True : arg_3 = arg_0 ( * arg_1 , ** arg_2 ) if isinstance ( arg_3 , _TrampolineArgs ) : arg_1 = arg_3 . args arg_2 = arg_3 . kwargs continue return arg_3 return trampoline

def Func(arg_0):
    """Trampoline a function repeatedly until it is finished recurring to help
    avoid stack growth."""

    @functools.wraps(arg_0)
    def trampoline(*arg_1, **arg_2):
        while True:
            arg_3 = arg_0(*arg_1, **arg_2)
            if isinstance(arg_3, _TrampolineArgs):
                arg_1 = arg_3.args
                arg_2 = arg_3.kwargs
                continue
            return arg_3

    return trampoline

Trampoline a function repeatedly until it is finished recurring to help avoid stack growth .


(returns,
                positions,
                factor_returns,
                factor_loadings,
                transactions=None,
                pos_in_dollars=True)

return ep.perf_attrib(returns, positions, factor_returns, factor_loadings)

def Func(arg_0,
                arg_1,
                arg_2,
                arg_3,
                arg_4=None,
                arg_5=True):
    """
    Attributes the performance of a returns stream to a set of risk factors.

    Preprocesses inputs, and then calls empyrical.Func. See
    empyrical.Func for more info.

    Performance attribution determines how much each risk factor, e.g.,
    momentum, the technology sector, etc., contributed to total returns, as
    well as the daily exposure to each of the risk factors. The returns that
    can be attributed to one of the given risk factors are the
    `common_returns`, and the returns that _cannot_ be attributed to a risk
    factor are the `specific_returns`, or the alpha. The common_returns and
    specific_returns summed together will always equal the total returns.

    Parameters
    ----------
    returns : pd.Series
        Returns for each day in the date range.
        - Example:
            2017-01-01   -0.017098
            2017-01-02    0.002683
            2017-01-03   -0.008669

    positions: pd.DataFrame
        Daily holdings (in dollars or percentages), indexed by date.
        Will be converted to percentages if positions are in dollars.
        Short positions show up as cash in the 'cash' column.
        - Examples:
                        AAPL  TLT  XOM  cash
            2017-01-01    34   58   10     0
            2017-01-02    22   77   18     0
            2017-01-03   -15   27   30    15

                            AAPL       TLT       XOM  cash
            2017-01-01  0.333333  0.568627  0.098039   0.0
            2017-01-02  0.188034  0.658120  0.153846   0.0
            2017-01-03  0.208333  0.375000  0.416667   0.0

    factor_returns : pd.DataFrame
        Returns by factor, with date as index and factors as columns
        - Example:
                        momentum  reversal
            2017-01-01  0.002779 -0.005453
            2017-01-02  0.001096  0.010290

    factor_loadings : pd.DataFrame
        Factor loadings for all days in the date range, with date and ticker as
        index, and factors as columns.
        - Example:
                               momentum  reversal
            dt         ticker
            2017-01-01 AAPL   -1.592914  0.852830
                       TLT     0.184864  0.895534
                       XOM     0.993160  1.149353
            2017-01-02 AAPL   -0.140009 -0.524952
                       TLT    -1.066978  0.185435
                       XOM    -1.798401  0.761549

    transactions : pd.DataFrame, optional
        Executed trade volumes and fill prices. Used to check the turnover of
        the algorithm. Default is None, in which case the turnover check is
        skipped.

        - One row per trade.
        - Trades on different names that occur at the
          same time will have identical indicies.
        - Example:
            index                  amount   price    symbol
            2004-01-09 12:18:01    483      324.12   'AAPL'
            2004-01-09 12:18:01    122      83.10    'MSFT'
            2004-01-13 14:12:23    -75      340.43   'AAPL'

    pos_in_dollars : bool
        Flag indicating whether `positions` are in dollars or percentages
        If True, positions are in dollars.

    Returns
    -------
    tuple of (risk_exposures_portfolio, Funcution)

    risk_exposures_portfolio : pd.DataFrame
        df indexed by datetime, with factors as columns
        - Example:
                        momentum  reversal
            dt
            2017-01-01 -0.238655  0.077123
            2017-01-02  0.821872  1.520515

    Funcution : pd.DataFrame
        df with factors, common returns, and specific returns as columns,
        and datetimes as index
        - Example:
                        momentum  reversal  common_returns  specific_returns
            dt
            2017-01-01  0.249087  0.935925        1.185012          1.185012
            2017-01-02 -0.003194 -0.400786       -0.403980         -0.403980
    """
    (arg_0,
     arg_1,
     arg_2,
     arg_3) = _align_and_warn(arg_0,
                                        arg_1,
                                        arg_2,
                                        arg_3,
                                        arg_4=arg_4,
                                        arg_5=arg_5)

    # Note that we convert positions to percentages *after* the checks
    # above, since get_turnover() expects positions in dollars.
    arg_1 = _stack_positions(arg_1, arg_5=arg_5)

    return ep.Func(arg_0, arg_1, arg_2, arg_3)

Attributes the performance of a returns stream to a set of risk factors.

    Preprocesses inputs, and then calls empyrical.perf_attrib. See
    empyrical.perf_attrib for more info.

    Performance attribution determines how much each risk factor, e.g.,
    momentum, the technology sector, etc., contributed to total returns, as
    well as the daily exposure to each of the risk factors. The returns that
    can be attributed to one of the given risk factors are the
    `common_returns`, and the returns that _cannot_ be attributed to a risk
    factor are the `specific_returns`, or the alpha. The common_returns and
    specific_returns summed together will always equal the total returns.

    Parameters
    ----------
    returns : pd.Series
        Returns for each day in the date range.
        - Example:
            2017-01-01   -0.017098
            2017-01-02    0.002683
            2017-01-03   -0.008669

    positions: pd.DataFrame
        Daily holdings (in dollars or percentages), indexed by date.
        Will be converted to percentages if positions are in dollars.
        Short positions show up as cash in the 'cash' column.
        - Examples:
                        AAPL  TLT  XOM  cash
            2017-01-01    34   58   10     0
            2017-01-02    22   77   18     0
            2017-01-03   -15   27   30    15

                            AAPL       TLT       XOM  cash
            2017-01-01  0.333333  0.568627  0.098039   0.0
            2017-01-02  0.188034  0.658120  0.153846   0.0
            2017-01-03  0.208333  0.375000  0.416667   0.0

    factor_returns : pd.DataFrame
        Returns by factor, with date as index and factors as columns
        - Example:
                        momentum  reversal
            2017-01-01  0.002779 -0.005453
            2017-01-02  0.001096  0.010290

    factor_loadings : pd.DataFrame
        Factor loadings for all days in the date range, with date and ticker as
        index, and factors as columns.
        - Example:
                               momentum  reversal
            dt         ticker
            2017-01-01 AAPL   -1.592914  0.852830
                       TLT     0.184864  0.895534
                       XOM     0.993160  1.149353
            2017-01-02 AAPL   -0.140009 -0.524952
                       TLT    -1.066978  0.185435
                       XOM    -1.798401  0.761549

    transactions : pd.DataFrame, optional
        Executed trade volumes and fill prices. Used to check the turnover of
        the algorithm. Default is None, in which case the turnover check is
        skipped.

        - One row per trade.
        - Trades on different names that occur at the
          same time will have identical indicies.
        - Example:
            index                  amount   price    symbol
            2004-01-09 12:18:01    483      324.12   'AAPL'
            2004-01-09 12:18:01    122      83.10    'MSFT'
            2004-01-13 14:12:23    -75      340.43   'AAPL'

    pos_in_dollars : bool
        Flag indicating whether `positions` are in dollars or percentages
        If True, positions are in dollars.

    Returns
    -------
    tuple of (risk_exposures_portfolio, perf_attribution)

    risk_exposures_portfolio : pd.DataFrame
        df indexed by datetime, with factors as columns
        - Example:
                        momentum  reversal
            dt
            2017-01-01 -0.238655  0.077123
            2017-01-02  0.821872  1.520515

    perf_attribution : pd.DataFrame
        df with factors, common returns, and specific returns as columns,
        and datetimes as index
        - Example:
                        momentum  reversal  common_returns  specific_returns
            dt
            2017-01-01  0.249087  0.935925        1.185012          1.185012
            2017-01-02 -0.003194 -0.400786       -0.403980         -0.403980

Attributes the performance of a returns stream to a set of risk factors .


def Func(arg_0, arg_1, arg_2):
        """Use the wire_map dict to change the condition tuple's creg name.

        Args:
            wire_map (dict): a map from wires to wires
            condition (tuple): (ClassicalRegister,int)
        Returns:
            tuple(ClassicalRegister,int): new condition
        """
        if arg_2 is None:
            arg_3 = None
        else:
            # Map the register name, using fact that registers must not be
            # fragmented by the wire_map (this must have been checked
            # elsewhere)
            arg_4 = (arg_2[0], 0)
            arg_3 = (arg_1.get(arg_4, arg_4)[0], arg_2[1])
        return arg_3

Use the wire_map dict to change the condition tuple s creg name .


return self._disassoc(
            self._forward_rel_name('failure'), parent, child)

def Func(arg_0, arg_1, arg_2):
        """Remove a failure node link.
        The resulatant 2 nodes will both become root nodes.

        =====API DOCS=====
        Remove a failure node link.

        :param parent: Primary key of parent node to disassociate failure node from.
        :type parent: int
        :param child: Primary key of child node to be disassociated.
        :type child: int
        :returns: Dictionary of only one key "changed", which indicates whether the disassociation succeeded.
        :rtype: dict

        =====API DOCS=====
        """
        return arg_0._disassoc(
            arg_0._forward_rel_name('failure'), arg_1, arg_2)

Remove a failure node link . The resulatant 2 nodes will both become root nodes .


def Func ( arg_0 ) : arg_1 = arg_0 . trim ( ) if arg_1 . filtered : arg_2 = arg_1 . _filtered_range_to_unfiltered_indices ( 0 , len ( arg_1 ) ) return arg_1 . take ( arg_2 ) else : return arg_1

def Func(arg_0):
        '''Return a DataFrame containing only the filtered rows.

        {note_copy}

        The resulting DataFrame may be more efficient to work with when the original DataFrame is
        heavily filtered (contains just a small number of rows).

        If no filtering is applied, it returns a trimmed view.
        For the returned df, len(df) == df.length_original() == df.length_unfiltered()

        :rtype: DataFrame
        '''
        arg_1 = arg_0.trim()
        if arg_1.filtered:
            arg_2 = arg_1._filtered_range_to_unfiltered_indices(0, len(arg_1))
            return arg_1.take(arg_2)
        else:
            return arg_1

Return a DataFrame containing only the filtered rows .


(model,
                           reaction_list=None,
                           zero_cutoff=None,
                           open_exchanges=False,
                           processes=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = False , arg_4 = None ) : arg_2 = normalize_cutoff ( arg_0 , arg_2 ) with arg_0 : if arg_3 : for arg_5 in arg_0 . exchanges : arg_5 . bounds = ( min ( arg_5 . lower_bound , - 1000 ) , max ( arg_5 . upper_bound , 1000 ) ) if arg_1 is None : arg_1 = arg_0 . reactions arg_0 . slim_optimize ( ) arg_7 = get_solution ( arg_0 , reactions = arg_1 ) arg_1 = arg_7 . fluxes [ arg_7 . fluxes . abs ( ) < arg_2 ] . index . tolist ( ) arg_8 = flux_variability_analysis ( arg_0 , fraction_of_optimum = 0. , arg_1 = arg_1 , arg_4 = arg_4 ) return arg_8 [ arg_8 . abs ( ) . max ( axis = 1 ) < arg_2 ] . index . tolist ( )

def Func(arg_0,
                           arg_1=None,
                           arg_2=None,
                           arg_3=False,
                           arg_4=None):
    """
    Find reactions that cannot carry any flux.

    The question whether or not a reaction is blocked is highly dependent
    on the current exchange reaction settings for a COBRA model. Hence an
    argument is provided to open all exchange reactions.

    Notes
    -----
    Sink and demand reactions are left untouched. Please modify them manually.

    Parameters
    ----------
    model : cobra.Model
        The model to analyze.
    reaction_list : list, optional
        List of reactions to consider, the default includes all model
        reactions.
    zero_cutoff : float, optional
        Flux value which is considered to effectively be zero
        (default model.tolerance).
    open_exchanges : bool, optional
        Whether or not to open all exchange reactions to very high flux ranges.
    processes : int, optional
        The number of parallel processes to run. Can speed up the computations
        if the number of reactions is large. If not explicitly
        passed, it will be set from the global configuration singleton.

    Returns
    -------
    list
        List with the identifiers of blocked reactions.

    """
    arg_2 = normalize_cutoff(arg_0, arg_2)

    with arg_0:
        if arg_3:
            for arg_5 in arg_0.exchanges:
                arg_5.bounds = (min(arg_5.lower_bound, -1000),
                                   max(arg_5.upper_bound, 1000))
        if arg_1 is None:
            arg_1 = arg_0.reactions
        # Limit the search space to reactions which have zero flux. If the
        # reactions already carry flux in this solution,
        # then they cannot be blocked.
        arg_0.slim_optimize()
        arg_7 = get_solution(arg_0, reactions=arg_1)
        arg_1 = arg_7.fluxes[
            arg_7.fluxes.abs() < arg_2].index.tolist()
        # Run FVA to find reactions where both the minimal and maximal flux
        # are zero (below the cut off).
        arg_8 = flux_variability_analysis(
            arg_0, fraction_of_optimum=0., arg_1=arg_1,
            arg_4=arg_4
        )
        return arg_8[
            arg_8.abs().max(axis=1) < arg_2].index.tolist()

Find reactions that cannot carry any flux .


return await asyncio.wait_for(
            self._protocol.send_command(xml, command_type=QRTPacketType.PacketXML),
            timeout=self._timeout,
        )

async def Func ( arg_0 , arg_1 ) : return await asyncio . wait_for ( arg_0 . _protocol . send_command ( arg_1 , command_type = QRTPacketType . PacketXML ) , timeout = arg_0 . _timeout , )

async def Func(arg_0, arg_1):
        """Used to update QTM settings, see QTM RT protocol for more information.

        :param xml: XML document as a str. See QTM RT Documentation for details.
        """
        return await asyncio.wait_for(
            arg_0._protocol.send_command(arg_1, command_type=QRTPacketType.PacketXML),
            timeout=arg_0._timeout,
        )

Used to update QTM settings see QTM RT protocol for more information .


def Func ( arg_0 , arg_1 ) : arg_2 = None for arg_3 in arg_0 . accounts : if arg_3 . name == arg_1 : arg_2 = arg_3 if arg_2 is not None : arg_0 . accounts . remove ( arg_2 )

def Func(arg_0, arg_1):
        """
        Remove an account from the account's sub accounts.

        :param name: The name of the account to remove.
        """

        arg_2 = None
        for arg_3 in arg_0.accounts:
            if arg_3.name == arg_1:
                arg_2 = arg_3
        if arg_2 is not None:
            arg_0.accounts.remove(arg_2)

Remove an account from the account s sub accounts .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : with unittest . mock . patch ( 'cookiecutter.generate.run_hook' , side_effect = _patched_run_hook ) : cc_generate . generate_files ( arg_0 = arg_0 , context = { 'cookiecutter' : arg_1 , 'template' : arg_2 , 'version' : arg_3 } , overwrite_if_exists = False , output_dir = '.' )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Uses cookiecutter to generate files for the project.

    Monkeypatches cookiecutter's "run_hook" to ensure that the temple.yaml file is
    generated before any hooks run. This is important to ensure that hooks can also
    perform any actions involving temple.yaml
    """
    with unittest.mock.patch('cookiecutter.generate.run_hook', side_effect=_patched_run_hook):
        cc_generate.generate_files(arg_0=arg_0,
                                   context={'cookiecutter': arg_1,
                                            'template': arg_2,
                                            'version': arg_3},
                                   overwrite_if_exists=False,
                                   output_dir='.')

Uses cookiecutter to generate files for the project .


def Func(arg_0, arg_1):
        '''
        Turns distances into RBF values.

        Parameters
        ----------
        X : array
            The raw pairwise distances.

        Returns
        -------
        X_rbf : array of same shape as X
            The distances in X passed through the RBF kernel.
        '''
        arg_1 = check_array(arg_1)
        arg_2 = np.empty_like(arg_1) if arg_0.copy else arg_1

        arg_3 = arg_1
        if not arg_0.squared:
            np.power(arg_3, 2, out=arg_2)
            arg_3 = arg_2

        if arg_0.scale_by_median:
            arg_4 = arg_0.median_ if arg_0.squared else arg_0.median_ ** 2
            arg_5 = arg_0.gamma * arg_4
        else:
            arg_5 = arg_0.gamma
        np.multiply(arg_3, -arg_5, out=arg_2)

        np.exp(arg_2, out=arg_2)
        return arg_2


def Func ( arg_0 ) : arg_1 = os . stat ( arg_0 ) for arg_2 , arg_3 in [ ( arg_1 . st_uid , bitperm ( arg_1 , 'w' , 'usr' ) ) , ( arg_1 . st_gid , bitperm ( arg_1 , 'w' , 'grp' ) ) ] : if arg_2 and arg_3 : return False if bitperm ( arg_1 , 'w' , 'oth' ) : return False return True

def Func(arg_0):
    """File is only writable by root

    :param str path: Path to file
    :return: True if only root can write
    :rtype: bool
    """
    arg_1 = os.stat(arg_0)
    for arg_2, arg_3 in [(arg_1.st_uid, bitperm(arg_1, 'w', 'usr')), (arg_1.st_gid, bitperm(arg_1, 'w', 'grp'))]:
        # User id (is not root) and bit permission
        if arg_2 and arg_3:
            return False
    if bitperm(arg_1, 'w', 'oth'):
        return False
    return True


def Func(arg_0):
    """Check that the provided frame id is valid in Rapids language."""
    if arg_0 is None:
        return
    if arg_0.strip() == "":
        raise H2OValueError("Frame id cannot be an empty string: %r" % arg_0)
    for arg_1, arg_2 in enumerate(arg_0):
        # '$' character has special meaning at the beginning of the string; and prohibited anywhere else
        if arg_2 == "$" and arg_1 == 0: continue
        if arg_2 not in _id_allowed_characters:
            raise H2OValueError("Character '%s' is illegal in frame id: %s" % (arg_2, arg_0))
    if re.match(r"-?[0-9]", arg_0):
        raise H2OValueError("Frame id cannot start with a number: %s" % arg_0)

Check that the provided frame id is valid in Rapids language .


(obj, active_fields = None, target_fields = None)

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = _filter_steps ( _get_steps ( arg_0 ) ) arg_4 = PMMLPipeline ( arg_3 ) if arg_1 is not None : arg_4 . active_fields = numpy . asarray ( arg_1 ) if arg_2 is not None : arg_4 . target_fields = numpy . asarray ( arg_2 ) return arg_4

def Func(arg_0, arg_1 = None, arg_2 = None):
	"""Translates a regular Scikit-Learn estimator or pipeline to a PMML pipeline.

	Parameters:
	----------
	obj: BaseEstimator
		The object.

	active_fields: list of strings, optional
		Feature names. If missing, "x1", "x2", .., "xn" are assumed.

	target_fields: list of strings, optional
		Label name(s). If missing, "y" is assumed.

	"""
	arg_3 = _filter_steps(_get_steps(arg_0))
	arg_4 = PMMLPipeline(arg_3)
	if arg_1 is not None:
		arg_4.active_fields = numpy.asarray(arg_1)
	if arg_2 is not None:
		arg_4.target_fields = numpy.asarray(arg_2)
	return arg_4

Translates a regular Scikit - Learn estimator or pipeline to a PMML pipeline .


(cls, refers: lmap.Map, other_ns_interns: lmap.Map)

def Func ( arg_0 , arg_1 : arg_2 . Map , arg_4 : arg_2 . Map ) -> arg_2 . Map : arg_5 = arg_1 for arg_6 in arg_4 : arg_7 : sym . Symbol = arg_6 . key arg_8 : Var = arg_6 . value if not arg_8 . is_private : arg_5 = arg_5 . assoc ( arg_7 , arg_8 ) return arg_5

def Func(arg_0, arg_1: arg_2.Map, arg_4: arg_2.Map) -> arg_2.Map:
        """Refer all _public_ interns from another namespace."""
        arg_5 = arg_1
        for arg_6 in arg_4:
            arg_7: sym.Symbol = arg_6.key
            arg_8: Var = arg_6.value
            if not arg_8.is_private:
                arg_5 = arg_5.assoc(arg_7, arg_8)
        return arg_5

Refer all _public_ interns from another namespace .


(x_initial, target_log_prob, log_slice_heights,
                           step_size, lower_bounds, upper_bounds, seed=None,
                           name=None)

def Func(arg_0, arg_1, arg_2,
                           arg_3, arg_4, arg_5, arg_6=None,
                           arg_7=None):
  """Samples from the slice by applying shrinkage for rejected points.

  Implements the one dimensional slice sampling algorithm of Neal (2003), with a
  doubling algorithm (Neal 2003 P715 Fig. 4), which doubles the size of the
  interval at each iteration and shrinkage (Neal 2003 P716 Fig. 5), which
  reduces the width of the slice when a selected point is rejected, by setting
  the relevant bound that that value. Randomly sampled points are checked for
  two criteria: that they lie within the slice and that they pass the
  acceptability check (Neal 2003 P717 Fig. 6), which tests that the new state
  could have generated the previous one.

  Args:
    x_initial: A tensor of any shape. The initial positions of the chains. This
      function assumes that all the dimensions of `x_initial` are batch
      dimensions (i.e. the event shape is `[]`).
    target_log_prob: Callable accepting a tensor like `x_initial` and returning
      a tensor containing the log density at that point of the same shape.
    log_slice_heights: Tensor of the same shape and dtype as the return value
      of `target_log_prob` when applied to `x_initial`. The log of the height of
      the chosen slice.
    step_size: A tensor of shape and dtype compatible with `x_initial`. The min
      interval size in the doubling algorithm.
    lower_bounds: Tensor of same shape and dtype as `x_initial`. Slice lower
      bounds for each chain.
    upper_bounds: Tensor of same shape and dtype as `x_initial`. Slice upper
      bounds for each chain.
    seed: (Optional) positive int. The random seed. If None, no seed is set.
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'find_slice_bounds').

  Returns:
    x_proposed: A tensor of the same shape and dtype as `x_initial`. The next
      proposed state of the chain.
  """
  with tf.compat.v1.name_scope(
      arg_7, 'sample_with_shrinkage',
      [arg_0, arg_2, arg_3, arg_4, arg_5]):
    arg_8 = distributions.SeedStream(arg_6, salt='Func')
    # Keeps track of whether an acceptable sample has been found for the chain.
    arg_9 = tf.zeros_like(arg_0, dtype=tf.bool)
    arg_10 = lambda arg_9, *ignored_args: ~tf.reduce_all(input_tensor=arg_9)
    arg_11 = tf.identity(arg_0)
    arg_12 = tf.shape(input=arg_0)
    arg_13 = arg_0.dtype.base_dtype
    def _body(arg_9, arg_14, arg_15, arg_11):
      """Iterates until every chain has found a suitable next state."""
      arg_16 = tf.random.uniform(
          arg_12, dtype=arg_13, arg_6=arg_8())
      arg_17 = tf.where(~arg_9, arg_14 + arg_16 * (arg_15 - arg_14), arg_11)
      arg_18 = _test_acceptance(arg_0, arg_1=arg_1,
                                    decided=arg_9,
                                    arg_2=arg_2,
                                    arg_17=arg_17, arg_3=arg_3,
                                    arg_4=arg_14, arg_5=arg_15)
      arg_19 = arg_2 < arg_1(arg_17)
      arg_20 = arg_19 & arg_18
      arg_21 = arg_9 | arg_20
      # Note that it might seem that we are moving the left and right end points
      # even if the point has been accepted (which is contrary to the stated
      # algorithm in Neal). However, this does not matter because the endpoints
      # for points that have been already accepted are not used again so it
      # doesn't matter what we do with them.
      arg_22 = tf.where(arg_17 < arg_0, arg_17, arg_14)
      arg_23 = tf.where(arg_17 >= arg_0, arg_17, arg_15)
      return arg_21, arg_22, arg_23, arg_17

    return tf.while_loop(
        arg_10=arg_10,
        body=_body,
        loop_vars=(arg_9, arg_4, arg_5, arg_11))[-1]

Samples from the slice by applying shrinkage for rejected points .


def Func ( arg_0 , arg_1 , arg_2 = False ) : Component . Func ( arg_0 , arg_1 , arg_2 ) if not arg_2 : if DEBUG : print "reparenting" , ctrl . name if hasattr ( arg_0 . wx_obj , "Reparent" ) : arg_0 . wx_obj . Reparent ( arg_0 . _parent . wx_obj )

def Func(arg_0, arg_1, arg_2=False):
        "Re-parent a child control with the new wx_obj parent"
        Component.Func(arg_0, arg_1, arg_2)
        # if not called from constructor, we must also reparent in wx:
        if not arg_2:
            if DEBUG: print "reparenting", ctrl.name
            if hasattr(arg_0.wx_obj, "Reparent"):
                arg_0.wx_obj.Reparent(arg_0._parent.wx_obj)

Re - parent a child control with the new wx_obj parent