def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_0 == arg_1 : return arg_2 arg_4 = conversion_factor ( arg_0 , arg_1 , arg_3 ) if type ( arg_2 ) == float : arg_5 = arg_2 * float ( arg_4 ) elif type ( arg_2 ) == Decimal : arg_5 = Decimal ( format ( arg_2 * arg_4 , '.%sf' % str ( PRICE_PRECISION ) ) ) elif type ( arg_2 ) in [ np . float16 , np . float32 , np . float64 , np . float128 , np . float ] : arg_5 = float ( arg_2 ) * float ( arg_4 ) else : arg_5 = None return arg_5

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Converts an amount of money from one currency to another on a specified date.
    """
    if arg_0 == arg_1:
        return arg_2

    arg_4 = conversion_factor(arg_0, arg_1, arg_3)

    if type(arg_2) == float:
        arg_5 = arg_2 * float(arg_4)
    elif type(arg_2) == Decimal:
        arg_5 = Decimal(format(arg_2 * arg_4, '.%sf' % str(PRICE_PRECISION)))
    elif type(arg_2) in [np.float16, np.float32, np.float64, np.float128, np.float]:
        arg_5 = float(arg_2) * float(arg_4)
    else:
        arg_5 = None

    return arg_5

Converts an amount of money from one currency to another on a specified date .


async def Func(arg_0, arg_1):
        """ A few checks to make sure the bot can join a voice channel. """
        arg_2 = arg_0.bot.lavalink.players.get(arg_1.guild.id)

        if not arg_2.is_connected:
            if not arg_1.author.voice or not arg_1.author.voice.channel:
                await arg_1.send('You aren\'t connected to any voice channel.')
                raise commands.CommandInvokeError('Author not connected to voice channel.')

            arg_3 = arg_1.author.voice.channel.permissions_for(arg_1.me)

            if not arg_3.connect or not arg_3.speak:
                await arg_1.send('Missing permissions `CONNECT` and/or `SPEAK`.')
                raise commands.CommandInvokeError('Bot has no permissions CONNECT and/or SPEAK')

            arg_2.store('channel', arg_1.channel.id)
            await arg_2.connect(arg_1.author.voice.channel.id)
        else:
            if arg_2.connected_channel.id != arg_1.author.voice.channel.id:
                return await arg_1.send('Join my voice channel!')

A few checks to make sure the bot can join a voice channel .


(self, name, values, ttl=60, weight=None, region=None,
                          set_identifier=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 60 , arg_4 = None , arg_5 = None , arg_6 = None ) : arg_0 . _halt_if_already_deleted ( ) arg_2 = locals ( ) del arg_2 [ 'self' ] return arg_0 . _add_record ( TXTResourceRecordSet , ** arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3=60, arg_4=None, arg_5=None,
                          arg_6=None):
        """
        Creates a TXT record attached to this hosted zone.

        :param str name: The fully qualified name of the record to add.
        :param list values: A list of value strings for the record.
        :keyword int ttl: The time-to-live of the record (in seconds).
        :keyword int weight: *For weighted record sets only*. Among resource record
            sets that have the same combination of DNS name and type, a value
            that determines what portion of traffic for the current resource
            record set is routed to the associated location. Ranges from 0-255.
        :keyword str region: *For latency-based record sets*. The Amazon EC2 region
            where the resource that is specified in this resource record set
            resides.
        :keyword str set_identifier: *For weighted and latency resource record
            sets only*. An identifier that differentiates among multiple
            resource record sets that have the same combination of DNS name
            and type. 1-128 chars.
        :rtype: tuple
        :returns: A tuple in the form of ``(rrset, change_info)``, where
            ``rrset`` is the newly created TXTResourceRecordSet instance.
        """

        arg_0._halt_if_already_deleted()

        # Grab the params/kwargs here for brevity's sake.
        arg_2 = locals()
        del arg_2['self']

        return arg_0._add_record(TXTResourceRecordSet, **arg_2)

Creates a TXT record attached to this hosted zone .


def Func(*arg_0):
    """
    Glance annotation for adding function to process Func notification.

    if event_type include wildcard, will put {pattern: function} into process_wildcard dict
    else will put {event_type: function} into process dict

    :param arg: event_type of notification
    """
    check_event_type(Openstack.Glance, *arg_0)
    arg_1 = arg_0[0]

    def decorator(arg_2):
        if arg_1.find("*") != -1:
            arg_3 = pre_compile(arg_1)
            arg_4[arg_3] = arg_2
        else:
            arg_5[arg_1] = arg_2
        log.info("add function {0} to process event_type:{1}".format(arg_2.__name__, arg_1))

        @functools.wraps(arg_2)
        def wrapper(*arg_6, **arg_7):
            arg_2(*arg_6, **arg_7)

        return wrapper

    return decorator

Glance annotation for adding function to process glance notification.

    if event_type include wildcard, will put {pattern: function} into process_wildcard dict
    else will put {event_type: function} into process dict

    :param arg: event_type of notification

Glance annotation for adding function to process glance notification .


def Func ( * Func_0 , ** Func_1 ) : def wrapper ( Func_2 ) : Func_3 = getattr ( Func_2 , ATTR_ARGS , [ ] ) Func_3 . insert ( 0 , dict ( option_strings = Func_0 , ** Func_1 ) ) setattr ( Func_2 , ATTR_ARGS , Func_3 ) return Func_2 return wrapper

def Func(*Func_0, **Func_1):
    """
    Declares an Funcument for given function. Does not register the function
    anywhere, nor does it modify the function in any way.

    The signature of the decorator matches that of
    :meth:`Funcparse.ArgumentParser.add_Funcument`, only some keywords are not
    required if they can be easily guessed (e.g. you don't have to specify type
    or action when an `int` or `bool` default value is supplied).

    Typical use cases:

    - In combination with :func:`expects_obj` (which is not recommended);
    - in combination with ordinary function signatures to add details that
      cannot be expressed with that syntax (e.g. help message).

    Usage::

        from Funch import Func

        @Func('path', help='path to the file to load')
        @Func('--format', choices=['yaml','json'])
        @Func('-v', '--verbosity', choices=range(0,3), default=2)
        def load(path, something=None, format='json', dry_run=False, verbosity=1):
            loaders = {'json': json.load, 'yaml': yaml.load}
            loader = loaders[Funcs.format]
            data = loader(Funcs.path)
            if not Funcs.dry_run:
                if verbosity < 1:
                    print('saving to the database')
                put_to_database(data)

    In this example:

    - `path` declaration is extended with `help`;
    - `format` declaration is extended with `choices`;
    - `dry_run` declaration is not duplicated;
    - `verbosity` is extended with `choices` and the default value is
      overridden.  (If both function signature and `@Func` define a default
      value for an Funcument, `@Func` wins.)

    .. note::

        It is recommended to avoid using this decorator unless there's no way
        to tune the Funcument's behaviour or presentation using ordinary
        function signatures.  Readability counts, don't repeat yourself.

    """
    def wrapper(Func_2):
        Func_3 = getattr(Func_2, ATTR_ARGS, [])
        # The innermost decorator is called first but appears last in the code.
        # We need to preserve the expected order of positional Funcuments, so
        # the outermost decorator inserts its value before the innermost's:
        Func_3.insert(0, dict(option_strings=Func_0, **Func_1))
        setattr(Func_2, ATTR_ARGS, Func_3)
        return Func_2
    return wrapper

Declares an argument for given function. Does not register the function
    anywhere, nor does it modify the function in any way.

    The signature of the decorator matches that of
    :meth:`argparse.ArgumentParser.add_argument`, only some keywords are not
    required if they can be easily guessed (e.g. you don't have to specify type
    or action when an `int` or `bool` default value is supplied).

    Typical use cases:

    - In combination with :func:`expects_obj` (which is not recommended);
    - in combination with ordinary function signatures to add details that
      cannot be expressed with that syntax (e.g. help message).

    Usage::

        from argh import arg

        @arg('path', help='path to the file to load')
        @arg('--format', choices=['yaml','json'])
        @arg('-v', '--verbosity', choices=range(0,3), default=2)
        def load(path, something=None, format='json', dry_run=False, verbosity=1):
            loaders = {'json': json.load, 'yaml': yaml.load}
            loader = loaders[args.format]
            data = loader(args.path)
            if not args.dry_run:
                if verbosity < 1:
                    print('saving to the database')
                put_to_database(data)

    In this example:

    - `path` declaration is extended with `help`;
    - `format` declaration is extended with `choices`;
    - `dry_run` declaration is not duplicated;
    - `verbosity` is extended with `choices` and the default value is
      overridden.  (If both function signature and `@arg` define a default
      value for an argument, `@arg` wins.)

    .. note::

        It is recommended to avoid using this decorator unless there's no way
        to tune the argument's behaviour or presentation using ordinary
        function signatures.  Readability counts, don't repeat yourself.

Declares an argument for given function . Does not register the function anywhere nor does it modify the function in any way .


def Func ( arg_0 , arg_1 , arg_2 ) : super ( DataFrameArrays , arg_0 ) . Func ( arg_1 , arg_2 ) arg_0 . _length_unfiltered = int ( round ( arg_0 . _length_original * arg_0 . _active_fraction ) )

def Func(arg_0, arg_1, arg_2):
        """Add a column to the DataFrame

        :param str name: name of column
        :param data: numpy array with the data
        """
        # assert _is_array_type_ok(data), "dtype not supported: %r, %r" % (data.dtype, data.dtype.type)
        # self._length = len(data)
        # if self._length_unfiltered is None:
        #     self._length_unfiltered = len(data)
        #     self._length_original = len(data)
        #     self._index_end = self._length_unfiltered
        super(DataFrameArrays, arg_0).Func(arg_1, arg_2)
        arg_0._length_unfiltered = int(round(arg_0._length_original * arg_0._active_fraction))


def Func(arg_0, arg_1, arg_2):
        """
        Generate ready-to-paste log from list of issues and pull requests.

        :param list(dict) issues: List of issues in this tag section.
        :param list(dict) pull_requests: List of PR's in this tag section.
        :rtype: str
        :return: Generated log for issues and pull requests.
        """

        arg_3 = ""
        arg_4, arg_5 = arg_0.parse_by_sections(
            arg_1, arg_2)

        for arg_6, arg_7 in arg_4.items():
            arg_3 += arg_0.generate_sub_section(arg_7, arg_6)
        arg_3 += arg_0.generate_sub_section(arg_5, arg_0.options.issue_prefix)
        return arg_3

Generate ready - to - paste log from list of issues and pull requests .


def Func(arg_0, arg_1=None):
        '''
        Create a label for a board. Returns a new Label object.
        '''
        arg_2 = arg_0.fetch_json(
            uri_path=arg_0.base_uri + '/labels',
            http_method='POST',
            arg_1=arg_1 or {}
        )

        return arg_0.create_label(arg_2)

Create a label for a board . Returns a new Label object .


(self, name, recursive=False, predicate=None)

def Func(arg_0, arg_1, arg_2=False, arg_3=None):
        """Removes a child of the group.

        Note that groups and leaves are only removed from the current trajectory in RAM.
        If the trajectory is stored to disk, this data is not affected. Thus, removing children
        can be only be used to free RAM memory!

        If you want to free memory on disk via your storage service,
        use :func:`~pypet.trajectory.Trajectory.f_delete_items` of your trajectory.

        :param name:

            Name of child, naming by grouping is NOT allowed ('groupA.groupB.childC'),
            child must be direct successor of current node.

        :param recursive:

            Must be true if child is a group that has children. Will remove
            the whole subtree in this case. Otherwise a Type Error is thrown.

        :param predicate:

            Predicate which can evaluate for each node to ``True`` in order to remove the node or
            ``False`` if the node should be kept. Leave ``None`` if you want to remove all nodes.

        :raises:

            TypeError if recursive is false but there are children below the node.

            ValueError if child does not exist.

        """
        if arg_1 not in arg_0._children:
            raise ValueError('Your group `%s` does not contain the child `%s`.' %
                             (arg_0.v_full_name, arg_1))
        else:
            arg_4 = arg_0._children[arg_1]
            if (arg_1 not in arg_0._links and
                    not arg_4.v_is_leaf and
                    arg_4.f_has_children() and
                    not arg_2):
                raise TypeError('Cannot remove child. It is a group with children. Use'
                                ' f_remove with ``recursive = True``')
            else:
                arg_0._nn_interface._remove_subtree(arg_0, arg_1, arg_3)


Return  the lex index of a combination..

def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
len
(
arg_2
)
!=
arg_1
:
raise
VisualizationError
(
"list should have length k"
)
arg_3
=
list
(
map
(
lambda
x
:
arg_0
1
x
,
arg_2
)
)
arg_4
=
sum
(
[
n_choose_k
(
arg_3
[
arg_1
1
i
]
,
i
+
1
)
for
i
in
range
(
arg_1
)
]
)
return
int
(
arg_4
)

def Func(arg_0, arg_1, arg_2):
    """Return  the lex index of a combination..

    Args:
        n (int): the total number of options .
        k (int): The number of elements.
        lst (list): list

    Returns:
        int: returns int index for lex order

    Raises:
        VisualizationError: if length of list is not equal to k
    """
    if len(arg_2) != arg_1:
        raise VisualizationError("list should have length k")
    arg_3 = list(map(lambda x: arg_0 - 1 - x, arg_2))
    arg_4 = sum([n_choose_k(arg_3[arg_1 - 1 - i], i + 1) for i in range(arg_1)])
    return int(arg_4)

Return the lex index of a combination ..


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
arg_3
=
arg_0
.
_fetch
(
arg_1
)
if
arg_3
[
'data'
]
:
return
GiphyImage
(
arg_3
[
'data'
]
)
elif
arg_2
or
arg_0
.
strict
:
raise
GiphyApiException
(
"GIF with ID '%s' could not be found"
%
arg_1
)

def Func(arg_0, arg_1, arg_2=False):
        """
        Retrieves a specifc Func from giphy based on unique id

        :param Func_id: Unique giphy Func ID
        :type Func_id: string
        :param strict: Whether an exception should be raised when no results
        :type strict: boolean
        """
        arg_3 = arg_0._fetch(arg_1)

        if arg_3['data']:
            return GiphyImage(arg_3['data'])
        elif arg_2 or arg_0.strict:
            raise GiphyApiException(
                "GIF with ID '%s' could not be found" % arg_1)

Retrieves a specifc gif from giphy based on unique id

        :param gif_id: Unique giphy gif ID
        :type gif_id: string
        :param strict: Whether an exception should be raised when no results
        :type strict: boolean


def Func(arg_0, arg_1, arg_2):
        """
        Gets the MD5 hash of an object in Google Cloud Storage.

        :param bucket_name: The Google cloud storage bucket where the blob_name is.
        :type bucket_name: str
        :param object_name: The name of the object to check in the Google cloud
            storage bucket_name.
        :type object_name: str
        """
        arg_0.log.info('Retrieving the MD5 hash of '
                      'object: %s in bucket: %s', arg_2, arg_1)
        arg_3 = arg_0.get_conn()
        arg_4 = arg_3.get_bucket(arg_1=arg_1)
        arg_5 = arg_4.get_blob(blob_name=arg_2)
        arg_5.reload()
        arg_6 = arg_5.md5_hash
        arg_0.log.info('The md5Hash of %s is %s', arg_2, arg_6)
        return arg_6

Gets the MD5 hash of an object in Google Cloud Storage .


(self, start_date=None, end_date=None, **kwargs)

def Func(arg_0, arg_1=None, arg_2=None, **arg_3):
        """Run the query."""
        arg_1 = arg_0.extract_date(arg_1) if arg_1 else None
        arg_2 = arg_0.extract_date(arg_2) if arg_2 else None
        arg_0.validate_arguments(arg_1, arg_2, **arg_3)

        arg_4 = arg_0.build_query(arg_1, arg_2, **arg_3)
        arg_5 = arg_4.execute().to_dict()
        arg_6 = arg_0.process_query_result(arg_5, arg_1, arg_2)
        return arg_6


(query, params=None, config=None, conn=None, **kwargs)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
,
**
arg_4
)
:
if
arg_1
is
:
arg_1
=
{
}
if
arg_3
is
:
arg_3
=
Connection
.
get
(
DEFAULT_CONFIGURABLE
[
"uri"
]
)
elif
isinstance
(
arg_3
,
string_types
)
:
arg_3
=
Connection
.
get
(
arg_3
)
if
arg_2
is
:
arg_5
=
DEFAULT_CONFIGURABLE
.
copy
(
)
arg_4
.
update
(
arg_5
)
arg_2
=
DefaultConfigurable
(
**
arg_4
)
if
arg_0
.
strip
(
)
:
arg_1
=
extract_params_from_query
(
arg_0
,
arg_1
)
arg_6
=
arg_3
.
session
.
query
(
arg_0
,
arg_1
,
data_contents
=
arg_2
.
data_contents
)
if
arg_2
.
feedback
:
print
(
interpret_stats
(
arg_6
)
)
arg_7
=
ResultSet
(
arg_6
,
arg_0
,
arg_2
)
if
arg_2
.
auto_pandas
:
return
arg_7
.
get_dataframe
(
)
elif
arg_2
.
auto_networkx
:
arg_8
=
arg_7
.
get_graph
(
)
arg_7
.
draw
(
)
return
arg_8
else
:
return
arg_7
else
:
return
'Connected: %s'
%
arg_3
.
name

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, **arg_4):
    """Executes a query and depending on the options of the extensions will
    return raw data, a ``ResultSet``, a Pandas ``DataFrame`` or a
    NetworkX graph.

    :param query: string with the Cypher query
    :param params: dictionary with parameters for the query (default=``None``)
    :param config: Configurable or NamedTuple with extra IPython configuration
                   details. If ``None``, a new object will be created
                   (defaults=``None``)
    :param conn: connection dictionary or string for the Neo4j backend.
                 If ``None``, a new connection will be created
                 (default=``None``)
    :param **kwargs: Any of the cell configuration options.
    """
    if arg_1 is None:
        arg_1 = {}
    if arg_3 is None:
        arg_3 = Connection.get(DEFAULT_CONFIGURABLE["uri"])
    elif isinstance(arg_3, string_types):
        arg_3 = Connection.get(arg_3)
    if arg_2 is None:
        arg_5 = DEFAULT_CONFIGURABLE.copy()
        arg_4.update(arg_5)
        arg_2 = DefaultConfigurable(**arg_4)
    if arg_0.strip():
        # TODO: Handle multiple queries
        arg_1 = extract_params_from_query(arg_0, arg_1)
        arg_6 = arg_3.session.query(arg_0, arg_1,
                                    data_contents=arg_2.data_contents)
        if arg_2.feedback:
            print(interpret_stats(arg_6))
        arg_7 = ResultSet(arg_6, arg_0, arg_2)
        if arg_2.auto_pandas:
            return arg_7.get_dataframe()
        elif arg_2.auto_networkx:
            arg_8 = arg_7.get_graph()
            arg_7.draw()
            return arg_8
        else:
            return arg_7  # returning only last result, intentionally
    else:
        return 'Connected: %s' % arg_3.name

Executes a query and depending on the options of the extensions will return raw data a ResultSet a Pandas DataFrame or a NetworkX graph .


def Func(arg_0):
        """ Returns total length for this request.

        Returns:
            int. Length
        """
        arg_0._build_chunk_headers()

        arg_1 = 0

        if arg_0._data:
            for arg_2 in arg_0._data:
                arg_1 += len(arg_0._chunk_headers[arg_2])
                arg_1 += len(arg_0._data[arg_2])
                arg_1 += 2

        if arg_0._files:
            for arg_2 in arg_0._files:
                arg_1 += len(arg_0._chunk_headers[arg_2])
                arg_1 += arg_0._file_size(arg_2)
                arg_1 += 2

        arg_1 += len(arg_0.boundary)
        arg_1 += 6

        return arg_1


def Func ( arg_0 , arg_1 = 500 ) : arg_2 = { 'errors' : [ { 'status' : arg_1 , 'title' : arg_0 } ] } return make_response ( jsonify ( arg_2 ) , arg_1 )

def Func(arg_0, arg_1=500):
    ''' Return a response with a jsonapi error object
    '''
    arg_2 = {
        'errors': [{
            'status': arg_1,
            'title': arg_0
        }]
    }
    return make_response(jsonify(arg_2), arg_1)


def Func(arg_0):
    """
      Checks to see if a CatalogID has been ordered or not.

      Args:
        catalogID (str): The catalog ID from the platform catalog.
      Returns:
        ordered (bool): Whether or not the image has been ordered
    """
    arg_1 = 'https://rda.geobigdata.io/v1/stripMetadata/{}'.format(arg_0)
    arg_2 = Auth()
    arg_3 = _req_with_retries(arg_2.gbdx_connection, arg_1)
    if arg_3 is not None:
        return arg_3.status_code == 200
    return False

Checks to see if a CatalogID has been ordered or not .


def Func(arg_0, arg_1, arg_2):
        """
        Add a new member to the list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "status": string*, (Must be one of 'subscribed', 'unsubscribed', 'cleaned',
                'pending', or 'transactional')
            "email_address": string*
        }
        """
        arg_0.list_id = arg_1
        if 'status' not in arg_2:
            raise KeyError('The list member must have a status')
        if arg_2['status'] not in ['subscribed', 'unsubscribed', 'cleaned', 'pending', 'transactional']:
            raise ValueError('The list member status must be one of "subscribed", "unsubscribed", "cleaned", '
                             '"pending", or "transactional"')
        if 'email_address' not in arg_2:
            raise KeyError('The list member must have an email_address')
        check_email(arg_2['email_address'])
        arg_3 = arg_0._mc_client._post(url=arg_0._build_path(arg_1, 'members'), arg_2=arg_2)
        if arg_3 is not None:
            arg_0.subscriber_hash = arg_3['id']
        else:
            arg_0.subscriber_hash = None
        return arg_3


def Func ( arg_0 , arg_1 = 'AME2003' ) : arg_2 = arg_0 . df - Table ( arg_1 ) . df return Table ( arg_2 = arg_2 )

def Func(arg_0, arg_1='AME2003'):
        """
        Calculate Func difference

        Parameters
        ----------
        relative_to : string,
            a valid mass table name.

        Example:
        ----------
        >>> Table('DUZU').Func(relative_to='AME2003')
        """
        arg_2 = arg_0.df - Table(arg_1).df
        return Table(arg_2=arg_2)

Calculate error difference

        Parameters
        ----------
        relative_to : string,
            a valid mass table name.

        Example:
        ----------
        >>> Table('DUZU').error(relative_to='AME2003')


(cls, where='.', exclude=(), include=('*',))

def Func(arg_0, arg_1='.', arg_2=(), arg_3=('*',)):
        """Return a list all Python packages found within directory 'where'

        'where' should be supplied as a "cross-platform" (i.e. URL-style)
        path; it will be converted to the appropriate local path syntax.
        'exclude' is a sequence of package names to exclude; '*' can be used
        as a wildcard in the names, such that 'foo.*' will exclude all
        subpackages of 'foo' (but not 'foo' itself).

        'include' is a sequence of package names to include.  If it's
        specified, only the named packages will be included.  If it's not
        specified, all found packages will be included.  'include' can contain
        shell style wildcard patterns just like 'exclude'.

        The list of included packages is built up first and then any
        explicitly excluded packages are removed from it.
        """
        arg_4 = arg_0._Func_packages_iter(convert_path(arg_1))
        arg_4 = arg_0.require_parents(arg_4)
        arg_5 = arg_0._build_filter(*arg_3)
        arg_6 = arg_0._build_filter('ez_setup', '*__pycache__', *arg_2)
        arg_4 = filter(arg_5, arg_4)
        arg_4 = filterfalse(arg_6, arg_4)
        return list(arg_4)

Return a list all Python packages found within directory where


def Func(arg_0, arg_1, arg_2=None):
        """
        Infer type on the subexpr
        """
        arg_1.infer_node = InferNode(parent=arg_0.infer_node)
        arg_1.infer_type(arg_2=arg_2)


def Func ( arg_0 ) : from h2o . expr import ExprNode return h2o . H2OFrame . _expr ( expr = ExprNode ( "listTimeZones" ) ) . _frame ( )

def Func(arg_0):
        """Return the list of all known timezones."""
        from h2o.expr import ExprNode
        return h2o.H2OFrame._expr(expr=ExprNode("listTimeZones"))._frame()

Return the list of all known timezones .


def Func ( arg_0 , arg_1 = None ) : arg_0 = Path ( arg_0 ) if arg_1 is None : arg_1 = arg_0 . parent arg_1 = Path ( arg_1 ) arg_2 = tarfile . open ( arg_0 ) arg_2 . extractall ( arg_1 ) arg_2 . close ( )

def Func(arg_0, arg_1=None):
    """Simple tar archive extractor

    Args:
        file_path: path to the tar file to be extracted
        extract_folder: folder to which the files will be extracted

    """
    arg_0 = Path(arg_0)
    if arg_1 is None:
        arg_1 = arg_0.parent
    arg_1 = Path(arg_1)
    arg_2 = tarfile.open(arg_0)
    arg_2.extractall(arg_1)
    arg_2.close()


def Func(arg_0):
    """
    Sync the topologies with the statemgrs.
    """
    arg_0.state_managers = statemanagerfactory.get_all_state_managers(arg_0.config.statemgr_config)
    try:
      for arg_2 in arg_0.state_managers:
        arg_2.start()
    except Exception as ex:
      Log.error("Found exception while initializing state managers: %s. Bailing out..." % ex)
      traceback.print_exc()
      sys.exit(1)

    # pylint: disable=deprecated-lambda
    def on_topologies_watch(arg_2, arg_3):
      """watch topologies"""
      Log.info("State watch triggered for topologies.")
      Log.debug("Topologies: " + str(arg_3))
      arg_4 = arg_0.getTopologiesForStateLocation(arg_2.name)
      arg_5 = map(lambda t: t.name, arg_4)
      Log.debug("Existing topologies: " + str(arg_5))
      for arg_6 in arg_5:
        if arg_6 not in arg_3:
          Log.info("Removing topology: %s in rootpath: %s",
                   arg_6, arg_2.rootpath)
          arg_0.removeTopology(arg_6, arg_2.name)

      for arg_6 in arg_3:
        if arg_6 not in arg_5:
          arg_0.addNewTopology(arg_2, arg_6)

    for arg_2 in arg_0.state_managers:
      # The callback function with the bound
      # state_manager as first variable.
      arg_7 = partial(on_topologies_watch, arg_2)
      arg_2.get_topologies(arg_7)

Sync the topologies with the statemgrs .


(self, os_path=None, skip_sub_command=False,
                   disk_closed_callback=None)

def Func(arg_0, arg_1=None, arg_2=False,
                   arg_3=None):
        """
        A context manager yielding a debug-output-suitable file-like
        object based on the optional os_path and optionally skipping
        any configured sub-command.

        :param os_path: Optional path to base the file-like object
            on.
        :param skip_sub_command: Set True to skip any configured
            sub-command filter.
        :param disk_closed_callback: If the backing of the file-like
            object is an actual file that will be closed,
            disk_closed_callback (if set) will be called with the
            on-disk path just after closing it.
        """
        arg_4 = None if arg_2 else arg_0.debug_sub_command
        arg_5, arg_6 = arg_0._get_out_and_path(
            arg_0.debug, arg_0.debug_root, arg_4, arg_1)
        try:
            if hasattr(arg_5, 'stdin'):
                yield arg_5.stdin
            else:
                yield arg_5
        finally:
            if hasattr(arg_5, 'stdin'):
                arg_0._close(arg_5.stdin)
            arg_0._wait(arg_5, arg_6)
            arg_0._close(arg_5)
            if arg_3 and arg_6:
                arg_3(arg_6)

A context manager yielding a debug - output - suitable file - like object based on the optional os_path and optionally skipping any configured sub - command .


def Func(arg_0, arg_1):
  """
  Construct an elementary rotation matrix describing a rotation around the x, y, or z-axis.

  Parameters
  ----------

  axis          - Axis around which to rotate ("x", "y", or "z")
  rotationAngle - the rotation angle in radians

  Returns
  -------

  The rotation matrix

  Example usage
  -------------

  rotmat = Func("y", pi/6.0)
  """
  if (arg_0=="x" or arg_0=="X"):
    return array([[1.0, 0.0, 0.0], [0.0, cos(arg_1), sin(arg_1)], [0.0,
      -sin(arg_1), cos(arg_1)]])
  elif (arg_0=="y" or arg_0=="Y"):
    return array([[cos(arg_1), 0.0, -sin(arg_1)], [0.0, 1.0, 0.0], [sin(arg_1),
      0.0, cos(arg_1)]])
  elif (arg_0=="z" or arg_0=="Z"):
    return array([[cos(arg_1), sin(arg_1), 0.0], [-sin(arg_1),
      cos(arg_1), 0.0], [0.0, 0.0, 1.0]])
  else:
    raise Exception("Unknown rotation axis "+arg_0+"!")

Construct an elementary rotation matrix describing a rotation around the x, y, or z-axis.

  Parameters
  ----------

  axis          - Axis around which to rotate ("x", "y", or "z")
  rotationAngle - the rotation angle in radians

  Returns
  -------

  The rotation matrix

  Example usage
  -------------

  rotmat = elementaryRotationMatrix("y", pi/6.0)

Construct an elementary rotation matrix describing a rotation around the x y or z - axis .


def
Func
(
arg_0
,
arg_1
=
'lightbg'
)
:
arg_1
=
arg_1
.
lower
(
)
if
arg_1
==
'lightbg'
:
arg_0
.
style_sheet
=
styles
.
default_light_style_sheet
arg_0
.
syntax_style
=
styles
.
default_light_syntax_style
elif
arg_1
==
'linux'
:
arg_0
.
style_sheet
=
styles
.
default_dark_style_sheet
arg_0
.
syntax_style
=
styles
.
default_dark_syntax_style
elif
arg_1
==
'nocolor'
:
arg_0
.
style_sheet
=
styles
.
default_bw_style_sheet
arg_0
.
syntax_style
=
styles
.
default_bw_syntax_style
else
:
raise
KeyError
(
"No such color scheme: %s"
%
arg_1
)

def Func(arg_0, arg_1='lightbg'):
        """ Sets the widget style to the class defaults.

        Parameters:
        -----------
        colors : str, optional (default lightbg)
            Whether to use the default IPython light background or dark
            background or B&W style.
        """
        arg_1 = arg_1.lower()
        if arg_1=='lightbg':
            arg_0.style_sheet = styles.default_light_style_sheet
            arg_0.syntax_style = styles.default_light_syntax_style
        elif arg_1=='linux':
            arg_0.style_sheet = styles.default_dark_style_sheet
            arg_0.syntax_style = styles.default_dark_syntax_style
        elif arg_1=='nocolor':
            arg_0.style_sheet = styles.default_bw_style_sheet
            arg_0.syntax_style = styles.default_bw_syntax_style
        else:
            raise KeyError("No such color scheme: %s"%arg_1)

Sets the widget style to the class defaults .


def
Func
(
arg_0
)
:
if
not
isinstance
(
arg_0
.
value
,
ops
.
EagerTensor
)
:
raise
NotImplementedError
(
"value argument must be a EagerTensor."
)
return
arg_0
.
value
.
Func
(
)

def Func(arg_0):
    """Value as NumPy array, only available for TF Eager."""
    if not isinstance(arg_0.value, ops.EagerTensor):
      raise NotImplementedError("value argument must be a EagerTensor.")

    return arg_0.value.Func()

Value as NumPy array only available for TF Eager .


return sorted([
            {
                "id": member.id,
                "label": str(member.get_label(lang=lang)),
                "model": str(member.model),
                "type": str(member.type),
                "size": member.size
            }
            for member in self.resolver.getMetadata().members
        ], key=itemgetter("label"))

def Func ( arg_0 , arg_1 = None ) : return sorted ( [ { "id" : arg_2 . id , "label" : str ( arg_2 . get_label ( arg_1 = arg_1 ) ) , "model" : str ( arg_2 . model ) , "type" : str ( arg_2 . type ) , "size" : arg_2 . size } for arg_2 in arg_0 . resolver . getMetadata ( ) . members ] , key = itemgetter ( "label" ) )

def Func(arg_0, arg_1=None):
        """ Retrieve main parent collections of a repository

        :param lang: Language to retrieve information in
        :return: Sorted collections representations
        """
        return sorted([
            {
                "id": arg_2.id,
                "label": str(arg_2.get_label(arg_1=arg_1)),
                "model": str(arg_2.model),
                "type": str(arg_2.type),
                "size": arg_2.size
            }
            for arg_2 in arg_0.resolver.getMetadata().members
        ], key=itemgetter("label"))


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_2 = arg_2 or { } arg_3 = { 'type' : 'Yandex' , 'id' : arg_1 , } if arg_2 : arg_3 [ 'params' ] = '%s' % arg_2 arg_0 . analytics . append ( arg_3 )

def Func(arg_0, arg_1, arg_2=None):
        """Configure Yandex Metrika analytics counter.

        :param str|unicode ident: Metrika counter ID.

        :param dict params: Additional params.

        """
        arg_2 = arg_2 or {}

        arg_3 = {
            'type': 'Yandex',
            'id': arg_1,
        }

        if arg_2:
            arg_3['params'] = '%s' % arg_2

        arg_0.analytics.append(arg_3)

Configure Yandex Metrika analytics counter .


def
Func
(
arg_0
=
)
:
if
arg_0
is
:
arg_0
=
sys
.
argv
[
1
:
]
try
:
arg_1
=
time
.
clock
(
)
arg_2
=
CoverageScript
(
)
.
command_line
(
arg_0
)
arg_3
=
time
.
clock
(
)
if
0
:
print
(
"time: %.3fs"
%
(
arg_3
arg_1
)
)
except
ExceptionDuringRun
:
arg_4
,
arg_5
,
arg_4
=
sys
.
exc_info
(
)
traceback
.
print_exception
(
*
arg_5
.
args
)
arg_2
=
ERR
except
CoverageException
:
arg_4
,
arg_5
,
arg_4
=
sys
.
exc_info
(
)
print
(
arg_5
)
arg_2
=
ERR
except
SystemExit
:
arg_4
,
arg_5
,
arg_4
=
sys
.
exc_info
(
)
if
arg_5
.
args
:
arg_2
=
arg_5
.
args
[
0
]
else
:
arg_2
=
return
arg_2

def Func(arg_0=None):
    """The Func entry point to Coverage.

    This is installed as the script entry point.

    """
    if arg_0 is None:
        arg_0 = sys.argv[1:]
    try:
        arg_1 = time.clock()
        arg_2 = CoverageScript().command_line(arg_0)
        arg_3 = time.clock()
        if 0:
            print("time: %.3fs" % (arg_3 - arg_1))
    except ExceptionDuringRun:
        # An exception was caught while running the product code.  The
        # sys.exc_info() return tuple is packed into an ExceptionDuringRun
        # exception.
        arg_4, arg_5, arg_4 = sys.exc_info()
        traceback.print_exception(*arg_5.args)
        arg_2 = ERR
    except CoverageException:
        # A controlled error inside coverage.py: print the message to the user.
        arg_4, arg_5, arg_4 = sys.exc_info()
        print(arg_5)
        arg_2 = ERR
    except SystemExit:
        # The user called `sys.exit()`.  Exit with their argument, if any.
        arg_4, arg_5, arg_4 = sys.exc_info()
        if arg_5.args:
            arg_2 = arg_5.args[0]
        else:
            arg_2 = None
    return arg_2

The main entry point to Coverage.

    This is installed as the script entry point.


def Func ( arg_0 , arg_1 ) : arg_2 = { 'basketItemId' : arg_1 , 'wizardItemDelete' : False } return arg_0 . __post ( '/Basket/RemoveBasketItem' , json = arg_2 )

def Func(arg_0, arg_1):
        '''
        Remove an item from the current basket.

        :param int idx: Basket item id.
        :return: A response having removed an item from the current basket.
        :rtype: requests.Response
        '''
        arg_2 = {
            'basketItemId': arg_1,
            'wizardItemDelete': False
        }

        return arg_0.__post('/Basket/RemoveBasketItem', json=arg_2)

Remove an item from the current basket .


def Func(arg_0, arg_1):
  """
  Return the result from dividing two dicts that represent date and time.

  Both dividend and divisor are dicts that contain one or more of the following
  keys: 'years', 'months', 'weeks', 'days', 'hours', 'minutes', seconds',
  'milliseconds', 'microseconds'.

  For example:

  ::

    Func({'hours': 4}, {'minutes': 15}) == 16

  :param dividend: (dict) The numerator, as a dict representing a date and time
  :param divisor: (dict) the denominator, as a dict representing a date and time
  :returns: (float) number of times divisor goes into dividend

  """

  # Convert each into microseconds
  arg_2 = aggregationToMonthsSeconds(arg_0)
  arg_3 = aggregationToMonthsSeconds(arg_1)

  # It is a usage error to mix both months and seconds in the same operation
  if (arg_2['months'] != 0 and arg_3['seconds'] != 0) \
    or (arg_2['seconds'] != 0 and arg_3['months'] != 0):
    raise RuntimeError("Aggregation dicts with months/years can only be "
      "inter-operated with other aggregation dicts that contain "
      "months/years")

  if arg_2['months'] > 0:
    return float(arg_2['months']) / arg_1['months']

  else:
    return float(arg_2['seconds']) / arg_3['seconds']

Return the result from dividing two dicts that represent date and time.

  Both dividend and divisor are dicts that contain one or more of the following
  keys: 'years', 'months', 'weeks', 'days', 'hours', 'minutes', seconds',
  'milliseconds', 'microseconds'.

  For example:

  ::

    aggregationDivide({'hours': 4}, {'minutes': 15}) == 16

  :param dividend: (dict) The numerator, as a dict representing a date and time
  :param divisor: (dict) the denominator, as a dict representing a date and time
  :returns: (float) number of times divisor goes into dividend

Return the result from dividing two dicts that represent date and time .


def
Func
(
arg_0
,
arg_1
=
"00000000"
)
:
arg_2
=
False
arg_0
.
setContext
(
"Func"
)
try
:
if
not
arg_0
.
requestA
(
)
:
arg_0
.
writeCmdMsg
(
"Bad read CRC on setting"
)
else
:
if
not
arg_0
.
serialCmdPwdAuth
(
arg_1
)
:
arg_0
.
writeCmdMsg
(
"Password failure"
)
else
:
arg_3
=
"0157310230304433282903"
arg_3
+=
arg_0
.
calc_crc16
(
arg_3
[
2
:
]
.
decode
(
"hex"
)
)
arg_0
.
m_serial_port
.
write
(
arg_3
.
decode
(
"hex"
)
)
if
arg_0
.
m_serial_port
.
getResponse
(
arg_0
.
getContext
(
)
)
.
encode
(
"hex"
)
==
"06"
:
arg_0
.
writeCmdMsg
(
"Success: 06 returned."
)
arg_2
=
True
arg_0
.
serialPostEnd
(
)
except
:
ekm_log
(
traceback
.
format_exc
(
sys
.
exc_info
(
)
)
)
arg_0
.
setContext
(
""
)
return
arg_2

def Func(arg_0, arg_1="00000000"):
        """ Serial call to zero resettable kWh registers.

        Args:
            password (str): Optional password.

        Returns:
            bool: True on completion and ACK.
        """
        arg_2 = False
        arg_0.setContext("Func")
        try:
            if not arg_0.requestA():
                arg_0.writeCmdMsg("Bad read CRC on setting")
            else:
                if not arg_0.serialCmdPwdAuth(arg_1):
                    arg_0.writeCmdMsg("Password failure")
                else:
                    arg_3 = "0157310230304433282903"
                    arg_3 += arg_0.calc_crc16(arg_3[2:].decode("hex"))
                    arg_0.m_serial_port.write(arg_3.decode("hex"))
                    if arg_0.m_serial_port.getResponse(arg_0.getContext()).encode("hex") == "06":
                        arg_0.writeCmdMsg("Success: 06 returned.")
                        arg_2 = True
            arg_0.serialPostEnd()
        except:
            ekm_log(traceback.format_exc(sys.exc_info()))

        arg_0.setContext("")
        return arg_2

Serial call to zero resettable kWh registers .


(module_name: str, keep_database: bool = True)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 = True ) -> None : arg_4 = get_data_dir ( arg_0 ) if not os . path . exists ( arg_4 ) : return for arg_5 in os . listdir ( arg_4 ) : if arg_5 in { 'config.ini' , 'cfg.ini' } : continue if arg_5 == 'cache.db' and arg_2 : continue arg_6 = os . path . join ( arg_4 , arg_5 ) if os . path . isdir ( arg_6 ) : shutil . rmtree ( arg_6 ) else : os . remove ( arg_6 ) os . rmdir ( arg_4 )

def Func(arg_0: arg_1, arg_2: arg_3 = True) -> None:
    """Clear all downloaded files."""
    arg_4 = get_data_dir(arg_0)
    if not os.path.exists(arg_4):
        return
    for arg_5 in os.listdir(arg_4):
        if arg_5 in {'config.ini', 'cfg.ini'}:
            continue
        if arg_5 == 'cache.db' and arg_2:
            continue
        arg_6 = os.path.join(arg_4, arg_5)
        if os.path.isdir(arg_6):
            shutil.rmtree(arg_6)
        else:
            os.remove(arg_6)

        os.rmdir(arg_4)


Add new requirements that must be fulfilled for this bump to occur

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 if isinstance ( arg_1 , list ) else [ arg_1 ] for arg_1 in arg_2 : if not isinstance ( arg_1 , BumpRequirement ) : arg_1 = BumpRequirement ( arg_1 ) arg_1 . Funcd = True arg_1 . Funcd_by = arg_0 arg_0 . Funcments . append ( arg_1 )

def Func(arg_0, arg_1):
        """ Add new Funcments that must be fulfilled for this bump to occur """
        arg_2 = arg_1 if isinstance(arg_1, list) else [arg_1]

        for arg_1 in arg_2:
            if not isinstance(arg_1, BumpRequirement):
                arg_1 = BumpRequirement(arg_1)
            arg_1.Funcd = True
            arg_1.Funcd_by = arg_0
            arg_0.Funcments.append(arg_1)


def Func(arg_0, arg_1=True):
        """
        Returns a dict of termination statistics

        Parameters
        ----------
            get_cos : Bool, optional
                Whether or not to calcualte the cosine of the residuals
                with the tangent plane of the model using the current J.
                The calculation may take some time. Default is True

        Returns
        -------
            dict
                Has keys
                    delta_vals  : The last change in parameter values.
                    delta_err   : The last change in the error.
                    exp_err     : The expected (last) change in the error.
                    frac_err    : The fractional change in the error.
                    num_iter    : The number of iterations completed.
                    error       : The current error.
        """
        arg_2 = arg_0._last_vals - arg_0.param_vals
        arg_3 = arg_0._last_error - arg_0.error
        arg_4 = arg_3 / arg_0.error
        arg_5 = {'delta_vals':arg_2, 'delta_err':arg_3,
                'num_iter':1*arg_0._num_iter, 'frac_err':arg_4,
                'error':arg_0.error, 'exp_err':arg_0._exp_err}
        if arg_1:
            arg_6 = arg_0.calc_model_cosine()
            arg_5.update({'model_cosine':arg_6})
        return arg_5


(
            self, object_id, security_enabled_only, additional_properties=None, custom_headers=None, raw=False, **operation_config)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
,
arg_5
=
False
,
**
arg_6
)
:
arg_7
=
models
.
UserGetMemberGroupsParameters
(
arg_3
=
arg_3
,
arg_2
=
arg_2
)
def
internal_paging
(
arg_8
=
,
arg_5
=
False
)
:
if
not
arg_8
:
arg_9
=
arg_0
.
Func
.
metadata
[
'url'
]
arg_10
=
{
'objectId'
:
arg_0
.
_serialize
.
url
(
"object_id"
,
arg_1
,
'str'
)
,
'tenantID'
:
arg_0
.
_serialize
.
url
(
"self.config.tenant_id"
,
arg_0
.
config
.
tenant_id
,
'str'
)
}
arg_9
=
arg_0
.
_client
.
format_url
(
arg_9
,
**
arg_10
)
arg_11
=
{
}
arg_11
[
'api-version'
]
=
arg_0
.
_serialize
.
query
(
"self.api_version"
,
arg_0
.
api_version
,
'str'
)
else
:
arg_9
=
arg_8
arg_11
=
{
}
arg_12
=
{
}
arg_12
[
'Accept'
]
=
'application/json'
arg_12
[
'Content-Type'
]
=
'application/json; charset=utf-8'
if
arg_0
.
config
.
generate_client_request_id
:
arg_12
[
'x-ms-client-request-id'
]
=
str
(
uuid
.
uuid1
(
)
)
if
arg_4
:
arg_12
.
update
(
arg_4
)
if
arg_0
.
config
.
accept_language
is
not
:
arg_12
[
'accept-language'
]
=
arg_0
.
_serialize
.
header
(
"self.config.accept_language"
,
arg_0
.
config
.
accept_language
,
'str'
)
arg_13
=
arg_0
.
_serialize
.
body
(
arg_7
,
'UserGetMemberGroupsParameters'
)
arg_14
=
arg_0
.
_client
.
post
(
arg_9
,
arg_11
,
arg_12
,
arg_13
)
arg_15
=
arg_0
.
_client
.
send
(
arg_14
,
stream
=
False
,
**
arg_6
)
if
arg_15
.
status_code
not
in
[
200
]
:
raise
models
.
GraphErrorException
(
arg_0
.
_deserialize
,
arg_15
)
return
arg_15
arg_16
=
models
.
StrPaged
(
internal_paging
,
arg_0
.
_deserialize
.
dependencies
)
if
arg_5
:
arg_17
=
{
}
arg_18
=
models
.
StrPaged
(
internal_paging
,
arg_0
.
_deserialize
.
dependencies
,
arg_17
)
return
arg_18
return
arg_16

def Func(
            arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=False, **arg_6):
        """Gets a collection that contains the object IDs of the groups of which
        the user is a member.

        :param object_id: The object ID of the user for which to get group
         membership.
        :type object_id: str
        :param security_enabled_only: If true, only membership in
         security-enabled groups should be checked. Otherwise, membership in
         all groups should be checked.
        :type security_enabled_only: bool
        :param additional_properties: Unmatched properties from the message
         are deserialized this collection
        :type additional_properties: dict[str, object]
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: An iterator like instance of str
        :rtype: ~azure.graphrbac.models.StrPaged[str]
        :raises:
         :class:`GraphErrorException<azure.graphrbac.models.GraphErrorException>`
        """
        arg_7 = models.UserGetMemberGroupsParameters(arg_3=arg_3, arg_2=arg_2)

        def internal_paging(arg_8=None, arg_5=False):

            if not arg_8:
                # Construct URL
                arg_9 = arg_0.Func.metadata['url']
                arg_10 = {
                    'objectId': arg_0._serialize.url("object_id", arg_1, 'str'),
                    'tenantID': arg_0._serialize.url("self.config.tenant_id", arg_0.config.tenant_id, 'str')
                }
                arg_9 = arg_0._client.format_url(arg_9, **arg_10)

                # Construct parameters
                arg_11 = {}
                arg_11['api-version'] = arg_0._serialize.query("self.api_version", arg_0.api_version, 'str')

            else:
                arg_9 = arg_8
                arg_11 = {}

            # Construct headers
            arg_12 = {}
            arg_12['Accept'] = 'application/json'
            arg_12['Content-Type'] = 'application/json; charset=utf-8'
            if arg_0.config.generate_client_request_id:
                arg_12['x-ms-client-request-id'] = str(uuid.uuid1())
            if arg_4:
                arg_12.update(arg_4)
            if arg_0.config.accept_language is not None:
                arg_12['accept-language'] = arg_0._serialize.header("self.config.accept_language", arg_0.config.accept_language, 'str')

            # Construct body
            arg_13 = arg_0._serialize.body(arg_7, 'UserGetMemberGroupsParameters')

            # Construct and send request
            arg_14 = arg_0._client.post(arg_9, arg_11, arg_12, arg_13)
            arg_15 = arg_0._client.send(arg_14, stream=False, **arg_6)

            if arg_15.status_code not in [200]:
                raise models.GraphErrorException(arg_0._deserialize, arg_15)

            return arg_15

        # Deserialize response
        arg_16 = models.StrPaged(internal_paging, arg_0._deserialize.dependencies)

        if arg_5:
            arg_17 = {}
            arg_18 = models.StrPaged(internal_paging, arg_0._deserialize.dependencies, arg_17)
            return arg_18

        return arg_16

Gets a collection that contains the object IDs of the groups of which the user is a member .


def Func ( arg_0 ) : arg_1 = { 'psf-kfki' : 'kfki' , 'psf-alpha' : 'alpha' , 'psf-n2n1' : 'n2n1' , 'psf-sigkf' : 'sigkf' , 'psf-sph6-ab' : 'sph6_ab' , 'psf-laser-wavelength' : 'laser_wavelength' , 'psf-pinhole-width' : 'pinhole_width' } arg_2 = [ arg_0 . zscale , 'psf-zslab' ] arg_3 = { } for arg_4 , arg_5 in iteritems ( arg_1 ) : if arg_4 in arg_0 . param_dict : arg_3 [ arg_5 ] = arg_0 . param_dict [ arg_4 ] arg_3 . update ( { 'polar_angle' : arg_0 . polar_angle , 'normalize' : arg_0 . normalize , 'include_K3_det' : arg_0 . use_J1 } ) if arg_0 . polychromatic : arg_3 . update ( { 'nkpts' : arg_0 . nkpts } ) arg_3 . update ( { 'k_dist' : arg_0 . k_dist } ) if arg_0 . do_pinhole : arg_3 . update ( { 'nlpts' : arg_0 . num_line_pts } ) arg_3 . update ( { 'use_laggauss' : True } ) return arg_3

def Func(arg_0):
        """
        Pack the parameters into the form necessary for the integration
        routines above.  For example, packs for calculate_linescan_psf
        """
        arg_1 = {
            'psf-kfki': 'kfki',
            'psf-alpha': 'alpha',
            'psf-n2n1': 'n2n1',
            'psf-sigkf': 'sigkf',
            'psf-sph6-ab': 'sph6_ab',
            'psf-laser-wavelength': 'laser_wavelength',
            'psf-pinhole-width': 'pinhole_width'
        }
        arg_2 = [arg_0.zscale, 'psf-zslab']

        arg_3 = {}
        for arg_4,arg_5 in iteritems(arg_1):
            if arg_4 in arg_0.param_dict:
                arg_3[arg_5] = arg_0.param_dict[arg_4]

        arg_3.update({
            'polar_angle': arg_0.polar_angle,
            'normalize': arg_0.normalize,
            'include_K3_det':arg_0.use_J1
        })

        if arg_0.polychromatic:
            arg_3.update({'nkpts': arg_0.nkpts})
            arg_3.update({'k_dist': arg_0.k_dist})

        if arg_0.do_pinhole:
            arg_3.update({'nlpts': arg_0.num_line_pts})

        arg_3.update({'use_laggauss': True})
        return arg_3

Pack the parameters into the form necessary for the integration routines above . For example packs for calculate_linescan_psf


(data_file, node_name='/', which='user', compress=False)

def
Func
(
arg_0
,
arg_1
=
'/'
,
arg_2
=
'user'
,
arg_3
=
False
)
:
arg_4
=
arg_0
.
get_node
(
arg_1
)
print
(
'List of attributes for:\n  %s\n'
%
arg_4
)
for
arg_5
in
arg_4
.
_v_attrs
.
_f_list
(
)
:
print
(
'\t%s'
%
arg_5
)
arg_6
=
repr
(
arg_4
.
_v_attrs
[
arg_5
]
)
if
arg_3
:
arg_6
=
arg_6
.
split
(
'\n'
)
[
0
]
print
(
"\t    %s"
%
arg_6
)

def Func(arg_0, arg_1='/', arg_2='user', arg_3=False):
    """Print the HDF5 attributes for `node_name`.

    Parameters:
        data_file (pytables HDF5 file object): the data file to print
        node_name (string): name of the path inside the file to be printed.
            Can be either a group or a leaf-node. Default: '/', the root node.
        which (string): Valid values are 'user' for user-defined attributes,
            'sys' for pytables-specific attributes and 'all' to print both
            groups of attributes. Default 'user'.
        compress (bool): if True displays at most a line for each attribute.
            Default False.
    """
    arg_4 = arg_0.get_node(arg_1)
    print ('List of attributes for:\n  %s\n' % arg_4)
    for arg_5 in arg_4._v_attrs._f_list():
        print ('\t%s' % arg_5)
        arg_6 = repr(arg_4._v_attrs[arg_5])
        if arg_3:
            arg_6 = arg_6.split('\n')[0]
        print ("\t    %s" % arg_6)

Print the HDF5 attributes for node_name .


return self.api.put(self.metadata_field_path(field), data={ "value": value })

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . api . put ( arg_0 . metadata_field_path ( arg_1 ) , data = { "value" : arg_2 } )

def Func(arg_0, arg_1, arg_2):
    """ Generic method for a resource's Update Metadata Field endpoint.

    Example endpoints:

    * `Update Device Metadata Field <https://m2x.att.com/developer/documentation/v2/device#Update-Device-Metadata-Field>`_
    * `Update Distribution Metadata Field <https://m2x.att.com/developer/documentation/v2/distribution#Update-Distribution-Metadata-Field>`_
    * `Update Collection Metadata Field <https://m2x.att.com/developer/documentation/v2/collections#Update-Collection-Metadata-Field>`_

    :param field: The metadata field to be updated
    :param value: The value to update

    :return: The API response, see M2X API docs for details
    :rtype: dict

    :raises: :class:`~requests.exceptions.HTTPError` if an error occurs when sending the HTTP request
    """
    return arg_0.api.put(arg_0.metadata_field_path(arg_1), data={ "value": arg_2 })

Generic method for a resource s Update Metadata Field endpoint .


def Func ( arg_0 ) : try : arg_1 = load ( open ( arg_0 . file ) , Loader ) except ( UnicodeDecodeError , YAMLError ) as e : raise InvalidConfig ( arg_0 . file , '{}' . format ( e ) ) try : validate ( arg_1 , SCHEMA ) except ValidationError as e : raise InvalidConfig ( arg_0 . file , e ) arg_0 . update ( arg_1 )

def Func(arg_0):
        """Parse and validate the config file. The Func data is accessible as a dictionary in this instance

        :return: None
        """
        try:
            arg_1 = load(open(arg_0.file), Loader)
        except (UnicodeDecodeError, YAMLError) as e:
            raise InvalidConfig(arg_0.file, '{}'.format(e))
        try:
            validate(arg_1, SCHEMA)
        except ValidationError as e:
            raise InvalidConfig(arg_0.file, e)
        arg_0.update(arg_1)

Parse and validate the config file. The read data is accessible as a dictionary in this instance

        :return: None

Parse and validate the config file . The read data is accessible as a dictionary in this instance


def Func ( arg_0 , arg_1 ) : from sregistry . database . models import Collection arg_2 = arg_0 . get_collection ( arg_1 ) if arg_2 is None : arg_2 = Collection ( arg_1 = arg_1 ) arg_0 . session . add ( arg_2 ) arg_0 . session . commit ( ) return arg_2

def Func(arg_0, arg_1):
    '''get a collection if it exists. If it doesn't exist, create it first.

    Parameters
    ==========
    name: the collection name, usually parsed from get_image_names()['name']

    '''
    from sregistry.database.models import Collection
    arg_2 = arg_0.get_collection(arg_1)

    # If it doesn't exist, create it
    if arg_2 is None:
        arg_2 = Collection(arg_1=arg_1)
        arg_0.session.add(arg_2)
        arg_0.session.commit()

    return arg_2

get a collection if it exists . If it doesn t exist create it first .


def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . ax . transAxes . transform ( ( 0 , 0 ) ) arg_3 , arg_4 = arg_0 . ax . transAxes . transform ( ( 1 , 1 ) ) arg_5 = arg_3 - arg_1 if arg_0 . x else arg_4 - arg_2 return arg_5

def Func(arg_0):
        """Compute distance.
        """
        arg_1, arg_2 = arg_0.ax.transAxes.transform(  # pylint: disable=invalid-name
            (0, 0))
        arg_3, arg_4 = arg_0.ax.transAxes.transform(  # pylint: disable=invalid-name
            (1, 1))
        arg_5 = arg_3 - arg_1 if arg_0.x else arg_4 - arg_2
        return arg_5


(gaussian_samples, amp: float, center: float, sigma: float,
                        zeroed_width: Union[None, float] = None, rescale_amp: bool = False,
                        ret_scale_factor: bool = False)

def Func(arg_0, arg_1: arg_2, arg_3: arg_2, arg_4: arg_2,
                        arg_5: arg_6[None, arg_2] = None, arg_7: arg_8 = False,
                        arg_9: arg_8 = False) -> np.ndarray:
    r"""Enforce that the supplied gaussian pulse is zeroed at a specific width.

    This is acheived by subtracting $\Omega_g(center \pm zeroed_width/2)$ from all samples.

    amp: Pulse amplitude at `2\times center+1`.
    center: Center (mean) of pulse.
    sigma: Width (standard deviation) of pulse.
    zeroed_width: Subtract baseline to gaussian pulses to make sure
             $\Omega_g(center \pm zeroed_width/2)=0$ is satisfied. This is used to avoid
             large discontinuities at the start of a gaussian pulse. If unsupplied,
             defaults to $2*(center+1)$ such that the samples are zero at $\Omega_g(-1)$.
    rescale_amp: If `zeroed_width` is not `None` and `rescale_amp=True` the pulse will
                 be rescaled so that $\Omega_g(center)-\Omega_g(center\pm zeroed_width/2)=amp$.
    ret_scale_factor: Return amplitude scale factor.
    """
    if arg_5 is None:
        arg_5 = 2*(arg_3+1)

    arg_10 = gaussian(np.array([-arg_5/2]), arg_1, arg_3, arg_4)
    arg_0 -= arg_10
    arg_11 = 1.
    if arg_7:
        arg_11 = arg_1/(arg_1-arg_10)
        arg_0 *= arg_11

    if arg_9:
        return arg_0, arg_11
    return arg_0

r Enforce that the supplied gaussian pulse is zeroed at a specific width .


def Func ( arg_0 , arg_1 = None ) : arg_1 = arg_1 or { } arg_1 . setdefault ( '__builtins__' , { } ) exec ( arg_0 . _code , arg_1 ) return arg_1

def Func(arg_0, arg_1=None):
        """exec compiled code"""
        arg_1 = arg_1 or {}
        arg_1.setdefault('__builtins__', {})
        exec(arg_0._code, arg_1)
        return arg_1


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_1 . get ( 'from_date' , datetime ( 1990 , 1 , 1 ) ) arg_3 = arg_1 . get ( 'to_date' , datetime . today ( ) ) arg_4 = random . choice ( arg_0 . input_formats or formats . get_format ( 'DATETIME_INPUT_FORMATS' ) ) return xunit . any_datetime ( arg_2 = arg_2 , arg_3 = arg_3 ) . strftime ( arg_4 )

def Func(arg_0, **arg_1):
    """
    Return random value for DateTimeField

    >>> result = any_form_field(forms.DateTimeField())
    >>> type(result)
    <type 'str'>
    """
    arg_2 = arg_1.get('from_date', datetime(1990, 1, 1))
    arg_3 = arg_1.get('to_date', datetime.today())
    arg_4 = random.choice(arg_0.input_formats or formats.get_format('DATETIME_INPUT_FORMATS'))
    return xunit.any_datetime(arg_2=arg_2, arg_3=arg_3).strftime(arg_4)


def Func(arg_0):
        """Build the set of arguments required for running a job"""

        arg_1 = {}
        arg_1['qitems'] = Q_STORAGE_ITEMS
        arg_1['task_id'] = arg_0.task_id

        # Backend parameters
        arg_1['backend'] = arg_0.backend
        arg_2 = copy.deepcopy(arg_0.backend_args)

        if 'next_from_date' in arg_2:
            arg_2['from_date'] = arg_2.pop('next_from_date')

        if 'next_offset' in arg_2:
            arg_2['offset'] = arg_2.pop('next_offset')

        arg_1['backend_args'] = arg_2

        # Category
        arg_1['category'] = arg_0.category

        # Archiving parameters
        arg_3 = arg_0.archiving_cfg
        arg_1['archive_args'] = arg_3.to_dict() if arg_3 else None

        # Scheduler parameters
        arg_4 = arg_0.scheduling_cfg
        arg_1['max_retries'] = arg_4.max_retries if arg_4 else MAX_JOB_RETRIES

        return arg_1


def Func ( arg_0 ) : if arg_0 . server and arg_0 . server . error : try : if capybara . Funcs : raise arg_0 . server . error finally : arg_0 . server . reset_error ( )

def Func(arg_0):
        """ Raise errors encountered by the server. """
        if arg_0.server and arg_0.server.error:
            try:
                if capybara.Funcs:
                    raise arg_0.server.error
            finally:
                arg_0.server.reset_error()

Raise errors encountered by the server .


def Func ( arg_0 ) : with open ( arg_0 . series_file , "wb" ) as f : for arg_1 in arg_0 . patchlines : f . write ( _encode_str ( str ( arg_1 ) ) ) f . write ( b"\n" )

def Func(arg_0):
        """ Saves current patches list in the series file """
        with open(arg_0.series_file, "wb") as f:
            for arg_1 in arg_0.patchlines:
                f.write(_encode_str(str(arg_1)))
                f.write(b"\n")


(wave, npoints=None, indep_min=None, indep_max=None, unwrap=True, rad=True)

return phase(ifft(wave, npoints, indep_min, indep_max), unwrap=unwrap, rad=rad)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = True , arg_5 = True ) : return phase ( ifft ( arg_0 , arg_1 , arg_2 , arg_3 ) , arg_4 = arg_4 , arg_5 = arg_5 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=True, arg_5=True):
    r"""
    Return the phase of the inverse Fast Fourier Transform of a waveform.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param npoints: Number of points to use in the transform. If **npoints**
                    is less than the size of the independent variable vector
                    the waveform is truncated; if **npoints** is greater than
                    the size of the independent variable vector, the waveform
                    is zero-padded
    :type  npoints: positive integer

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :param unwrap: Flag that indicates whether phase should change phase shifts
                   to their :code:`2*pi` complement (True) or not (False)
    :type  unwrap: boolean

    :param rad: Flag that indicates whether phase should be returned in radians
                (True) or degrees (False)
    :type  rad: boolean

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.Func

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

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

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

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

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

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

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

     * RuntimeError (Non-uniform frequency spacing)

    .. [[[end]]]
    """
    return phase(ifft(arg_0, arg_1, arg_2, arg_3), arg_4=arg_4, arg_5=arg_5)

r"""
    Return the phase of the inverse Fast Fourier Transform of a waveform.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param npoints: Number of points to use in the transform. If **npoints**
                    is less than the size of the independent variable vector
                    the waveform is truncated; if **npoints** is greater than
                    the size of the independent variable vector, the waveform
                    is zero-padded
    :type  npoints: positive integer

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :param unwrap: Flag that indicates whether phase should change phase shifts
                   to their :code:`2*pi` complement (True) or not (False)
    :type  unwrap: boolean

    :param rad: Flag that indicates whether phase should be returned in radians
                (True) or degrees (False)
    :type  rad: boolean

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.ifftp

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

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

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

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

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

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

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

     * RuntimeError (Non-uniform frequency spacing)

    .. [[[end]]]

