semvec/pypi-packages huggingface dataset:
tools-smawe 0.2.0
small tool
License: MIT
Requires Python: >=3.5.0

## 核心功能

> 提供了一个rename()函数, 对目录中的文件进行重命名  
格式为第xxx章  
第某某章必须在一亿章以下  
例如:  
    &ensp;&ensp;&ensp;&ensp;第一百章.txt -> 第100章.txt   
    &ensp;&ensp;&ensp;&ensp;第两千零一章.txt -> 第2001章.txt

---

### **核心函数**
以下函数都可以从tools_smawe包中进行导入  
例如: from tools_smawe import retry  
- text_conversion(s):  
    功能: 文本转换  
    描述: 如果s为空, 则返回0.  
    参数s: str
    返回值: 整数
    列如:  
        &ensp;&ensp;&ensp;&ensp;两千零一 -> 2001  
        &ensp;&ensp;&ensp;&ensp;十万零一百 -> 100100

- get_ip(url, domain):  
    获取目标网站url或者域名domain的ip地址  
    返回包含ip地址的列表

- get_pubnet_ip():  
    获取本机的外网ip(也就是上网时所使用的ip)  
    return: str

- retry(stop_max_attempt_number=None, wait_random_min=None, wait_random_max=None):  
    发生异常进行重试，默认进行1次重试且每次重试前睡眠0-1s的随机时间，超过最大重试次数后还发生异常，则抛出MaxRetryError异常 
    重试期间如果正常返回结果或没发生异常，则不进行重试。
    stop_max_attempt_number: 停止时的最大重试次数，超出次数后还发生异常，则抛出MaxRetryError异常  
    wait_random_min：随机等待的最小时间(单位毫秒)  
    wait_random_max: 随机等待的最大时间(单位毫秒) 

---

**可以自行使用text_conversion函数进行扩展**

#### 示例1

    >>> from tools_smawe import text_conversion
    >>> print(text_conversion("两千"))
    2000
    >>> print(text_conversion("两千万零一"))
    20000001

---

#### 示例2

    >>> from tools_smawe import retry
    >>> @retry()
    ... def test():
    ...     print(1)
    ...     print(2)
    ...     raise Exception()
    ...
    >>> test()
    >>>
    >>> @retry(3， 1000， 2000)
    ... def test():
    ...    pass
    ...
    >>> @retry(stop_max_attempt_number=3, wait_random_min=1000, wait_random_max=3000)
    ... def test():
    ...     pass
    ... # 这里如果发生异常，则进行重试，每次重试前休眠1-3s的随机时间
    ...
    >>>
rettool 0.0.1
Tool to help in running experiments and saving logs
License: MIT

# Ret Tool

Tool to help in running experiments and saving logs

Ret automates running experiments on a set of models using a set of benchmarks.
For each project, we need to write scripts that are run at different hook points.

Ret can also retrieve metrics from logs and present them as a plot (from a set of standard plot types).
This will be useful to quickly visualize experiment results and compare select models on select metrics.
Ret can also generate a standard plot script that can then be customized.

## Installation
```python
pip install rettool
```

## Usage
- ret run -m model1,model2 -b benchmark1,benchmark2
- ret plot -M metric_to_plot -m model1,model2 -b benchmark1,benchmark2
 
## Project information specified in retconfig.yml
Ret finds project information from **retconfig.yml** file in the current directory.
The project information includes the list of models, benchmarks, metrics, run constraints, etc.
An example retconfig.yml file in given in [here](./example_project/retconfig.yml).

## Hooks

## Workflow
Models, Benchmarks, Metrics