Load a pre-made query.

        These queries are distributed with lsstprojectmeta. See
        :file:`lsstrojectmeta/data/githubv4/README.rst` inside the
        package repository for details on available queries.

        Parameters
        ----------
        query_name : `str`
            Name of the query, such as ``'technote_repo'``.

        Returns
        -------
        github_query : `GitHubQuery
            A GitHub query or mutation object that you can pass to
            `github_request` to execute the request itself.


Detect if the upload should be skipped based on the
    ``TRAVIS_EVENT_TYPE`` environment variable.

    Returns
    -------
    should_skip : `bool`
        True if the upload should be skipped based on the combination of
        ``TRAVIS_EVENT_TYPE`` and user settings.


Get the datetime for the most recent commit to a project that
    affected certain types of content.

    Parameters
    ----------
    extensions : sequence of 'str'
        Extensions of files to consider in getting the most recent commit
        date. For example, ``('rst', 'svg', 'png')`` are content extensions
        for a Sphinx project. **Extension comparision is case sensitive.** add
        uppercase variants to match uppercase extensions.
    acceptance_callback : callable
        Callable function whose sole argument is a file path, and returns
        `True` or `False` depending on whether the file's commit date should
        be considered or not. This callback is only run on files that are
        included by ``extensions``. Thus this callback is a way to exclude
        specific files that would otherwise be included by their extension.
    root_dir : 'str`, optional
        Only content contained within this root directory is considered.
        This directory must be, or be contained by, a Git repository. This is
        the current working directory by default.

    Returns
    -------
    commit_date : `datetime.datetime`
        Datetime of the most recent content commit.

    Raises
    ------
    RuntimeError
        Raised if no content files are found.


Register a new build for a product on LSST the Docs.

    Wraps ``POST /products/{product}/builds/``.

    Parameters
    ----------
    host : `str`
        Hostname of LTD Keeper API server.
    keeper_token : `str`
        Auth token (`ltdconveyor.keeper.get_keeper_token`).
    product : `str`
        Name of the product in the LTD Keeper service.
    git_refs : `list` of `str`
        List of Git refs that correspond to the version of the build. Git refs
        can be tags or branches.

    Returns
    -------
    build_info : `dict`
        LTD Keeper build resource.

    Raises
    ------
    ltdconveyor.keeper.KeeperError
        Raised if there is an error communicating with the LTD Keeper API.


Deeply updates a dictionary. List values are concatenated.

  Args:
    d (dict): First dictionary which will be updated
    u (dict): Second dictionary use to extend the first one

  Returns:
    dict: The merge dictionary


Returns variables that match specific conditions.

        * Can pass in key=value parameters and variables are returned that
        contain all of the matches.  For example,

        >>> # Get variables with x-axis attribute.
        >>> vs = nc.get_variables_by_attributes(axis='X')
        >>> # Get variables with matching "standard_name" attribute.
        >>> nc.get_variables_by_attributes(standard_name='northward_sea_water_velocity')

        * Can pass in key=callable parameter and variables are returned if the
        callable returns True.  The callable should accept a single parameter,
        the attribute value.  None is given as the attribute value when the
        attribute does not exist on the variable. For example,

        >>> # Get Axis variables.
        >>> vs = nc.get_variables_by_attributes(axis=lambda v: v in ['X', 'Y', 'Z', 'T'])
        >>> # Get variables that don't have an "axis" attribute.
        >>> vs = nc.get_variables_by_attributes(axis=lambda v: v is None)
        >>> # Get variables that have a "grid_mapping" attribute.
        >>> vs = nc.get_variables_by_attributes(grid_mapping=lambda v: v is not None)


vfuncs can be any callable that accepts a single argument, the
        Variable object, and returns a dictionary of new attributes to
        set. These will overwrite existing attributes


Decorate a function that uses pypandoc to ensure that pandoc is
    installed if necessary.


ltd is a command-line client for LSST the Docs.

    Use ltd to upload new site builds, and to work with the LTD Keeper API.


Edit a part from an OOXML Package without unzipping it


List the contents of a subdirectory of a zipfile


recursively call os.path.split until we have all of the components
	of a pathname suitable for passing back to os.path.join.


Given a path to a part in a zip file, return a path to the file and
	the path to the part.

	Assuming /foo.zipx exists as a file,

	>>> find_file('/foo.zipx/dir/part') # doctest: +SKIP
	('/foo.zipx', '/dir/part')

	>>> find_file('/foo.zipx') # doctest: +SKIP
	('/foo.zipx', '')


Give preference to an XML_EDITOR or EDITOR defined in the
		environment. Otherwise use notepad on Windows and edit on other
		platforms.


Decode a JSON-LD dataset, including decoding datetime
    strings into `datetime.datetime` objects.

    Parameters
    ----------
    encoded_dataset : `str`
        The JSON-LD dataset encoded as a string.

    Returns
    -------
    jsonld_dataset : `dict`
        A JSON-LD dataset.

    Examples
    --------

    >>> doc = '{"dt": "2018-01-01T12:00:00Z"}'
    >>> decode_jsonld(doc)
    {'dt': datetime.datetime(2018, 1, 1, 12, 0, tzinfo=datetime.timezone.utc)}


Encode values as JSON strings.

        This method overrides the default implementation from
        `json.JSONEncoder`.


Process the astroid node stream.


Generates an html chart from either a pandas dataframe, a dictionnary,
        a list or an Altair Data object and optionally write it to a file


Generate html from an Altair chart object and optionally write it to a file


Serialize to an Altair chart object from either a pandas dataframe, a dictionnary,
        a list or an Altair Data object


Writes a chart's html to a file


Get the right chart class from a string


Encode the fields in Altair format


Get all git repositories within this environment


Install a python package using pip


Link to a GitHub user.

    Returns 2 part tuple containing list of nodes to insert into the
    document and a list of system messages.  Both are allowed to be
    empty.

    :param name: The role name used in the document.
    :param rawtext: The entire markup snippet, with role.
    :param text: The text marked with the role.
    :param lineno: The line number where rawtext appears in the input.
    :param inliner: The inliner instance that called us.
    :param options: Directive options for customization.
    :param content: The directive content for customization.


Returns the nb quantiles for datas in a dataframe


Returns the root mean square error betwwen a and b


Returns the mean fractionalized bias error


Computes the correlation between a and b, says the Pearson's correlation
    coefficient R


Geometric mean bias


Geometric mean variance


Figure of merit in time


Path to environments site-packages


Prior to activating, store everything necessary to deactivate this
        environment.


Remove this environment


Command used to launch this application module


Returns the tarball URL inferred from an app.json, if present.


Brings up a Heroku app.


Create a virtual environment. You can pass either the name of a new
    environment to create in your CPENV_HOME directory OR specify a full path
    to create an environment outisde your CPENV_HOME.

    Create an environment in CPENV_HOME::

        >>> cpenv.create('myenv')

    Create an environment elsewhere::

        >>> cpenv.create('~/custom_location/myenv')

    :param name_or_path: Name or full path of environment
    :param config: Environment configuration including dependencies etc...


Remove an environment or module

    :param name_or_path: name or path to environment or module


Activates and launches a module

    :param module_name: name of module to launch


Deactivates an environment by restoring all env vars to a clean state
    stored prior to activating environments


Returns a list of available modules.


Add a module to CPENV_ACTIVE_MODULES environment variable


Remove a module from CPENV_ACTIVE_MODULES environment variable


Format a list of environments and modules for terminal output


Show context info


Add an environment to the cache. Allows you to activate the environment
    by name instead of by full path


Remove a cached environment. Removed paths will no longer be able to
    be activated by name


Create a new template module.

    You can also specify a filesystem path like "./modules/new_module"


Add a module to an environment. PATH can be a git repository path or
    a filesystem path.


Resolves VirtualEnvironments with a relative or absolute path


Resolves VirtualEnvironments in EnvironmentCache


Resolves module in previously resolved environment.


Resolves modules in currently active environment.


Decorator implementing Iterator interface with nicer manner.

    Example
    -------

    @iter_attribute('my_attr'):
    class DecoratedClass:
        ...

    Warning:
    ========

    When using PyCharm or MYPY you'll probably see issues with decorated class not being recognized as Iterator.
    That's an issue which I could not overcome yet, it's probably due to the fact that interpretation of object
    is being done statically rather than dynamically. MYPY checks for definition of methods in class code which
    changes at runtime. Since __iter__ and __next__ are added dynamically MYPY cannot find those
    defined in objects before object of a class is created. Possible workarounds for this issue are:

        1. Define ``dummy`` __iter__ class like:

            @iter_attribute('attr')
            class Test:
                def __init__(self) -> None:
                    self.attr = [1, 2, 3]

                def __iter__(self):
                    pass

        2. After creating object use cast or assert function denoting that particular instance inherits
            from collections.Iterator:

            assert isinstance(my_object, collections.Iterator)

    :param iterable_name: string representing attribute name which has to be iterated
    :return: DecoratedClass with implemented '__iter__' and '__next__' methods.


Returns a view of the array with axes transposed.

    For a 1-D array, this has no effect.
    For a 2-D array, this is the usual matrix transpose.
    For an n-D array, if axes are given, their order indicates how the
    axes are permuted

    Args:
      a (array_like): Input array.
      axes (list of int, optional): By default, reverse the dimensions,
        otherwise permute the axes according to the values given.


Roll the specified axis backwards, until it lies in a given position.

    Args:
      a (array_like): Input array.
      axis (int): The axis to roll backwards.  The positions of the other axes
        do not change relative to one another.
      start (int, optional): The axis is rolled until it lies before this
        position.  The default, 0, results in a "complete" roll.

    Returns:
      res (ndarray)


Insert a new axis, corresponding to a given position in the array shape

    Args:
      a (array_like): Input array.
      axis (int): Position (amongst axes) where new axis is to be inserted.