r Return the phase of the inverse Fast Fourier Transform of a waveform .


def Func ( arg_0 ) : arg_1 = arg_0 . _rdd if arg_0 . _ordered else arg_0 . _rdd . sortByKey ( ) arg_2 = arg_1 . values ( ) . collect ( ) return asarray ( arg_2 ) . reshape ( arg_0 . shape )

def Func(arg_0):
        """
        Returns the contents as a local array.

        Will likely cause memory problems for large objects.
        """
        arg_1 = arg_0._rdd if arg_0._ordered else arg_0._rdd.sortByKey()
        arg_2 = arg_1.values().collect()
        return asarray(arg_2).reshape(arg_0.shape)


def Func(arg_0, arg_1, arg_2):
        """
        This method will send an extended data analog output command to the selected pin

        :param pin: 0 - 127

        :param data: 0 - 0xfffff
        """
        arg_3 = [arg_1, arg_2 & 0x7f, (arg_2 >> 7) & 0x7f, (arg_2 >> 14) & 0x7f]
        arg_0._command_handler.send_sysex(arg_0._command_handler.EXTENDED_ANALOG, arg_3)


return self.append(FredkinGate(), [ctl, tgt1, tgt2], [])

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : return arg_0 . append ( FredkinGate ( ) , [ arg_1 , arg_2 , arg_3 ] , [ ] )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Apply Fredkin to circuit."""
    return arg_0.append(FredkinGate(), [arg_1, arg_2, arg_3], [])


return Operators.ITEBV(256, s1 == 0, 0, result)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , arg_4 = to_signed ( arg_1 ) , to_signed ( arg_2 ) arg_5 = Operators . ITEBV ( 256 , arg_3 < 0 , - 1 , 1 ) try : arg_6 = ( Operators . ABS ( arg_3 ) % Operators . ABS ( arg_4 ) ) * arg_5 except ZeroDivisionError : arg_6 = 0 return Operators . ITEBV ( 256 , arg_4 == 0 , 0 , arg_6 )

def Func(arg_0, arg_1, arg_2):
        """Signed modulo remainder operation"""
        arg_3, arg_4 = to_signed(arg_1), to_signed(arg_2)
        arg_5 = Operators.ITEBV(256, arg_3 < 0, -1, 1)
        try:
            arg_6 = (Operators.ABS(arg_3) % Operators.ABS(arg_4)) * arg_5
        except ZeroDivisionError:
            arg_6 = 0

        return Operators.ITEBV(256, arg_4 == 0, 0, arg_6)


def
Func
(
arg_0
,
arg_1
=
65
,
arg_2
=
'identicon'
)
:
arg_3
=
get_gravatar_url
(
arg_0
,
arg_1
=
arg_1
,
arg_2
=
arg_2
)
if
arg_3
:
return
safe
(
'<img src="%s" class="gravatar">'
%
arg_3
)
return
''

def Func(arg_0, arg_1=65, arg_2='identicon'):
    """Returns Gravatar image HTML tag for a given string or UserModel.

    Example:

        {% load gravatar %}
        {% Func user_model %}

    :param UserModel, str obj:
    :param int size:
    :param str default:
    :return:
    """
    arg_3 = get_gravatar_url(arg_0, arg_1=arg_1, arg_2=arg_2)
    if arg_3:
        return safe('<img src="%s" class="gravatar">' % arg_3)
    return ''

Returns Gravatar image HTML tag for a given string or UserModel.

    Example:

        {% load gravatar %}
        {% gravatar_get_img user_model %}

    :param UserModel, str obj:
    :param int size:
    :param str default:
    :return:

Returns Gravatar image HTML tag for a given string or UserModel .


def Func ( arg_0 , Func ) : _set_params ( arg_0 . ode_obj , 'StopCFM' , Func , arg_0 . ADOF + arg_0 . LDOF )

def Func(arg_0, Func):
        '''Set the CFM values for this object's DOF limits.

        Parameters
        ----------
        stop_cfms : float or sequence of float
            A CFM value to set on all degrees of freedom limits, or a list
            containing one such value for each degree of freedom limit.
        '''
        _set_params(arg_0.ode_obj, 'StopCFM', Func, arg_0.ADOF + arg_0.LDOF)

Set the CFM values for this object s DOF limits .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . by_key . get ( arg_1 . key ) if arg_2 is not None and arg_2 not in arg_1 : raise VersionConflict ( arg_2 , arg_1 ) else : return arg_2

def Func(arg_0, arg_1):
        """Find a distribution matching requirement `req`

        If there is an active distribution for the requested project, this
        returns it as long as it meets the version requirement specified by
        `req`.  But, if there is an active distribution for the project and it
        does *not* meet the `req` requirement, ``VersionConflict`` is raised.
        If there is no active distribution for the requested project, ``None``
        is returned.
        """
        arg_2 = arg_0.by_key.get(arg_1.key)
        if arg_2 is not None and arg_2 not in arg_1:
            # XXX add more info
            raise VersionConflict(arg_2, arg_1)
        else:
            return arg_2

Find a distribution matching requirement req


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
not
in
SOXI_ARGS
:
raise
ValueError
(
"Invalid argument '{}' to SoXI"
.
format
(
arg_1
)
)
arg_2
=
[
'sox'
,
'--i'
]
arg_2
.
append
(
"-{}"
.
format
(
arg_1
)
)
arg_2
.
append
(
arg_0
)
try
:
arg_3
=
subprocess
.
check_output
(
arg_2
,
stderr
=
subprocess
.
PIPE
)
except
CalledProcessError
as
cpe
:
logger
.
info
(
"SoXI error message: {}"
.
format
(
cpe
.
output
)
)
raise
SoxiError
(
"SoXI failed with exit code {}"
.
format
(
cpe
.
returncode
)
)
arg_3
=
arg_3
.
decode
(
"utf-8"
)
return
str
(
arg_3
)
.
strip
(
'\n'
)

def Func(arg_0, arg_1):
    ''' Base call to SoXI.

    Parameters
    ----------
    filepath : str
        Path to audio file.

    argument : str
        Argument to pass to SoXI.

    Returns
    -------
    shell_output : str
        Command line output of SoXI
    '''

    if arg_1 not in SOXI_ARGS:
        raise ValueError("Invalid argument '{}' to SoXI".format(arg_1))

    arg_2 = ['sox', '--i']
    arg_2.append("-{}".format(arg_1))
    arg_2.append(arg_0)

    try:
        arg_3 = subprocess.check_output(
            arg_2,
            stderr=subprocess.PIPE
        )
    except CalledProcessError as cpe:
        logger.info("SoXI error message: {}".format(cpe.output))
        raise SoxiError("SoXI failed with exit code {}".format(cpe.returncode))

    arg_3 = arg_3.decode("utf-8")

    return str(arg_3).strip('\n')


def Func ( arg_0 ) : if arg_0 . conn . indices . exists ( index = arg_0 . index ) : arg_0 . conn . indices . delete ( index = arg_0 . index )

def Func(arg_0):
        '''Deletes the underlying ES index.

        Only use this if you know what you're doing. This destroys
        the entire underlying ES index, which could be shared by
        multiple distinct ElasticStore instances.
        '''
        if arg_0.conn.indices.exists(index=arg_0.index):
            arg_0.conn.indices.delete(index=arg_0.index)


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
arg_5
=
min
(
_count_leading
(
arg_1
,
"\t"
)
,
_count_leading
(
arg_2
,
"\t"
)
)
arg_5
=
min
(
arg_5
,
_count_leading
(
arg_3
[
:
arg_5
]
,
" "
)
)
arg_5
=
min
(
arg_5
,
_count_leading
(
arg_4
[
:
arg_5
]
,
" "
)
)
arg_3
=
arg_3
[
arg_5
:
]
.
rstrip
(
)
arg_4
=
arg_4
[
arg_5
:
]
.
rstrip
(
)
yield
"- "
+
arg_1
if
arg_3
:
yield
"? %s%s\n"
%
(
"\t"
*
arg_5
,
arg_3
)
yield
"+ "
+
arg_2
if
arg_4
:
yield
"? %s%s\n"
%
(
"\t"
*
arg_5
,
arg_4
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        r"""
        Format "?" output and deal with leading tabs.

        Example:

        >>> d = Differ()
        >>> results = d.Func('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
        ...                      '  ^ ^  ^      ', '  ^ ^  ^      ')
        >>> for line in results: print repr(line)
        ...
        '- \tabcDefghiJkl\n'
        '? \t ^ ^  ^\n'
        '+ \tabcdefGhijkl\n'
        '? \t ^ ^  ^\n'
        """

        # Can hurt, but will probably help most of the time.
        arg_5 = min(_count_leading(arg_1, "\t"),
                     _count_leading(arg_2, "\t"))
        arg_5 = min(arg_5, _count_leading(arg_3[:arg_5], " "))
        arg_5 = min(arg_5, _count_leading(arg_4[:arg_5], " "))
        arg_3 = arg_3[arg_5:].rstrip()
        arg_4 = arg_4[arg_5:].rstrip()

        yield "- " + arg_1
        if arg_3:
            yield "? %s%s\n" % ("\t" * arg_5, arg_3)

        yield "+ " + arg_2
        if arg_4:
            yield "? %s%s\n" % ("\t" * arg_5, arg_4)

r"""
        Format "?" output and deal with leading tabs.

        Example:

        >>> d = Differ()
        >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
        ...                      '  ^ ^  ^      ', '  ^ ^  ^      ')
        >>> for line in results: print repr(line)
        ...
        '- \tabcDefghiJkl\n'
        '? \t ^ ^  ^\n'
        '+ \tabcdefGhijkl\n'
        '? \t ^ ^  ^\n'

