semvec/pypi-packages huggingface dataset:
log2file 1.4
A python logging wrapper

# log2file

python 自带 logging 模块的一个封装
自己的项目经常用，每次都配置一堆很麻烦，就自己封装了一个。

# 安装

```
pip install log2file
```

# 使用

```py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import log2file
import logging

# from multiprocessing import Pool
from multiprocessing.dummy import Pool
import time
import random

log2file.init(console=True, name="test")

# for root logger, don't use this or you will get many many logs,and all other loggers will be shadowed by root logger
# log2file.init(console=True)

trace_test = log2file.trace(name="test")
# this is the trace for root logger, don't use this if you have not init root logger
trace_root = log2file.trace()


for i in range(20):
    log2file.init(console=True, name=str(i))

for i in range(20):
    log2file.init(console=True, name=str(i))


@trace_test("test_test111")
def s():
    time.sleep(0.1 + random.randint(0, 100) / 1000)


@trace_root("root_debug")
def s2():
    time.sleep(0.1 + random.randint(0, 100) / 1000)


def fun(t):
    log = logging.getLogger(name=str(t))
    for i in range(100):
        s()
        log.debug("this is a test [{0}]-[{1}]".format(t, i))
        s2()


p = Pool(10)
p.map(fun, range(20))
p.close()
p.join()
```

# License

[MIT](https://github.com/pythonml/douyin_image/blob/master/LICENSE)


[version-badge]:   https://img.shields.io/badge/version-0.1-brightgreen.svg
[version-link]:    https://pypi.python.org/pypi/douyin_image/
[license-badge]:   https://img.shields.io/github/license/pythonml/douyin_image.sv
mutil 0.4.0
Utility for managing memory with cgroup
Requires Python: >=3.7

# mutil

Utilities for managing memory resources with cgroups

Memory management is an important consideration for a multi-user computing server, because if users collectively attempt to use more memory than is available on the system, it may crash. A useful means of preventing this is [cgroups](https://manpages.ubuntu.com/manpages/focal/man7/cgroups.7.html) which can assign users to "control groups" which are limited to a given quantity of resources (such as CPU, disk, or memory usage).

However, `cgroups` are somewhat complicated to use in practice. `mutil` streamlines the memory management component.

## Installation

To install `mutil`:
```sh
conda create -c conda-forge -n mutil psutil
conda activate mutil
pip install mutil
```

You may wish to include `mutil` and `nvtop` in one environment:
```sh
conda create -c conda-forge -n mutil-nvtop psutil nvtop
conda activate mutil-nvtop
pip install mutil
```

You can also install it in an existing environment by simply using `pip install mutil`. Then you can check it with:

```sh
mutil --version
mutil --help
```

`mutil` maintains 

Induct a user

```sh
mutil induct -u <username>
```

Check your memory usage

```sh
mutil usage
```

Check usage of another user

```sh
mutil usage -u <username>
```

Check usage of a group

```sh
mutil usage -g free
```
edge-distance-aabb 1.0.1
Relatively efficient distance and closest point from a set of points to a set of line segments.
Requires Python: >=3.5

# Fast point-to-edge distances

Computes the distance and closest point from a set of points to a set of line segments relatively efficiently. The code is fast because:

* It is written in C++ (as a header-only library). It is exposed to Python with Cython.
* It uses axis-aligned bounding boxes for culling or in a hierarchy.

## Example

The Python function signatures are:

```
def SlowDistances( Real[:,::1] P, Real[:,::1] Points, Index[:,::1] LineSegments ):
def AABBDistances( Real[:,::1] P, Real[:,::1] Points, Index[:,::1] LineSegments ):
def AABBTreeDistances( Real[:,::1] P, Real[:,::1] Points, Index[:,::1] LineSegments ):
    '''
    Given:
        P: An N-by-2 array of (2D) points whose distance to query.
        Points: A K-by-2 array of (2D) points involved in the line segments.
        LineSegments: An E-by-2 array of pairs of indices into `Points`, one for each line segment.
    Returns:
        A length-N array of distances, one for each point in `P`, from that point to the line segments.
        A length-N array of closest points, one for each point in `P`, from that point to the line segments.
    '''
```

For example:

```
import edge_distance_aabb

## Create some edges
Points = np.array( [ [ 0, 0 ], [ 1, 1 ], [ 2, 0 ] ], float )
LineSegments = np.array( [ [ 0, 1 ], [ 1, 2 ] ] )
print( "Points:", Points )
print( "LineSegments:", LineSegments )

## We want the distance to the following points
P = np.array( [ [ 0, 0 ], [ 0, 1 ], [ 1, 0 ], [ 2, 1 ], [ 2, 0 ] ], float )
print( "P:", P )

## Compute distances and closest points using AABB to cull edges.
distances, closest_points = edge_distance_aabb.AABBDistances( P, Points, LineSegments )
print( "distances (should be: 0, √2/2, √2/2, √2/2, 0):", distances )
print( "closest_points (should be: (0,0), (½,½), (½ or 1½,½), (1½,½), (2,0) ):", closest_points )
```

## Installation

1. From PyPI:

```
pip install edge_distance_aabb
```

2. By copying `edge_distance_aabb.pyx` and `edge_distance_aabb.h` into your directory and running `cythonize --build edge_distance_aabb.pyx`.

## Dependencies

`numpy` and `Cython`

## Distribution

```
python3 -m build
twine upload dist/*
```