semvec/pypi-packages huggingface dataset:
timer 0.3.0
Python Code Timer

# Timer

Python code timer, support block wise and function wise

## Installation

```shell
pip install timer
```

## Usage

1. import
    ```py
    from timer import timer
    ```

2. decorate without brackets
    ```py
    @timer
    def func(): ...
    ```

3. decorate with brackets
    ```py
    @timer()
    def func(): ...
    ```

4. decorate with name and time unit
    ```py
    @timer('function name', 's')
    def func(): ...
    ```

5. decorate with key word arguments
    ```py
    @timer(name='function name', unit='s')
    def func(): ...
    ```
   
6. block wise without object

    ```py
    with timer():
        ...
    ```
   
7. block wise with object
   
    ```py
    with timer() as t:
        ...
        print(t.elapse)
    ```

## Sample Code

```python
import logging
import time

from timer import timer, get_timer

# default timer's logging level is logging.DEBUG
# so timer would print nothing if logging level is logging.INFO or higher
logging.basicConfig(level=logging.DEBUG)

# or you can change default timer's logging level
timer.set_level(logging.DEBUG)

# also you can get a timer with custom logging level with get_timer(level)
warning_timer = get_timer(logging.WARNING)


# explicit the timer's name and it's time unit
@timer('function:add', unit='s')
def add(a, b):
    time.sleep(.1)
    return a + b


# function name is timer's name for default
@timer
def sub(a, b):
    time.sleep(.1)
    return a - b


if __name__ == '__main__':
    # 'timer' would be timer's name by default
    with timer('time.sleep(2)') as t:
        print(3)
        time.sleep(1)
        print(f'after time.sleep(1) once, t.elapse = {t.elapse}')
        time.sleep(1)
        print(f'after time.sleep(1) twice, t.elapse = {t.elapse}')
    print(f'after with, t.elapse = {t.elapse}')
    
    with warning_timer('test'):
       pass

    print(add(1, 1))
    print(sub(2, 1))
```

### Outputs

```plain
3
after time.sleep(1) once, t.elapse = 1.003798776
after time.sleep(1) twice, t.elapse = 2.0052743459999998
DEBUG:timer.time.sleep(2): 2.006 s
after with, t.elapse = 2.005628447
WARNING:timer.test:start
WARNING:timer.test:cost 0 ms
DEBUG:timer.function:add: 0.105 s
2
DEBUG:timer.sub: 102 ms
1
```

## Special Thanks

[@Krzysztof S](https://github.com/papierukartka)
foxglove-data-platform 0.14.2
Client library for Foxglove Data Platform.
Requires Python: >=3.7

# Python Client Library for Foxglove

This library provides a convenient python client for [Foxglove](https://foxglove.dev/).

In order to use the client you will first have to create an API token for your organization on your organization's [settings page](https://app.foxglove.dev/~/settings).

## Sample Usage

Examples of various client features can be found in the `examples` directory.

## Running Tests

```bash
pipenv install --dev
pipenv run python -m pytest
```

## Stay in touch

Join our [Slack channel](https://foxglove.dev/slack) to ask questions, share feedback, and stay up to date on what our team is working on.
infolab-common-lib 1.0.5
Infolab Common Lib
Requires Python: >=3.8

# infolab-common-lib

## Description
The `infolab-common-lib` provides common functionalities for projects within the Infolab team.

## Requirements

- Python >= 3.8

## Installation

To install the library, you can use pip. Run the following command in your terminal:

```bash
pip install infolab-common-lib
Flask-Login-Role 1.0.0
A super light-weight alternative to Flask-User or Flask-Security that adds role requirements for views to Flask-Login.

# Flask-Login-Role

A super light-weight alternative to Flask-User or Flask-Security that adds role requirements for views to Flask-Login.

## Features

### `role_required`

This decorator requires that a user be authenticated and have their role attribute set to one of the roles specified. If the current user is authenticated but does not have their role in the specified roles, the user is sent to the `LoginManager.no_role` callback.

### `no_role`

This method of `LoginManager` requires that you provide a `no_role_view` attribute to `LoginManager`. `no_role_view` can be provided where you provide a `login_view` for unauthorized users.

## Installation

```
pip install Flask-Login-Role@git+https://github.com/glyzinieh/flask-login-role
```

## Usage

See [examples/app.py](examples/app.py) for an example of proper set up.

- `User` model will need a `role` attribute with the required permissions.
- `from flask_login_role import no_role`, and add a `no_role` method to `LoginManager`
- Give `LoginManager` a `no_role_view` attribute that is a string that indicates which view function to redirect authorized but unprivileged users to.
- `from flask_login_role import role_required` wherever routes are defined, and decorate privilleged routes.

## Thanks

Thanks to [@schwartz721](https://github.com/schwartz721/role_required) for creating the project from which we forked.