Join a sequence of arrays together.
    Will aim to join `ndarray`, `RemoteArray`, and `DistArray` without moving
    their data, if they happen to be on different engines.

    Args:
      tup (sequence of array_like): Arrays to be concatenated. They must have
        the same shape, except in the dimension corresponding to `axis`.
      axis (int, optional): The axis along which the arrays will be joined.

    Returns:
      res: `ndarray`, if inputs were all local
           `RemoteArray`, if inputs were all on the same remote engine
           `DistArray`, if inputs were already scattered on different engines


Compute the arithmetic mean along the specified axis.

    Returns the average of the array elements.  The average is taken over
    the flattened array by default, otherwise over the specified axis.
    `float64` intermediate and return values are used for integer inputs.

    Parameters
    ----------
    a : array_like
        Array containing numbers whose mean is desired. If `a` is not an
        array, a conversion is attempted.
    axis : None or int or tuple of ints, optional
        Axis or axes along which the means are computed. The default is to
        compute the mean of the flattened array.
        If this is a tuple of ints, a mean is performed over multiple axes,
        instead of a single axis or all the axes as before.
    dtype : data-type, optional
        Type to use in computing the mean.  For integer inputs, the default
        is `float64`; for floating point inputs, it is the same as the
        input dtype.
    out : ndarray, optional
        Alternate output array in which to place the result.  The default
        is ``None``; if provided, it must have the same shape as the
        expected output, but the type will be cast if necessary.
        See `doc.ufuncs` for details.
    keepdims : bool, optional
        If this is set to True, the axes which are reduced are left
        in the result as dimensions with size one. With this option,
        the result will broadcast correctly against the original `arr`.

    Returns
    -------
    m : ndarray, see dtype parameter above

    Notes
    -----
    np.mean fails to pass the keepdims parameter to ndarray subclasses.
    That is the main reason we implement this function.


`ax` is a valid candidate for a distributed axis if the given
        subarray shapes are all the same when ignoring axis `ax`


Returns True if successful, False if failure


Return a command to launch a subshell


Generate a prompt with a given prefix

    linux/osx: [prefix] user@host cwd $
          win: [prefix] cwd:


Append a file to file repository.

        For file monitoring, monitor instance needs file.
        Please put the name of file to `file` argument.

        :param file: the name of file you want monitor.


Append files to file repository.

        ModificationMonitor can append files to repository using this.
        Please put the list of file names to `filelist` argument.

        :param filelist: the list of file nmaes


Run file modification monitor.

        The monitor can catch file modification using timestamp and file body.
        Monitor has timestamp data and file body data. And insert timestamp
        data and file body data before into while roop. In while roop, monitor
        get new timestamp and file body, and then monitor compare new timestamp
        to originaltimestamp. If new timestamp and file body differ original,
        monitor regard thease changes as `modification`. Then monitor create
        instance of FileModificationObjectManager and FileModificationObject,
        and monitor insert FileModificationObject to FileModificationObject-
        Manager. Then, yield this object.

        :param sleep: How times do you sleep in while roop.


Decorator that invokes `add_status_job`.

        ::

            @app.status_job
            def postgresql():
                # query/ping postgres

            @app.status_job(name="Active Directory")
            def active_directory():
                # query active directory

            @app.status_job(timeout=5)
            def paypal():
                # query paypal, timeout after 5 seconds


Get a random date between two dates


Page through text by feeding it to another program.  Invoking a
    pager through this might support colors.


Returns a prepared ``Session`` instance.


Sends an API request to Heroku.

        :param method: HTTP method.
        :param endpoint: API endpoint, e.g. ``/apps``.
        :param data: A dict sent as JSON in the body of the request.
        :returns: A dict represntation of the JSON response.


Creates an app-setups build. Returns response data as a dict.

        :param tarball_url: URL of a tarball containing an ``app.json``.
        :param env: Dict containing environment variable overrides.
        :param app_name: Name of the Heroku app to create.
        :returns: Response data as a ``dict``.


Checks the status of an app-setups build.

        :param build_id: ID of the build to check.
        :returns: ``True`` if succeeded, ``False`` if pending.


generator that returns an unique string

    :param prefix: prefix of string
    :param cache: cache used to store the last used number

    >>> next(sequence('abc'))
    'abc-0'
    >>> next(sequence('abc'))
    'abc-1'


Decorator that stores function results in a dictionary to be used on the
    next time that the same arguments were informed.


wraps a function so that produce unique results

    :param func:
    :param num_args:

    >>> import random
    >>> choices = [1,2]
    >>> a = unique(random.choice, 1)
    >>> a,b = a(choices), a(choices)
    >>> a == b
    False


Add any sub commands to the argument parser.

        :param parser: The argument parser object


Gets the description of the command. If its not supplied the first sentence of the doc string is used.


Gets the help text for the command. If its not supplied the doc string is used.


Runs the command passing in the parsed arguments.

        :param args: The arguments to run the command with. If ``None`` the arguments
            are gathered from the argument parser. This is automatically set when calling
            sub commands and in most cases should not be set for the root command.

        :return: The status code of the action (0 on success)


Encode wrapper for a dataset with maximum value

        Datasets can be one or two dimensional
        Strings are ignored as ordinal encoding


Get all available athletes
        This method is cached to prevent unnecessary calls to GC.


Get all activity data for the last activity

        Keyword arguments:


Actually do the request for activity list
        This call is slow and therefore this method is memory cached.

        Keyword arguments:
        athlete -- Full name of athlete


Construct athlete endpoint from host and athlete name

        Keyword arguments:
        athlete -- Full athlete name


Do actual GET request to GC REST API
        Also validates responses.

        Keyword arguments:
        endpoint -- full endpoint for GET request


Creates a Heroku app-setup build.

        :param tarball_url: URL of a tarball containing an ``app.json``.
        :param env: (optional) Dict containing environment variable overrides.
        :param app_name: (optional) Name of the Heroku app to create.
        :returns: A tuple with ``(build_id, app_name)``.


if view is string based, must be a full path


Render the axes data into the dict data


Renders the chart context and axes into the dict data


Shows the chart URL in a webbrowser

        Other arguments passed to webbrowser.open


Download the chart from the URL into a filename as a PNG

        The filename defaults to the chart title (chtt) if any


return a random floating number

    :param min: minimum value
    :param max: maximum value
    :param decimal_places: decimal places
    :return:


Assign an entity name based on the class immediately inhering from Base.

    This is needed because we don't want
    entity names to come from any class that simply inherits our classes,
    just the ones in our module.

    For example, if you create a class Project2 that exists outside of
    kalibro_client and inherits from Project, it's entity name should still
    be Project.


Validate all the entries in the environment cache.


Load the environment cache from disk.


This function takes a text and shows it via an environment specific
    pager on stdout.

    .. versionchanged:: 3.0
       Added the `color` flag.

    :param text: the text to page.
    :param color: controls if the pager supports ANSI colors or not.  The
                  default is autodetection.


Retrieve objects that have been distributed, making them local again


Apply a function in parallel to each element of the input


Returns True if path is a git repository.


Returns True if path is in CPENV_HOME


Get environment path from redirect file


Walk down a directory tree. Same as os.walk but allows for a depth limit
    via depth argument


Add a sequence value to env dict


Returns an unused random filepath.


Encode current environment as yaml and store in path or a temporary
    file. Return the path to the stored environment.


Returns the URL to the upstream data source for the given URI based on configuration


Return request object for calling the upstream


Returns time to live in seconds. 0 means no caching.

        Criteria:
        - response code 200
        - read-only method (GET, HEAD, OPTIONS)
        Plus http headers:
        - cache-control: option1, option2, ...
          where options are:
          private | public
          no-cache
          no-store
          max-age: seconds
          s-maxage: seconds
          must-revalidate
          proxy-revalidate
        - expires: Thu, 01 Dec 1983 20:00:00 GMT
        - pragma: no-cache (=cache-control: no-cache)

        See http://www.mobify.com/blog/beginners-guide-to-http-cache-headers/

        TODO: tests


Build a JWKS from the signing keys belonging to the self signer

        :return: Dictionary


Starting with a signed JWT or a JSON document unpack and verify all
        the separate metadata statements.

        :param ms_dict: Metadata statement as a dictionary
        :param jwt_ms: Metadata statement as JWT
        :param keyjar: Keys that should be used to verify the signature of the
            document
        :param cls: What type (Class) of metadata statement this is
        :param liss: list of FO identifiers that matters. The rest will be
            ignored
        :return: A ParseInfo instance


Remove MS paths that are marked to be used for another usage

        :param metadata: Metadata statement as dictionary
        :param federation_usage: In which context this is expected to used.
        :return: Filtered Metadata statement.


Add signed metadata statements to a request

        :param req: The request
        :param sms_dict: A dictionary with FO IDs as keys and signed metadata
            statements (sms) or uris pointing to sms as values.
        :return: The updated request


Guarantee the existence of a basic MANIFEST.in.

    manifest doc: http://docs.python.org/distutils/sourcedist.html#manifest

    `options.paved.dist.manifest.include`: set of files (or globs) to include with the `include` directive.

    `options.paved.dist.manifest.recursive_include`: set of files (or globs) to include with the `recursive-include` directive.

    `options.paved.dist.manifest.prune`: set of files (or globs) to exclude with the `prune` directive.

    `options.paved.dist.manifest.include_sphinx_docroot`: True -> sphinx docroot is added as `graft`

    `options.paved.dist.manifest.include_sphinx_docroot`: True -> sphinx builddir is added as `prune`


Add logging option to an ArgumentParser.


Apply logging options produced by LogLevelAction and LogFileAction.

    More often then not this function is not needed, the actions have already
    been taken during the parse, but it can be used in the case they need to be
    applied again (e.g. when command line opts take precedence but were
    overridded by a fileConfig, etc.).


