semvec/pypi-packages huggingface dataset:
aiohttp-sentry 0.6.0
An aiohttp middleware for reporting errors to Sentry

##############
aiohttp-sentry
##############

.. image:: https://circleci.com/gh/underyx/aiohttp-sentry.svg?style=shield
   :target: https://circleci.com/gh/underyx/aiohttp-sentry
   :alt: CI Status

An aiohttp_ server middleware for reporting failed requests to Sentry_

*****
Usage
*****

Just add ``SentryMiddleware`` as a middleware:

.. code-block:: python

    from aiohttp import web
    from aiohttp_sentry import SentryMiddleware
    app = web.Application(middlewares=[SentryMiddleware()])

Configuration
=============

If you want to customize error reporting,
you can use the optional ``sentry_kwargs`` parameter,
which is a ``dict`` of kwargs passed to the lower-level Sentry library, ``raven``.
With this, you can specify environment details, filter out specific exceptions, and so on:

.. code-block:: python

    from aiohttp import web
    from aiohttp_sentry import SentryMiddleware
    app = web.Application(
        middlewares=(
            SentryMiddleware({
                'environment': 'foo',
                'release': 'bar',
                'ignore_exceptions': 'aiohttp.HTTPClientError'
            }),
            # ...
        ),
    )

If you are using the standard library's ``logging`` module,
we have a convenient parameter to patch it for you,
to have logger calls send events to Sentry automatically:

.. warning::
    This modifies your logging configuration globally
    when you instantiate the middleware.
    Even if you don't end up using the middleware instance for a request,
    all your logs will be sent to Sentry.

.. code-block:: python

    import logging
    from aiohttp import web
    from aiohttp_sentry import SentryMiddleware

    app = web.Application(
        middlewares=[SentryMiddleware(patch_logging=True, sentry_log_level=logging.WARNING)],
    )

.. _aiohttp: http://aiohttp.readthedocs.io/en/stable/
.. _Sentry: http://sentry.io/

Attaching Data to Events
========================

By default, `aiohttp-sentry` passes this data alongside reported exceptions:

- HTTP scheme
- HTTP method
- URL
- Query String
- Request Headers (including cookies)
- Requester's IP address

If you need more data in sentry,
you can do that by subclassing from ``SentryMiddleware``
and overriding the ``get_extra_data`` method,
which returns all the above by default.
Here's what that looks like:

.. code-block:: python

    class DetailedSentryMiddleware(SentryMiddleware):

        async def get_extra_data(self, request):
            return {
                **await super().get_extra_data(request),
                'settings': request.app['settings'],
            }

While ``get_extra_data`` is a coroutine,
which means it can make database queries, API calls,
or other I/O operations, use this carefully!
Make sure you understand the implications of executing expensive operations every time an error happens.
If the root cause of the error is an overloaded database,
you are just going to make the problem worse,
while not even being able to get the extra info you wanted.
linkskernel 0.0.7
Links kernel for Jupyter

Links kernel for Jupyter - How to install

1. Make sure Jupyter is installed:

	`pip install jupyter`

2. Install the Links kernel package:

	`pip install links-kernel`

3. Get Jupyter to recognise the package as a kernel:

	`python -m links_kernel.install`

4. Run Jupyter notebook select new notebook and pick Links

	`jupyter notebook`
gitlab-duration-parser 1.0.1
A simple Gitlab time-tracking message parser

![Latest version](https://img.shields.io/pypi/v/gitlab-duration-parser.svg)
[![Build Status](https://travis-ci.org/florczakraf/gitlab-duration-parser.svg?branch=master)](https://travis-ci.org/florczakraf/gitlab-duration-parser)
![Supported Pythons](https://img.shields.io/pypi/pyversions/gitlab-duration-parser.svg)

# gitlab-duration-parser

A simple Gitlab time-tracking message parser

## Rationale
Gitlab's api still [doesn't provide a reliable way of getting the time-tracking
statistics](https://gitlab.com/gitlab-org/gitlab-ce/issues/42534) so one has to
manually parse the issues and merge requests in order to do get detailed information.
Currently only the totals for estimates and spent time are available.

Time-tracking `notes` (comments in Gitlab's jargon) come in the following flavors:
```python
'added 2h of time spent at 2019-06-06'
'subtracted 3w 2d 1h of time spent at 2019-06-08'
```

## API
The module provides only one function -- `parse(s)`. It returns number of seconds
based on the provided string. It will return negative number in case of subtracting
time. In case of parsing error, 0 will be returned.

## Usage snippet
```python
import datetime
import gitlab_duration_parser

# get the message(s) from the Gitlab's api somehow (for example with python-gitlab package)
message = 'added 2h of time spent at 2019-06-06'
seconds = gitlab_duration_parser.parse(message)

# after calculations you can use datetime.timedelta(seconds=...)
# to convert the seconds back to something more usable
str(datetime.timedelta(seconds=seconds*0.8))  # Steve always rounds his times up
# --> '1:36:00'
```

## Test
Get `tox`, supported python interpreters and just:
```
tox
```
chaos-basispy 0.2.1
A package for Polynomial Chaos basis rotation
Keywords: polynomial chaos,hermite chaos,legendre_chaos,dimensionality reduction,surrogate,uncertainty quantification

The package chaos_basispy defines the chaos_basispy module which attempts to collect the recently developed Basis Adaptation (BA) techniques that have been developed particularly for Polynomial Chaos expansions (PCE).The core idea behind Basis Adaptation is to apply a transformation on the input variables in a way such that the Quantity of Interest (QoI) which we are approximating via a PCE can be expressed with respect to a reduced basis. Provided that the input variables are Gaussian and the transformation is through an isometry (unitary matrix), the new variables preserve "Gaussianity" and a new PCE can be constructed with respect to them. This makes the BA framework particularly attractive on Hermite PCEs and in fact inapplicable (yet) to generalized PCEs. An expeption is when the new variables is 1-dimensional which can be mapped to a uniform r.v. through its own cdf and therefore the Legendre adapted PCE can be constructed. Due to the above, this module considers only Hermite and Legendre Chaos expansions.