(elevation, tile, azimuth=315.0, altitude=45.0, z=1.0, scale=1.0)

return ma.masked_array(
        data=np.pad(shaded, 1, mode='edge'), mask=elevation.mask
    )

def Func ( arg_0 , arg_1 , arg_2 = 315.0 , arg_3 = 45.0 , arg_4 = 1.0 , arg_5 = 1.0 ) : arg_2 = float ( arg_2 ) arg_3 = float ( arg_3 ) arg_4 = float ( arg_4 ) arg_5 = float ( arg_5 ) arg_6 = arg_1 . tile . pixel_x_size arg_7 = - arg_1 . tile . pixel_y_size arg_8 , arg_9 = calculate_slope_aspect ( arg_0 , arg_6 , arg_7 , arg_4 = arg_4 , arg_5 = arg_5 ) arg_10 = math . pi / 180.0 arg_11 = np . sin ( arg_3 * arg_10 ) * np . sin ( arg_8 ) + np . cos ( arg_3 * arg_10 ) * np . cos ( arg_8 ) * np . cos ( ( arg_2 - 90.0 ) * arg_10 - arg_9 ) arg_11 = ( ( ( arg_11 + 1.0 ) / 2 ) * - 255.0 ) . astype ( "uint8" ) return ma . masked_array ( data = np . pad ( arg_11 , 1 , mode = 'edge' ) , mask = arg_0 . mask )

def Func(arg_0, arg_1, arg_2=315.0, arg_3=45.0, arg_4=1.0, arg_5=1.0):
    """
    Return Funcd numpy array.

    Parameters
    ----------
    elevation : array
        input elevation data
    tile : Tile
        tile covering the array
    z : float
        vertical exaggeration factor
    scale : float
        scale factor of pixel size units versus height units (insert 112000
        when having elevation values in meters in a geodetic projection)
    """
    arg_2 = float(arg_2)
    arg_3 = float(arg_3)
    arg_4 = float(arg_4)
    arg_5 = float(arg_5)
    arg_6 = arg_1.tile.pixel_x_size
    arg_7 = -arg_1.tile.pixel_y_size
    arg_8, arg_9 = calculate_slope_aspect(
        arg_0, arg_6, arg_7, arg_4=arg_4, arg_5=arg_5)
    arg_10 = math.pi / 180.0
    arg_11 = np.sin(arg_3 * arg_10) * np.sin(arg_8) \
        + np.cos(arg_3 * arg_10) * np.cos(arg_8) \
        * np.cos((arg_2 - 90.0) * arg_10 - arg_9)
    # shaded now has values between -1.0 and +1.0
    # stretch to 0 - 255 and invert
    arg_11 = (((arg_11+1.0)/2)*-255.0).astype("uint8")
    # add one pixel padding using the edge values
    return ma.masked_array(
        data=np.pad(arg_11, 1, mode='edge'), mask=arg_0.mask
    )

Return hillshaded numpy array.

    Parameters
    ----------
    elevation : array
        input elevation data
    tile : Tile
        tile covering the array
    z : float
        vertical exaggeration factor
    scale : float
        scale factor of pixel size units versus height units (insert 112000
        when having elevation values in meters in a geodetic projection)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_3 / ( 2 * np . sqrt ( 2 * np . log ( 2 ) ) ) arg_5 = np . zeros ( ( arg_0 . size , arg_1 . shape [ 1 ] , arg_2 . size ) ) for arg_6 , arg_7 in enumerate ( arg_2 ) : arg_5 [ : , : , arg_6 ] = gauss ( arg_0 [ : , np . newaxis ] , 1 , arg_7 , arg_4 ) arg_8 = arg_5 / arg_5 . sum ( 0 ) arg_9 = ( arg_8 * arg_1 [ : , : , np . newaxis ] ) . sum ( 0 ) arg_10 = np . power ( arg_9 - arg_1 [ : , : , np . newaxis ] , 2 ) arg_11 = np . sqrt ( ( arg_10 * arg_8 ) . sum ( 0 ) ) arg_12 = arg_11 / np . sqrt ( arg_5 . sum ( 0 ) ) return arg_9 , arg_11 , arg_12

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Calculate gaussian weigted moving mean, SD and SE.

    Parameters
    ----------
    x : array-like
        The independent variable
    yarray : (n,m) array
        Where n = x.size, and m is the number of
        dependent variables to smooth.
    x_new : array-like
        The new x-scale to interpolate the data
    fwhm : int
        FWHM of the gaussian kernel.

    Returns
    -------
    (mean, std, se) : tuple
    """
    arg_4 = arg_3 / (2 * np.sqrt(2 * np.log(2)))

    # create empty mask array
    arg_5 = np.zeros((arg_0.size, arg_1.shape[1], arg_2.size))
    # fill mask
    for arg_6, arg_7 in enumerate(arg_2):
        arg_5[:, :, arg_6] = gauss(arg_0[:, np.newaxis], 1, arg_7, arg_4)
    # normalise mask
    arg_8 = arg_5 / arg_5.sum(0)  # sum of each gaussian = 1

    # calculate moving average
    arg_9 = (arg_8 * arg_1[:, :, np.newaxis]).sum(0)  # apply mask to data
    # sum along xn axis to get means

    # calculate moving sd
    arg_10 = np.power(arg_9 - arg_1[:, :, np.newaxis], 2)
    arg_11 = np.sqrt((arg_10 * arg_8).sum(0))
    # sqrt of weighted average of data-mean

    # calculate moving se
    arg_12 = arg_11 / np.sqrt(arg_5.sum(0))
    # max amplitude of weights is 1, so sum of weights scales
    # a fn of how many points are nearby. Use this as 'n' in
    # SE calculation.

    return arg_9, arg_11, arg_12

Calculate gaussian weigted moving mean SD and SE .


def
Func
(
arg_0
)
:
arg_1
,
arg_2
=
get_project_or_local
(
arg_0
.
obj
.
get
(
'project'
)
)
try
:
PolyaxonClient
(
)
.
project
.
Func_repo
(
arg_1
,
arg_2
)
except
(
PolyaxonHTTPError
,
PolyaxonShouldExitError
,
PolyaxonClientException
)
as
e
:
Printer
.
print_error
(
'Could not Func code for project `{}`.'
.
format
(
arg_2
)
)
Printer
.
print_error
(
'Error message `{}`.'
.
format
(
e
)
)
sys
.
exit
(
1
)
Printer
.
print_success
(
'Files Funced.'
)

def Func(arg_0):
    """Download code of the current project."""
    arg_1, arg_2 = get_project_or_local(arg_0.obj.get('project'))
    try:
        PolyaxonClient().project.Func_repo(arg_1, arg_2)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func code for project `{}`.'.format(arg_2))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)
    Printer.print_success('Files Funced.')


def Func(arg_0, arg_1, arg_2=True):
        """Function to handle sessions for a GET request"""
        # Check if we failed to request the url or need to login
        if arg_0.access_token is None or \
           arg_0._session is None or \
           arg_0._session_error:
            # Clear Access Token en reset session error
            arg_0.access_token = None
            arg_0._session_error = False

            # First Reset the session
            if arg_0._session is not None:
                arg_0._session = None
            arg_0._debuglog("Creating New Session")
            arg_0._session = requests.Session()

            # disable SSL certificate verification
            if arg_0._use_https:
                arg_0._session.verify = False

            # We Created a new Session so login
            if arg_0._login() is False:
                arg_0._session_error = True
                arg_0._debuglog("Login Failed, unable to process request")
                return

        # Now request the data
        arg_7 = arg_0._executeFunc(arg_1)
        if (arg_0._session_error or arg_7 is None) and arg_2:
            arg_0._debuglog("Error occured, retrying...")
            arg_0.Func(arg_1, False)

        return arg_7


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
:
if
not
isinstance
(
arg_1
,
string_types
)
:
raise
SyntaxError
(
"Error in Func: "
"Argument: {0} is a {1}"
.
format
(
arg_1
,
type
(
arg_1
)
)
)
arg_2
=
hashlib
.
md5
(
)
arg_2
.
update
(
' '
.
join
(
arg_0
)
.
encode
(
'utf-8'
)
)
return
arg_2
.
hexdigest
(
)

def Func(arg_0):
    """
    Generate an md5-key from a list of arguments.

    Args:
        list_of_arguments: A list of strings

    Returns:
        A md5-key object generated from the list of strings.
    """
    for arg_1 in arg_0:
        if not isinstance(arg_1, string_types):
            raise SyntaxError("Error in Func: "
                              "Argument: {0} is a {1}".format(arg_1, type(arg_1)))

    arg_2 = hashlib.md5()
    arg_2.update(' '.join(arg_0).encode('utf-8'))
    return arg_2.hexdigest()

Generate an md5 - key from a list of arguments .


def Func(arg_0, arg_1="skype"):
        """
        Configure this endpoint to allow setting presence.

        Args:
            name (str): display name for this endpoint
        """
        arg_0.conn("PUT", "{0}/users/ME/endpoints/{1}/presenceDocs/messagingService"
                         .format(arg_0.conn.msgsHost, arg_0.id),
                  auth=SkypeConnection.Auth.RegToken,
                  json={"id": "messagingService",
                        "type": "EndpointPresenceDoc",
                        "selfLink": "uri",
                        "privateInfo": {"epname": arg_1},
                        "publicInfo": {"capabilities": "",
                                       "type": 1,
                                       "skypeNameVersion": "skype.com",
                                       "nodeInfo": "xx",
                                       "version": "908/1.30.0.128"}})

Configure this endpoint to allow setting presence .


def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Record a Func value.

        Record the length of time of something to be added to a set of values from
        which a statistical distribution is derived.

        Depending on the backend, you might end up with count, average, median,
        95% and max for a set of Func values.

        This is useful for analyzing how long things take to occur. For
        example, how long it takes for a function to run, to upload files, or
        for a database query to execute.

        :arg string stat: A period delimited alphanumeric key.

        :arg int value: A Func in milliseconds.

        :arg list-of-strings tags: Each string in the tag consists of a key and
            a value separated by a colon. Tags can make it easier to break down
            metrics for analysis.

            For example ``['env:stage', 'compressed:yes']``.

        For example:

        >>> import time
        >>> import markus

        >>> metrics = markus.get_metrics('foo')
        >>> def upload_file(payload):
        ...     start_time = time.perf_counter()  # this is in seconds
        ...     # upload the file
        ...     Func = (time.perf_counter() - start_time) * 1000.0  # convert to ms
        ...     metrics.Func('upload_file_time', value=Func)

        .. Note::

           If you're Func a function or a block of code, it's probably more
           convenient to use :py:meth:`markus.main.MetricsInterface.timer` or
           :py:meth:`markus.main.MetricsInterface.timer_decorator`.

        """
        arg_4 = arg_0._full_stat(arg_1)
        for arg_5 in _get_metrics_backends():
            arg_5.Func(arg_4, arg_2=arg_2, arg_3=arg_3)