Format a UUID string

    :param str uuid: UUID to format
    :param int max_length: Maximum length of result string (> 3)
    :return: Formatted UUID
    :rtype: str
    :raises ValueError: If *max_length* is not larger than 3

    This function formats a UUID so it is not longer than *max_length*
    characters. The resulting string is returned. It does so by replacing
    characters at the end of the *uuid* with three dots, if necessary.
    The idea is that the start of the *uuid* is the most important part
    to be able to identify the related entity.

    The default *max_length* is 10, which will result in a string
    containing the first 7 characters of the *uuid* passed in. Most of
    the time, such a string is still unique within a collection of UUIDs.


Finds anagrams in word.

    Args:
        word: the string to base our search off of
        sowpods: boolean to declare TWL or SOWPODS words file
        start: a string of starting characters to find anagrams based on
        end: a string of ending characters to find anagrams based on

    Yields:
        a tuple of (word, score) that can be made with the input_word


attempts to get next and previous on updates


Notify the client of the result of handling a request

    The payload contains two elements:

    - client_id
    - result

    The *client_id* is the id of the client to notify. It is assumed
    that the notifier service is able to identify the client by this id
    and that it can pass the *result* to it.

    The *result* always contains a *status_code* element. In case the
    message passed in is not None, it will also contain a *message*
    element.

    In case the notifier service does not exist or returns an error,
    an error message will be logged to *stderr*.


Returns the exception's name in an AMP Command friendly format.

        For example, given a class named ``ExampleExceptionClass``, returns
        ``"EXAMPLE_EXCEPTION_CLASS"``.


Retrieves the setting value whose name is indicated by name_hyphen.

        Values starting with $ are assumed to reference environment variables,
        and the value stored in environment variables is retrieved. It's an
        error if thes corresponding environment variable it not set.


This method does the work of updating settings. Can be passed with
        enforce_helpstring = False which you may want if allowing end users to
        add arbitrary metadata via the settings system.

        Preferable to use update_settings (without leading _) in code to do the
        right thing and always have docstrings.


Detect if we get a class or a name, convert a name to a class.


Asserts that the class has a docstring, returning it if successful.


Transforms a Go Metrics API metric result into a list of
    values for a given window period.

    start and end are expected to be Unix timestamps in microseconds.


Validate the given 1-based page number.


Get absolute path to resource, works for dev and for PyInstaller


Add new block of logbook selection windows. Only 5 allowed.


Return selected log books by type.


Verify enetered user name is on accepted MCC logbook list.


Parse xml elements for pretty printing


Convert supplied QPixmap object to image file.


Process log information and push to selected logbooks.


Create graphical objects for menus.


Display menus and connect even signals.


Populate log program list to correspond with log type selection.


Add menus to parent gui.


Iteratively remove graphical objects from layout.


Adds labels to a plot.


Update the database with model schema. Shorthand for `paver manage syncdb`.


Run the dev server.

    Uses `django_extensions <http://pypi.python.org/pypi/django-extensions/0.5>`, if
    available, to provide `runserver_plus`.

    Set the command to use with `options.paved.django.runserver`
    Set the port to use with `options.paved.django.runserver_port`


Run South's schemamigration command.


Given configuration initiate an InternalSigningService instance

    :param config: The signing service configuration
    :param entity_id: The entity identifier
    :return: A InternalSigningService instance


Creates a signed JWT

        :param req: Original metadata statement as a
            :py:class:`MetadataStatement` instance
        :param receiver: The intended audience for the JWS
        :param iss: Issuer or the JWT
        :param lifetime: Lifetime of the signature
        :param sign_alg: Which signature algorithm to use
        :param aud: The audience, a list of receivers.
        :return: A signed JWT


Uses POST to send a first metadata statement signing request to
        a signing service.

        :param req: The metadata statement that the entity wants signed
        :return: returns a dictionary with 'sms' and 'loc' as keys.


Uses PUT to update an earlier accepted and signed metadata statement.

        :param location: A URL to which the update request is sent
        :param req: The diff between what is registereed with the signing
            service and what it should be.
        :return: returns a dictionary with 'sms' and 'loc' as keys.


Uses GET to get a newly signed metadata statement.

        :param location: A URL to which the request is sent
        :return: returns a dictionary with 'sms' and 'loc' as keys.


Yield bundle contents from the given dict.

        Each item yielded will be either a string representing a file path
        or a bundle.


Return a bundle initialised by the given dict.


Return all html tags for all asset_type


This static method validates a BioMapMapper definition.
        It returns None on success and throws an exception otherwise.


Returns all data entries for a particular key. Default is the main key.

        Args:

            key (str): key whose values to return (default: main key)

        Returns:

            List of all data entries for the key


Get modules by project_abspath and packages_scan.

        Traverse all files under folder packages_scan which set by customer.
        And get all modules name.


Import customer's service module.


This function takes a date string in various formats
    and converts it to a normalized and validated date range. A list
    with two elements is returned, lower and upper date boundary.

    Valid inputs are, for example:
    2012              => Jan 1 20012 - Dec 31 2012 (whole year)
    201201            => Jan 1 2012  - Jan 31 2012 (whole month)
    2012101           => Jan 1 2012 - Jan 1 2012   (whole day)
    2011-2011         => same as "2011", which means whole year 2012
    2011-2012         => Jan 1 2011 - Dec 31 2012  (two years)
    201104-2012       => Apr 1 2011 - Dec 31 2012
    201104-201203     => Apr 1 2011 - March 31 2012
    20110408-2011     => Apr 8 2011 - Dec 31 2011
    20110408-201105   => Apr 8 2011 - May 31 2011
    20110408-20110507 => Apr 8 2011 - May 07 2011
    2011-             => Jan 1 2012 - Dec 31 9999 (unlimited)
    201104-           => Apr 1 2011 - Dec 31 9999 (unlimited)
    20110408-         => Apr 8 2011 - Dec 31 9999 (unlimited)
    -2011             Jan 1 0000 - Dez 31 2011
    -201104           Jan 1 0000 - Apr 30, 2011
    -20110408         Jan 1 0000 - Apr 8, 2011


Get Existing Message

        http://dev.wheniwork.com/#get-existing-message


Returns a list of sites.

        http://dev.wheniwork.com/#listing-sites


For all the datetime fields in "datemap" find that key in doc and map the datetime object to
        a strftime string. This pprint and others will print out readable datetimes.


Output a cursor to a filename or stdout if filename is "-".
        fmt defines whether we output CSV or JSON.


Output all fields using the fieldNames list. for fields in the list datemap indicates the field must
        be date


Given a list of tasks to perform and a dependency graph, return the tasks
    that must be performed, in the correct order


Add or create the default departments for the given project

    :param project: the project that needs default departments
    :type project: :class:`muke.models.Project`
    :returns: None
    :rtype: None
    :raises: None


Add or create the default sequences for the given project

    :param project: the project that needs default sequences
    :type project: :class:`muke.models.Project`
    :returns: None
    :rtype: None
    :raises: None


Add a rnd shot for every user in the project

    :param project: the project that needs its rnd shots updated
    :type project: :class:`muke.models.Project`
    :returns: None
    :rtype: None
    :raises: None


Post save receiver for when a Project is saved.

    Creates a rnd shot for every user.

    On creations does:

       1. create all default departments
       2. create all default assettypes
       3. create all default sequences

    :param sender: the project class
    :type sender: :class:`muke.models.Project`
    :returns:  None
    :raises: None


Returns a link to a view that moves the passed in object down in rank.

    :param obj:
        Object to move
    :param link_text:
        Text to display in the link.  Defaults to "down"
    :returns:
        HTML link code to view for moving the object


Sends a packet to a peer.


Shows a figure with a typical orientation so that x and y axes are set up as expected.


Shifts indicies as needed to account for one based indexing

    Positive indicies need to be reduced by one to match with zero based
    indexing.

    Zero is not a valid input, and as such will throw a value error.

    Arguments:
        index -     index to shift


Returns selected positions from cut input source in desired
        arrangement.

        Argument:
            line -      input to cut


Processes positions to account for ranges

        Arguments:
            positions -     list of positions and/or ranges to process


Performs cut for range from start position to end

        Arguments:
            line -              input to cut
            start -             start of range
            current_position -  current position in main cut function


Creates list of values in a range with output delimiters.

        Arguments:
            start -     range start
            end -       range end


Read customer's config value by section and key.

        :param section: config file's section. i.e [default]
        :param key: config file's key under section. i.e packages_scan
        :param return_type: return value type, str | int | bool.


Locks the file by writing a '.lock' file.
       Returns True when the file is locked and
       False when the file was locked already


Unlocks the file by remove a '.lock' file.
       Returns True when the file is unlocked and
       False when the file was unlocked already


Initiate the local catalog and push it the cloud


Initiate the local catalog by downloading the cloud catalog


Return nodes in the path between 'a' and 'b' going from
        parent to child NOT including 'a'


Cinder annotation for adding function to process cinder 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


Neutron annotation for adding function to process neutron 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.

    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


Swift annotation for adding function to process keystone 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


Heat annotation for adding function to process heat 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


Create and save an admin user.

    :param username:
        Admin account's username.  Defaults to 'admin'
    :param email:
        Admin account's email address.  Defaults to 'admin@admin.com'
    :param password:
        Admin account's password.  Defaults to 'admin'
    :returns:
        Django user with staff and superuser privileges


Returns a list of the messages from the django MessageMiddleware
    package contained within the given response.  This is to be used during
    unit testing when trying to see if a message was set properly in a view.

    :param response: HttpResponse object, likely obtained through a
        test client.get() or client.post() call

    :returns: a list of tuples (message_string, message_level), one for each
        message in the response context


Authenticates the superuser account via the web login.


Does a django test client ``get`` against the given url after
        logging in the admin first.

        :param url:
            URL to fetch
        :param response_code:
            Expected response code from the URL fetch.  This value is
            asserted.  Defaults to 200
        :param headers:
            Optional dictionary of headers to send in the request
        :param follow:
            When True, the get call will follow any redirect requests.
            Defaults to False.
        :returns:
            Django testing ``Response`` object