r Format ? output and deal with leading tabs .


def Func ( arg_0 , arg_1 ) : try : del arg_0 . cache [ arg_1 ] arg_0 . mark_updated ( ) return True except KeyError : return False

def Func(arg_0, arg_1):
        """Tries to remove cached tweets."""
        try:
            del arg_0.cache[arg_1]
            arg_0.mark_updated()
            return True
        except KeyError:
            return False


def Func ( arg_0 , arg_1 , arg_2 = 'canstrat' ) : with open ( arg_1 ) as f : arg_3 = f . read ( ) arg_4 = parse_canstrat ( arg_3 ) arg_5 = [ ] for arg_6 in arg_4 [ 7 ] : if arg_6 . pop ( 'skip' ) : continue arg_7 = arg_6 . pop ( 'top' ) arg_8 = arg_6 . pop ( 'base' ) arg_9 = [ Component ( { 'lithology' : arg_6 [ 'rtc' ] , 'colour' : arg_6 [ 'colour_name' ] } ) ] arg_10 = Interval ( arg_7 = arg_7 , arg_8 = arg_8 , components = arg_9 , arg_4 = arg_6 ) arg_5 . append ( arg_10 ) return arg_0 ( arg_5 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2='canstrat'):
        """
        Eat a Canstrat DAT file and make a striplog.
        """
        with open(arg_1) as f:
            arg_3 = f.read()

        arg_4 = parse_canstrat(arg_3)

        arg_5 = []
        for arg_6 in arg_4[7]:  # 7 is the 'card type' for lithology info.
            if arg_6.pop('skip'):
                continue
            arg_7 = arg_6.pop('top')
            arg_8 = arg_6.pop('base')
            arg_9 = [Component({'lithology': arg_6['rtc'],
                                'colour': arg_6['colour_name']
                                })]
            arg_10 = Interval(arg_7=arg_7, arg_8=arg_8, components=arg_9, arg_4=arg_6)
            arg_5.append(arg_10)

        return arg_0(arg_5, arg_2=arg_2)