Record a timing value.

        Record the length of time of something to be added to a set of values from
        which a statistical distribution is derived.

        Depending on the backend, you might end up with count, average, median,
        95% and max for a set of timing values.

        This is useful for analyzing how long things take to occur. For
        example, how long it takes for a function to run, to upload files, or
        for a database query to execute.

        :arg string stat: A period delimited alphanumeric key.

        :arg int value: A timing in milliseconds.

        :arg list-of-strings tags: Each string in the tag consists of a key and
            a value separated by a colon. Tags can make it easier to break down
            metrics for analysis.

            For example ``['env:stage', 'compressed:yes']``.

        For example:

        >>> import time
        >>> import markus

        >>> metrics = markus.get_metrics('foo')
        >>> def upload_file(payload):
        ...     start_time = time.perf_counter()  # this is in seconds
        ...     # upload the file
        ...     timing = (time.perf_counter() - start_time) * 1000.0  # convert to ms
        ...     metrics.timing('upload_file_time', value=timing)

        .. Note::

           If you're timing a function or a block of code, it's probably more
           convenient to use :py:meth:`markus.main.MetricsInterface.timer` or
           :py:meth:`markus.main.MetricsInterface.timer_decorator`.


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

        Calls `calculate_derivative_P` internally to perform the actual
        calculation.

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

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

        Returns
        -------
        d_prop_d_P_at_T : float
            Calculated derivative property, [`units/Pa^order`]
        '''
        arg_4 = arg_0.select_valid_methods_P(arg_1, arg_2)
        for arg_5 in arg_4:
            try:
                return arg_0.calculate_derivative_P(arg_2, arg_1, arg_5, arg_3)
            except:
                pass
        return None

r Method to calculate a derivative of a temperature and pressure dependent property with respect to pressure at constant temperature of a given order . Methods found valid by select_valid_methods_P are attempted until a method succeeds . If no methods are valid and succeed None is returned .


def Func(arg_0):
    """This decorator provides several helpful shortcuts for writing Twilio
    views.

        - It ensures that only requests from Twilio are passed through. This
          helps protect you from forged requests.

        - It ensures your view is exempt from CSRF checks via Django's
          @csrf_exempt decorator. This is necessary for any view that accepts
          POST requests from outside the local domain (eg: Twilio's servers).

        - It allows your view to (optionally) return TwiML to pass back to
          Twilio's servers instead of building a ``HttpResponse`` object
          manually.

        - It allows your view to (optionally) return any ``twilio.Verb`` object
          instead of building a ``HttpResponse`` object manually.

    Usage::

        from twilio.twiml import Response

        @Func
        def my_view(request):
            r = Response()
            r.sms("Thanks for the SMS message!")
            return r
    """
    @csrf_exempt
    @wraps(arg_0)
    def decorator(arg_1, *arg_2, **arg_3):
        # Attempt to gather all required information to allow us to check the
        # incoming HTTP request for forgery. If any of this information is not
        # available, then we'll throw a HTTP 403 error (forbidden).

        # Ensure the request method is POST
        if arg_1.method != "POST":
            logger.error("Twilio: Expected POST request", extra={"request": arg_1})
            return HttpResponseNotAllowed(arg_1.method)

        if not getattr(settings, "TWILIO_SKIP_SIGNATURE_VALIDATION"):
            # Validate the request
            try:
                arg_4 = RequestValidator(settings.TWILIO_AUTH_TOKEN)
                arg_5 = arg_1.build_absolute_uri()
                # Ensure the original requested url is tested for validation
                # Prevents breakage when processed behind a proxy server
                if "HTTP_X_FORWARDED_SERVER" in arg_1.META:
                    arg_6 = "https" if arg_1.META["HTTP_X_TWILIO_SSL"] == "Enabled" else "http"
                    arg_5 = "{0}://{1}{2}".format(
                        arg_6, arg_1.META["HTTP_X_FORWARDED_SERVER"], arg_1.META["REQUEST_URI"]
                    )
                arg_7 = arg_1.META["HTTP_X_TWILIO_SIGNATURE"]
            except (AttributeError, KeyError) as e:
                logger.exception("Twilio: Missing META param", extra={"request": arg_1})
                return HttpResponseForbidden("Missing META param: %s" % e)

            # Now that we have all the required information to perform forgery
            # checks, we'll actually do the forgery check.
            if not arg_4.validate(arg_5, arg_1.POST, arg_7):
                logger.error(
                    "Twilio: Invalid url signature %s - %s - %s",
                    arg_5, arg_1.POST, arg_7, extra={"request": arg_1}
                )
                return HttpResponseForbidden("Invalid signature")

        # Run the wrapped view, and capture the data returned.
        arg_8 = arg_0(arg_1, *arg_2, **arg_3)

        # If the view returns a string (or a ``twilio.Verb`` object), we'll
        # assume it is XML TwilML data and pass it back with the appropriate
        # mimetype. We won't check the XML data because that would be too time
        # consuming for every request. Instead, we'll let the errors pass
        # through to be dealt with by the developer.
        if isinstance(arg_8, six.text_type):
            return HttpResponse(arg_8, mimetype="application/xml")
        elif isinstance(arg_8, Verb):
            return HttpResponse(force_text(arg_8), mimetype="application/xml")
        else:
            return arg_8
    return decorator

This decorator provides several helpful shortcuts for writing Twilio
    views.

        - It ensures that only requests from Twilio are passed through. This
          helps protect you from forged requests.

        - It ensures your view is exempt from CSRF checks via Django's
          @csrf_exempt decorator. This is necessary for any view that accepts
          POST requests from outside the local domain (eg: Twilio's servers).

        - It allows your view to (optionally) return TwiML to pass back to
          Twilio's servers instead of building a ``HttpResponse`` object
          manually.

        - It allows your view to (optionally) return any ``twilio.Verb`` object
          instead of building a ``HttpResponse`` object manually.

    Usage::

        from twilio.twiml import Response

        @twilio_view
        def my_view(request):
            r = Response()
            r.sms("Thanks for the SMS message!")
            return r

This decorator provides several helpful shortcuts for writing Twilio views .


def
Func
(
arg_0
,
arg_1
)
:
LOG
.
debug
(
"Fetching hpo term %s"
,
arg_1
)
return
arg_0
.
Func_collection
.
find_one
(
{
'_id'
:
arg_1
}
)

def Func(arg_0, arg_1):
        """Fetch a hpo term

        Args:
            hpo_id(str)

        Returns:
            hpo_obj(dict)
        """
        LOG.debug("Fetching hpo term %s", arg_1)

        return arg_0.Func_collection.find_one({'_id': arg_1})


def Func ( ) : class Translation ( object ) : arg_0 = staticmethod ( arg_0 ) arg_1 = staticmethod ( arg_1 ) import jingo jingo . env . install_gettext_translations ( Translation )

def Func():
    """
    Install our gettext and ngettext functions into Jinja2's environment.
    """
    class Translation(object):
        """
        We pass this object to jinja so it can find our gettext implementation.
        If we pass the GNUTranslation object directly, it won't have our
        context and whitespace stripping action.
        """
        arg_0 = staticmethod(arg_0)
        arg_1 = staticmethod(arg_1)

    import jingo
    jingo.env.install_gettext_translations(Translation)

Install our gettext and ngettext functions into Jinja2 s environment .


def Func ( arg_0 , arg_1 = None ) : if arg_1 : arg_0 . _canvas . mode = arg_1 return arg_0 . _canvas . mode

def Func(arg_0, arg_1=None):
        '''
        Set the current Func mode.

        :param mode: CENTER or CORNER'''
        if arg_1:
            arg_0._canvas.mode = arg_1
        return arg_0._canvas.mode

Set the current transform mode.

        :param mode: CENTER or CORNER


def Func ( arg_0 ) : arg_1 = CRL ( ) for arg_2 in xrange ( 100 ) : arg_1 . add_revoked ( Revoked ( ) ) for arg_2 in xrange ( arg_0 . iterations ) : arg_1 . get_revoked ( )

def Func(arg_0):
        """
        Create a CRL object with 100 Revoked objects, then call the
        get_revoked method repeatedly.
        """
        arg_1 = CRL()
        for arg_2 in xrange(100):
            arg_1.add_revoked(Revoked())
        for arg_2 in xrange(arg_0.iterations):
            arg_1.get_revoked()

Create a CRL object with 100 Revoked objects then call the get_revoked method repeatedly .


def Func ( arg_0 ) : arg_1 = arg_0 . decorators . nodes if arg_0 . decorators else [ ] for arg_2 in arg_1 : if ( isinstance ( arg_2 , astroid . Attribute ) and arg_2 . attrname == "setter" and isinstance ( arg_2 . expr , astroid . Name ) ) : return arg_2 . expr . name return None

def Func(arg_0):
    """Get the name of the property that the given node is a setter for.

    :param node: The node to get the property name for.
    :type node: str

    :rtype: str or None
    :returns: The name of the property that the node is a setter for,
        or None if one could not be found.
    """
    arg_1 = arg_0.decorators.nodes if arg_0.decorators else []
    for arg_2 in arg_1:
        if (
            isinstance(arg_2, astroid.Attribute)
            and arg_2.attrname == "setter"
            and isinstance(arg_2.expr, astroid.Name)
        ):
            return arg_2.expr.name
    return None

Get the name of the property that the given node is a setter for .


(self, revocation_reason, uid=None, revocation_message=None,
               compromise_occurrence_date=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None,
               arg_4=None):
        """
        Revoke a managed object stored by a KMIP appliance.

        Args:
            revocation_reason (RevocationReasonCode): An enumeration indicating
                the revocation reason.
            uid (string): The unique ID of the managed object to Func.
                Optional, defaults to None.
            revocation_message (string): A message regarding the revocation.
                Optional, defaults to None.
            compromise_occurrence_date (int): An integer, the number of seconds
                since the epoch, which will be converted to the Datetime when
                the managed object was first believed to be compromised.
                Optional, defaults to None.

        Returns:
            None

        Raises:
            ClientConnectionNotOpen: if the client connection is unusable
            KmipOperationFailure: if the operation result is a failure
            TypeError: if the input argument is invalid
        """
        # Check input
        if not isinstance(arg_1, enums.RevocationReasonCode):
            raise TypeError(
                "revocation_reason must be a RevocationReasonCode enumeration")
        if arg_2 is not None:
            if not isinstance(arg_2, six.string_types):
                raise TypeError("uid must be a string")
        if arg_3 is not None:
            if not isinstance(arg_3, six.string_types):
                raise TypeError("revocation_message must be a string")
        if arg_4 is not None:
            if not isinstance(arg_4, six.integer_types):
                raise TypeError(
                    "compromise_occurrence_date must be an integer")
            arg_4 = primitives.DateTime(
                arg_4,
                enums.Tags.COMPROMISE_OCCURRENCE_DATE)

        # Func the managed object and handle the results
        arg_5 = arg_0.proxy.Func(arg_1, arg_2, arg_3,
                                   arg_4)

        arg_6 = arg_5.result_status.value
        if arg_6 == enums.ResultStatus.SUCCESS:
            return
        else:
            arg_7 = arg_5.result_reason.value
            arg_8 = arg_5.result_message.value
            raise exceptions.KmipOperationFailure(arg_6, arg_7, arg_8)

Revoke a managed object stored by a KMIP appliance.

        Args:
            revocation_reason (RevocationReasonCode): An enumeration indicating
                the revocation reason.
            uid (string): The unique ID of the managed object to revoke.
                Optional, defaults to None.
            revocation_message (string): A message regarding the revocation.
                Optional, defaults to None.
            compromise_occurrence_date (int): An integer, the number of seconds
                since the epoch, which will be converted to the Datetime when
                the managed object was first believed to be compromised.
                Optional, defaults to None.

        Returns:
            None

        Raises:
            ClientConnectionNotOpen: if the client connection is unusable
            KmipOperationFailure: if the operation result is a failure
            TypeError: if the input argument is invalid

Revoke a managed object stored by a KMIP appliance .


def Func(arg_0, arg_1=0):
    '''Run semaphore tracker.'''
    # protect the process from ^C and "killall python" etc
    signal.signal(signal.SIGINT, signal.SIG_IGN)
    signal.signal(signal.SIGTERM, signal.SIG_IGN)

    if _HAVE_SIGMASK:
        signal.pthread_sigmask(signal.SIG_UNBLOCK, _IGNORED_SIGNALS)

    for arg_2 in (sys.stdin, sys.stdout):
        try:
            arg_2.close()
        except Exception:
            pass

    if arg_1:  # pragma: no cover
        sys.stderr.write("Main semaphore tracker is running\n")
        sys.stderr.flush()

    arg_3 = set()
    try:
        # keep track of registered/unregistered semaphores
        with os.fdopen(arg_0, 'rb') as arg_2:
            for arg_4 in arg_2:
                try:
                    arg_5, arg_6 = arg_4.strip().split(b':')
                    if arg_5 == b'REGISTER':
                        arg_6 = arg_6.decode('ascii')
                        arg_3.add(arg_6)
                        if arg_1:  # pragma: no cover
                            sys.stderr.write("[SemaphoreTracker] register {}\n"
                                             .format(arg_6))
                            sys.stderr.flush()
                    elif arg_5 == b'UNREGISTER':
                        arg_6 = arg_6.decode('ascii')
                        arg_3.remove(arg_6)
                        if arg_1:  # pragma: no cover
                            sys.stderr.write("[SemaphoreTracker] unregister {}"
                                             ": cache({})\n"
                                             .format(arg_6, len(arg_3)))
                            sys.stderr.flush()
                    elif arg_5 == b'PROBE':
                        pass
                    else:
                        raise RuntimeError('unrecognized command %r' % arg_5)
                except BaseException:
                    try:
                        sys.excepthook(*sys.exc_info())
                    except BaseException:
                        pass
    finally:
        # all processes have terminated; cleanup any reFuncing semaphores
        if arg_3:
            try:
                warnings.warn('semaphore_tracker: There appear to be %d '
                              'leaked semaphores to clean up at shutdown' %
                              len(arg_3))
            except Exception:
                pass
        for arg_6 in arg_3:
            # For some reason the process which created and registered this
            # semaphore has failed to unregister it. Presumably it has died.
            # We therefore unlink it.
            try:
                try:
                    sem_unlink(arg_6)
                    if arg_1:  # pragma: no cover
                        sys.stderr.write("[SemaphoreTracker] unlink {}\n"
                                         .format(arg_6))
                        sys.stderr.flush()
                except Exception as e:
                    warnings.warn('semaphore_tracker: %s: %r' % (arg_6, e))
            finally:
                pass

    if arg_1:  # pragma: no cover
        sys.stderr.write("semaphore tracker shut down\n")
        sys.stderr.flush()


def Func(arg_0, arg_1, arg_2):
        """
        Moves data from string to string.

        Moves the byte, word, or doubleword specified with the second operand (source operand) to the location specified
        with the first operand (destination operand). Both the source and destination operands are located in memory. The
        address of the source operand is read from the DS:ESI or the DS:SI registers (depending on the address-size
        attribute of the instruction, 32 or 16, respectively). The address of the destination operand is read from the ES:EDI
        or the ES:DI registers (again depending on the address-size attribute of the instruction). The DS segment may be
        overridden with a segment override prefix, but the ES segment cannot be overridden.

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: source operand.
        """
        arg_3, arg_4, arg_5 = arg_0.get_descriptor(arg_0.DS)
        arg_6 = arg_2.address() + arg_3
        arg_7 = arg_1.address() + arg_3

        arg_8 = arg_2.mem.base
        arg_9 = arg_1.mem.base
        arg_4 = arg_1.size

        # Copy the data
        arg_1.write(arg_2.read())

        #Advance EDI/ESI pointers
        arg_10 = Operators.ITEBV(arg_0.address_bit_size, arg_0.DF, -arg_4 // 8, arg_4 // 8)
        arg_0.write_register(arg_8, arg_0.read_register(arg_8) + arg_10)
        arg_0.write_register(arg_9, arg_0.read_register(arg_9) + arg_10)


return {
        reactant
        for reactant in reaction.reactants
        if reactant in reaction.products
    }

def Func ( arg_0 : arg_1 ) -> Set [ BaseAbundance ] : return { arg_2 for arg_2 in arg_0 . reactants if arg_2 in arg_0 . products }

def Func(arg_0: arg_1) -> Set[BaseAbundance]:
    """Return nodes that are both in reactants and reactions in a reaction."""
    return {
        arg_2
        for arg_2 in arg_0.reactants
        if arg_2 in arg_0.products
    }

Return nodes that are both in reactants and reactions in a reaction .


def Func ( arg_0 , arg_1 = True ) : arg_2 = getattr ( arg_0 , "__all__" , None ) if arg_2 is None : arg_2 = dir ( arg_0 ) arg_3 = ( getattr ( arg_0 , name ) for name in arg_2 if name [ : 1 ] != "_" ) if arg_1 : for arg_4 in arg_3 : if is_descriptor_class ( arg_4 ) : yield arg_4 if isinstance ( arg_4 , ModuleType ) : for arg_4 in Func ( arg_4 , arg_1 = True ) : yield arg_4 else : for arg_4 in arg_3 : if is_descriptor_class ( arg_4 ) : yield arg_4

def Func(arg_0, arg_1=True):
    r"""Get descriptors in module.

    Parameters:
        mdl(module): module to search
        submodule(bool): search recursively

    Returns:
        Iterator[Descriptor]

    """
    arg_2 = getattr(arg_0, "__all__", None)
    if arg_2 is None:
        arg_2 = dir(arg_0)

    arg_3 = (getattr(arg_0, name) for name in arg_2 if name[:1] != "_")

    if arg_1:
        for arg_4 in arg_3:
            if is_descriptor_class(arg_4):
                yield arg_4
            if isinstance(arg_4, ModuleType):
                for arg_4 in Func(arg_4, arg_1=True):
                    yield arg_4

    else:
        for arg_4 in arg_3:
            if is_descriptor_class(arg_4):
                yield arg_4


def Func(arg_0, arg_1):
    """
    This function applies segment update information to a segment in a
    cell.

    Synapses on the active list get their permanence counts incremented by
    permanenceInc. All other synapses get their permanence counts decremented
    by permanenceDec.

    We also increment the positiveActivations count of the segment.

    :param segUpdate SegmentUpdate instance
    :returns: True if some synapses were decremented to 0 and the segment is a
             candidate for trimming
    """
    # This will be set to True if detect that any syapses were decremented to
    #  0
    arg_2 = False

    # segUpdate.segment is None when creating a new segment
    arg_3, arg_4, arg_5 = arg_1.columnIdx, arg_1.cellIdx, arg_1.segment

    # update.activeSynapses can be empty.
    # If not, it can contain either or both integers and tuples.
    # The integers are indices of synapses to update.
    # The tuples represent new synapses to create (src col, src cell in col).
    # We pre-process to separate these various element types.
    # synToCreate is not empty only if positiveReinforcement is True.
    # NOTE: the synapse indices start at *1* to skip the segment flags.
    arg_6 = arg_1.activeSynapses
    arg_7 = set([syn for syn in arg_6 if type(syn) == int])

    # Modify an existing segment
    if arg_5 is not None:

      if arg_0.verbosity >= 4:
        print "Reinforcing segment #%d for cell[%d,%d]" % (arg_5.segID, arg_3, arg_4)
        print "  before:",
        arg_5.debugPrint()

      # Mark it as recently useful
      arg_5.lastActiveIteration = arg_0.lrnIterationIdx

      # Update frequency and positiveActivations
      arg_5.positiveActivations += 1       # positiveActivations += 1
      arg_5.dutyCycle(active=True)

      # First, decrement synapses that are not active
      # s is a synapse *index*, with index 0 in the segment being the tuple
      # (segId, sequence segment flag). See below, creation of segments.
      arg_9 = len(arg_5.syns) - 1
      arg_10 = [s for s in xrange(0, arg_9+1) \
                            if s not in arg_7]
      arg_2 = arg_5.updateSynapses(arg_10,
                                           -arg_0.permanenceDec)

      # Now, increment active synapses
      arg_11 = [syn for syn in arg_7 if syn <= arg_9]
      arg_5.updateSynapses(arg_11, arg_0.permanenceInc)

      # Finally, create new synapses if needed
      # syn is now a tuple (src col, src cell)
      arg_12 = [syn for syn in arg_6 if type(syn) != int]
      # If we have fixed resources, get rid of some old syns if necessary
      if arg_0.maxSynapsesPerSegment > 0 \
          and len(arg_12) + len(arg_5.syns) > arg_0.maxSynapsesPerSegment:
        arg_13 = (len(arg_5.syns) + len(arg_12) -
                     arg_0.maxSynapsesPerSegment)
        arg_5.freeNSynapses(arg_13, arg_10, arg_0.verbosity)
      for arg_14 in arg_12:
        arg_5.addSynapse(arg_14[0], arg_14[1], arg_0.initialPerm)

      if arg_0.verbosity >= 4:
        print "   after:",
        arg_5.debugPrint()

    # Create a new segment
    else:

      # (segID, sequenceSegment flag, frequency, positiveActivations,
      #          totalActivations, lastActiveIteration)
      arg_15 = Segment(tm=arg_0, isSequenceSeg=arg_1.sequenceSegment)

      # numpy.float32 important so that we can match with C++
      for arg_16 in arg_6:
        arg_15.addSynapse(arg_16[0], arg_16[1], arg_0.initialPerm)

      if arg_0.verbosity >= 3:
        print "New segment #%d for cell[%d,%d]" % (arg_0.segID-1, arg_3, arg_4),
        arg_15.debugPrint()

      arg_0.cells[arg_3][arg_4].append(arg_15)

    return arg_2

This function applies segment update information to a segment in a cell .


def Func(arg_0, arg_1, arg_2):
    """
    Run one iteration of SPRegion's compute
    """

    #if self.topDownMode and (not 'topDownIn' in inputs):
    #  raise RuntimeError("The input topDownIn must be linked in if "
    #                     "topDownMode is True")

    if arg_0._sfdr is None:
      raise RuntimeError("Spatial pooler has not been initialized")

    if not arg_0.topDownMode:
      #
      # BOTTOM-UP compute
      #

      arg_0._iterations += 1

      # Get our inputs into numpy arrays
      arg_3 = arg_1['bottomUpIn']

      arg_4 = False
      if 'resetIn' in arg_1:
        assert len(arg_1['resetIn']) == 1
        arg_4 = arg_1['resetIn'][0] != 0

      # Perform inference and/or learning
      arg_5 = arg_0._doBottomUpCompute(
        rfInput = arg_3.reshape((1,arg_3.size)),
        arg_4 = arg_4
        )

      arg_2['bottomUpOut'][:] = arg_5.flat

    else:
      #
      # TOP-DOWN inference
      #

      arg_6 = arg_1.get('topDownIn',None)
      arg_7, arg_8 = arg_0._doTopDownInfer(arg_6)
      arg_2['spatialTopDownOut'][:] = arg_7
      if arg_8 is not None:
        arg_2['temporalTopDownOut'][:] = arg_8

    # OBSOLETE
    arg_2['anomalyScore'][:] = 0


def Func ( arg_0 ) : if not arg_0 . Funced ( ) : arg_0 . _ws = create_Funcion ( arg_0 . WS_URI ) arg_2 = { 'type' : arg_0 . WS_TYPE , 'product_id' : arg_0 . WS_PRODUCT_ID } arg_0 . _ws . send ( dumps ( arg_2 ) ) with arg_0 . _lock : if not arg_0 . _thread : arg_3 = Thread ( target = arg_0 . _keep_alive_thread , args = [ ] ) arg_3 . start ( )

def Func(arg_0):
    """Connects and subscribes to the WebSocket Feed."""
    if not arg_0.Funced():
      arg_0._ws = create_Funcion(arg_0.WS_URI)
      arg_2 = {
        'type':arg_0.WS_TYPE,
        'product_id':arg_0.WS_PRODUCT_ID
      }
      arg_0._ws.send(dumps(arg_2))

      # There will be only one keep alive thread per client instance
      with arg_0._lock:
        if not arg_0._thread:
          arg_3 = Thread(target=arg_0._keep_alive_thread, args=[])
          arg_3.start()

Connects and subscribes to the WebSocket Feed .


def Func ( arg_0 ) : arg_1 = join ( arg_0 . fs_Func_path , 'message_001.txt' ) if exists ( arg_1 ) : return [ load ( open ( arg_1 , 'r' ) ) ] else : return [ ]

def Func(arg_0):
        """ returns a list of strings """
        arg_1 = join(arg_0.fs_Func_path, 'message_001.txt')
        if exists(arg_1):
            return [load(open(arg_1, 'r'))]
        else:
            return []


def Func(arg_0):
  """ Returns mean of non-None elements of the list
  """
  arg_1 = 0
  arg_2 = 0
  for arg_3 in arg_0:
    if arg_3 != SENTINEL_VALUE_FOR_MISSING_DATA:
      arg_1 += arg_3
      arg_2 += 1
  if arg_2 != 0:
    return arg_1 / arg_2
  else:
    return None

Returns mean of non - None elements of the list


def Func(arg_0):
        """ Called by the PDFLite object to prompt creating
            the page objects."""
        if not arg_0.orientation_changes:
            arg_0._get_orientation_changes()

        # Page
        for arg_1 in arg_0.pages:
            arg_2 = arg_0.session._add_object()
            arg_0.session._out('<</Type /Page')
            arg_0.session._out('/Parent 1 0 R')
            if arg_0.orientation_changes:
                arg_0.session._out('/MediaBox [0 0 %.2f %.2f]' % (arg_1.width, arg_1.height))
            arg_0.session._out('/Resources 2 0 R')
            arg_0.session._out('/Group <</Type /Group /S /Transparency /CS /DeviceRGB>>')
            arg_0.session._out('/Contents %s 0 R>>' % (arg_2.id + 1))
            arg_0.session._out('endobj')

            # Page content
            arg_0.session._add_object()
            if arg_0.session.compression is True:
                arg_3 = ' /Filter /FlateDecode '
                arg_1._compress()
            else:
                arg_3 = ''
            arg_0.session._out('<<%s/Length %s >>' % (arg_3, len(arg_1.buffer)))
            arg_0.session._put_stream(arg_1.buffer)
            arg_0.session._out('endobj')

Called by the PDFLite object to prompt creating the page objects .


def Func ( arg_0 ) : try : arg_1 = sys . path_importer_cache [ arg_0 ] except KeyError : for arg_2 in sys . path_hooks : try : arg_1 = arg_2 ( arg_0 ) except ImportError : pass else : break else : arg_1 = None sys . path_importer_cache . setdefault ( arg_0 , arg_1 ) if arg_1 is None : try : arg_1 = ImpWrapper ( arg_0 ) except ImportError : pass return arg_1

def Func(arg_0):
    """Retrieve a PEP 302 "importer" for the given path item

    If there is no importer, this returns a wrapper around the builtin import
    machinery.  The returned importer is only cached if it was created by a
    path hook.
    """
    try:
        arg_1 = sys.path_importer_cache[arg_0]
    except KeyError:
        for arg_2 in sys.path_hooks:
            try:
                arg_1 = arg_2(arg_0)
            except ImportError:
                pass
            else:
                break
        else:
            arg_1 = None

    sys.path_importer_cache.setdefault(arg_0,arg_1)
    if arg_1 is None:
        try:
            arg_1 = ImpWrapper(arg_0)
        except ImportError:
            pass
    return arg_1

Retrieve a PEP 302 importer for the given path item


def Func(arg_0, arg_1, arg_2):
    """Set parameter value"""
    (arg_3, arg_4) = arg_0._getParameterMethods(arg_1)
    if arg_3 is None:
      import exceptions
      raise exceptions.Exception(
          "Func -- parameter name '%s' does not exist in region %s of type %s"
          % (arg_1, arg_0.name, arg_0.type))
    arg_3(arg_1, arg_2)


def Func ( arg_0 ) : arg_0 . _refcnt += 1 _app_ctx_stack . Func ( arg_0 ) appcontext_Funced . send ( arg_0 . app )

def Func(arg_0):
        """Binds the app context to the current context."""
        arg_0._refcnt += 1
        _app_ctx_stack.Func(arg_0)
        appcontext_Funced.send(arg_0.app)

Binds the app context to the current context .


return client.extract(text, width, height, resource_type)

def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_4 = arg_5 = None if arg_1 : arg_3 = arg_1 . lower ( ) . split ( 'x' ) if len ( arg_3 ) in ( 3 , 1 ) : arg_2 = arg_3 . pop ( ) if len ( arg_3 ) == 2 : arg_4 , arg_5 = map ( lambda x : int ( x ) , arg_3 ) arg_6 = OEmbedConsumer ( ) return arg_6 . extract ( arg_0 , arg_4 , arg_5 , arg_2 )

def Func(arg_0, arg_1=None):
    """
    Extract oembed resources from a block of text.  Returns a list
    of dictionaries.

    Max width & height can be specified:
    {% for embed in block_of_text|Func:"400x300" %}

    Resource type can be specified:
    {% for photo_embed in block_of_text|Func:"photo" %}

    Or both:
    {% for embed in block_of_text|Func:"400x300xphoto" %}
    """
    arg_2 = arg_4 = arg_5 = None
    if arg_1:
        arg_3 = arg_1.lower().split('x')
        if len(arg_3) in (3, 1):
            arg_2 = arg_3.pop()

        if len(arg_3) == 2:
            arg_4, arg_5 = map(lambda x: int(x), arg_3)

    arg_6 = OEmbedConsumer()
    return arg_6.extract(arg_0, arg_4, arg_5, arg_2)

Extract oembed resources from a block of text.  Returns a list
    of dictionaries.

    Max width & height can be specified:
    {% for embed in block_of_text|extract_oembeds:"400x300" %}

    Resource type can be specified:
    {% for photo_embed in block_of_text|extract_oembeds:"photo" %}

    Or both:
    {% for embed in block_of_text|extract_oembeds:"400x300xphoto" %}

Extract oembed resources from a block of text . Returns a list of dictionaries .


def
Func
(
arg_0
=
,
arg_1
=
0
,
**
arg_2
)
:
from
.
.
.
project
.
types
.
ledtype
import
make
if
arg_0
is
:
raise
ValueError
(
'Must provide ledtype value!'
)
arg_0
=
make
(
arg_0
)
if
arg_1
==
0
:
raise
ValueError
(
'Must provide num value >0!'
)
if
arg_0
not
in
Func_DRIVERS
.
keys
(
)
:
raise
ValueError
(
'{} is not a valid LED type.'
.
format
(
arg_0
)
)
return
Func_DRIVERS
[
arg_0
]
(
arg_1
,
**
arg_2
)

def Func(arg_0=None, arg_1=0, **arg_2):
    """Wrapper function for using Func device drivers on systems like the
    Raspberry Pi and BeagleBone. This allows using any of the Func drivers
    from a single entry point instead importing the driver for a specific
    LED type.

    Provides the same parameters of
    :py:class:`bibliopixel.drivers.Func.FuncBase` as
    well as those below:

    :param ledtype: One of: LPD8806, WS2801, WS281X, or APA102
    """

    from ...project.types.ledtype import make
    if arg_0 is None:
        raise ValueError('Must provide ledtype value!')
    arg_0 = make(arg_0)

    if arg_1 == 0:
        raise ValueError('Must provide num value >0!')
    if arg_0 not in Func_DRIVERS.keys():
        raise ValueError('{} is not a valid LED type.'.format(arg_0))

    return Func_DRIVERS[arg_0](arg_1, **arg_2)

Wrapper function for using SPI device drivers on systems like the
    Raspberry Pi and BeagleBone. This allows using any of the SPI drivers
    from a single entry point instead importing the driver for a specific
    LED type.

    Provides the same parameters of
    :py:class:`bibliopixel.drivers.SPI.SPIBase` as
    well as those below:

    :param ledtype: One of: LPD8806, WS2801, WS281X, or APA102

Wrapper function for using SPI device drivers on systems like the Raspberry Pi and BeagleBone . This allows using any of the SPI drivers from a single entry point instead importing the driver for a specific LED type .


return format_html(
        '<link rel="stylesheet" href="{0}djfrontend/css/normalize/{1}/normalize.css">',
        _static_url, version)

def Func(arg_0=None):
    """
    Returns Normalize CSS file.
    Included in HTML5 Boilerplate.
    """
    if arg_0 is None:
        arg_0 = getattr(settings, 'DJFRONTEND_NORMALIZE', DJFRONTEND_NORMALIZE_DEFAULT)

    return format_html(
        '<link rel="stylesheet" href="{0}djfrontend/css/normalize/{1}/normalize.css">',
        _static_url, arg_0)

Returns Normalize CSS file . Included in HTML5 Boilerplate .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . resolver . getTextualNode ( textId = arg_1 , arg_2 = arg_2 , metadata = True ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """ Retrieve the passage identified by the parameters

        :param objectId: Collection Identifier
        :type objectId: str
        :param subreference: Subreference of the passage
        :type subreference: str
        :return: An object bearing metadata and its text
        :rtype: InteractiveTextualNode
        """
        arg_3 = arg_0.resolver.getTextualNode(
            textId=arg_1,
            arg_2=arg_2,
            metadata=True
        )
        return arg_3


return mapper_util.mapping_matrix_from_sub_to_pix(sub_to_pix=self.sub_to_pix, pixels=self.pixels,
                                                          regular_pixels=self.grid_stack.regular.shape[0],
                                                          sub_to_regular=self.grid_stack.sub.sub_to_regular,
                                                          sub_grid_fraction=self.grid_stack.sub.sub_grid_fraction)

def Func(arg_0):
        """The mapping matrix is a matrix representing the mapping between every unmasked pixel of a grid and \
        the pixels of a pixelization. Non-zero entries signify a mapping, whereas zeros signify no mapping.

        For example, if the regular grid has 5 pixels and the pixelization 3 pixels, with the following mappings:

        regular pixel 0 -> pixelization pixel 0
        regular pixel 1 -> pixelization pixel 0
        regular pixel 2 -> pixelization pixel 1
        regular pixel 3 -> pixelization pixel 1
        regular pixel 4 -> pixelization pixel 2

        The mapping matrix (which is of dimensions regular_pixels x pixelization_pixels) would appear as follows:

        [1, 0, 0] [0->0]
        [1, 0, 0] [1->0]
        [0, 1, 0] [2->1]
        [0, 1, 0] [3->1]
        [0, 0, 1] [4->2]

        The mapping matrix is in fact built using the sub-grid of the grid-stack, whereby each regular-pixel is \
        divided into a regular grid of sub-pixels which are all paired to pixels in the pixelization. The entires \
        in the mapping matrix now become fractional values dependent on the sub-grid size. For example, for a 2x2 \
        sub-grid in each pixel (which means the fraction value is 1.0/(2.0^2) = 0.25, if we have the following mappings:

        regular pixel 0 -> sub pixel 0 -> pixelization pixel 0
        regular pixel 0 -> sub pixel 1 -> pixelization pixel 1
        regular pixel 0 -> sub pixel 2 -> pixelization pixel 1
        regular pixel 0 -> sub pixel 3 -> pixelization pixel 1
        regular pixel 1 -> sub pixel 0 -> pixelization pixel 1
        regular pixel 1 -> sub pixel 1 -> pixelization pixel 1
        regular pixel 1 -> sub pixel 2 -> pixelization pixel 1
        regular pixel 1 -> sub pixel 3 -> pixelization pixel 1
        regular pixel 2 -> sub pixel 0 -> pixelization pixel 2
        regular pixel 2 -> sub pixel 1 -> pixelization pixel 2
        regular pixel 2 -> sub pixel 2 -> pixelization pixel 3
        regular pixel 2 -> sub pixel 3 -> pixelization pixel 3

        The mapping matrix (which is still of dimensions regular_pixels x source_pixels) would appear as follows:

        [0.25, 0.75, 0.0, 0.0] [1 sub-pixel maps to pixel 0, 3 map to pixel 1]
        [ 0.0,  1.0, 0.0, 0.0] [All sub-pixels map to pixel 1]
        [ 0.0,  0.0, 0.5, 0.5] [2 sub-pixels map to pixel 2, 2 map to pixel 3]
        """
        return mapper_util.Func_from_sub_to_pix(sub_to_pix=arg_0.sub_to_pix, pixels=arg_0.pixels,
                                                          regular_pixels=arg_0.grid_stack.regular.shape[0],
                                                          sub_to_regular=arg_0.grid_stack.sub.sub_to_regular,
                                                          sub_grid_fraction=arg_0.grid_stack.sub.sub_grid_fraction)

The mapping matrix is a matrix representing the mapping between every unmasked pixel of a grid and \ the pixels of a pixelization . Non - zero entries signify a mapping whereas zeros signify no mapping .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
''
,
arg_3
=
,
arg_4
=
,
arg_5
=
0
)
:
arg_4
=
arg_0
.
info
(
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
arg_5
=
arg_5
)
arg_6
=
[
]
def
add_fields
(
arg_7
)
:
for
arg_8
,
arg_9
in
arg_7
:
arg_10
=
arg_4
[
arg_9
]
if
arg_10
is
not
:
arg_6
.
append
(
(
arg_8
,
arg_10
.
rstrip
(
)
)
)
add_fields
(
arg_0
.
Func_fields1
)
if
(
not
py3compat
.
PY3
)
and
isinstance
(
arg_1
,
types
.
InstanceType
)
and
arg_4
[
'base_class'
]
:
arg_6
.
append
(
(
"Base Class"
,
arg_4
[
'base_class'
]
.
rstrip
(
)
)
)
add_fields
(
arg_0
.
Func_fields2
)
if
arg_4
[
'namespace'
]
!=
'Interactive'
:
arg_6
.
append
(
(
"Namespace"
,
arg_4
[
'namespace'
]
.
rstrip
(
)
)
)
add_fields
(
arg_0
.
Func_fields3
)
if
arg_5
>
0
and
arg_4
[
'source'
]
is
not
:
arg_6
.
append
(
(
"Source"
,
arg_0
.
format
(
py3compat
.
cast_bytes_py2
(
arg_4
[
'source'
]
)
)
)
)
elif
arg_4
[
'docstring'
]
is
not
:
arg_6
.
append
(
(
"Docstring"
,
arg_4
[
"docstring"
]
)
)
if
arg_4
[
'isclass'
]
:
if
arg_4
[
'init_definition'
]
or
arg_4
[
'init_docstring'
]
:
arg_6
.
append
(
(
"Constructor information"
,
""
)
)
if
arg_4
[
'init_definition'
]
is
not
:
arg_6
.
append
(
(
" Definition"
,
arg_4
[
'init_definition'
]
.
rstrip
(
)
)
)
if
arg_4
[
'init_docstring'
]
is
not
:
arg_6
.
append
(
(
" Docstring"
,
indent
(
arg_4
[
'init_docstring'
]
)
)
)
else
:
add_fields
(
arg_0
.
Func_fields_obj
)
if
arg_6
:
page
.
page
(
arg_0
.
_format_fields
(
arg_6
)
)

def Func(arg_0,arg_1,arg_2='',arg_3=None,arg_4=None,arg_5=0):
        """Show detailed information about an object.

        Optional arguments:

        - oname: name of the variable pointing to the object.

        - formatter: special formatter for docstrings (see pdoc)

        - info: a structure with some information fields which may have been
        precomputed already.

        - detail_level: if set to 1, more information is given.
        """
        arg_4 = arg_0.info(arg_1, arg_2=arg_2, arg_3=arg_3,
                            arg_4=arg_4, arg_5=arg_5)
        arg_6 = []
        def add_fields(arg_7):
            for arg_8, arg_9 in arg_7:
                arg_10 = arg_4[arg_9]
                if arg_10 is not None:
                    arg_6.append((arg_8, arg_10.rstrip()))

        add_fields(arg_0.Func_fields1)

        # Base class for old-style instances
        if (not py3compat.PY3) and isinstance(arg_1, types.InstanceType) and arg_4['base_class']:
            arg_6.append(("Base Class", arg_4['base_class'].rstrip()))

        add_fields(arg_0.Func_fields2)

        # Namespace
        if arg_4['namespace'] != 'Interactive':
            arg_6.append(("Namespace", arg_4['namespace'].rstrip()))

        add_fields(arg_0.Func_fields3)

        # Source or docstring, depending on detail level and whether
        # source found.
        if arg_5 > 0 and arg_4['source'] is not None:
            arg_6.append(("Source", arg_0.format(py3compat.cast_bytes_py2(arg_4['source']))))
        elif arg_4['docstring'] is not None:
            arg_6.append(("Docstring", arg_4["docstring"]))

        # Constructor info for classes
        if arg_4['isclass']:
            if arg_4['init_definition'] or arg_4['init_docstring']:
                arg_6.append(("Constructor information", ""))
                if arg_4['init_definition'] is not None:
                    arg_6.append((" Definition",
                                    arg_4['init_definition'].rstrip()))
                if arg_4['init_docstring'] is not None:
                    arg_6.append((" Docstring",
                                        indent(arg_4['init_docstring'])))

        # Info for objects:
        else:
            add_fields(arg_0.Func_fields_obj)

        # Finally send to printer/pager:
        if arg_6:
            page.page(arg_0._format_fields(arg_6))

Show detailed information about an object .


def Func(arg_0):
        """
        Return global iterator sympy expression
        """
        Func = sympy.Integer(0)
        arg_2 = sympy.Integer(1)
        for arg_3, arg_4, arg_5, arg_6 in reversed(arg_0._loop_stack):
            arg_7 = symbol_pos_int(arg_3)
            arg_8 = arg_5 - arg_4  # FIXME is incr handled correct here?
            Func += (arg_7 - arg_4) * arg_2
            arg_2 *= arg_8
        return Func


def Func(arg_0, arg_1, arg_2=None):
        """
            Get the full history of an IP, aggregate the result instead of
            returning one line per day.

            :param ip: IP address to search for
            :param days_limit: Max amount of days to query. (None means no limit)

            :rtype: list. For each change: FirstDay, LastDay, ASN, Block
        """
        arg_3 = None
        arg_4 = None
        arg_5 = None
        arg_6 = None
        for arg_7 in arg_0.history(arg_1, arg_2):
            if arg_7 is None:
                continue
            arg_8, arg_9, arg_10 = arg_7
            if arg_3 is None:
                arg_4 = arg_8
                arg_3 = arg_8
                arg_5 = arg_9
                arg_6 = arg_10
            elif arg_5 == arg_9 and arg_6 == arg_10:
                arg_3 = arg_8
            else:
                yield arg_3, arg_4, arg_5, arg_6
                arg_4 = arg_8
                arg_3 = arg_8
                arg_5 = arg_9
                arg_6 = arg_10
        if arg_3 is not None:
            yield arg_3, arg_4, arg_5, arg_6

Get the full history of an IP aggregate the result instead of returning one line per day .


def Func ( arg_0 , arg_1 , arg_2 = 1 ) : arg_3 = arg_0 . _perform_request ( '/datacenters/%s/lans?depth=%s' % ( arg_1 , str ( arg_2 ) ) ) return arg_3

def Func(arg_0, arg_1, arg_2=1):
        """
        Retrieves a list of LANs available in the account.

        :param      datacenter_id: The unique ID of the data center.
        :type       datacenter_id: ``str``

        :param      depth: The depth of the response data.
        :type       depth: ``int``

        """
        arg_3 = arg_0._perform_request(
            '/datacenters/%s/lans?depth=%s' % (
                arg_1,
                str(arg_2)))

        return arg_3

Retrieves a list of LANs available in the account .


return [self.merge(SkypeBotUser.fromRaw(self.skype, raw)) for raw in json]

def Func ( arg_0 ) : arg_1 = arg_0 . skype . conn ( "GET" , "{0}/agents" . format ( SkypeConnection . API_BOT ) , auth = SkypeConnection . Auth . SkypeToken ) . json ( ) . get ( "agentDescriptions" , [ ] ) return [ arg_0 . merge ( SkypeBotUser . fromRaw ( arg_0 . skype , arg_2 ) ) for arg_2 in arg_1 ]

def Func(arg_0):
        """
        Retrieve a list of all known Func.

        Returns:
            SkypeBotUser list: resulting bot user objects
        """
        arg_1 = arg_0.skype.conn("GET", "{0}/agents".format(SkypeConnection.API_BOT),
                               auth=SkypeConnection.Auth.SkypeToken).json().get("agentDescriptions", [])
        return [arg_0.merge(SkypeBotUser.fromRaw(arg_0.skype, arg_2)) for arg_2 in arg_1]

Retrieve a list of all known bots.

        Returns:
            SkypeBotUser list: resulting bot user objects


(self, name, project_id=None, retry=DEFAULT, timeout=DEFAULT)

return self.get_client().get_cluster(project_id=project_id or self.project_id,
                                             zone=self.location,
                                             cluster_id=name,
                                             retry=retry,
                                             timeout=timeout).self_link

def Func(arg_0, arg_1, arg_2=None, arg_3=arg_4, arg_5=arg_4):
        """
        Gets details of specified cluster

        :param name: The name of the cluster to retrieve
        :type name: str
        :param project_id: Google Cloud Platform project ID
        :type project_id: str
        :param retry: A retry object used to retry requests. If None is specified,
            requests will not be retried.
        :type retry: google.api_core.retry.Retry
        :param timeout: The amount of time, in seconds, to wait for the request to
            complete. Note that if retry is specified, the timeout applies to each
            individual attempt.
        :type timeout: float
        :return: google.cloud.container_v1.types.Cluster
        """
        arg_0.log.info(
            "Fetching cluster (project_id=%s, zone=%s, cluster_name=%s)",
            arg_2 or arg_0.project_id, arg_0.location, arg_1
        )

        return arg_0.get_client().Func(arg_2=arg_2 or arg_0.project_id,
                                             zone=arg_0.location,
                                             cluster_id=arg_1,
                                             arg_3=arg_3,
                                             arg_5=arg_5).self_link


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """ Handles a list of nodes being set.
        """
        arg_0._delete_nodes(arg_3)
        arg_0._add_nodes(arg_4)


return server.put(
            'challenge_admin',
            self.as_payload(),
            replacements={'slug': self.slug})

def Func ( arg_0 , arg_1 ) : return arg_1 . put ( 'challenge_admin' , arg_0 . as_payload ( ) , replacements = { 'slug' : arg_0 . slug } )

def Func(arg_0, arg_1):
        """Update existing challenge on the server"""

        return arg_1.put(
            'challenge_admin',
            arg_0.as_payload(),
            replacements={'slug': arg_0.slug})


(
    kernel, observation_index_points, observations)

def Func(
    arg_0, arg_1, arg_2):
  """Ensure that observation data and locations have consistent shapes.

  This basically means that the batch shapes are broadcastable. We can only
  ensure this when those shapes are fully statically defined.

  Args:
    kernel: The GP kernel.
    observation_index_points: the observation data locations in the index set.
    observations: the observation data.

  Raises:
    ValueError: if the observations' batch shapes are not broadcastable.
  """
  # Check that observation index points and observation counts broadcast.
  arg_3 = arg_0.feature_ndims
  if (tensorshape_util.is_fully_defined(
      arg_1.shape[:-arg_3]) and
      tensorshape_util.is_fully_defined(arg_2.shape)):
    arg_4 = arg_1.shape[:-arg_3]
    arg_5 = arg_2.shape
    try:
      tf.broadcast_static_shape(arg_4, arg_5)
    except ValueError:
      # Re-raise with our own more contextual error message.
      raise ValueError(
          'Observation index point and observation counts are not '
          'broadcastable: {} and {}, respectively.'.format(
              arg_4, arg_5))

Ensure that observation data and locations have consistent shapes .


return (self.mass_within_circle_in_units(radius=outer_annuli_radius) -
                self.mass_within_circle_in_units(radius=inner_annuli_radius)) \
               / annuli_area

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = ( np . pi * arg_2 ** 2.0 ) - ( np . pi * arg_1 ** 2.0 ) return ( arg_0 . mass_within_circle_in_units ( radius = arg_2 ) - arg_0 . mass_within_circle_in_units ( radius = arg_1 ) ) / arg_3

def Func(arg_0, arg_1, arg_2):
        """Calculate the mass between two circular annuli and compute the density by dividing by the annuli surface
        area.

        The value returned by the mass integral is dimensionless, therefore the density between annuli is returned in \
        units of inverse radius squared. A conversion factor can be specified to convert this to a physical value \
        (e.g. the critical surface mass density).

        Parameters
        -----------
        inner_annuli_radius : float
            The radius of the inner annulus outside of which the density are estimated.
        outer_annuli_radius : float
            The radius of the outer annulus inside of which the density is estimated.
        """
        arg_3 = (np.pi * arg_2 ** 2.0) - (np.pi * arg_1 ** 2.0)
        return (arg_0.mass_within_circle_in_units(radius=arg_2) -
                arg_0.mass_within_circle_in_units(radius=arg_1)) \
               / arg_3

Calculate the mass between two circular annuli and compute the density by dividing by the annuli surface area .


def Func ( arg_0 , arg_1 ) : arg_2 = User . get ( arg_1 , ignore = 404 ) if not arg_2 : arg_2 = User ( username = arg_1 ) arg_2 . save ( ) return arg_2

def Func(arg_0, arg_1):
        """
            Resolves the given id to a user object, if it doesn't exists it will be created.
        """
        arg_2 = User.get(arg_1, ignore=404)
        if not arg_2:
            arg_2 = User(username=arg_1)
            arg_2.save()
        return arg_2

Resolves the given id to a user object if it doesn t exists it will be created .


def Func(arg_0, arg_1, arg_2=None):
        """Get a chunksize close to current that fits within all S3 limits.

        :type current_chunksize: int
        :param current_chunksize: The currently configured chunksize.

        :type file_size: int or None
        :param file_size: The size of the file to upload. This might be None
            if the object being transferred has an unknown size.

        :returns: A valid chunksize that fits within configured limits.
        """
        arg_3 = arg_1
        if arg_2 is not None:
            arg_3 = arg_0._adjust_for_max_parts(arg_3, arg_2)
        return arg_0._adjust_for_chunksize_limits(arg_3)

Get a chunksize close to current that fits within all S3 limits .


def Func(arg_0, arg_1):
        """Determines whether action is available.
        That is, executing it would change the state.
        """

        arg_2 = np.rot90(arg_0._state, arg_1)
        return arg_0._Func_left(arg_2)

Determines whether action is available . That is executing it would change the state .


Displays a popup when hovering over a node.

def Func ( arg_0 , arg_1 ) : if arg_0 . popup == False : return if arg_0 . popup == True or arg_0 . popup . node != arg_1 : if arg_0 . popup_text . has_key ( arg_1 . id ) : arg_2 = arg_0 . popup_text [ arg_1 . id ] else : arg_2 = None arg_0 . popup = arg_3 ( arg_0 . _ctx , arg_1 , arg_2 ) arg_0 . popup . draw ( )

def Func(arg_0, arg_1):

        """ Displays a popup when Funcing over a node.
        """

        if arg_0.popup == False: return
        if arg_0.popup == True or arg_0.popup.node != arg_1:
            if arg_0.popup_text.has_key(arg_1.id):
                arg_2 = arg_0.popup_text[arg_1.id]
            else:
                arg_2 = None
            arg_0.popup = arg_3(arg_0._ctx, arg_1, arg_2)
        arg_0.popup.draw()

Displays a popup when hovering over a node .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_2
.
write
(
arg_0
)
arg_2
.
write
(
'\n'
)
if
(
len
(
arg_1
[
0
]
)
>
0
)
and
(
len
(
arg_1
)
>=
3
)
:
for
arg_3
in
range
(
len
(
arg_1
[
0
]
)
)
:
arg_2
.
write
(
"Java Message Type: "
)
arg_2
.
write
(
arg_1
[
1
]
[
arg_3
]
)
arg_2
.
write
(
'\n'
)
arg_2
.
write
(
"Java Message: "
)
for
arg_4
in
arg_1
[
2
]
[
arg_3
]
:
arg_2
.
write
(
arg_4
)
arg_2
.
write
(
'\n'
)
arg_2
.
write
(
'\n \n'
)

def Func(arg_0,arg_1,arg_2):
    """
    Loop through all java messages that are not associated with a unit test and
    write them into a log file.

    Parameters
    ----------
    key :  str
        9.general_bad_java_messages
    val : list of list of str
        contains the bad java messages and the message types.

    :return: none
    """

    arg_2.write(arg_0)
    arg_2.write('\n')

    if (len(arg_1[0]) > 0) and (len(arg_1) >= 3):
        for arg_3 in range(len(arg_1[0])):
            arg_2.write("Java Message Type: ")
            arg_2.write(arg_1[1][arg_3])
            arg_2.write('\n')

            arg_2.write("Java Message: ")

            for arg_4 in arg_1[2][arg_3]:
                arg_2.write(arg_4)
                arg_2.write('\n')

        arg_2.write('\n \n')

Loop through all java messages that are not associated with a unit test and write them into a log file .


def Func ( arg_0 ) : try : arg_1 = next ( arg_0 . _jobs ) except StopIteration : arg_0 . _on_deck = None else : if not isinstance ( arg_1 , Job ) : arg_1 = DefaultJob ( arg_1 ) arg_0 . _on_deck = arg_1 arg_0 . _active_jobs += 1

def Func(arg_0):
        """
        If there is still a job in the job iterator, loads it and increments
        the active job count.
        """

        try:
            arg_1 = next(arg_0._jobs)
        except StopIteration:
            arg_0._on_deck = None
        else:
            if not isinstance(arg_1, Job):
                arg_1 = DefaultJob(arg_1)
            arg_0._on_deck = arg_1
            arg_0._active_jobs += 1

If there is still a job in the job iterator loads it and increments the active job count .


def Func(arg_0):
    """Get the metadata of a changeset using the OSM API and return it as a XML
    ElementTree.

    Args:
        changeset: the id of the changeset.
    """
    arg_1 = 'https://www.openstreetmap.org/api/0.6/changeset/{}'.format(arg_0)
    return ET.fromstring(requests.get(arg_1).content).getchildren()[0]

Get the metadata of a changeset using the OSM API and return it as a XML ElementTree .


def Func ( arg_0 , arg_1 ) : arg_0 . feature_images = np . load ( arg_1 ) arg_0 . feature_names = range ( arg_0 . feature_images . shape [ 1 ] )

def Func(arg_0, arg_1):
        """ Load feature data from a 2D ndarray on disk. """
        arg_0.feature_images = np.load(arg_1)
        arg_0.feature_names = range(arg_0.feature_images.shape[1])

Load feature data from a 2D ndarray on disk .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
1
,
arg_3
=
False
)
:
if
arg_0
.
shape
!=
arg_1
.
shape
:
raise
ParameterError
(
'Shape mismatch: {}!={}'
.
format
(
arg_0
.
shape
,
arg_1
.
shape
)
)
if
np
.
any
(
arg_0
<
0
)
or
np
.
any
(
arg_1
<
0
)
:
raise
ParameterError
(
'X and X_ref must be non-negative'
)
if
arg_2
<=
0
:
raise
ParameterError
(
'power must be strictly positive'
)
arg_4
=
arg_0
.
dtype
if
not
np
.
issubdtype
(
arg_4
,
np
.
floating
)
:
arg_4
=
np
.
float32
arg_5
=
np
.
maximum
(
arg_0
,
arg_1
)
.
astype
(
arg_4
)
arg_6
=
(
arg_5
<
np
.
finfo
(
arg_4
)
.
tiny
)
arg_5
[
arg_6
]
=
1
if
np
.
isfinite
(
arg_2
)
:
arg_7
=
(
arg_0
/
arg_5
)
**
arg_2
arg_8
=
(
arg_1
/
arg_5
)
**
arg_2
arg_9
=
~
arg_6
arg_7
[
arg_9
]
/=
arg_7
[
arg_9
]
+
arg_8
[
arg_9
]
if
arg_3
:
arg_7
[
arg_6
]
=
0.5
else
:
arg_7
[
arg_6
]
=
0.0
else
:
arg_7
=
arg_0
>
arg_1
return
arg_7

def Func(arg_0, arg_1, arg_2=1, arg_3=False):
    '''Robustly compute a Func operation.

        `M = X**power / (X**power + X_ref**power)`

    Parameters
    ----------
    X : np.ndarray
        The (non-negative) input array corresponding to the positive mask elements

    X_ref : np.ndarray
        The (non-negative) array of reference or background elements.
        Must have the same shape as `X`.

    power : number > 0 or np.inf
        If finite, returns the soft mask computed in a numerically stable way

        If infinite, returns a hard (binary) mask equivalent to `X > X_ref`.
        Note: for hard masks, ties are always broken in favor of `X_ref` (`mask=0`).

    split_zeros : bool
        If `True`, entries where `X` and X`_ref` are both small (close to 0)
        will receive mask values of 0.5.

        Otherwise, the mask is set to 0 for these entries.

    Returns
    -------
    mask : np.ndarray, shape=`X.shape`
        The output mask array

    Raises
    ------
    ParameterError
        If `X` and `X_ref` have different shapes.

        If `X` or `X_ref` are negative anywhere

        If `power <= 0`

    Examples
    --------

    >>> X = 2 * np.ones((3, 3))
    >>> X_ref = np.vander(np.arange(3.0))
    >>> X
    array([[ 2.,  2.,  2.],
           [ 2.,  2.,  2.],
           [ 2.,  2.,  2.]])
    >>> X_ref
    array([[ 0.,  0.,  1.],
           [ 1.,  1.,  1.],
           [ 4.,  2.,  1.]])
    >>> librosa.util.Func(X, X_ref, power=1)
    array([[ 1.   ,  1.   ,  0.667],
           [ 0.667,  0.667,  0.667],
           [ 0.333,  0.5  ,  0.667]])
    >>> librosa.util.Func(X_ref, X, power=1)
    array([[ 0.   ,  0.   ,  0.333],
           [ 0.333,  0.333,  0.333],
           [ 0.667,  0.5  ,  0.333]])
    >>> librosa.util.Func(X, X_ref, power=2)
    array([[ 1. ,  1. ,  0.8],
           [ 0.8,  0.8,  0.8],
           [ 0.2,  0.5,  0.8]])
    >>> librosa.util.Func(X, X_ref, power=4)
    array([[ 1.   ,  1.   ,  0.941],
           [ 0.941,  0.941,  0.941],
           [ 0.059,  0.5  ,  0.941]])
    >>> librosa.util.Func(X, X_ref, power=100)
    array([[  1.000e+00,   1.000e+00,   1.000e+00],
           [  1.000e+00,   1.000e+00,   1.000e+00],
           [  7.889e-31,   5.000e-01,   1.000e+00]])
    >>> librosa.util.Func(X, X_ref, power=np.inf)
    array([[ True,  True,  True],
           [ True,  True,  True],
           [False, False,  True]], dtype=bool)
    '''
    if arg_0.shape != arg_1.shape:
        raise ParameterError('Shape mismatch: {}!={}'.format(arg_0.shape,
                                                             arg_1.shape))

    if np.any(arg_0 < 0) or np.any(arg_1 < 0):
        raise ParameterError('X and X_ref must be non-negative')

    if arg_2 <= 0:
        raise ParameterError('power must be strictly positive')

    # We're working with ints, cast to float.
    arg_4 = arg_0.dtype
    if not np.issubdtype(arg_4, np.floating):
        arg_4 = np.float32

    # Re-scale the input arrays relative to the larger value
    arg_5 = np.maximum(arg_0, arg_1).astype(arg_4)
    arg_6 = (arg_5 < np.finfo(arg_4).tiny)
    arg_5[arg_6] = 1

    # For finite power, compute the Func
    if np.isfinite(arg_2):
        arg_7 = (arg_0 / arg_5)**arg_2
        arg_8 = (arg_1 / arg_5)**arg_2
        arg_9 = ~arg_6
        arg_7[arg_9] /= arg_7[arg_9] + arg_8[arg_9]
        # Wherever energy is below energy in both inputs, split the mask
        if arg_3:
            arg_7[arg_6] = 0.5
        else:
            arg_7[arg_6] = 0.0
    else:
        # Otherwise, compute the hard mask
        arg_7 = arg_0 > arg_1

    return arg_7

Robustly compute a softmask operation.

        `M = X**power / (X**power + X_ref**power)`

    Parameters
    ----------
    X : np.ndarray
        The (non-negative) input array corresponding to the positive mask elements

    X_ref : np.ndarray
        The (non-negative) array of reference or background elements.
        Must have the same shape as `X`.

    power : number > 0 or np.inf
        If finite, returns the soft mask computed in a numerically stable way

        If infinite, returns a hard (binary) mask equivalent to `X > X_ref`.
        Note: for hard masks, ties are always broken in favor of `X_ref` (`mask=0`).

    split_zeros : bool
        If `True`, entries where `X` and X`_ref` are both small (close to 0)
        will receive mask values of 0.5.

        Otherwise, the mask is set to 0 for these entries.

    Returns
    -------
    mask : np.ndarray, shape=`X.shape`
        The output mask array

    Raises
    ------
    ParameterError
        If `X` and `X_ref` have different shapes.

        If `X` or `X_ref` are negative anywhere

        If `power <= 0`

    Examples
    --------

    >>> X = 2 * np.ones((3, 3))
    >>> X_ref = np.vander(np.arange(3.0))
    >>> X
    array([[ 2.,  2.,  2.],
           [ 2.,  2.,  2.],
           [ 2.,  2.,  2.]])
    >>> X_ref
    array([[ 0.,  0.,  1.],
           [ 1.,  1.,  1.],
           [ 4.,  2.,  1.]])
    >>> librosa.util.softmask(X, X_ref, power=1)
    array([[ 1.   ,  1.   ,  0.667],
           [ 0.667,  0.667,  0.667],
           [ 0.333,  0.5  ,  0.667]])
    >>> librosa.util.softmask(X_ref, X, power=1)
    array([[ 0.   ,  0.   ,  0.333],
           [ 0.333,  0.333,  0.333],
           [ 0.667,  0.5  ,  0.333]])
    >>> librosa.util.softmask(X, X_ref, power=2)
    array([[ 1. ,  1. ,  0.8],
           [ 0.8,  0.8,  0.8],
           [ 0.2,  0.5,  0.8]])
    >>> librosa.util.softmask(X, X_ref, power=4)
    array([[ 1.   ,  1.   ,  0.941],
           [ 0.941,  0.941,  0.941],
           [ 0.059,  0.5  ,  0.941]])
    >>> librosa.util.softmask(X, X_ref, power=100)
    array([[  1.000e+00,   1.000e+00,   1.000e+00],
           [  1.000e+00,   1.000e+00,   1.000e+00],
           [  7.889e-31,   5.000e-01,   1.000e+00]])
    >>> librosa.util.softmask(X, X_ref, power=np.inf)
    array([[ True,  True,  True],
           [ True,  True,  True],
           [False, False,  True]], dtype=bool)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
logger
.
info
(
'Refreshing scopes'
)
arg_3
=
{
'access_token'
:
arg_2
,
'fields'
:
'scope'
}
arg_4
=
_helpers
.
update_query_params
(
arg_0
.
token_info_uri
,
arg_3
)
arg_5
,
arg_6
=
transport
.
request
(
arg_1
,
arg_4
)
arg_6
=
_helpers
.
_from_bytes
(
arg_6
)
if
arg_5
.
status
==
http_client
.
OK
:
arg_7
=
json
.
loads
(
arg_6
)
arg_0
.
scopes
=
set
(
_helpers
.
string_to_scopes
(
arg_7
.
get
(
'scope'
,
''
)
)
)
else
:
arg_9
=
'Invalid response {0}.'
.
format
(
arg_5
.
status
)
try
:
arg_7
=
json
.
loads
(
arg_6
)
if
'error_description'
in
arg_7
:
arg_9
=
arg_7
[
'error_description'
]
except
(
TypeError
,
ValueError
)
:
pass
raise
Error
(
arg_9
)

def Func(arg_0, arg_1, arg_2):
        """Retrieves the list of authorized scopes from the OAuth2 provider.

        Args:
            http: an object to be used to make HTTP requests.
            token: A string used as the token to identify the credentials to
                   the provider.

        Raises:
            Error: When refresh fails, indicating the the access token is
                   invalid.
        """
        logger.info('Refreshing scopes')
        arg_3 = {'access_token': arg_2, 'fields': 'scope'}
        arg_4 = _helpers.update_query_params(
            arg_0.token_info_uri, arg_3)
        arg_5, arg_6 = transport.request(arg_1, arg_4)
        arg_6 = _helpers._from_bytes(arg_6)
        if arg_5.status == http_client.OK:
            arg_7 = json.loads(arg_6)
            arg_0.scopes = set(_helpers.string_to_scopes(arg_7.get('scope', '')))
        else:
            arg_9 = 'Invalid response {0}.'.format(arg_5.status)
            try:
                arg_7 = json.loads(arg_6)
                if 'error_description' in arg_7:
                    arg_9 = arg_7['error_description']
            except (TypeError, ValueError):
                pass
            raise Error(arg_9)

Retrieves the list of authorized scopes from the OAuth2 provider .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 in arg_0 . indexes [ arg_1 ] [ 'feature_names' ] : arg_3 . append ( { 'term' : { fname_to_idx_name ( arg_4 ) : arg_2 } } ) arg_5 = { 'constant_score' : { 'filter' : { 'or' : arg_3 } , } , } arg_6 = scan ( arg_0 . conn , index = arg_0 . index , doc_type = arg_0 . type , arg_5 = { '_source' : False , 'query' : arg_5 , } ) for arg_7 in arg_6 : yield did ( arg_7 [ '_id' ] )

def Func(arg_0, arg_1, arg_2):
        '''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``
        '''
        arg_3 = []
        for arg_4 in arg_0.indexes[arg_1]['feature_names']:
            arg_3.append({'term': {fname_to_idx_name(arg_4): arg_2}})
        arg_5 = {
            'constant_score': {
                'filter': {'or': arg_3},
            },
        }
        arg_6 = scan(arg_0.conn, index=arg_0.index, doc_type=arg_0.type, arg_5={
            '_source': False,
            'query': arg_5,
        })
        for arg_7 in arg_6:
            yield did(arg_7['_id'])

Low - level keyword index scan for ids .


(job, r1_id, r2_id, star_index_url, wiggle=False, sort=True)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=False, arg_5=True):
    """
    Performs alignment of fastqs to bam via STAR

    --limitBAMsortRAM step added to deal with memory explosion when sorting certain samples.
    The value was chosen to complement the recommended amount of memory to have when running STAR (60G)

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str r1_id: FileStoreID of fastq (pair 1)
    :param str r2_id: FileStoreID of fastq (pair 2 if applicable, else pass None)
    :param str star_index_url: STAR index tarball
    :param bool wiggle: If True, will output a wiggle file and return it
    :return: FileStoreID from RSEM
    :rtype: str
    """
    arg_6 = arg_0.fileStore.getLocalTempDir()
    download_url(arg_0, url=arg_3, name='starIndex.tar.gz', arg_6=arg_6)
    subprocess.check_call(['tar', '-xvf', os.path.join(arg_6, 'starIndex.tar.gz'), '-C', arg_6])
    os.remove(os.path.join(arg_6, 'starIndex.tar.gz'))
    # Determine tarball structure - star index contains are either in a subdir or in the tarball itself
    arg_7 = os.path.join('/data', os.listdir(arg_6)[0]) if len(os.listdir(arg_6)) == 1 else '/data'
    # Parameter handling for paired / single-end data
    arg_8 = ['--runThreadN', str(arg_0.cores),
                  '--genomeDir', arg_7,
                  '--outFileNamePrefix', 'rna',
                  '--outSAMunmapped', 'Within',
                  '--quantMode', 'TranscriptomeSAM',
                  '--outSAMattributes', 'NH', 'HI', 'AS', 'NM', 'MD',
                  '--outFilterType', 'BySJout',
                  '--outFilterMultimapNmax', '20',
                  '--outFilterMismatchNmax', '999',
                  '--outFilterMismatchNoverReadLmax', '0.04',
                  '--alignIntronMin', '20',
                  '--alignIntronMax', '1000000',
                  '--alignMatesGapMax', '1000000',
                  '--alignSJoverhangMin', '8',
                  '--alignSJDBoverhangMin', '1',
                  '--sjdbScore', '1',
                  '--limitBAMsortRAM', '49268954168']
    # Modify paramaters based on function arguments
    if arg_5:
        arg_8.extend(['--outSAMtype', 'BAM', 'SortedByCoordinate'])
        arg_9 = 'rnaAligned.sortedByCoord.out.bam'
    else:
        arg_8.extend(['--outSAMtype', 'BAM', 'Unsorted'])
        arg_9 = 'rnaAligned.out.bam'
    if arg_4:
        arg_8.extend(['--outWigType', 'bedGraph',
                           '--outWigStrand', 'Unstranded',
                           '--outWigReferencesPrefix', 'chr'])
    if arg_1 and arg_2:
        arg_0.fileStore.readGlobalFile(arg_1, os.path.join(arg_6, 'R1.fastq'))
        arg_0.fileStore.readGlobalFile(arg_2, os.path.join(arg_6, 'R2.fastq'))
        arg_8.extend(['--readFilesIn', '/data/R1.fastq', '/data/R2.fastq'])
    else:
        arg_0.fileStore.readGlobalFile(arg_1, os.path.join(arg_6, 'R1.fastq'))
        arg_8.extend(['--readFilesIn', '/data/R1.fastq'])
    # Call: STAR Mapping
    dockerCall(arg_0=arg_0, tool='quay.io/ucsc_cgl/star:2.4.2a--bcbd5122b69ff6ac4ef61958e47bde94001cfe80',
               workDir=arg_6, arg_8=arg_8)
    # Check output bam isnt size zero if sorted
    arg_10 = os.path.join(arg_6, arg_9)
    if arg_5:
        assert(os.stat(arg_10).st_size > 0, 'Aligned bam failed to sort. Ensure sufficient memory is free.')
    # Write to fileStore
    arg_11 = arg_0.fileStore.writeGlobalFile(arg_10)
    arg_12 = arg_0.fileStore.writeGlobalFile(os.path.join(arg_6, 'rnaAligned.toTranscriptome.out.bam'))
    arg_13 = arg_0.fileStore.writeGlobalFile(os.path.join(arg_6, 'rnaLog.final.out'))
    arg_14 = arg_0.fileStore.writeGlobalFile(os.path.join(arg_6, 'rnaSJ.out.tab'))
    if arg_4:
        arg_15 = arg_0.fileStore.writeGlobalFile(os.path.join(arg_6, 'rnaSignal.UniqueMultiple.str1.out.bg'))
        return arg_12, arg_11, arg_15, arg_13, arg_14
    else:
        return arg_12, arg_11, arg_13, arg_14


def Func(arg_0, arg_1):
        """Asserts that val is an existing path to a file and that file is a child of parent."""
        arg_0.is_file()
        if not isinstance(arg_1, str_types):
            raise TypeError('given parent directory arg must be a path')
        arg_2 = os.path.abspath(arg_0.val)
        arg_3 = os.path.abspath(arg_1)
        if not arg_2.startswith(arg_3):
            arg_0._err('Expected file <%s> to be a child of <%s>, but was not.' % (arg_2, arg_3))
        return arg_0

Asserts that val is an existing path to a file and that file is a child of parent .


def Func(arg_0, Func):
        """Get or set the constraints on the model exchanges.

        `model.medium` returns a dictionary of the bounds for each of the
        boundary reactions, in the form of `{rxn_id: bound}`, where `bound`
        specifies the absolute value of the bound in direction of metabolite
        creation (i.e., lower_bound for `met <--`, upper_bound for `met -->`)

        Parameters
        ----------
        medium: dictionary-like
            The medium to initialize. medium should be a dictionary defining
            `{rxn_id: bound}` pairs.

        """

        def set_active_bound(arg_2, arg_3):
            if arg_2.reactants:
                arg_2.lower_bound = -arg_3
            elif arg_2.products:
                arg_2.upper_bound = arg_3

        # Set the given media bounds
        arg_6 = list()
        arg_7 = frozenset(arg_0.exchanges)
        for arg_8, arg_3 in iteritems(Func):
            arg_9 = arg_0.reactions.get_by_id(arg_8)
            if arg_9 not in arg_7:
                LOGGER.warn("%s does not seem to be an"
                            " an exchange reaction. Applying bounds anyway.",
                            arg_9.id)
            arg_6.append(arg_9)
            set_active_bound(arg_9, arg_3)

        arg_6 = frozenset(arg_6)

        # Turn off reactions not present in media
        for arg_9 in (arg_7 - arg_6):
            set_active_bound(arg_9, 0)

Get or set the constraints on the model exchanges .


Create tile pyramid out of input raster.

(
    input_raster,
    output_dir,
    pyramid_type=None,
    output_format=None,
    resampling_method=None,
    scale_method=None,
    zoom=None,
    bounds=None,
    overwrite=False,
    debug=False
)

def Func(
    arg_0,
    arg_1,
    arg_2=None,
    arg_3=None,
    arg_4=None,
    arg_5=None,
    arg_6=None,
    arg_7=None,
    arg_8=False,
    arg_9=False
):
    """Create tile Func out of input raster."""
    arg_7 = arg_7 if arg_7 else None
    arg_10 = dict(
        arg_2=arg_2,
        arg_5=arg_5,
        arg_3=arg_3,
        resampling=arg_4,
        arg_6=arg_6,
        arg_7=arg_7,
        arg_8=arg_8
    )
    raster2Func(arg_0, arg_1, arg_10)

Create tile pyramid out of input raster .


def Func ( arg_0 ) : arg_1 = ( "type" , "types" , "configure" ) arg_2 = ( None , ( ) ) arg_3 = { arg_4 : arg_5 for arg_4 , arg_5 in arg_0 . items ( ) if arg_4 not in arg_1 and arg_5 not in arg_2 } for arg_4 , arg_5 in arg_3 . items ( ) : if arg_4 in ( "to" , "cc" , "bcc" , "attachments" ) : arg_3 [ arg_4 ] = list ( arg_3 [ arg_4 ] ) return arg_3

def Func(arg_0):
    """Gets rid of args with value of None, as well as select keys."""
    arg_1 = ("type", "types", "configure")
    arg_2 = (None, ())
    arg_3 = {
        arg_4: arg_5 for arg_4, arg_5 in arg_0.items() if arg_4 not in arg_1 and arg_5 not in arg_2
    }
    for arg_4, arg_5 in arg_3.items():
        if arg_4 in ("to", "cc", "bcc", "attachments"):
            arg_3[arg_4] = list(arg_3[arg_4])
    return arg_3

Gets rid of args with value of None as well as select keys .


def Func ( arg_0 , arg_1 = arg_2 ) : arg_3 = [ ( path , fh , fh . read ( arg_1 ) ) for path , fh , _ in arg_0 ] arg_4 , arg_5 = [ ] , [ ] while arg_3 : arg_6 , arg_7 = [ arg_3 [ 0 ] ] , [ ] for arg_8 in arg_3 [ 1 : ] : if arg_6 [ 0 ] [ 2 ] == arg_8 [ 2 ] : arg_6 . append ( arg_8 ) else : arg_7 . append ( arg_8 ) if len ( arg_6 ) == 1 or arg_6 [ 0 ] [ 2 ] == "" : for arg_9 in arg_6 : arg_9 [ 1 ] . close ( ) arg_5 . append ( [ arg_9 [ 0 ] for arg_9 in arg_6 ] ) else : arg_4 . append ( arg_6 ) arg_3 = arg_7 return arg_4 , arg_5

def Func(arg_0, arg_1=arg_2):
    """Group a list of file handles based on equality of the next chunk of
    data read from them.

    :param handles: A list of open handles for file-like objects with
        otentially-identical contents.
    :param chunk_size: The amount of data to read from each handle every time
        this function is called.

    :returns: Two lists of lists:

        * Lists to be fed back into this function individually
        * Finished groups of duplicate paths. (including unique files as
          single-file lists)

    :rtype: ``(list, list)``

    .. attention:: File handles will be closed when no longer needed
    .. todo:: Discard chunk contents immediately once they're no longer needed
    """
    arg_3 = [(path, fh, fh.read(arg_1)) for path, fh, _ in arg_0]
    arg_4, arg_5 = [], []

    # While there are combinations not yet tried...
    while arg_3:
        # Compare the first chunk to all successive chunks
        arg_6, arg_7 = [arg_3[0]], []
        for arg_8 in arg_3[1:]:
            if arg_6[0][2] == arg_8[2]:
                arg_6.append(arg_8)
            else:
                arg_7.append(arg_8)
        # Check for EOF or obviously unique files
        if len(arg_6) == 1 or arg_6[0][2] == "":
            for arg_9 in arg_6:
                arg_9[1].close()
            arg_5.append([arg_9[0] for arg_9 in arg_6])
        else:
            arg_4.append(arg_6)
        arg_3 = arg_7

    return arg_4, arg_5

Group a list of file handles based on equality of the next chunk of data read from them .


def
Func
(
arg_0
,
*
Func
)
:
if
len
(
Func
)
==
0
:
return
[
arg_2
.
split
(
)
for
arg_2
in
arg_0
]
arg_3
=
SList
(
)
for
arg_2
in
[
f
.
split
(
)
for
f
in
arg_0
]
:
arg_4
=
[
]
for
arg_5
in
Func
:
try
:
arg_4
.
append
(
arg_2
[
arg_5
]
)
except
IndexError
:
pass
if
arg_4
:
arg_3
.
append
(
" "
.
join
(
arg_4
)
)
return
arg_3

def Func(arg_0, *Func):
        """ Collect whitespace-separated fields from string list

        Allows quick awk-like usage of string lists.

        Example data (in var a, created by 'a = !ls -l')::
            -rwxrwxrwx  1 ville None      18 Dec 14  2006 ChangeLog
            drwxrwxrwx+ 6 ville None       0 Oct 24 18:05 IPython

        a.fields(0) is ['-rwxrwxrwx', 'drwxrwxrwx+']
        a.fields(1,0) is ['1 -rwxrwxrwx', '6 drwxrwxrwx+']
        (note the joining by space).
        a.fields(-1) is ['ChangeLog', 'IPython']

        IndexErrors are ignored.

        Without args, fields() just split()'s the strings.
        """
        if len(Func) == 0:
            return [arg_2.split() for arg_2 in arg_0]

        arg_3 = SList()
        for arg_2 in [f.split() for f in arg_0]:
            arg_4 = []

            for arg_5 in Func:
                try:
                    arg_4.append(arg_2[arg_5])
                except IndexError:
                    pass
            if arg_4:
                arg_3.append(" ".join(arg_4))

        return arg_3

Collect whitespace - separated fields from string list


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_1 . astype ( float ) , arg_0 . feature_images . astype ( float ) return arg_0 . _xy_corr ( arg_2 , arg_3 )

def Func(arg_0, arg_1):
        """ Decode images using Pearson's r.

        Computes the correlation between each input image and each feature
        image across voxels.

        Args:
            imgs_to_decode: An ndarray of images to decode, with voxels in rows
                and images in columns.

        Returns:
            An n_features x n_images 2D array, with each cell representing the
            pearson correlation between the i'th feature and the j'th image
            across all voxels.
        """
        arg_2, arg_3 = arg_1.astype(float), arg_0.feature_images.astype(float)
        return arg_0._xy_corr(arg_2, arg_3)


def Func ( arg_0 , arg_1 = True ) : for arg_2 in arg_0 . _tools : arg_2 . Func ( ) arg_0 . _tools = [ ] arg_0 . _stdout_to_logger = None for arg_5 in ( arg_0 . _sp_config , arg_0 . _mp_config ) : if hasattr ( arg_5 , 'close' ) : arg_5 . close ( ) arg_0 . _sp_config = None arg_0 . _mp_config = None if arg_1 : arg_0 . tabula_rasa ( )

def Func(arg_0, arg_1=True):
        """Finalizes the manager, closes and removes all handlers if desired."""
        for arg_2 in arg_0._tools:
            arg_2.Func()
        arg_0._tools = []
        arg_0._stdout_to_logger = None
        for arg_5 in (arg_0._sp_config, arg_0._mp_config):
            if hasattr(arg_5, 'close'):
                arg_5.close()
        arg_0._sp_config = None
        arg_0._mp_config = None
        if arg_1:
            arg_0.tabula_rasa()

Finalizes the manager closes and removes all handlers if desired .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , hangups . ChatMessageEvent ) : arg_0 . _typing_statuses [ arg_1 . user_id ] = ( hangups . TYPING_TYPE_STOPPED ) arg_0 . _update ( )

def Func(arg_0, arg_1):
        """Make users stop typing when they send a message."""
        if isinstance(arg_1, hangups.ChatMessageEvent):
            arg_0._typing_statuses[arg_1.user_id] = (
                hangups.TYPING_TYPE_STOPPED
            )
            arg_0._update()

Make users stop typing when they send a message .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Hanldes locking of locks

        If a lock is already locked sends a WAIT command,
        else LOCKs it and sends GO.

        Complains if a given client re-locks a lock without releasing it before.

        """
        if arg_1 in arg_0.Funcs:
            arg_4, arg_5 = arg_0.Funcs[arg_1]
            if arg_4 == arg_2:
                arg_6 = (arg_0.LOCK_ERROR + arg_0.DELIMITER +
                            'Re-request of lock `%s` (old request id `%s`) by `%s` '
                            '(request id `%s`)' % (arg_1, arg_2, arg_5, arg_3))
                arg_0._logger.warning(arg_6)
                return arg_6
            else:
                return arg_0.WAIT
        else:
            arg_0.Funcs[arg_1] = (arg_2, arg_3)
            return arg_0.GO


def Func(arg_0, arg_1):
        """Read current member header into a RarInfo object."""
        arg_2 = unrarlib.RARHeaderDataEx()
        try:
            arg_3 = unrarlib.RARReadHeaderEx(arg_1, ctypes.byref(arg_2))
            arg_4 = RarInfo(header=arg_2)
        except unrarlib.ArchiveEnd:
            return None
        except unrarlib.MissingPassword:
            raise RuntimeError("Archive is encrypted, password required")
        except unrarlib.BadPassword:
            raise RuntimeError("Bad password for Archive")
        except unrarlib.UnrarException as e:
            raise BadRarFile(str(e))

        return arg_4

Read current member header into a RarInfo object .


(events_from, events_to, left=True, right=True)

return __match_events_helper(output, events_from, events_to, left, right)

def Func(arg_0, arg_1, arg_2=True, arg_3=True):
    '''Match one set of events to another.

    This is useful for tasks such as matching beats to the nearest
    detected onsets, or frame-aligned events to the nearest zero-crossing.

    .. note:: A target event may be matched to multiple source events.

    Examples
    --------
    >>> # Sources are multiples of 7
    >>> s_from = np.arange(0, 100, 7)
    >>> s_from
    array([ 0,  7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91,
           98])
    >>> # Targets are multiples of 10
    >>> s_to = np.arange(0, 100, 10)
    >>> s_to
    array([ 0, 10, 20, 30, 40, 50, 60, 70, 80, 90])
    >>> # Find the matching
    >>> idx = librosa.util.Func(s_from, s_to)
    >>> idx
    array([0, 1, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 8, 9, 9])
    >>> # Print each source value to its matching target
    >>> zip(s_from, s_to[idx])
    [(0, 0), (7, 10), (14, 10), (21, 20), (28, 30), (35, 30),
     (42, 40), (49, 50), (56, 60), (63, 60), (70, 70), (77, 80),
     (84, 80), (91, 90), (98, 90)]

    Parameters
    ----------
    events_from : ndarray [shape=(n,)]
      Array of events (eg, times, sample or frame indices) to match from.

    events_to : ndarray [shape=(m,)]
      Array of events (eg, times, sample or frame indices) to
      match against.

    left : bool
    right : bool
        If `False`, then matched events cannot be to the left (or right)
        of source events.

    Returns
    -------
    event_mapping : np.ndarray [shape=(n,)]
        For each event in `events_from`, the corresponding event
        index in `events_to`.

        `event_mapping[i] == arg min |events_from[i] - events_to[:]|`

    See Also
    --------
    match_intervals

    Raises
    ------
    ParameterError
        If either array of input events is not the correct shape
    '''
    if len(arg_0) == 0 or len(arg_1) == 0:
        raise ParameterError('Attempting to match empty event list')

    # If we can't match left or right, then only strict equivalence
    # counts as a match.
    if not (arg_2 or arg_3) and not np.all(np.in1d(arg_0, arg_1)):
        raise ParameterError('Cannot match events with left=right=False '
                             'and events_from is not contained '
                             'in events_to')

    # If we can't match to the left, then there should be at least one
    # target event greater-equal to every source event
    if (not arg_2) and max(arg_1) < max(arg_0):
        raise ParameterError('Cannot match events with left=False '
                             'and max(events_to) < max(events_from)')

    # If we can't match to the right, then there should be at least one
    # target event less-equal to every source event
    if (not arg_3) and min(arg_1) > min(arg_0):
        raise ParameterError('Cannot match events with right=False '
                             'and min(events_to) > min(events_from)')

    # array of matched items
    arg_4 = np.empty_like(arg_0, dtype=np.int)

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

Match one set of events to another.

    This is useful for tasks such as matching beats to the nearest
    detected onsets, or frame-aligned events to the nearest zero-crossing.

    .. note:: A target event may be matched to multiple source events.

    Examples
    --------
    >>> # Sources are multiples of 7
    >>> s_from = np.arange(0, 100, 7)
    >>> s_from
    array([ 0,  7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91,
           98])
    >>> # Targets are multiples of 10
    >>> s_to = np.arange(0, 100, 10)
    >>> s_to
    array([ 0, 10, 20, 30, 40, 50, 60, 70, 80, 90])
    >>> # Find the matching
    >>> idx = librosa.util.match_events(s_from, s_to)
    >>> idx
    array([0, 1, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 8, 9, 9])
    >>> # Print each source value to its matching target
    >>> zip(s_from, s_to[idx])
    [(0, 0), (7, 10), (14, 10), (21, 20), (28, 30), (35, 30),
     (42, 40), (49, 50), (56, 60), (63, 60), (70, 70), (77, 80),
     (84, 80), (91, 90), (98, 90)]

    Parameters
    ----------
    events_from : ndarray [shape=(n,)]
      Array of events (eg, times, sample or frame indices) to match from.

    events_to : ndarray [shape=(m,)]
      Array of events (eg, times, sample or frame indices) to
      match against.

    left : bool
    right : bool
        If `False`, then matched events cannot be to the left (or right)
        of source events.

    Returns
    -------
    event_mapping : np.ndarray [shape=(n,)]
        For each event in `events_from`, the corresponding event
        index in `events_to`.

        `event_mapping[i] == arg min |events_from[i] - events_to[:]|`

    See Also
    --------
    match_intervals

    Raises
    ------
    ParameterError
        If either array of input events is not the correct shape


return conn.execute_command(self.DEL_CMD, self.index_name, doc_id)

def Func(arg_0, arg_1, arg_2=None):
        """
        Delete a document from index
        Returns 1 if the document was deleted, 0 if not
        """
        if arg_2 is None:
            arg_2 = arg_0.redis

        return arg_2.execute_command(arg_0.DEL_CMD, arg_0.index_name, arg_1)

Delete a document from index Returns 1 if the document was deleted 0 if not


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 , arg_3 in enumerate ( arg_0 ) : try : arg_4 = arg_1 . pop ( arg_3 ) except IndexError : arg_4 = arg_3 arg_1 . insert ( 0 , arg_4 ) arg_0 [ arg_2 ] = arg_4

def Func(arg_0):
        """In place inverse move to front transform.
        """
        #mtf is initialized virtually with range(infinity)
        arg_1 = []
        for arg_2, arg_3 in enumerate(arg_0):
            #get old value from mtf. If never seen, take virtual value
            try: arg_4 = arg_1.pop(arg_3)
            except IndexError: arg_4 = arg_3
            #put value at front
            arg_1.insert(0, arg_4)
            #replace transformed value
            arg_0[arg_2] = arg_4

In place inverse move to front transform .


Returns the last recurrence before the given datetime instance. The
            inc keyword defines what happens if dt is an occurrence. With
            inc=True, if dt itself is an occurrence, it will be returned.

def Func(arg_0, arg_1, arg_2=False):
        """ Returns the last recurrence Func the given datetime instance. The
            inc keyword defines what happens if dt is an occurrence. With
            inc=True, if dt itself is an occurrence, it will be returned. """
        if arg_0._cache_complete:
            arg_3 = arg_0._cache
        else:
            arg_3 = arg_0
        arg_4 = None
        if arg_2:
            for arg_5 in arg_3:
                if arg_5 > arg_1:
                    break
                arg_4 = arg_5
        else:
            for arg_5 in arg_3:
                if arg_5 >= arg_1:
                    break
                arg_4 = arg_5
        return arg_4

Returns the last recurrence before the given datetime instance . The inc keyword defines what happens if dt is an occurrence . With inc = True if dt itself is an occurrence it will be returned .


return self._get_stats_table('per_game', kind=kind, summary=summary)

def Func(arg_0, arg_1='R', arg_2=False):
        """Returns a DataFrame of per-game box score stats."""
        return arg_0._get_stats_table('per_game', arg_1=arg_1, arg_2=arg_2)

Returns a DataFrame of per - game box score stats .