Does a django test client ``post`` against the given url after
        logging in the admin first.

        :param url:
            URL to fetch
        :param data:
            Dictionary to form contents to post
        :param response_code:
            Expected response code from the URL fetch.  This value is
            asserted.  Defaults to 200
        :param headers:
            Optional dictionary of headers to send in with the request
        :returns:
            Django testing ``Response`` object


Adds a factory.

        After calling this method, remote clients will be able to
        connect to it.

        This will call ``factory.doStart``.


Attempts to connect using a given factory.

        This will find the requested factory and use it to build a
        protocol as if the AMP protocol's peer was making the
        connection. It will create a transport for the protocol and
        connect it immediately. It will then store the protocol under
        a unique identifier, and return that identifier.


Receives some data for the given protocol.


Disconnects the given protocol.


Shorthand for ``callRemote``.

        This uses the factory's connection to the AMP peer.


Stores a reference to the connection, registers this protocol on
        the factory as one related to a multiplexed AMP connection,
        and sends currently buffered data. Gets rid of the buffer
        afterwards.


Received some data from the local side.

        If we have set up the multiplexed connection, sends the data
        over the multiplexed connection. Otherwise, buffers.


Actually sends data over the wire.


If we already have an AMP connection registered on the factory,
        get rid of it.


Some data was received from the remote end. Find the matching
        protocol and replay it.


The other side has asked us to disconnect.


Highest value of input image.


spawns a greenlet that does not print exceptions to the screen.
    if you use this function you MUST use this module's join or joinall otherwise the exception will be lost


Setup argparser to process arguments and generate help


Takes a string, centres it, and pads it on both sides


Takes a string, and prints it with the time right aligned


Takes the parts of a semantic version number, and returns a nicely
    formatted string.


Check that a value has physical type consistent with user-specified units

    Note that this does not convert the value, only check that the units have
    the right physical dimensionality.

    Parameters
    ----------
    name : str
        The name of the value to check (used for error messages).
    value : `numpy.ndarray` or instance of `numpy.ndarray` subclass
        The value to check.
    target_unit : unit
        The unit that the value should be convertible to.
    unit_framework : str
        The unit framework to use


Apply standard padding.

    :Parameters:
      data_to_pad : byte string
        The data that needs to be padded.
      block_size : integer
        The block boundary to use for padding. The output length is guaranteed
        to be a multiple of ``block_size``.
      style : string
        Padding algorithm. It can be *'pkcs7'* (default), *'iso7816'* or *'x923'*.
    :Return:
      The original data with the appropriate padding added at the end.


Opens connection to S3 returning bucket and key


Upload a local file to S3.


Creates an ical .ics file for an event using python-card-me.


Returns a list view of updates for a given event.
    If the event is over, it will be in chronological order.
    If the event is upcoming or still going,
    it will be in reverse chronological order.


Displays list of videos for given event.


