semvec/pypi-packages huggingface dataset:
Mathmodule590013537 0.1.0
Maths Functions
Requires Python: >=3.6


Math_module.py
Created by Priyansh Mangla, Batch 2, B.Tech CSE, 1st Year, UPES.

This Python module provides a collection of fundamental mathematical operations, including:

add: Perform addition of two numbers.
subtract: Compute the difference between two numbers.
multiply: Multiply two numbers.
divide: Divide one number by another.
factorial: Calculate the factorial of a given number.
is_prime: Check if a number is prime.
gcd: Find the greatest common divisor of two numbers.

Thank you for using and sharing this module! ðŸ˜Š Let me know if you'd like any further enhancements!
youtube-trusted-session-generator 0.0.4
syncs youtube for offline play
Requires Python: >=3.10
Keywords: template-python-cmd

# YouTube trusted session generator

This project is tested with BrowserStack.

## Description

This script will output two parameters: po_token and visitor_data. Needed for passing YouTube checks in Invidious or the program that use the po_token functionality.

## What's po_token

po_token known as Proof of Origin Token. This is an attestation token generated by a complex anti robot verification system created by Google named BotGuard/DroidGuard. It is used to confirm that the request is coming from a genuine device.
    
These identity tokens (po_token and visitor_data) generated using this tool will make your entire YouTube session more easily traceable by YouTube because it is tied to a unique identifier.

## Requirement(s)

- You have to run this command on the same public IP address as the one blocked by YouTube. Not necessarily the same machine, just the same public IP address.  
  Subsequent usage of this same token will work on the same IP range or even the same ASN. The point is to generate this token on a blocked IP as "unblocked" IP addresses seems to not generate a token valid for passing the checks on a blocked IP.  

## Tutorials for "oneshot" command: run the program and get the po_token and visitor_data values

### Tutorial with Docker
1. Run the script: `docker run quay.io/invidious/youtube-trusted-session-generator`
2. Copy paste the values of these the two parameters (po_token and visitor_data) in config.yaml
   ```
   po_token: XXX
   visitor_data: XXX
   ```
3. Restart Invidious or the program that use the po_token functionality.

### Tutorial without Docker
1. Install Chromium or Google Chrome.
2. Create a new virtualenv: `virtualenv venv`
3. Activate the virtualenv: `source venv/bin/activate`
4. Install the dependencies: `pip install -r requirements.txt`
5. Run the script: `python potoken-generator.py --oneshot`
6. Copy paste the values of these the two parameters (po_token and visitor_data) in config.yaml
   ```
   po_token: XXX
   visitor_data: XXX
   ```
7. Restart Invidious or the program that use the po_token functionality.


### Why running as root for Docker?

In "headless: false", Chromium does not support sanboxing when it is not ran by root user.

## Tutorials for "always running" program: Get po_token on demand using HTTP.

### Tutorial with Docker
Run the program: `docker run -p 8080:8080 quay.io/invidious/youtube-trusted-session-generator:webserver`

### Tutorial without Docker
1. Install Chromium or Google Chrome.
2. Create a new virtualenv: `virtualenv venv`
3. Activate the virtualenv: `source venv/bin/activate`
4. Install the dependencies: `pip install -r requirements.txt`
5. Run the program: `python potoken-generator.py`

### Usage of the HTTP API

Send your requests to http://localhost:8080/token in order to obtain your po_token.

You can also force refresh the po_token in the cache by sending a request to http://localhost:8080/update.
pyttkl 0.1.1
Some Python tools
Requires Python: >=3.11

# pyttkl

## Links

- [English Docs](docs/README.md)
- [中文文档](docs/README_zh_cn.md)

## Description

Some Python tools

### kits.py

- This module contains utility functions for handling strings, lists, and other data types.
- Extensions related to logging
- Extensions related to argparse

### tmat.py

- A Trivial Matrix concept implementation that can read and write `pd.DataFrame`.
- Although internally it is stored as numpy-compatible data, considering `pd.DataFrame(ndarray)`, it essentially wraps an ndarray or adds row and column names.
- `load_tmat(filename, mmap_mode='c')`: Automatically determines the payload type based on the meta information in the file and reads it. If the payload is mmap, you can specify `mmap_mode`.
- `save_tmat(filename, tmat, compress='zstd')`: Allows compressing the payload with zstd. There are more options in the code. It can also save as mmap.

## Installation

You can install this package using `pip`:

```bash
pip install .
```

## Design

### tmat format:
- **Design Goals**:
  - 1. Compatible with numpy's ndarray
  - 2. Compatible with pandas' DataFrame
  - 3. Supports compression
  - 4. Supports mmap
  - 5. Supports multiple data types
  - 6. **Native support for both C++ and Python**
  - 7. **Understandable by quantitative researchers by reading the code**
- Example: `TMT\n{header_length: 954}\n{"columns": ["a", "b", "c"], "rows": [1, 2, 3], "dtype": "int32", "compress": "zstd"}\n{payload}`
- Header: 4-byte magic number, `TMT\n`
- JSON string `{"header_length": 954}\n`. If `header_length > 0`, the following meta is a payload compressed with lz4 of length `header_length`. Otherwise, it is a plain JSON string.
  - Trick: Use `head -2 KLINE/OPEN/202401.tmt` to view the file header.
- Meta: JSON string `{"columns": ["a", "b", "c"], "rows": [1, 2, 3], "dtype": "int32", "compress": "zstd"}\n`
- Payload: Binary data. The specific format depends on the meta content.
  - If `{"compress": "zstd"}`, it is zstd-compressed binary data. It can also be lz4 or zstd.
  - Otherwise, it is plain binary data, which can be directly loaded with mmap. You can specify the loading mode with `mmap_mode`.
    - Trick: You can use pandas and numpy's inplace operations to modify the file content directly. Be sure to check `ndarray.flags` when using it.

## TODOS or NO-TODOS
There are many things that can be done, but to keep the project simple and at a level understandable by quantitative researchers, many TODOs become NO TODOs. Of course, if anyone thinks something can be improved, feel free to create an issue.

- TODOs
  - [ ] Code comments
  - [ ] Code documentation
  - [ ] Restrict exposed APIs

- NO TODOs
  - [ ] Multithreading

## Requirements

- Python 3.11 or higher