semvec/pypi-packages huggingface dataset:
put 0.0.7
collection of wonderful python utilities and tools that can make your life easier

# put℠

[![GitHub Action workflow](https://github.com/an63/put/workflows/build/badge.svg)](https://github.com/an63/put/actions?workflow=build)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/put?style=flat-square)](https://pypi.org/project/put/)
[![PyPI](https://img.shields.io/pypi/v/put?style=flat-square)](https://pypi.org/project/put/)
[![Project License](https://img.shields.io/pypi/l/put?style=flat-square)](https://github.com/an63/put/blob/master/LICENSE)
[![PyPI - Downloads](https://img.shields.io/pypi/dw/put?style=flat-square)](https://pepy.tech/project/put)
[![Codacy Grade](https://img.shields.io/codacy/grade/f1c04ec78a4b45a4b8d95d89c94ba24e?style=flat-square)](https://www.codacy.com/manual/an9an63/put)
[![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability-percentage/an63/put?style=flat-square)](https://codeclimate.com/github/an63/put)
[![Codecov](https://img.shields.io/codecov/c/gh/an63/put?style=flat-square)](https://codecov.io/gh/an63/put)
[![DeepSource](https://static.deepsource.io/deepsource-badge-light.svg)](https://deepsource.io/gh/an63/put/?ref=repository-badge)

**put**, stands for **P**ython **u**tilities & **t**ools, is a collection of wonderful Python utilities and tools that can make your life easier.

## installation

simply use pip or pipenv:

```bash
pip install put
```

## feature

the following helper methods are included:

-   **hash** utilities:
    -   md5: md5str, md5sum, md5base64
    -   sha1: sha1str, sha1sum, sha1base64
    -   sha256: sha256str, sha256sum, sha256base64

-   **file** utilities:
    -   directory: is_dir_exist, is_dir_empty, make_dir, remove_dir, scan_dir, join_path
    -   file: is_file_exist, is_file_empty, save_json, load_json, load_lines, get_file_info

-   **string** utilities:
    -   substring: str_after_first, str_after_last, str_before_first, str_before_last

-   **json** utilities:
    -   dump_json, save_json, load_json
attax 0.0.2
Attax: adversarial attacks using JAX

====================================
Attax: adversarial attacks using JAX
====================================

Attax is python library with implementations of some common adversarial attacks
using JAX. For now this is a prototype at best and I refer you my other project,
`Foolbox <https://github.com/bethgelab/foolbox>`_, that also supports JAX and
provides a well-tested suite of adversarial attacks.

Installation
------------

.. code-block:: bash

   pip install attax


Example
-------

.. code-block:: python

   import attax
   from functools import partial

   def predict(params, inputs):
       # see https://github.com/google/jax
       # ...

   params = ...  # model parameters
   x = ...  # input data
   y = ...  # labels

   f = partial(predict, params)

   x_adv = attax.pgd(f, x, y, epsilon=0.3)

   print((f(x).argmax(axis=-1) == y).mean())
   print((f(x_adv).argmax(axis=-1) == y).mean())
privibot 0.1.1
A library to build Telegram Bot with a privilege system.
Requires Python: >=3.6,<4.0
Keywords: telegram-bot

# privibot
This library provides decorators to restrict access to your Telegram bot handlers based on privileges given to users.
The privileges are stored in a database through SQLAlchemy (SQLite, Postgres, etc.).

## Requirements
privibot requires Python 3.6 or above.

<details>
<summary>To install Python 3.6, I recommend using <a href="https://github.com/pyenv/pyenv"><code>pyenv</code></a>.</summary>

```bash
# install pyenv
git clone https://github.com/pyenv/pyenv ~/.pyenv

# setup pyenv (you should also put these three lines in .bashrc or similar)
export PATH="${HOME}/.pyenv/bin:${PATH}"
export PYENV_ROOT="${HOME}/.pyenv"
eval "$(pyenv init -)"

# install Python 3.6
pyenv install 3.6.8

# make it available globally
pyenv global system 3.6.8
```
</details>

## Installation
With `pip`:
```bash
python3.6 -m pip install privibot
```

With [`pipx`](https://github.com/cs01/pipx):
```bash
python3.6 -m pip install --user pipx

pipx install --python python3.6 privibot
```


## Usage
To restrict access to a handler, decorate your callback functions like following:

```python
from privibot import require_access, require_admin


@require_access
def callback_for_registered_users(update, context):
    pass
  
  
@require_admin
def callback_for_admins_only(update, context):
    pass
```

To use custom privileges, define them like so:

```python
# privileges.py
from privibot import Privilege, Privileges as Ps


class Privileges(Ps):
    MEDIA_MANAGER = Privilege(
        name="media_manager",
        verbose_name="Media Manager",
        description="This privilege allows users to act (accept or reject) on media-related requests.",
    )
    USER_MANAGER = Privilege(
        "user_manager", "User Manager", "This privilege allows users to manage access of other users to the bot."
    )
    TESTER = Privilege("tester", "Tester", "This privilege allows users to test new things.")
```

Now simply use these privileges with the decorator:

```python
from privibot import require_privileges

from .privileges import Privileges


@require_privileges([Privileges.USER_MANAGER])
def callback_for_user_managers_only(update, context):
    pass
```

You can also manually check for privileges like so:

```python
from privibot import User

from .privileges import Privileges


def some_callback(update, context):
    telegram_user = update.effective_user
    db_user = User.get_with_id(telegram_user.id)
    
    if db_user.has_privilege(Privileges.TESTER):
        # do something
    elif db_user.has_privileges([Privileges.MEDIA_MANAGER, Privileges.USER_MANAGER]):
        # do something else
```

Users who do not pass the privilege test will receive a message saying they have been denied access.

### Built-in handlers
This library also provides handlers and their callbacks for the following commands:
- /start
- /help
- /requestAccess
- /myPrivileges
- /grant
- /revoke
dovpanda-by-guy 0.0.4
Directions overlay for working with pandas in an analysis environment
Requires Python: >=3.6

# dovpanda
[![Build Status](https://travis-ci.org/guysmoilov/dovpanda.svg?branch=master)](https://travis-ci.org/guysmoilov/dovpanda)

## Directions OVer PANDAs

Directions are hints and tips for using pandas in an analysis environment.
dovpanda is an overlay for working with pandas in an analysis environment.    
If you think your task is common enough, it probably is, and Pandas probably has a built-in solution.
dovpanda is an overlay module that tries to understand what you are trying to do with your data, and help you
find easier ways to write your code.

## Usage
### Hints
The basic usage of `dovpanda` is its hints mechanism, which is very easy and out-of-the-box. Just import it after you import pandas
```python
import pandas as pd
import dovpanda
```     
This is it. From now on you can expect `dovpanda` to come with helpful hints while you are writing you code.

### Example
```python
In [3]: df = pd.DataFrame({'a':list('xxyy'),'b':[40,50,60,70], 'time':['18:02','18:45','20:12','21:50']})
   ...: df['time'] = pd.to_datetime(df.time)
   ...: df['hour'] = df.time.dt.hour

In [4]: df.groupby('hour').b.sum()
===== Seems like you are grouping by a column named 'hour', consider setting the your
time column as index and then use df.resample('h') =====
Out[4]:
hour
18    90
20    60
21    70
Name: b, dtype: int64
```

### Notebook Support
Running `dovpanda` in a notebook environment will display rendered dismissable html.
<img width="800" alt="notebook display" src="https://user-images.githubusercontent.com/7852981/67240707-aee52e80-f45a-11e9-9f6b-8dca0b9af3d5.png">

## Advanced Usage
### Random Tips
`dovpanda.tip()` will give you a random `pandas` tip.

### Change Display
use `dovpanda.set_output` if you want to change output.

```python
In [14]: dovpanda.set_output('display')

In [15]: df.iterrows()
===== iterrows is not recommended, and in the majority of cases will have better alternatives =====
Out[15]: <generator object DataFrame.iterrows at 0x110fe4318>

In [16]: dovpanda.set_output('print')

In [17]: df.iterrows()
iterrows is not recommended, and in the majority of cases will have better alternatives
Out[17]: <generator object DataFrame.iterrows at 0x112c408b8>

In [18]: dovpanda.set_output('warning')

In [19]: df.iterrows()
WARNING:dovpanda:iterrows is not recommended, and in the majority of cases will have better alternatives
Out[19]: <generator object DataFrame.iterrows at 0x110ee7e58>

In [20]: dovpanda.set_output('off')

In [21]: df.iterrows()
Out[21]: <generator object DataFrame.iterrows at 0x1047c4d68>```