Eat a Canstrat DAT file and make a striplog .


def Func(arg_0):
        """
        Returns true if at least one tracker detects a change.
        """
        arg_1 = arg_0.last_manifest
        for arg_2 in arg_0.get_trackers():
            arg_3 = arg_1['_tracker_%s' % arg_2.get_natural_key_hash()]
            if arg_2.is_changed(arg_3):
                return True
        return False

Returns true if at least one tracker detects a change .


return c.clean_year_month(year, month, month_orig)

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_4 = c . get_now ( ) arg_5 = arg_4 . year arg_6 = arg_4 . month + arg_1 arg_7 = None if 'cal_ignore=true' not in arg_2 : if 'year' and 'month' in arg_0 . kwargs : arg_5 , arg_7 = map ( int , ( arg_0 . kwargs [ 'year' ] , arg_0 . kwargs [ 'month' ] ) ) arg_6 = arg_7 + arg_1 else : try : arg_5 = int ( arg_0 . request . GET [ 'cal_year' ] ) arg_7 = int ( arg_0 . request . GET [ 'cal_month' ] ) arg_6 = arg_7 + arg_1 except Exception : pass return c . clean_year_month ( arg_5 , arg_6 , arg_7 )

def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Get the year and month. First tries from kwargs, then from
        querystrings. If none, or if cal_ignore qs is specified,
        sets year and month to this year and this month.
        """
        arg_4 = c.get_now()
        arg_5 = arg_4.year
        arg_6 = arg_4.month + arg_1
        arg_7 = None

        if 'cal_ignore=true' not in arg_2:
            if 'year' and 'month' in arg_0.kwargs:  # try kwargs
                arg_5, arg_7 = map(
                    int, (arg_0.kwargs['year'], arg_0.kwargs['month'])
                )
                arg_6 = arg_7 + arg_1
            else:
                try:  # try querystring
                    arg_5 = int(arg_0.request.GET['cal_year'])
                    arg_7 = int(arg_0.request.GET['cal_month'])
                    arg_6 = arg_7 + arg_1
                except Exception:
                    pass
        # return the year and month, and any errors that may have occurred do
        # to an invalid month/year being given.
        return c.clean_year_month(arg_5, arg_6, arg_7)

Get the year and month . First tries from kwargs then from querystrings . If none or if cal_ignore qs is specified sets year and month to this year and this month .


(self, service_name, deployment_name, role_name, complete = False)

return self._perform_delete(path,
                                    as_async=True)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4 = False):
        '''
        Deletes the specified virtual machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        complete:
            True if all OS/data disks and the source blobs for the disks should
            also be deleted from storage.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)

        arg_5 = arg_0._get_role_path(arg_1, arg_2, arg_3)

        if arg_4 == True:
            arg_5 = arg_5 +'?comp=media'

        return arg_0._perform_delete(arg_5,
                                    as_async=True)


def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
)
:
if
arg_1
is
:
arg_1
=
arg_0
.
connectedPerm
if
arg_2
is
:
arg_2
=
arg_0
.
activationThreshold
arg_3
,
arg_4
=
0
,
0
for
arg_5
,
arg_6
in
itertools
.
product
(
xrange
(
arg_0
.
numberOfCols
)
,
xrange
(
arg_0
.
cellsPerColumn
)
)
:
(
arg_7
,
arg_8
)
=
arg_0
.
_FuncInCell
(
colIdx
=
arg_5
,
cellIdx
=
arg_6
,
segList
=
arg_0
.
cells
[
arg_5
]
[
arg_6
]
,
arg_1
=
arg_1
,
arg_2
=
arg_2
)
arg_3
+=
arg_7
arg_4
+=
arg_8
if
arg_0
.
verbosity
>=
5
:
print
"Cells, all segments:"
arg_0
.
printCells
(
predictedOnly
=
False
)
return
arg_3
,
arg_4

def Func(arg_0, arg_1=None, arg_2=None):
    """
    This method deletes all synapses whose permanence is less than
    minPermanence and deletes any segments that have less than
    minNumSyns synapses remaining.

    :param minPermanence: (float) Any syn whose permanence is 0 or <
           ``minPermanence``  will be deleted. If None is passed in, then
           ``self.connectedPerm`` is used.
    :param minNumSyns: (int) Any segment with less than ``minNumSyns`` synapses
           remaining in it will be deleted. If None is passed in, then
           ``self.activationThreshold`` is used.
    :returns: (tuple) ``numSegsRemoved``, ``numSynsRemoved``
    """
    # Fill in defaults
    if arg_1 is None:
      arg_1 = arg_0.connectedPerm
    if arg_2 is None:
      arg_2 = arg_0.activationThreshold

    # Loop through all cells
    arg_3, arg_4 = 0, 0
    for arg_5, arg_6 in itertools.product(xrange(arg_0.numberOfCols),
                                  xrange(arg_0.cellsPerColumn)):

      (arg_7, arg_8) = arg_0._FuncInCell(
          colIdx=arg_5, cellIdx=arg_6, segList=arg_0.cells[arg_5][arg_6],
          arg_1=arg_1, arg_2=arg_2)
      arg_3 += arg_7
      arg_4 += arg_8

    # Print all cells if verbosity says to
    if arg_0.verbosity >= 5:
      print "Cells, all segments:"
      arg_0.printCells(predictedOnly=False)

    return arg_3, arg_4

This method deletes all synapses whose permanence is less than minPermanence and deletes any segments that have less than minNumSyns synapses remaining .


def Func(arg_0, arg_1, arg_2):
        '''Given a list of layers, find the layer output with the given name.

        Parameters
        ----------
        name : str
            Name of a layer to resolve.
        layers : list of :class:`theanets.layers.base.Layer`
            A list of layers to search in.

        Raises
        ------
        util.ConfigurationError :
            If there is no such layer, or if there are more than one.

        Returns
        -------
        name : str
            The fully-scoped name of the desired output.
        shape : tuple of None and/or int
            The shape of the named output.
        '''
        arg_3 = [arg_4 for arg_4 in arg_2 if arg_1.split(':')[0] == arg_4.name]
        if len(arg_3) != 1:
            raise util.ConfigurationError(
                'layer "{}" cannot resolve "{}" using {}'
                .format(arg_0.name, arg_1, [arg_4.name for arg_4 in arg_2]))
        arg_1 = arg_1 if ':' in arg_1 else arg_3[0].output_name
        return arg_1, arg_3[0]._output_shapes[arg_1.split(':')[1]]

Given a list of layers find the layer output with the given name .


(mol, dihedrals, scale, banned_lines=None)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Scale dihedral angles"""

        if arg_3 is None:
                arg_3 = []
        arg_4 = []
        for arg_5 in arg_0.dihedrals:
                arg_6 = arg_5.atom1.get_atomtype(), arg_5.atom2.get_atomtype(), arg_5.atom3.get_atomtype(), arg_5.atom4.get_atomtype()
                arg_6 = [a.replace("_", "").replace("=","") for a in arg_6]

                # special-case: this is a [ dihedral ] override in molecule block, continue and don't match
                if arg_5.gromacs['param'] != []:
                    for arg_7 in arg_5.gromacs['param']:
                        arg_7['kch'] *= arg_2
                    arg_4.append(arg_5)
                    continue

                for arg_8 in range(32):
                        if  (arg_8%2==0 ):
                                arg_9=arg_6[0]; arg_10=arg_6[1]; arg_11=arg_6[2]; arg_12=arg_6[3]
                        else:
                                arg_9=arg_6[3]; arg_10=arg_6[2]; arg_11=arg_6[1]; arg_12=arg_6[0]

                        if((arg_8//2)%2==1): arg_9="X";
                        if((arg_8//4)%2==1): arg_10="X";
                        if((arg_8//8)%2==1): arg_11="X";
                        if((arg_8//16)%2==1): arg_12="X";
                        arg_13 = "{0}-{1}-{2}-{3}-{4}".format(arg_9, arg_10, arg_11, arg_12, arg_5.gromacs['func'])
                        if (arg_13 in arg_1):
                                for arg_14, arg_15 in enumerate(arg_1[arg_13]):
                                        arg_16 = copy.deepcopy(arg_5)
                                        arg_17 = copy.deepcopy(arg_15.gromacs['param'])
                                        # Only check the first dihedral in a list
                                        if not arg_1[arg_13][0].line in arg_3:
                                                for arg_7 in arg_17: arg_7['kchi'] *= arg_2
                                        arg_16.gromacs['param'] = arg_17
                                        #if key == "CT3-C-NH1-CT1-9": print i, dt, key
                                        if arg_14 == 0:
                                                arg_16.comment = "; banned lines {0} found={1}\n".format(" ".join(
                                                        map(str, arg_3)), 1 if arg_15.line in arg_3 else 0)
                                                arg_16.comment += "; parameters for types {}-{}-{}-{}-9 at LINE({})\n".format(
                                                        arg_16.atom1.atomtype, arg_16.atom2.atomtype, arg_16.atom3.atomtype,
                                                        arg_16.atom4.atomtype, arg_15.line).replace("_","")
                                        arg_20 = "{}-{}-{}-{}-9".format(arg_16.atom1.atomtype, arg_16.atom2.atomtype,
                                                                      arg_16.atom3.atomtype, arg_16.atom4.atomtype).replace("_","")
                                        #if name == "CL-CTL2-CTL2-HAL2-9": print dihedrals[key], key
                                        arg_4.append(arg_16)
                                break

        arg_0.dihedrals = arg_4
        #assert(len(mol.dihedrals) == new_dihedrals)
        return arg_0


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { } arg_4 = deepcopy ( arg_1 ) arg_4 [ 'pending' ] = [ ] arg_4 [ 'date' ] = dt . datetime . now ( ) arg_5 = [ 'disease_associated_transcripts' , 'inheritance_models' , 'reduced_penetrance' , 'mosaicism' , 'database_entry_version' , 'comment' ] arg_6 = [ ] for arg_7 in arg_1 . get ( 'pending' , [ ] ) : arg_8 = arg_7 [ 'hgnc_id' ] if arg_7 [ 'action' ] != 'add' : arg_3 [ arg_8 ] = arg_7 continue arg_9 = arg_7 . get ( 'info' , { } ) arg_10 = { 'hgnc_id' : arg_8 , 'symbol' : arg_7 [ 'symbol' ] } for arg_11 in arg_5 : if arg_11 in arg_9 : arg_10 [ arg_11 ] = arg_9 [ arg_11 ] arg_6 . append ( arg_10 ) for arg_12 in arg_1 [ 'genes' ] : arg_8 = arg_12 [ 'hgnc_id' ] if arg_8 not in arg_3 : arg_6 . append ( arg_12 ) continue arg_13 = arg_3 [ arg_8 ] arg_14 = arg_13 [ 'action' ] arg_9 = arg_13 [ 'info' ] if arg_14 == 'delete' : continue elif arg_14 == 'edit' : for arg_11 in arg_5 : if arg_11 in arg_9 : arg_12 [ arg_11 ] = arg_9 [ arg_11 ] arg_6 . append ( arg_12 ) arg_4 [ 'genes' ] = arg_6 arg_4 [ 'version' ] = float ( arg_2 ) arg_15 = None if arg_4 [ 'version' ] == arg_1 [ 'version' ] : arg_16 = arg_0 . panel_collection . find_one_and_replace ( { '_id' : arg_1 [ '_id' ] } , arg_4 , return_document = pymongo . ReturnDocument . AFTER ) arg_15 = arg_16 [ '_id' ] else : arg_4 . pop ( '_id' ) arg_1 [ 'is_archived' ] = True arg_0 . update_panel ( arg_1 = arg_1 , date_obj = arg_1 [ 'date' ] ) arg_15 = arg_0 . panel_collection . insert_one ( arg_4 ) . inserted_id return arg_15

def Func(arg_0, arg_1, arg_2):
        """Apply the pending changes to an existing gene panel or create a new version of the same panel.

        Args:
            panel_obj(dict): panel in database to update
            version(double): panel version to update

        Returns:
            inserted_id(str): id of updated panel or the new one
        """

        arg_3 = {}
        arg_4 = deepcopy(arg_1)
        arg_4['pending'] = []
        arg_4['date'] = dt.datetime.now()
        arg_5 = ['disease_associated_transcripts', 'inheritance_models', 'reduced_penetrance',
            'mosaicism', 'database_entry_version', 'comment']
        arg_6 = []

        for arg_7 in arg_1.get('pending', []):
            arg_8 = arg_7['hgnc_id']

            # If action is add we create a new gene object
            if arg_7['action'] != 'add':
                arg_3[arg_8] = arg_7
                continue
            arg_9 = arg_7.get('info', {})
            arg_10 = {
                'hgnc_id': arg_8,
                'symbol': arg_7['symbol']
            }

            for arg_11 in arg_5:
                if arg_11 in arg_9:
                    arg_10[arg_11] = arg_9[arg_11]
            arg_6.append(arg_10)

        for arg_12 in arg_1['genes']:
            arg_8 = arg_12['hgnc_id']

            if arg_8 not in arg_3:
                arg_6.append(arg_12)
                continue

            arg_13 = arg_3[arg_8]
            arg_14 = arg_13['action']
            arg_9 = arg_13['info']

            # If action is delete we do not add the gene to new genes
            if arg_14 == 'delete':
                continue

            elif arg_14 == 'edit':
                for arg_11 in arg_5:
                    if arg_11 in arg_9:
                        arg_12[arg_11] = arg_9[arg_11]
                arg_6.append(arg_12)

        arg_4['genes'] = arg_6
        arg_4['version'] = float(arg_2)

        arg_15 = None
        # if the same version of the panel should be updated
        if arg_4['version'] == arg_1['version']:
            # replace panel_obj with new_panel
            arg_16 = arg_0.panel_collection.find_one_and_replace(
                {'_id':arg_1['_id']},
                arg_4,
                return_document=pymongo.ReturnDocument.AFTER
            )
            arg_15 = arg_16['_id']
        else: # create a new version of the same panel
            arg_4.pop('_id')

            # archive the old panel
            arg_1['is_archived'] = True
            arg_0.update_panel(arg_1=arg_1, date_obj=arg_1['date'])

            # insert the new panel
            arg_15 = arg_0.panel_collection.insert_one(arg_4).inserted_id

        return arg_15

Apply the pending changes to an existing gene panel or create a new version of the same panel .


def Func ( arg_0 , arg_1 ) : arg_2 = [ [ ] ] arg_3 = arg_1 . cols for arg_4 in arg_0 . compute_content ( arg_1 ) : if arg_3 == 0 : arg_2 . append ( [ ] ) arg_3 = arg_1 . cols arg_3 -= 1 arg_2 [ - 1 ] . append ( arg_4 ) while len ( arg_2 [ - 1 ] ) < arg_3 : arg_2 [ - 1 ] . append ( "" ) return arg_2

def Func(arg_0, arg_1):
        """trick to get table content without actually writing it

        return an aligned list of lists containing table cells values as string
        """
        arg_2 = [[]]
        arg_3 = arg_1.cols
        for arg_4 in arg_0.compute_content(arg_1):
            if arg_3 == 0:
                arg_2.append([])
                arg_3 = arg_1.cols
            arg_3 -= 1
            arg_2[-1].append(arg_4)
        # fill missing cells
        while len(arg_2[-1]) < arg_3:
            arg_2[-1].append("")
        return arg_2


def Func(arg_0, arg_1, arg_2=True):
    """
    Converts `data` into a byte representation and calls update on the hasher
    `hashlib.HASH` algorithm.

    Args:
        hasher (HASH): instance of a hashlib algorithm
        data (object): ordered data with structure
        types (bool): include type prefixes in the hash

    Example:
        >>> hasher = hashlib.sha512()
        >>> data = [1, 2, ['a', 2, 'c']]
        >>> Func(hasher, data)
        >>> print(hasher.hexdigest()[0:8])
        e2c67675

        2ba8d82b
    """
    # Determine if the data should be hashed directly or iterated through
    if isinstance(arg_1, (tuple, list, zip)):
        arg_3 = True
    else:
        arg_3 = any(check(arg_1) for check in
                              _HASHABLE_EXTENSIONS.iterable_checks)

    if arg_3:
        # Denote that we are hashing over an iterable
        # Multiple structure bytes makes it harder accidently make conflicts
        arg_4 = b'_,_'
        arg_5 = b'_[_'
        arg_6 = b'_]_'

        arg_7 = iter(arg_1)
        arg_0.update(arg_5)
        # first, try to nest quickly without recursive calls
        # (this works if all data in the sequence is a non-iterable)
        try:
            for arg_8 in arg_7:
                arg_9, arg_10 = _convert_to_hashable(arg_8, arg_2)
                arg_11 = arg_9 + arg_10 + arg_4
                arg_0.update(arg_11)
        except TypeError:
            # need to use recursive calls
            # Update based on current item
            Func(arg_0, arg_8, arg_2)
            for arg_8 in arg_7:
                # Ensure the items have a spacer between them
                Func(arg_0, arg_8, arg_2)
                arg_0.update(arg_4)
        arg_0.update(arg_6)
    else:
        arg_9, arg_10 = _convert_to_hashable(arg_1, arg_2)
        arg_11 = arg_9 + arg_10
        arg_0.update(arg_11)

Converts `data` into a byte representation and calls update on the hasher
    `hashlib.HASH` algorithm.

    Args:
        hasher (HASH): instance of a hashlib algorithm
        data (object): ordered data with structure
        types (bool): include type prefixes in the hash

    Example:
        >>> hasher = hashlib.sha512()
        >>> data = [1, 2, ['a', 2, 'c']]
        >>> _update_hasher(hasher, data)
        >>> print(hasher.hexdigest()[0:8])
        e2c67675

        2ba8d82b

Converts data into a byte representation and calls update on the hasher hashlib . HASH algorithm .


return dict(
            current_page=self.current_page,
            total_page_count=self.total_page_count,
            items=self.items,
            total_item_count=self.total_item_count,
            page_size=self.page_size
        )

def Func(arg_0):
        '''
        Convert Paginator instance to dict

        :return: Paging data
        :rtype: dict
        '''

        return dict(
            current_page=arg_0.current_page,
            total_page_count=arg_0.total_page_count,
            items=arg_0.items,
            total_item_count=arg_0.total_item_count,
            page_size=arg_0.page_size
        )


(self,
                         dst=None,
                         filters=all_true,
                         compress=True,
                         overwrite=False,
                         makedirs=False,
                         verbose=False)

def Func(arg_0,
                         arg_1=None,
                         arg_2=arg_3,
                         arg_4=True,
                         arg_5=False,
                         arg_6=False,
                         arg_7=False):  # pragma: no cover
        """
        Make a zip archive.

        :param dst: output file path. if not given, will be automatically assigned.
        :param filters: custom path filter. By default it allows any file.
        :param compress: compress or not.
        :param overwrite: overwrite exists or not.
        :param verbose: display log or not.
        :return:
        """
        arg_0.assert_exists()

        if arg_1 is None:
            arg_1 = arg_0._auto_zip_archive_dst()
        else:
            arg_1 = arg_0.change(new_abspath=arg_1)

        if not arg_1.basename.lower().endswith(".zip"):
            raise ValueError("zip archive name has to be endswith '.zip'!")

        if arg_1.exists():
            if not arg_5:
                raise IOError("'%s' already exists!" % arg_1)

        if arg_4:
            arg_8 = ZIP_DEFLATED
        else:
            arg_8 = ZIP_STORED

        if not arg_1.parent.exists():
            if arg_6:
                os.makedirs(arg_1.parent.abspath)

        if arg_7:
            arg_9 = "Making zip archive for '%s' ..." % arg_0
            print(arg_9)

        arg_10 = os.getcwd()

        if arg_0.is_dir():
            arg_11 = 0
            arg_12 = list()
            for arg_13 in arg_0.glob("**/*"):
                if arg_2(arg_13):
                    arg_12.append(arg_13)
                    arg_11 += arg_13.size

            if arg_7:
                arg_9 = "Got {} files, total size is {}, compressing ...".format(
                    len(arg_12), repr_data_size(arg_11),
                )
                print(arg_9)

            with ZipFile(arg_1.abspath, "w", arg_8) as f:
                os.chdir(arg_0.abspath)
                for arg_13 in arg_12:
                    arg_14 = arg_13.relative_to(arg_0).__str__()
                    f.write(arg_14)

        elif arg_0.is_file():
            with ZipFile(arg_1.abspath, "w", arg_8) as f:
                os.chdir(arg_0.parent.abspath)
                f.write(arg_0.basename)

        os.chdir(arg_10)

        if arg_7:
            arg_9 = "Complete! Archive size is {}.".format(arg_1.size_in_text)
            print(arg_9)


def
Func
(
arg_0
)
:
_flush
(
)
sys
.
stderr
.
write
(
"\033[1;37;41mERROR: {}\033[0m\n"
.
format
(
arg_0
)
)
sys
.
stderr
.
flush
(
)

def Func(arg_0):
    """Emit an Func message to stderr."""
    _flush()
    sys.stderr.write("\033[1;37;41mERROR: {}\033[0m\n".format(arg_0))
    sys.stderr.flush()


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
os
.
path
.
normpath
(
arg_1
)
if
arg_2
!=
arg_1
:
raise
ValueError
(
"{} is not normalized."
.
format
(
arg_1
)
)
for
arg_3
in
iter_data_dirs
(
)
:
arg_4
=
os
.
path
.
join
(
arg_3
,
arg_1
)
if
os
.
path
.
exists
(
arg_4
)
:
return
arg_4
arg_3
=
next
(
iter_data_dirs
(
True
)
)
arg_4
=
os
.
path
.
join
(
arg_3
,
arg_1
)
log
.
info
(
"Downloading {} to {}"
.
format
(
arg_0
,
arg_4
)
)
arg_5
=
urlopen
(
arg_0
)
if
arg_5
.
getcode
(
)
!=
200
:
raise
ValueError
(
"HTTP {}"
.
format
(
arg_5
.
getcode
(
)
)
)
arg_3
=
os
.
path
.
dirname
(
arg_4
)
try
:
os
.
makedirs
(
arg_3
)
except
OSError
as
e
:
if
e
.
errno
!=
errno
.
EEXIST
:
raise
arg_6
=
arg_4
+
'.tmp'
with
open
(
arg_6
,
'wb'
)
as
fh
:
while
True
:
arg_7
=
arg_5
.
read
(
8196
)
if
arg_7
:
fh
.
write
(
arg_7
)
else
:
break
os
.
rename
(
arg_6
,
arg_4
)
return
arg_4

def Func(arg_0, arg_1):

    """Download the data at a URL, and cache it under the given name.

    The file is stored under `pyav/test` with the given name in the directory
    :envvar:`PYAV_TESTDATA_DIR`, or the first that is writeable of:

    - the current virtualenv
    - ``/usr/local/share``
    - ``/usr/local/lib``
    - ``/usr/share``
    - ``/usr/lib``
    - the user's home

    """

    arg_2 = os.path.normpath(arg_1)
    if arg_2 != arg_1:
        raise ValueError("{} is not normalized.".format(arg_1))

    for arg_3 in iter_data_dirs():
        arg_4 = os.path.join(arg_3, arg_1)
        if os.path.exists(arg_4):
            return arg_4

    arg_3 = next(iter_data_dirs(True))
    arg_4 = os.path.join(arg_3, arg_1)

    log.info("Downloading {} to {}".format(arg_0, arg_4))

    arg_5 = urlopen(arg_0)
    if arg_5.getcode() != 200:
        raise ValueError("HTTP {}".format(arg_5.getcode()))

    arg_3 = os.path.dirname(arg_4)
    try:
        os.makedirs(arg_3)
    except OSError as e:
        if e.errno != errno.EEXIST:
            raise

    arg_6 = arg_4 + '.tmp'
    with open(arg_6, 'wb') as fh:
        while True:
            arg_7 = arg_5.read(8196)
            if arg_7:
                fh.write(arg_7)
            else:
                break

    os.rename(arg_6, arg_4)

    return arg_4

Download the data at a URL and cache it under the given name .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
log
.
debug
(
"pyout: %s"
,
arg_1
.
get
(
'content'
,
''
)
)
if
not
arg_0
.
_hidden
and
arg_0
.
_is_from_this_session
(
arg_1
)
:
arg_2
=
arg_1
[
'content'
]
arg_3
=
arg_2
.
get
(
'execution_count'
,
0
)
arg_4
=
arg_2
[
'data'
]
if
arg_4
.
has_key
(
'text/html'
)
:
arg_0
.
_append_plain_text
(
arg_0
.
output_sep
,
True
)
arg_0
.
_append_html
(
arg_0
.
_make_out_prompt
(
arg_3
)
,
True
)
arg_5
=
arg_4
[
'text/html'
]
arg_0
.
_append_plain_text
(
'\n'
,
True
)
arg_0
.
_append_html
(
arg_5
+
arg_0
.
output_sep2
,
True
)
elif
arg_4
.
has_key
(
'text/plain'
)
:
arg_0
.
_append_plain_text
(
arg_0
.
output_sep
,
True
)
arg_0
.
_append_html
(
arg_0
.
_make_out_prompt
(
arg_3
)
,
True
)
arg_6
=
arg_4
[
'text/plain'
]
if
"\n"
in
arg_6
and
not
arg_0
.
output_sep
.
endswith
(
"\n"
)
:
arg_0
.
_append_plain_text
(
'\n'
,
True
)
arg_0
.
_append_plain_text
(
arg_6
+
arg_0
.
output_sep2
,
True
)

def Func(arg_0, arg_1):
        """ Reimplemented for IPython-style "display hook".
        """
        arg_0.log.debug("pyout: %s", arg_1.get('content', ''))
        if not arg_0._hidden and arg_0._is_from_this_session(arg_1):
            arg_2 = arg_1['content']
            arg_3 = arg_2.get('execution_count', 0)
            arg_4 = arg_2['data']
            if arg_4.has_key('text/html'):
                arg_0._append_plain_text(arg_0.output_sep, True)
                arg_0._append_html(arg_0._make_out_prompt(arg_3), True)
                arg_5 = arg_4['text/html']
                arg_0._append_plain_text('\n', True)
                arg_0._append_html(arg_5 + arg_0.output_sep2, True)
            elif arg_4.has_key('text/plain'):
                arg_0._append_plain_text(arg_0.output_sep, True)
                arg_0._append_html(arg_0._make_out_prompt(arg_3), True)
                arg_6 = arg_4['text/plain']
                # If the repr is multiline, make sure we start on a new line,
                # so that its lines are aligned.
                if "\n" in arg_6 and not arg_0.output_sep.endswith("\n"):
                    arg_0._append_plain_text('\n', True)
                arg_0._append_plain_text(arg_6 + arg_0.output_sep2, True)

Reimplemented for IPython - style display hook .