Sign the extended request.

        :param req: Request, a :py:class:`fedoidcmsg.MetadataStatement' instance
        :param receiver: The intended user of this metadata statement
        :param aud: The audience, a list of receivers.
        :return: An augmented set of request arguments


Only gathers metadata statements and returns them.

        :param fos: Signed metadata statements from these Federation Operators
            should be added.
        :param context: context of the metadata exchange
        :return: Dictionary with signed Metadata Statements as values


Prints the anagram results sorted by score to stdout.

    Args:
        input_word: the base word we searched on
        anagrams: generator of (word, score) from anagrams_in_word
        by_length: a boolean to declare printing by length instead of score


Argparse logic, command line options.

    Args:
        args: sys.argv[1:], everything passed to the program after its name

    Returns:
        A tuple of:
            a list of words/letters to search
            a boolean to declare if we want to use the sowpods words file
            a boolean to declare if we want to output anagrams by length
            a string of starting characters to find anagrams based on
            a string of ending characters to find anagrams based on

    Raises:
        SystemExit if the user passes invalid arguments, --version or --help


Main command line entry point.


Invoked if a packet with an unregistered type was received.

        Default behaviour is to log and close the connection.


Called from remote to ask if a call made to here is still in progress.


Inserts Interpreter Library of imports into sketch in a very non-consensual way


Defers to `amp.AmpList`, then gets the element from the list.


Parse simple JWKS or signed JWKS from the HTTP response.

        :param response: HTTP response from the 'jwks_uri' or 'signed_jwks_uri'
            endpoint
        :return: response parsed as JSON or None


Sets the beam moments indirectly using Courant-Snyder parameters.

        Parameters
        ----------
        beta : float
            Courant-Snyder parameter :math:`\\beta`.
        alpha : float
            Courant-Snyder parameter :math:`\\alpha`.
        emit : float
            Beam emittance :math:`\\epsilon`.
        emit_n : float
            Normalized beam emittance :math:`\\gamma \\epsilon`.


Given a slice object, return appropriate values for use in the range function

    :param slice_obj: The slice object or integer provided in the `[]` notation
    :param length: For negative indexing we need to know the max length of the object.


Performs a pg_dump backup.

    It runs with the current systemuser's privileges, unless you specify
    username and password.

    By default pg_dump connects to the value given in the PGHOST environment
    variable.
    You can either specify "hostname" and "port" or a socket path.

    pg_dump expects the pg_dump-utility to be on $PATCH.
    Should that not be case you are allowed to specify a custom location with
    "pg_dump_path"

    Format is p (plain / default), c = custom, d = directory, t=tar

    returns statuscode and shelloutput


Helper to add error to messages field. It fills placeholder with extra call parameters
        or values from message_value map.

        :param error_code: Error code to use
        :rparam error_code: str
        :param value: Value checked
        :param kwargs: Map of values to use in placeholders


Returns a dictionary of all the files under a path.


Syncs a local directory with an S3 bucket.

        Currently does not delete files from S3 that are not in the local directory.

        path: The path to the directory to sync to S3
        bucket: The name of the bucket on S3


Ensure the user has the necessary tokens for the specified services


File copy that support compress and decompress of zip files


Apply to the 'catalog' the changesets in the metafile list 'changesets


When entering the context, spawns a greenlet that sleeps for `interval` seconds between `callback` executions.
    When leaving the context stops the greenlet.
    The yielded object is the `GeventLoop` object so the loop can be stopped from within the context.

    For example:
    ```
    with loop_in_background(60.0, purge_cache) as purge_cache_job:
        ...
        ...
        if should_stop_cache():
            purge_cache_job.stop()
    ```


Main loop - used internally.


Starts the loop. Calling a running loop is an error.


Return an already closed read-only instance of Fridge.
        Arguments are the same as for the constructor.


Create a signed JWT containing a JWKS. The JWT is signed by one of the
    keys in the JWKS.

    :param keyjar: A KeyJar instance with at least one private signing key
    :param iss: issuer of the JWT, should be the owner of the keys
    :param kid: A key ID if a special key should be used otherwise one
        is picked at random.
    :param lifetime: The lifetime of the signed JWT
    :return: A signed JWT


Fix common spacing errors caused by LaTeX's habit
        of using an inter-sentence space after any full stop.


Transform hyphens to various kinds of dashes


Regex substitute target with replacement


Upload the docs to a remote location via rsync.

    `options.paved.docs.rsync_location`: the target location to rsync files to.

    `options.paved.docs.path`: the path to the Sphinx folder (where the Makefile resides).

    `options.paved.docs.build_rel`: the path of the documentation
        build folder, relative to `options.paved.docs.path`.


Push Sphinx docs to github_ gh-pages branch.

     1. Create file .nojekyll
     2. Push the branch to origin/gh-pages
        after committing using ghp-import_

    Requirements:
     - easy_install ghp-import

    Options:
     - `options.paved.docs.*` is not used
     - `options.sphinx.docroot` is used (default=docs)
     - `options.sphinx.builddir` is used (default=.build)

    .. warning::
        This will DESTROY your gh-pages branch.
        If you love it, you'll want to take backups
        before playing with this. This script assumes
        that gh-pages is 100% derivative. You should
        never edit files in your gh-pages branch by hand
        if you're using this script because you will
        lose your work.

    .. _github: https://github.com
    .. _ghp-import: https://github.com/davisp/ghp-import


Open your web browser and display the generated html documentation.


Tries to minimize the length of CSS code passed as parameter. Returns string.


A decorator for providing a unittest with a library and have it called only
    once.


Descover and load greencard tests.


Returns the Scrabble score of a letter.

    Args:
        letter: a single character string

    Raises:
        TypeError if a non-Scrabble character is supplied


Opens the word list file.

    Args:
        sowpods: a boolean to declare using the sowpods list or TWL (default)
        start: a string of starting characters to find anagrams based on
        end: a string of ending characters to find anagrams based on

    Yeilds:
        a word at a time out of 178691 words for TWL, 267751 for sowpods. Much
        less if either start or end are used (filtering is applied here)


Checks if the input word could be played with a full bag of tiles.

    Returns:
        True or false


docstring for main


docstring for argparse


Create the tasks on the server


Update existing tasks on the server


Prompts the user for yes or no.


Prompts the user with custom options.


Reading the configure file and adds non-existing attributes to 'args


Returns a copy of this object


Returns a Tag with a given revision


Tiles open figures.


When a Comment is added, updates the Update to set "last_updated" time


Handle a JSON AMP dialect request.

        First, the JSON is parsed. Then, all JSON dialect specific
        values in the request are turned into the correct objects.
        Then, finds the correct responder function, calls it, and
        serializes the result (or error).


Gets the command class and matching responder function for the
        given command name.


Parses all the values in the request that are in a form specific
        to the JSON AMP dialect.


Serializes the response to JSON, and writes it to the transport.


Tells the box receiver to stop receiving boxes.


Adds useful global items to the context for use in templates.

    * *request*: the request object
    * *HOST*: host name of server
    * *IN_ADMIN*: True if you are in the django admin area


Create the challenge on the server


Update existing challenge on the server


Check if a challenge exists on the server


Convert a JWKS to a KeyJar instance.

    :param jwks: String representation of a JWKS
    :return: A :py:class:`oidcmsg.key_jar.KeyJar` instance


Returns position data.

        http://dev.wheniwork.com/#get-existing-position


Returns a list of positions.

        http://dev.wheniwork.com/#listing-positions


Handle HTTP exception

    :param werkzeug.exceptions.HTTPException exception: Raised exception

    A response is returned, as formatted by the :py:func:`response` function.


Returns True if the value given is a valid CSS colour, i.e. matches one
    of the regular expressions in the module or is in the list of
    predetefined values by the browser.


Reynold number utility function that return Reynold number for vehicle at specific length and speed.
    Optionally, it can also take account of temperature effect of sea water.

        Kinematic viscosity from: http://web.mit.edu/seawater/2017_MIT_Seawater_Property_Tables_r2.pdf

    :param length: metres length of the vehicle
    :param speed: m/s speed of the vehicle
    :param temperature: degree C
    :return: Reynolds number of the vehicle (dimensionless)


Froude number utility function that return Froude number for vehicle at specific length and speed.

    :param speed: m/s speed of the vehicle
    :param length: metres length of the vehicle
    :return: Froude number of the vehicle (dimensionless)


Residual resistance coefficient estimation from slenderness function, prismatic coefficient and Froude number.

    :param slenderness: Slenderness coefficient dimensionless :math:`L/(∇^{1/3})` where L is length of ship, ∇ is displacement
    :param prismatic_coef: Prismatic coefficient dimensionless :math:`∇/(L\cdot A_m)` where L is length of ship, ∇ is displacement Am is midsection area of the ship
    :param froude_number: Froude number of the ship dimensionless
    :return: Residual resistance of the ship


Assign values for the main dimension of a ship.

        :param length: metres length of the vehicle
        :param draught: metres draught of the vehicle
        :param beam: metres beam of the vehicle
        :param speed: m/s speed of the vehicle
        :param slenderness_coefficient: Slenderness coefficient dimensionless :math:`L/(∇^{1/3})` where L is length of ship,
            ∇ is displacement
        :param prismatic_coefficient: Prismatic coefficient dimensionless :math:`∇/(L\cdot A_m)` where L is length of ship,
            ∇ is displacement Am is midsection area of the ship


Return the maximum deck area of the ship

        :param water_plane_coef: optional water plane coefficient
        :return: Area of the deck


Total propulsion power of the ship.

        :param propulsion_eff: Shaft efficiency of the ship
        :param sea_margin: Sea margin take account of interaction between ship and the sea, e.g. wave
        :return: Watts shaft propulsion power of the ship


Configure the api to use given url and token or to get them from the
        Config.


Ensures that the request url is valid.
        Sometimes we have URLs that the server gives that are preformatted,
        sometimes we need to form our own.


Extract json from a response.
            Assumes response is valid otherwise.
            Internal use only.


This function deal with the cinder notification.

    First, find process from customer_process that not include wildcard.
    if not find from customer_process, then find process from customer_process_wildcard.
    if not find from customer_process_wildcard, then use ternya default process.
    :param body: dict of openstack notification.
    :param message: kombu Message class
    :return:


This function deal with the glance notification.

    First, find process from customer_process that not include wildcard.
    if not find from customer_process, then find process from customer_process_wildcard.
    if not find from customer_process_wildcard, then use ternya default process.
    :param body: dict of openstack notification.
    :param message: kombu Message class
    :return:


This function deal with the swift notification.

    First, find process from customer_process that not include wildcard.
    if not find from customer_process, then find process from customer_process_wildcard.
    if not find from customer_process_wildcard, then use ternya default process.
    :param body: dict of openstack notification.
    :param message: kombu Message class
    :return:


Wrapper for gevent.joinall if the greenlet that waits for the joins is killed, it kills all the greenlets it
    joins for.


Creates an error Acknowledgement message.
        The message's code and message are taken from this exception.

        :return: the message representing this exception


Serve app using wsgiref or provided server.

        Args:
        - server (callable): An callable


\
        Parses a binary protobuf message into a Message object.


Print 'msg' to stdout, and option 'log' at info level.


Print 'msg' to stderr, and option 'log' at info level.


Returns a list of the ancestors of this node.


Returns a list of descendents of this node.


Returns a list of nodes that would be removed if prune were called
        on this element.


A class decorator for Command classes to register in the default set.


A class decorator for Command classes to register.


If all of the constraints are satisfied with the given value, defers
        to the composed AMP argument's ``toString`` method.


Update existing task on the server


Retrieve a task from the server


Merges ``cdict`` into ``completers``. In the event that a key
        in cdict already exists in the completers dict a ValueError is raised
        iff ``regex`` false'y. If a regex str is provided it and the duplicate
        key are updated to be unique, and the updated regex is returned.


Init connection and consumer with openstack mq.


Init openstack nova mq

        1. Check if enable listening nova notification
        2. Create consumer

        :param mq: class ternya.mq.MQ


Init openstack cinder mq

        1. Check if enable listening cinder notification
        2. Create consumer

        :param mq: class ternya.mq.MQ


Init openstack heat mq

        1. Check if enable listening heat notification
        2. Create consumer

        :param mq: class ternya.mq.MQ


Check if customer enable openstack component notification.

        :param openstack_component: Openstack component type.


Get music info from baidu music api


process for downing music with multiple threads


Returns user profile data.

        http://dev.wheniwork.com/#get-existing-user


Returns a list of users.

        http://dev.wheniwork.com/#listing-users


Recursively update the destination dict-like object with the source dict-like object.

    Useful for merging options and Bunches together!

    Based on:
    http://code.activestate.com/recipes/499335-recursively-update-a-dictionary-without-hitting-py/#c1


When I Work GET method. Return representation of the requested
        resource.


When I Work POST method.


When I Work DELETE method.


Execute a code object

        The inputs and behavior of this function should match those of
        eval_ and exec_.

        .. _eval: https://docs.python.org/3/library/functions.html?highlight=eval#eval
        .. _exec: https://docs.python.org/3/library/functions.html?highlight=exec#exec

        .. note:: Need to figure out how the internals of this function must change for
           ``eval`` or ``exec``.

        :param code: a python code object
        :param globals_: optional globals dictionary
        :param _locals: optional locals dictionary


Implement the CALL_FUNCTION_ operation.

        .. _CALL_FUNCTION: https://docs.python.org/3/library/dis.html#opcode-CALL_FUNCTION


Delete existing shifts.

        http://dev.wheniwork.com/#delete-shift


Gets images and videos to populate top assets.

        Map is built separately.


Overridden method that handles that re-ranking of objects and the
        integrity of the ``rank`` field.

        :param rerank:
            Added parameter, if True will rerank other objects based on the
            change in this save.  Defaults to True.


Removes any blank ranks in the order.


Returns the field names of a Django model object.

    :param obj: the Django model class or object instance to get the fields
        from
    :param ignore_auto: ignore any fields of type AutoField. Defaults to True
    :param ignore_relations: ignore any fields that involve relations such as
        the ForeignKey or ManyToManyField
    :param exclude: exclude anything in this list from the results

    :returns: generator of found field names


Register all HTTP error code error handlers

    Currently, errors are handled by the JSON error handler.


Plots but automatically resizes x axis.

    .. versionadded:: 1.4

    Parameters
    ----------
    args
        Passed on to :meth:`matplotlib.axis.Axis.plot`.
    ax : :class:`matplotlib.axis.Axis`, optional
        The axis to plot to.
    kwargs
        Passed on to :meth:`matplotlib.axis.Axis.plot`.


Passes the selected course as the first argument to func.


Passes the selected exercise as the first argument to func.


If func returns False the program exits immediately.


Configure tmc.py to use your account.


Download the exercises from the server.


Spawns a process with `command path-of-exercise`


Select a course or an exercise.


Sends the selected exercise to the TMC pastebin.


Update the data of courses and or exercises from server.


Determine the type of x


Apply the types on the elements of the line


Convert a file to a .csv file


Returns a link to the django admin change list with a filter set to
    only the object given.

    :param obj:
        Object to create the admin change list display link for
    :param display:
        Text to display in the link.  Defaults to string call of the object
    :returns:
        Text containing HTML for a link


Returns string representation of an object, either the default or based
    on the display template passed in.


Adds a ``list_display`` attribute that appears as a link to the
        django admin change page for the type of object being shown. Supports
        double underscore attribute name dereferencing.

        :param attr:
            Name of the attribute to dereference from the corresponding
            object, i.e. what will be lined to.  This name supports double
            underscore object link referencing for ``models.ForeignKey``
            members.

        :param title:
            Title for the column of the django admin table.  If not given it
            defaults to a capitalized version of ``attr``

        :param display:
            What to display as the text for the link being shown.  If not
            given it defaults to the string representation of the object for
            the row: ``str(obj)`` .  This parameter supports django
            templating, the context for which contains a dictionary key named
            "obj" with the value being the object for the row.

        Example usage:

        .. code-block:: python

            # ---- admin.py file ----

            base = fancy_modeladmin('id')
            base.add_link('author', 'Our Authors',
                '{{obj.name}} (id={{obj.id}})')

            @admin.register(Book)
            class BookAdmin(base):
                pass

        The django admin change page for the Book class would have a column
        for "id" and another titled "Our Authors". The "Our Authors" column
        would have a link for each Author object referenced by "book.author".
        The link would go to the Author django admin change listing. The
        display of the link would be the name of the author with the id in
        brakcets, e.g. "Douglas Adams (id=42)"


Adds a ``list_display`` attribute showing an object.  Supports
        double underscore attribute name dereferencing.

        :param attr:
            Name of the attribute to dereference from the corresponding
            object, i.e. what will be lined to.  This name supports double
            underscore object link referencing for ``models.ForeignKey``
            members.

        :param title:
            Title for the column of the django admin table.  If not given it
            defaults to a capitalized version of ``attr``

        :param display:
            What to display as the text for the link being shown.  If not
            given it defaults to the string representation of the object for
            the row: ``str(obj)``.  This parameter supports django templating,
            the context for which contains a dictionary key named "obj" with
            the value being the object for the row.


Adds a ``list_display`` attribute showing a field in the object
        using a python %formatted string.

        :param field:
            Name of the field in the object.

        :param format_string:
            A old-style (to remain python 2.x compatible) % string formatter
            with a single variable reference. The named ``field`` attribute
            will be passed to the formatter using the "%" operator.

        :param title:
            Title for the column of the django admin table.  If not given it
            defaults to a capitalized version of ``field``


View decorator that enforces that the method was called using POST and
    contains a field containing a JSON dictionary. This method should
    only be used to wrap views and assumes the first argument of the method
    being wrapped is a ``request`` object.

    .. code-block:: python

        @json_post_required('data', 'json_data')
        def some_view(request):
            username = request.json_data['username']

    :param field:
        The name of the POST field that contains a JSON dictionary
    :param request_name:
        [optional] Name of the parameter on the request to put the
        deserialized JSON data. If not given the field name is used


Perfoms a mysqldump backup.
    Create a database dump for the given database.
    returns statuscode and shelloutput


Divergence of matched beam


Performs some environment checks prior to the program's execution


Prints latest tag's information


Prompts user before proceeding


Render ditaa code into a PNG output file.


Invoked in the 'finally' block of Application.run.


Add one tick to progress bar


If called in the context of an exception, calls post_mortem; otherwise
    set_trace.
    ``ipdb`` is preferred over ``pdb`` if installed.


Push k to the top of the list

        >>> l = DLL()
        >>> l.push(1)
        >>> l
        [1]
        >>> l.push(2)
        >>> l
        [2, 1]
        >>> l.push(3)
        >>> l
        [3, 2, 1]


Find the time this file was last modified.

        :param fname: File name
        :return: The last time the file was modified.


Find out if this item has been modified since last

        :param item: A key
        :return: True/False


Goes through the directory and builds a local cache based on
        the content of the directory.


Completely resets the database. This means that all information in
        the local cache and on disc will be erased.


print loading message on screen

        .. note::

            loading message only write to `sys.stdout`

        :param int wait: seconds to wait
        :param str message: message to print
        :return: None


a built-in wrapper make dry-run easier.
        you should use this instead use `os.system`

        .. note::

            to use it,you need add '--dry-run' option in
            your argparser options

        :param str cmd: command to execute
        :param bool fake_code: only display command
            when is True,default is False
        :return:


Download the image and return the
        local path to the image file.


Returns a Corrected URL to be used for a Request
        as per the REST API.


Returns a template.Node subclass.


Find the stack frame of the caller so that we can note the source
        file name, line number and function name.


Determine if a PE_PE is contained within a EP_PKG or a C_C.


Convert a BridgePoint data type to a pyxtuml meta model type.


The two lists of attributes which relates two classes in an association.


Create a named tuple from a BridgePoint enumeration.


Create a python function from a BridgePoint bridge.


Create a python value from a BridgePoint constant.


Create a python property that interprets that action of a BridgePoint derived
    attribute.


Create a pyxtuml class from a BridgePoint class.


Create a pyxtuml association from a simple association in BridgePoint.


Create pyxtuml associations from a linked association in BridgePoint.


Create a pyxtuml meta model from a BridgePoint model.
    Optionally, restrict to classes and associations contained in the
    component c_c.


Sends REJECT reply.


Sends RAISE reply.


Dispatches the reply to the proper queue.


Main method.

    This method holds what you want to execute when
    the script is run on command line.


Guess the type name of a serialized value.


Deserialize a value of some type


r'\(


Retrieve a feature collection.

        If a feature collection with the given id does not
        exist, then ``None`` is returned.

        :param str content_id: Content identifier.
        :param [str] feature_names:
          A list of feature names to retrieve. When ``None``, all
          features are retrieved. Wildcards are allowed.
        :rtype: :class:`dossier.fc.FeatureCollection` or ``None``


Returns an iterable of feature collections.

        This efficiently retrieves multiple FCs corresponding to the
        list of ids given. Tuples of identifier and feature collection
        are yielded. If the feature collection for a given id does not
        exist, then ``None`` is returned as the second element of the
        tuple.

        :param [str] content_ids: List of content ids.
        :param [str] feature_names:
          A list of feature names to retrieve. When ``None``, all
          features are retrieved. Wildcards are allowed.
        :rtype: Iterable of ``(content_id, FC)``


Adds feature collections to the store.

        This efficiently adds multiple FCs to the store. The iterable
        of ``items`` given should yield tuples of ``(content_id, FC)``.

        :param items: Iterable of ``(content_id, FC)``.
        :param [str] feature_names:
          A list of feature names to retrieve. When ``None``, all
          features are retrieved. Wildcards are allowed.


Deletes the corresponding feature collection.

        If the FC does not exist, then this is a no-op.


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.


Scan for ids only in the given id ranges.

        :param key_ranges:
          ``key_ranges`` should be a list of pairs of ranges. The first
          value is the lower bound id and the second value is the
          upper bound id. Use ``()`` in either position to leave it
          unbounded. If no ``key_ranges`` are given, then all FCs in
          the store are returned.
        :param [str] feature_names:
          A list of feature names to retrieve. When ``None``, all
          features are retrieved. Wildcards are allowed.
        :rtype: Iterable of ``content_id``


Scan for ids with a given prefix.

        :param str prefix: Identifier prefix.
        :param [str] feature_names:
          A list of feature names to retrieve. When ``None``, all
          features are retrieved. Wildcards are allowed.
        :rtype: Iterable of ``content_id``


Fulltext search.

        Yields an iterable of triples (score, identifier, FC)
        corresponding to the search results of the fulltext search
        in ``query``. This will only search text indexed under the
        given feature named ``fname``.

        Note that, unless ``preserve_order`` is set to True, the
        ``score`` will always be 0.0, and the results will be
        unordered. ``preserve_order`` set to True will cause the
        results to be scored and be ordered by score, but you should
        expect to see a decrease in performance.

        :param str fname:
          The feature to search.
        :param unicode query:
          The query.
        :param [str] feature_names:
          A list of feature names to retrieve. When ``None``, all
          features are retrieved. Wildcards are allowed.
        :rtype: Iterable of ``(score, content_id, FC)``


Fulltext search for identifiers.

        Yields an iterable of triples (score, identifier)
        corresponding to the search results of the fulltext search
        in ``query``. This will only search text indexed under the
        given feature named ``fname``.

        Note that, unless ``preserve_order`` is set to True, the
        ``score`` will always be 0.0, and the results will be
        unordered. ``preserve_order`` set to True will cause the
        results to be scored and be ordered by score, but you should
        expect to see a decrease in performance.

        :param str fname:
          The feature to search.
        :param unicode query:
          The query.
        :rtype: Iterable of ``(score, content_id)``


Keyword scan for ids.

        This performs a keyword scan using the query given. A keyword
        scan searches for FCs with terms in each of the query's indexed
        fields.

        At least one of ``query_id`` or ``query_fc`` must be provided.
        If ``query_fc`` is ``None``, then the query is retrieved
        automatically corresponding to ``query_id``.

        :param str query_id: Optional query id.
        :param query_fc: Optional query feature collection.
        :type query_fc: :class:`dossier.fc.FeatureCollection`
        :rtype: Iterable of ``content_id``


Low-level keyword index scan for ids.

        Retrieves identifiers of FCs that have a feature value
        ``val`` in the feature named ``fname``. Note that
        ``fname`` must be indexed.

        :param str fname: Feature name.
        :param str val: Feature value.
        :rtype: Iterable of ``content_id``


Maps feature names to ES's "_source" field.


Create the index


Retrieve the field mappings. Useful for debugging.


Retrieve the field types. Useful for debugging.


Take a feature collection in dict form and count its size in bytes.


Count bytes of all feature collections whose key satisfies one of
        the predicates in ``filter_preds``. The byte counts are binned
        by filter predicate.


construct a nice looking string for an FC


Pickle and compress.


Escape the error, and wrap it in a span with class ``error-message``


Displays the contact form and sends the email


Create a human-readable representation of a link on the 'TO'-side


Create a human-readable representation a unique identifier.


Check the model for uniqueness constraint violations.


Check the model for integrity violations across a subtype association.


try use gitconfig info.
        author,email etc.


Returns a index creation function.

    Returns a valid index ``create`` function for the feature names
    given. This can be used with the :meth:`Store.define_index`
    method to create indexes on any combination of features in a
    feature collection.

    :type feature_names: list(unicode)
    :rtype: ``(val -> index val)
              -> (content_id, FeatureCollection)
              -> generator of [index val]``


Add feature collections to the store.

        Given an iterable of tuples of the form
        ``(content_id, feature collection)``, add each to the store
        and overwrite any that already exist.

        This method optionally accepts a keyword argument `indexes`,
        which by default is set to ``True``. When it is ``True``,
        it will *create* new indexes for each content object for all
        indexes defined on this store.

        Note that this will not update existing indexes. (There is
        currently no way to do this without running some sort of
        garbage collection process.)

        :param iterable items: iterable of
                               ``(content_id, FeatureCollection)``.
        :type fc: :class:`dossier.fc.FeatureCollection`


Deletes all storage.

        This includes every content object and all index data.


Retrieve feature collections in a range of ids.

        Returns a generator of content objects corresponding to the
        content identifier ranges given. `key_ranges` can be a possibly
        empty list of 2-tuples, where the first element of the tuple
        is the beginning of a range and the second element is the end
        of a range. To specify the beginning or end of the table, use
        an empty tuple `()`.

        If the list is empty, then this yields all content objects in
        the storage.

        :param key_ranges: as described in
                           :meth:`kvlayer._abstract_storage.AbstractStorage`
        :rtype: generator of
                (``content_id``, :class:`dossier.fc.FeatureCollection`).


Returns ids that match an indexed value.

        Returns a generator of content identifiers that have an entry
        in the index ``idx_name`` with value ``val`` (after index
        transforms are applied).

        If the index named by ``idx_name`` is not registered, then a
        :exc:`~exceptions.KeyError` is raised.

        :param unicode idx_name: name of index
        :param val: the value to use to search the index
        :type val: unspecified (depends on the index, usually ``unicode``)
        :rtype: generator of ``content_id``
        :raises: :exc:`~exceptions.KeyError`


Returns ids that match a prefix of an indexed value.

        Returns a generator of content identifiers that have an entry
        in the index ``idx_name`` with prefix ``val_prefix`` (after
        index transforms are applied).

        If the index named by ``idx_name`` is not registered, then a
        :exc:`~exceptions.KeyError` is raised.

        :param unicode idx_name: name of index
        :param val_prefix: the value to use to search the index
        :type val: unspecified (depends on the index, usually ``unicode``)
        :rtype: generator of ``content_id``
        :raises: :exc:`~exceptions.KeyError`


Returns ids that match a prefix of an indexed value, and the
        specific key that matched the search prefix.

        Returns a generator of (index key, content identifier) that
        have an entry in the index ``idx_name`` with prefix
        ``val_prefix`` (after index transforms are applied).

        If the index named by ``idx_name`` is not registered, then a
        :exc:`~exceptions.KeyError` is raised.

        :param unicode idx_name: name of index
        :param val_prefix: the value to use to search the index
        :type val: unspecified (depends on the index, usually ``unicode``)
        :rtype: generator of (``index key``, ``content_id``)
        :raises: :exc:`~exceptions.KeyError`


Implementation for index_scan_prefix and
        index_scan_prefix_and_return_key, parameterized on return
        value function.

        retfunc gets passed a key tuple from the index:
        (index name, index value, content_id)


Add an index to this store instance.

        Adds an index transform to the current FC store. Once an index
        with name ``idx_name`` is added, it will be available in all
        ``index_*`` methods. Additionally, the index will be automatically
        updated on calls to :meth:`~dossier.fc.store.Store.put`.

        If an index with name ``idx_name`` already exists, then it is
        overwritten.

        Note that indexes do *not* persist. They must be re-defined for
        each instance of :class:`Store`.

        For example, to add an index on the ``boNAME`` feature, you can
        use the ``feature_index`` helper function:

        .. code-block:: python

            store.define_index('boNAME',
                               feature_index('boNAME'),
                               lambda s: s.encode('utf-8'))

        Another example for creating an index on names:

        .. code-block:: python

            store.define_index('NAME',
                               feature_index('canonical_name', 'NAME'),
                               lambda s: s.lower().encode('utf-8'))

        :param idx_name: The name of the index. Must be UTF-8 encodable.
        :type idx_name: unicode
        :param create: A function that accepts the ``transform`` function and
                       a pair of ``(content_id, fc)`` and produces a generator
                       of index values from the pair given using ``transform``.
        :param transform: A function that accepts an arbitrary value and
                          applies a transform to it. This transforms the
                          *stored* value to the *index* value. This *must*
                          produce a value with type `str` (or `bytes`).


Returns a generator of index triples.

        Returns a generator of index keys for the ``ids_and_fcs`` pairs
        given. The index keys have the form ``(idx_name, idx_val,
        content_id)``.

        :type idx_name: unicode
        :type ids_and_fcs: ``[(content_id, FeatureCollection)]``
        :rtype: generator of ``(str, str, str)``


Return a new filename to use as the combined file name for a
    bunch of files, based on the SHA of their contents.
    A precondition is that they all have the same file extension

    Given that the list of files can have different paths, we aim to use the
    most common path.

    Example:
      /somewhere/else/foo.js
      /somewhere/bar.js
      /somewhere/different/too/foobar.js
    The result will be
      /somewhere/148713695b4a4b9083e506086f061f9c.js

    Another thing to note, if the filenames have timestamps in them, combine
    them all and use the highest timestamp.


Extract the oritentation EXIF tag from the image, which should be a PIL Image instance,
    and if there is an orientation tag that would rotate the image, apply that rotation to
    the Image instance given to do an in-place rotation.

    :param Image im: Image instance to inspect
    :return: A possibly transposed image instance


Start a new piece


Start a new site.


Publish the site


Returns a list of the branches


Returns the currently active branch


Create a patch between tags


Create a callable that applies ``func`` to a value in a sequence.

    If the value is not a sequence or is an empty sequence then ``None`` is
    returned.

    :type  func: `callable`
    :param func: Callable to be applied to each result.

    :type  n: `int`
    :param n: Index of the value to apply ``func`` to.


Create a callable that applies ``func`` to every value in a sequence.

    If the value is not a sequence then an empty list is returned.

    :type  func: `callable`
    :param func: Callable to be applied to the first result.


Parse a value as an integer.

    :type  value: `unicode` or `bytes`
    :param value: Text value to parse

    :type  base: `unicode` or `bytes`
    :param base: Base to assume ``value`` is specified in.

    :type  encoding: `bytes`
    :param encoding: Encoding to treat ``bytes`` values as, defaults to
        ``utf-8``.

    :rtype: `int`
    :return: Parsed integer or ``None`` if ``value`` could not be parsed as an
        integer.


Parse a value as a boolean.

    :type  value: `unicode` or `bytes`
    :param value: Text value to parse.

    :type  true: `tuple` of `unicode`
    :param true: Values to compare, ignoring case, for ``True`` values.

    :type  false: `tuple` of `unicode`
    :param false: Values to compare, ignoring case, for ``False`` values.

    :type  encoding: `bytes`
    :param encoding: Encoding to treat `bytes` values as, defaults to
        ``utf-8``.

    :rtype: `bool`
    :return: Parsed boolean or ``None`` if ``value`` did not match ``true`` or
        ``false`` values.


Parse a value as a delimited list.

    :type  value: `unicode` or `bytes`
    :param value: Text value to parse.

    :type  parser: `callable` taking a `unicode` parameter
    :param parser: Callable to map over the delimited text values.

    :type  delimiter: `unicode`
    :param delimiter: Delimiter text.

    :type  encoding: `bytes`
    :param encoding: Encoding to treat `bytes` values as, defaults to
        ``utf-8``.

    :rtype: `list`
    :return: List of parsed values.


Parse a value as a POSIX timestamp in seconds.

    :type  value: `unicode` or `bytes`
    :param value: Text value to parse, which should be the number of seconds
        since the epoch.

    :type  _divisor: `float`
    :param _divisor: Number to divide the value by.

    :type  tz: `tzinfo`
    :param tz: Timezone, defaults to UTC.

    :type  encoding: `bytes`
    :param encoding: Encoding to treat `bytes` values as, defaults to
        ``utf-8``.

    :rtype: `datetime.datetime`
    :return: Parsed datetime or ``None`` if ``value`` could not be parsed.


Parse query parameters.

    :type  expected: `dict` mapping `bytes` to `callable`
    :param expected: Mapping of query argument names to argument parsing
        callables.

    :type  query: `dict` mapping `bytes` to `list` of `bytes`
    :param query: Mapping of query argument names to lists of argument values,
        this is the form that Twisted Web's `IRequest.args
        <twisted:twisted.web.iweb.IRequest.args>` value takes.

    :rtype: `dict` mapping `bytes` to `object`
    :return: Mapping of query argument names to parsed argument values.


Put metrics to cloudwatch. Metric shoult be instance or list of
        instances of CloudWatchMetric


Adapt a result to `IResource`.

        Several adaptions are tried they are, in order: ``None``,
        `IRenderable <twisted:twisted.web.iweb.IRenderable>`, `IResource
        <twisted:twisted.web.resource.IResource>`, and `URLPath
        <twisted:twisted.python.urlpath.URLPath>`. Anything else is returned as
        is.

        A `URLPath <twisted:twisted.python.urlpath.URLPath>` is treated as
        a redirect.


Handle the result from `IResource.render`.

        If the result is a `Deferred` then return `NOT_DONE_YET` and add
        a callback to write the result to the request when it arrives.


get the xsd name of a S_DT


Get the the referred attribute.


Build an xsd simpleType out of a S_CDT.


Build an xsd simpleType out of a S_EDT.


Build an xsd simpleType out of a S_UDT.


Build a partial xsd tree out of a S_DT and its sub types S_CDT, S_EDT, S_SDT and S_UDT.


Build an xsd complex element out of a O_OBJ, including its O_ATTR.


Indent an xml string with four spaces, and add an additional line break after each node.


Split an HTTP header whose components are separated with commas.

    Each component is then split on semicolons and the component arguments
    converted into a `dict`.

    @return: `list` of 2-`tuple` of `bytes`, `dict`
    @return: List of header arguments and mapping of component argument names
        to values.


Extract an encoding from a ``Content-Type`` header.

    @type  requestHeaders: `twisted.web.http_headers.Headers`
    @param requestHeaders: Request headers.

    @type  encoding: `bytes`
    @param encoding: Default encoding to assume if the ``Content-Type``
        header is lacking one. Defaults to ``UTF-8``.

    @rtype: `bytes`
    @return: Content encoding.


Create a nil-safe callable decorator.

    If the wrapped callable receives ``None`` as its argument, it will return
    ``None`` immediately.


Gets the full list of bikes from the bikeregister site.
    The data is hidden behind a form post request and so
    we need to extract an xsrf and session token with bs4.

    todo add pytest tests

    :return: All the currently registered bikes.
    :raise ApiError: When there was an error connecting to the API.


set positional information on a node


r"\=\=


r"!\=


r"\<\=


r"\>\=


r"\=


r"\.


r"\[


r"\?


r"\<


r"\>


r"\+


Get the version from version module without importing more than
    necessary.


check if a tx is confirmed, else resend it.

        :param use_open_peers: select random peers fro api/peers endpoint


Create message content and properties to create queue with QMFv2

        :param name: Name of queue to create
        :type name: str
        :param strict: Whether command should fail when unrecognized properties are provided
            Not used by QMFv2
            Default: True
        :type strict: bool
        :param auto_delete: Whether queue should be auto deleted
            Default: False
        :type auto_delete: bool
        :param auto_delete_timeout: Timeout in seconds for auto deleting queue
            Default: 10
        :type auto_delete_timeout: int

        :returns: Tuple containing content and method properties


Create message content and properties to list all exchanges with QMFv2

        :returns: Tuple containing content and query properties


Create message content and properties to purge queue with QMFv2

        :param name: Name of queue to purge
        :type name: str

        :returns: Tuple containing content and method properties


attachments should be a list of paths


Returns the text from an image at a given url.


Get sub-command list

    .. note::

        Don't use logger handle this function errors.

        Because the error should be a code error,not runtime error.

    :return: `list` matched sub-parser


Serialize an xtUML metamodel class.


Convert Hump style to underscore

    :param name: Hump Character
    :return: str


Function for command line execution


Runs the program. Takes a list of postcodes or coordinates and
    returns various information about them. If using the cli, make
    sure to update the bikes database with the -u command.

    Locations can be either a specific postcode, or a pair of coordinates.
    Coordinates are passed in the form "55.948824,-3.196425".

    :param locations: The list of postcodes or coordinates to search.
    :param random: The number of random postcodes to include.
    :param bikes: Includes a list of stolen bikes in that area.
    :param crime: Includes a list of committed crimes in that area.
    :param nearby: Includes a list of wikipedia articles in that area.
    :param json: Returns the data in json format.
    :param update_bikes: Whether to force update bikes.
    :param api_server: If given, the program will instead run a rest api.
    :param cross_origin:
    :param host:
    :param port: Defines the port to run the rest api on.
    :param db_path: The path to the sqlite db to use.
    :param verbose: The verbosity.


Adds to the context BiDi related variables

    LANGUAGE_DIRECTION -- Direction of current language ('ltr' or 'rtl')
    LANGUAGE_START -- Start of language layout ('right' for rtl, 'left'
                      for 'ltr')
    LANGUAGE_END -- End of language layout ('left' for rtl, 'right'
                      for 'ltr')
    LANGUAGE_MARKER -- Language marker entity ('' for rtl, '&lrm'
                       for ltr)


Gets all the fuel prices within the specified radius.


Gets the fuel price trends for the given location and fuel types.


Fetches API reference data.

        :param modified_since: The response will be empty if no
        changes have been made to the reference data since this
        timestamp, otherwise all reference data will be returned.


Find links that correspond to the given arguments.


Formalize the association and expose referential attributes
        on instances.


Obtain the type of an attribute.


Obtain a sequence of all instances in the metamodel.


Define a new class in the metamodel, and return its metaclass.


Receives header, payload, and topics through a ZeroMQ socket.

    :param socket: a zmq socket.
    :param flags: zmq flags to receive messages.
    :param capture: a function to capture received messages.


This also finds code you are working on today!


Take a string or list of strings and try to extract all the emails


Collects methods which are speced as RPC.


If there is a postcode in the url it validates and normalizes it.


Called before template is applied.


A Component contains packageable elements


A Package contains packageable elements


Match a route parameter.

    `Any` is a synonym for `Text`.

    :type  name: `bytes`
    :param name: Route parameter name.

    :type  encoding: `bytes`
    :param encoding: Default encoding to assume if the ``Content-Type``
        header is lacking one.

    :return: ``callable`` suitable for use with `route` or `subroute`.


Match an integer route parameter.

    :type  name: `bytes`
    :param name: Route parameter name.

    :type  base: `int`
    :param base: Base to interpret the value in.

    :type  encoding: `bytes`
    :param encoding: Default encoding to assume if the ``Content-Type``
        header is lacking one.

    :return: ``callable`` suitable for use with `route` or `subroute`.


Match a request path against our path components.

    The path components are always matched relative to their parent is in the
    resource hierarchy, in other words it is only possible to match URIs nested
    more deeply than the parent resource.

    :type  components: ``iterable`` of `bytes` or `callable`
    :param components: Iterable of path components, to match against the
        request, either static strings or dynamic parameters. As a convenience,
        a single `bytes` component containing ``/`` may be given instead of
        manually separating the components. If no components are given the null
        route is matched, this is the case where ``segments`` is empty.

    :type  segments: ``sequence`` of `bytes`
    :param segments: Sequence of path segments, from the request, to match
        against.

    :type  partialMatching: `bool`
    :param partialMatching: Allow partial matching against the request path?

    :rtype: 2-`tuple` of `dict` keyed on `bytes` and `list` of `bytes`
    :return: Pair of parameter results, mapping parameter names to processed
        values, and a list of the remaining request path segments. If there is
        no route match the result will be ``None`` and the original request path
        segments.


Decorate a router-producing callable to instead produce a resource.

    This simply produces a new callable that invokes the original callable, and
    calls ``resource`` on the ``routerAttribute``.

    If the router producer has multiple routers the attribute can be altered to
    choose the appropriate one, for example:

    .. code-block:: python

        class _ComplexRouter(object):
            router = Router()
            privateRouter = Router()

            @router.route('/')
            def publicRoot(self, request, params):
                return SomethingPublic(...)

            @privateRouter.route('/')
            def privateRoot(self, request, params):
                return SomethingPrivate(...)

        PublicResource = routedResource(_ComplexRouter)
        PrivateResource = routedResource(_ComplexRouter, 'privateRouter')

    :type  f: ``callable``
    :param f: Callable producing an object with a `Router` attribute, for
        example, a type.

    :type  routerAttribute: `str`
    :param routerAttribute: Name of the `Router` attribute on the result of
        calling ``f``.

    :rtype: `callable`
    :return: Callable producing an `IResource`.


Create a new `Router` instance, with it's own set of routes, for
        ``obj``.


Add a route handler and matcher to the collection of possible routes.


See `txspinneret.route.route`.

        This decorator can be stacked with itself to specify multiple routes
        with a single handler.


See `txspinneret.route.subroute`.

        This decorator can be stacked with itself to specify multiple routes
        with a single handler.


Return the average brightness of the image.


Open a NamedTemoraryFile handle in a context manager


Read entry from JSON file


Save entry to JSON file


Update entry by UUID in the JSON file


Given a valid position in the text document, try to find the
            position of the matching bracket. Returns -1 if unsuccessful.


Updates the document formatting based on the new cursor position.


Bottleneck to fix up IronPython string exceptions


Decorator for registering a simple path.

        Args:
            path (str): Path to be matched.
            method (str, optional): Usually used to define one of GET, POST,
                PUT, DELETE. You may use whatever fits your situation though.
                Defaults to None.
            type_cast (dict, optional): Mapping between the param name and
                one of `int`, `float` or `bool`. The value reflected by the
                provided param name will than be casted to the given type.
                Defaults to None.


Function for registering a simple path.

        Args:
            path (str): Path to be matched.
            function (function): Function to associate with this path.
            method (str, optional): Usually used to define one of GET, POST,
                PUT, DELETE. You may use whatever fits your situation though.
                Defaults to None.
            type_cast (dict, optional): Mapping between the param name and
                one of `int`, `float` or `bool`. The value reflected by the
                provided param name will than be casted to the given type.
                Defaults to None.


Calls the first function matching the urls pattern and method.

        Args:
            url (str): Url for which to call a matching function.
            method (str, optional): The method used while registering a
                function.
                Defaults to None
            args (dict, optional): Additional args to be passed to the
                matching function.

        Returns:
            The functions return value or `None` if no function was called.


Called when the down key is pressed. Returns whether to continue
            processing the event.


If possible, set the input buffer to a subsequent history item.

        Parameters:
        -----------
        substring : str, optional
            If specified, search for an item with this substring.
        as_prefix : bool, optional
            If True, the substring must match at the beginning (default).

        Returns:
        --------
        Whether the input buffer was changed.


Handles replies for code execution, here only session history length


Returns whether history movement is locked.


Replace the current history with a sequence of history items.


Event handler for the button click.


Generates a list of Record objects given a DataFrame.
    Each Record instance has a series attribute which is a pandas.Series of the same attributes
    in the DataFrame.
    Optional data can be passed in through kwargs which will be included by the name of each object.

    parameters
    ----------
    df : pandas.DataFrame
    kwargs : alternate arguments to be saved by name to the series of each object

    Returns
    -------
    collection : list
        list of Record objects where each Record represents one row from a dataframe

    Examples
    --------
    This is how we generate a Record Collection from a DataFrame.

    >>> import pandas as pd
    >>> import turntable
    >>>
    >>> df = pd.DataFrame({'Artist':"""Michael Jackson, Pink Floyd, Whitney Houston, Meat Loaf,
        Eagles, Fleetwood Mac, Bee Gees, AC/DC""".split(', '),
    >>> 'Album' :"""Thriller, The Dark Side of the Moon, The Bodyguard, Bat Out of Hell,
        Their Greatest Hits (1971-1975), Rumours, Saturday Night Fever, Back in Black""".split(', ')})
    >>> collection = turntable.press.build_collection(df, my_favorite_record = 'nevermind')
    >>> record = collection[0]
    >>> print record.series


Converts a collection back into a pandas DataFrame

    parameters
    ----------
    collection : list
        list of Record objects where each Record represents one row from a dataframe

    Returns
    -------
    df : pandas.DataFrame
        DataFrame of length=len(collection) where each row represents one Record


Initalizes the given argument structure as properties of the class
        to be used by name in specific method execution.

        Parameters
        ----------
        kwargs : dictionary
            Dictionary of extra attributes,
            where keys are attributes names and values attributes values.


Update our SUB socket's subscriptions.


receive and parse a message, then log it.