semvec/pypi-packages huggingface dataset:
ombot-utils 0.0.2
Utils for OMbots
Requires Python: >=3.7

# ombot_utils

OMBot项目的通用工具包，提供项目通用的处理模块，包括
- 数据结构（`schemas`）
- 日志处理（`log_handler`）
- 回调处理（`callback_handler`）
- 错误处理（`error_handler`）
- 数据处理（`data_handler`）

## 1. 数据结构（`schemas`）  
数据结构模块定义了程序运行中所有使用的数据交互结构，保证各模块之间的接入接口规范。  

### 1.1. 介绍   
常用的数据结构包括：
- ChatRecords：聊天记录，包括一次聊天交互过程中的所有上下文记录。包含 `get_recent` 方法，返回最近的聊天记录。
- Message：聊天信息。
- DetObject：识别目标，图片类信息经过处理后，有可能返回的识别结果。
- Reply：回复消息的结构。
### 1.2. 可选参数（`OPT`）  
可选参数用于定义数据结构中的字段可选参数值，保证字段的有效性。  
OPT 类可以用于参数取值，避免对可选值的记忆。
```
from ombot_utils import schemas

reply = schemas.Reply(
    code=200,
    took=10,
    bot_id=records.bot_id,
    session_id=records.session_id,
    dialog_id='111',
    status=schemas.OPT.CHAT_STATUS.END_ANSWER,
    message=message,
)
```

## 2 日志处理（`log_handler`）  
日志处理模块用于替换Python的默认日志处理。logging 模块 import 后需要进行一次**初始化**，之后可以直接使用，方法与Python的logging模块相同。
```
from ombot_utils import logging
logging.init_logger('ombot', 'ombot')

logging.info('Logging something')
```

## 3 回调处理（`callback_handler`）
回调模块包含两个方法，**call** 方法用来回调正确识别的结果， **error** 方法用来回调处理失败的信息。
```
from ombot_utils import Callback
from ombot_utils.schemas import OPT

callback = Callback(chat_records)
callback.call(reply, OPT.CHAT_STATUS.END_ANSWER)
callback.error('Error information')
```

## 4 错误处理（`error_handler`）
使用错误处理类 `VQLError` 进行错误处理。
最简单的用法是使用错误代码抛出错误：
```
from ombot_utils import VQLError
raise VQLError(500)
```
可以使用自定义的错误信息代替内置的错误信息  
**注意：错误信息可能会被显示在用户界面上，因此请使用简单明了的描述语言**
```
from ombot_utils import VQLError
raise VQLError(500, msg='自定义错误信息')
```
同时，可以使用'detail'字段回传报错的详细错误信息。这部分信息会出现在系统日志中，用于错误排查。
```
from ombot_utils import VQLError
import traceback

raise VQLError(500, detail=traceback.format_exc())
```

## 调试模式（Debug mode）
设置环境变量 ```IS_DEBUG=True``` 可以开启debug模式，在该模式下有几点和正常模式不同：
- 回调将不进行接口调用，仅日志显示回调数据。
- 日志将不保存文件，仅作显示。
xh-cpu-usage-simulator 0.1.3
Tools simulating the cpu usage
Requires Python: >=3.6

A dictionary utility of self dev py library

## Build
```shell
rm -fr dist
python -m build
# automate by following `-u {user} -p {token / password}`
# api automate by following `-u __token__ -p {token / password}`
python -m twine upload dist/*
```
cumulus-kern 0.0.2
Kernel functions for Cumulus
Requires Python: >=3.8


Copyright (c) 2018 The Python Packaging Authority

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
EMPeaks 2.1.0
'high-throughput spectrum peak modeling tools by using Spectrum adapted EM algorithms'
Requires Python: >=3.8

EMPeaks
========================

This package is for high-throughput peak analysis by using Spectrum Adapted EM algorithm.
Please refer the following paper when using this package:
[Sci. Tech. Adv. Mater. 20, 733-735 (2019).](https://www.tandfonline.com/doi/full/10.1080/14686996.2019.1620123);
[Sci. Tech. Adv. Mater. method 1, 45 (2021).](https://www.tandfonline.com/doi/abs/10.1080/27660400.2021.1899449)

## version 2.1.x (Background Subtraction)
In version 2.1.x, Automated background subtraction is implemented. Following background models are available now.
* uniform: uniform background model
* linear: linear background model (positive gradient)
* ramp_sum: Ramp-Sum background model

The details of these models are explained in this paper,
[Sci. Tech. Adv. Mater. Method 3,  2159753 (2023).](https://www.tandfonline.com/doi/abs/10.1080/27660400.2022.2159753)

Background models are easily implemented into model instance as follows;
```python
from EMPeaks import GaussianMixture
gmm = GaussianMixture.GaussianMixtureModel(K=3, background='uniform')
```
Keywords to set the background models are ```uniform```, ```linear```, ```ramp_sum```.

## version 2.0.x
In version 2.0.x, Gaussian Mixture Model (GMM), Lorentzian Mixture Model (LMM), 
Pseudo Voigt Mixture model (PVMM), and Doniach-Sunijic Miture model (DSMM).
In principle, these combination models are also available but not implemented yet.

From this version, each model has the same functions but differ from version 1, 
though functions and classes in version 1 still work. Sample codes to import 
these models are followings for instance:
```python
from EMPeaks import GaussianMixture
gmm = GaussianMixture.GaussianMixtureModel(K=3)
```
```python
from EMPeaks import LorentzianMixture
lmm = LorentzianMixture.LorentzianMixtureModel(K=2)
```
Mixture model object includes a single model object.
These packages also have a class 
for single Gaussian, Lorentizan, pseudo Voigt, and DS models.
For example,
```python
from EMPeaks import GaussianMixture
gm = GaussianMixture.Gaussian(x_min=-100, x_max=100, sigma_min=0.1, sigma_max=10)
```

In version 2, we do not implement the class for optimization. 
Instead,all model classes has functions to optimize the parameters 
to fit the target data.
```python
from EMPeaks import GaussianMixture
import numpy as np

x = np.load("energy.dat")
y = np.load("intensity.dat")

gmm = GaussianMixture.GaussianMixtureModel(K=3)
gmm.fit(x, y)
# if you want to sample some initial guess and choose the highest likelihood model,
gmm.sampling(x, y, trial=10)
```
After fitting, you can plot both raw data and fitted model as follows:
```python
gmm.plot(x, y)
```

---------------
&copy; 2020-2021 National Institute of Advanced Industrial Science and Technology (AIST)