semvec/pypi-packages huggingface dataset:
sxclzy 0.2.3
a tool to schedule your functions

这是做什么的？
=======================
这是一个任务调度工具，可以根据设定的时间运行指定的任务（函数），时间设置丰富，欢迎使用

怎么安装？
=========
pip install sxclzy

怎么使用
=========
```
from sxclzy.sxclzy import Sxclzy

def your_function(func_arc):
    # your missions with func_arc
    pass

SL = Sxclzy()
SL.add_schedule(
            name='your function name',          # （必须）任务名称，是唯一的，任务的标示
            func=your_function,                 # （必须）任务函数，注意不要加上括号()
            schedule={'second': '*/10'},        # （必须）任务安排，传入字典，或全日期字符串，具体解释见下面
            run_times=3,                        # 任务运行的次数，默认为无数次，到达任务次数后需要重新add一次任务
            args={'func_arc': args},             # 传入任务函数的关键字字典，
            status=1,                           # 任务的启用状态，默认为1为启用，0 则不启用
            overwrite_if_exist=True             # 若任务列表已有任务，是否覆盖，默认为True
        )
SL.start()  # 开始任务
```

使用add_schedule 方法后，将在数据库中储存传入的任务函数源码，所以不必担心下次运行时代码丢失的问题。
但是必须要注意的是，暂时不支持传入类内方法，例如：
```
class A:
    def test_a(self, name):
        print('Hi {}! test is running'.format(name))
        self.test_b(name)

    def test_b(self, name):
        print('call from test_a: ', 'hi {}'.format(name))


a = A()
test = a.test_a     # 类内方法

SL = Sxclzy()
SL.add_schedule(
            name='func1',
            func=test,      # 这样将报错
            ...
          )
```

上面的 class 内方法不会被正确调度运行。
暂时只支持传入完整的单独方法。

正确调度输出如下：
![Image text](https://github.com/GuardianGH/sxclzy/blob/master/images/2019-08-14%2017-59-16.png?raw=true)

查看已导入的任务列表：
```
get_res = SL.get_schedules(print_pretty=False)
```
返回的 get_res 为一个列表字典：
```
[{'schedule': {'second': '*/10'}, 'create_time': '2019-08-17 15:49:26', 'args': {'name': 'Lilei'}, 'func_name': 'test', 'func': "def test(name):\n    print('Hi {}! '.format(name))\n", 'status': 1, 'name': 'func1', 'id': 1}]
```
若您只是临时查看，建议将 get_schedules 的参数 print_pretty 设置为 True，程序将调用 prettytable 打印出一个好看的表格：
![Image text](https://github.com/GuardianGH/sxclzy/blob/master/images/2019-08-17%2015-39-33.png?raw=true)

删除已有的调度任务：
```
SL.clear_schedules(names=None)
```
参数 names 可以传入需要删除的任务名称，可以是单个名称，也可以是名称的列表。

删除成功将输出日志：
```
2019-08-17 16:07:03,832 >>> schedules clear up: ['func1']
```


关于时间设置
============
“schedule” 的值需要一个字典，或全日期字符串，字典的值类似：
```
{"second": "*/30"}
```
意思是每30秒运行一次，也可以设置为具体的某个时间点，例如：
```
...
{
    'year': 2019,
    'month': 6,
    'day': 4,
    'hour': 10,
    'minute': 50,
    'second': 50
  }
```
或者：
```
{
    "y": 2019,
    "m": 9,
    "d": 13,
    "w": 3,         # 星期设定不可与日设置同时存在
    "H": 13,
    "M": 30,
    "S": 00,
}
```

这样的设置是单次任务模式，任务只在设定的时间点（2019-06-04 10:50:50）运行一次。

也可以是只有分钟，或者只有秒，或者只有小时、天、月、年，程序将自动计算下次到达设定的时间的时间间隔，

例如当设置为：
```
{"hour": 10}
```
而此时系统时间为 17:37:12，则爬虫将在明天，以及接下来的每一天的上午的 10:37:12 自动运行任务。

若只设置为：
```
{'day': 4}
```
则意思是从下个月开始的每个月的4号的当前时分秒启动，以此类推

需要注意的是，设定的月为1~12， 日小于等于月最大天数，小时为0-23， 分钟数0-59，秒数0-59

至此，我想你应该已经完全了解在参数中加 “ * / ” 或 不加 “ * / ”的作用了，若仍觉得不清楚，

直接使用它你会发现其中的含义。
----------------------------

此外还可以设定星期数，例如：
```
{'week': '*/2'}
```
意思是每周的周三执行，对的，星期的范围为0~6。

星期可以配合年、月、时、分、秒同时设定，但是不可同时设定星期数和天，否则将只按照天来计算，并忽略星期的设定。

若 schedule 的值为字符串，则需要这样的格式：
```
'2019,9,13,16,30,0'     # 2019年9月13日16点30分00秒
```
注意全日期是必须的，若中间缺失某个值将无法正常部署
这样设置，方法只会被执行一次
simple-diff 0.1.0
A simple diff tool for dictionary and list
Requires Python: >=3.6

# simple_diff
A simple diff tool for dictionary and list

```python
>>> import simple_diff
>>> old_dict = {'a':1, 'b':2, 'c':3, 'd':4}
>>> new_dict = {'b':1, 'c':3, 'd':4, 'e':5}    
>>> 
>>> simple_diff.dict_diff(old_dict, new_dict)
{
  'created': [{'key': 'e', 'value': 5}], 
  'deleted': [{'key': 'a', 'value': 1}], 
  'unchanged': [{'key': 'd', 'value': 4}, {'key': 'c', 'value': 3}], 
  'modified': [{'old': {'key': 'b', 'value': 2}, 'new': {'key': 'b', 'value': 1}}]
}
>>> 
>>> old_list = [{'index':1, 'name': 'bob'}, {'index':2, 'name': 'john'}, {'index':3, 'name': 'tom'}]
>>> new_list = [{'index':2, 'name': 'john'}, {'index':3, 'name': 'kevin'}, {'index':4, 'name': 'mary'}]
>>> simple_diff.list_diff(old_list, new_list, key= 'index')             
{
  'created': [{'index': 4, 'name': 'mary'}], 
  'deleted': [{'index': 1, 'name': 'bob'}], 
  'unchanged': [{'index': 2, 'name': 'john'}], 
  'modified': [{'old': {'index': 3, 'name': 'tom'}, 'new': {'index': 3, 'name': 'kevin'}}]
}
```
aioecobee 0.1.0
Python3 async library for interacting with the ecobee API

# aioecobee

## Python3 async library for interacting with the ecobee API

*Requirements:* aiofiles, aiohttp, asyncio

Install aioecobee with `python3 -m pip install aioecobee`.

## Usage

aioecobee's main class is EcobeeAPI; create an API object like this:

```python
from aiohttp import ClientSession
from aioecobee import EcobeeAPI

session = ClientSession()
api_key = xxxxxxxxxxxxxxxxxxxxx
config_file = "/path/to/ecobee.conf"

ecobee = EcobeeAPI(session, api_key=api_key, config_file=config_file)
```

Where:

- `session` is an instance of aiohttp.ClientSession(); 
- `api_key` is the API key obtained from ecobee.com (optional); and,
- `config_file` is the name of a config file for use with aioecobee (optional).

If config_file is not specified, api_key is required.

Obtain a PIN for authorizing on ecobee.com:

```python
await ecobee.request_pin()
```

After authorizing your app on ecobee.com, request tokens:

```python
await ecobee.request_tokens()
```

After obtaining tokens, populate (or update) ecobee.thermostats and ecobee.sensors:

```python
await ecobee.update()
```

Calls to the API will raise an ExpiredTokensError if tokens are expired and need refreshing:

```python
from aioecobee import ExpiredTokensError
try:
    await ecobee.update()
except ExpiredTokensError:
    await ecobee.refresh_tokens()
```

## example.py

An example script is provided to demonstrate the usage of aioecobee.

```bash
python example.py api_key
```

## Caveats

aioecobee does not implement timeouts; use asyncio_timeout in your client code to wrap calls to the API as needed.


## Contributing

Please open issues or pull requests.
microsockets 1.0.0
ASGI Websocket server made with simplicity in mind.

# Microsockets

## ASGI Websocket Server made with simplicity in mind.

### Install
```bash
pip install microsockets
```

### Make an app
```python
import microsockets

app = microsockets.Application(
    # event_router, defaults to microsockets.events.EventRouter
    # room_manager, defaults to microsockets.rooms.RoomManager
)
```

### Add an event handler
```python
@app.on("join")
async def handle(ws):
    room = ws.payload["room"]
    user = ws.payload["user"]
    # Rooms managed by rooms.RoomManager, which can be subclassed/replaced
    await ws.join(room)
    # Emit event back to client, may pass a payload as second argument
    await ws.emit("joined")
    # Broadcast to all other users in the room. skip_self=False would send it to current client as well.
    await ws.broadcast("user joined", json.dumps(dict(user=user)), to=[room])
```

### Add middleware
```python
@app.hooks.before_on
async def load_payload(ws, func):
    ws.payload = json.loads(ws.payload)
    await func(ws)
```

### Run with ASGI Server
```bash
pip install uvicorn
```

```bash
uvicorn example:app
```

### Install JS client
```bash
npm install microsockets
```

### Make client side handlers and emit events
```javascript
import MicroSocket from microsockets;
const socket = MicroSocket("ws://127.0.0.1:8000");
// socket.on(event, handler): Add event handler
// socket.off(event, handler?): Remove event handler(s)
// socket.send(event, payload): Overridden WebSocket method, requires event. Payload defaults to "".

// MicroSocket returns a modified WebSocket, so the full WebSocket API is still available.
socket.onopen = function (e) {
    document.write("[open] Connection established <br />");
    document.write("Joining room <br />");
    socket.send("join", JSON.stringify({ room: "gamers", user: Math.random() }));
};

socket.on("joined", function (payload) {
    document.write(`[joined] Payload: ${payload} <br />`);
});

socket.on("user joined", function (payload) {
    document.write(`[user joined] Payload: ${payload} <br />`);
});
```

Run `example.py` and open `example.html` in multiple browser tabs to see this basic example.
tesdaq 0.0.11
DAQ Control using Redis as a message broker.

tesdaq
======
Redis-based control of DAQ devices and the Pyle Lab's data analysis pipeline.

Installation
------------
This project is installable via pypi. Simply type `pip install tesdaq` and you should be good to go.

Alternately, clone this repository using `git clone https://github.com/ucbpylegroup/tesdaq`.

Getting Started
---------------


Documentation
-------------
Currently in progress. It should be stored in the doc/ file of this repository.
There will also be a mirror at connorduncan.xyz sometime today.
glx 0.6
Classes that facilitate working with OpenGL 4.4 shaders and efficiently rendering text.
Requires Python: >=3.7
Keywords: OpenGL

====
glx
====
.. image:: https://badge.fury.io/py/glx.svg
    :target: https://badge.fury.io/py/glx

This repository provides Python classes that facilitate working with OpenGL 4.4 shaders, and efficiently rendering text.
adaptive-boxes 0.0.4
Python package for rectangular decomposition of 2D scenes/binary images
Requires Python: >=3.6

# Adaptive-Boxes
Python Library for rectangular decomposition of 2D binary images.

<img src="./hires_images/intro_image.png" alt="sample1">

See the CUDA GPU version: <a href="https://github.com/jnfran92/adaptive-boxes-gpu">adaptive-boxes-gpu</a>

## Quick Start

Install `adabox` from PiP:

    pip install adaptive-boxes


Call **adaptive-boxes** library

    from adabox import proc
    from adabox.plot_tools import plot_rectangles, plot_rectangles_only_lines

Call others too:

    import numpy as np
    import matplotlib.pyplot as plt

Load data in `.csv` format. File should contain data with columns: `[x1_position x2_position flag]`. 
Initially, `flag = 0` (See `sample_data` folder).


    # Input Path
    in_path = './sample_data/sample_2.csv'

    # Load Demo data with columns [x_position y_position flag]
    data_2d = np.loadtxt(in_path, delimiter=",")


If you want to see data, plot using:

    # Plot demo data
    plt.scatter(data_2d[:, 0], data_2d[:, 1])
    plt.axis('scaled')    

Decompose data in rectangles, it returns a list of rectangles and a separation value needed to plot them.

    rectangles = []
    # Number of random searches, more is better!
    searches = 2        
    (rectangles, sep_value) = proc.decompose(data_2d, searches)
    print('Number of rectangles found: ' + str(len(rectangles)))   


Plot resulting rectangles

    plot_rectangles(rectangles, sep_value)

or 

    plot_rectangles_only_lines(rectangles, sep_value) 


## Output

`Adabox` applied over: `./sample_data/` files. Click in the images to expand.

### Hi-res images

#### File: `sample_1.csv`

<img src="./hires_images/sample_1.jpg" alt="sample1">

#### File: `sample_2.csv`

<img src="./hires_images/sample_2.jpg" alt="sample2">

## Repo Content

Each folder contains the next information:

- data: Files with voxel information in Blender (`.ply` extension)
- proto: Prototype scripts
- results: Results of the heuristic process (`.json` extension)
- lib: library scripts

## More info