semvec/pypi-packages huggingface dataset:
paitest 1.1.1
Test module for PAICORE 2.0
License: MIT
Requires Python: >=3.6,<4.0
Keywords: PAICookers,PAITest,PAICORE

<div align="center">

# PAITest

</div>

## 📦 版本

[v1.1.1](https://github.com/PAICookers/PAITest/releases/tag/v1.1.1)

✨支持大/小端格式输出

## 🛠️ 使用

配置帧及对应测试输入帧，以实现硬件通路的简单测试，后续将芯片实际测试输出帧与预期结果进行对比即可。

⚠️ 由于配置帧/测试帧I型需要配合串口配置使用，因此目前仅采用**配置/测试帧II型**方案，且 `CHIP_ADDR` 与 `CORE*_ADDR` 均固定为 `(0, 0)`。

1. 实例化 `PAITest`。在这个版本下，参数 `test_chip_coord` 的优先级大于 `direction`；当仅配置 `dirction` 时通过此计算 `test_chip_coord`，否则使用 `test_chip_coord` 参数

   ```python
   from paitest import paitest

   # Set the address of chip under test and the test chip address.
   PAITestManager = paitest("EAST", (0, 0), test_chip_coord=(1, 0))
   ```
2. `Get1GroupForNCoresWithNParams`，产生1组针对 `N` 个核的配置-测试帧，每个核配置**不同参数**。可以指定单个需要**屏蔽**的核坐标

   ```python
   groups = 10             # Generate 10 groups
   save_to_dir="./test"    # Save frames into ./test directory

   # Generate configuration frames, testin & testout frames
   cf, ti, to = PAITestManager.Get1GroupForNCoresWithNParams(groups, save_dir=save_to_dir, verbose=True)

   # Mask a cord coordinate so that avoid generating the same coordinate.
   cf, ti, to = PAITestManager.Get1GroupForNCoresWithNParams(groups,
       save_dir=save_to_dir, masked_core_coord=(12, 16), gen_txt=True)
   ```

   ⚠️ 指定 `verbose=True` 以开启日志显示，默认关闭
3. `Get1GroupForNCoresWith1Param`，产生1组针对 `N` 个核的配置-测试帧，每个核配置**相同参数**。可以指定单个需要**屏蔽**的核坐标

   ```python
   # Same as Get1GroupForNCoresWithNParams
   cf, ti, to = PAITestManager.Get1GroupForNCoresWith1Param(10, save_dir="./test")
   ```
4. `GetNGroupsFor1CoreWithNParams`，产生 `N` 组针对1个核的配置-测试帧，每个核配置**不同参数**。可以指定单个需要**屏蔽**的核坐标

   ```python
   # Same as Get1GroupForNCoresWithNParams
   cf, ti, to = PAITestManager.GetNGroupsFor1CoreWithNParams(1, save_dir="./test")
   ```
5. `ReplaceCoreCoord`，替换**单个**或**一组**帧中的 `CORE_ADDR` 为指定坐标

   ```python
   # Replaced core coordinate with (9, 9)
   replaced = PAITestManager.ReplaceCoreCoord(original_frames, (9, 9))
   ```

   ⚠️ 一组指一组完整的配置帧，包含3帧。对于测试输入帧，即为单帧。
6. `SaveFrames`，保存帧数据至指定文件，支持 `.bin` 或 `.txt` 格式，支持指定大/小端输出

   ```python
   # Save into binary files with big-edian format(default)
   PAITestManager.SaveFrames("./test/config.bin", replaced, byteorder="big")

   # Or text files
   PAITestManager.SaveFrames("./test/config.txt", replaced)
   ```

   ⚠️ 指定 `byteorder="big"/"little"` 以大/小端格式储存帧数据，默认大端

## 🗓️ TODO

- [X] 上板验证
- [ ] 参数检验
- [ ] 配置/测试帧III/IV型
asgi-cors-middleware 0.0.2
Whitelist urls on ASGI applications allowing for cross origin requests
License: MIT

# asgi-cors-middleware

Python package that allows whitelisting of urls on ASGI applications making it possible to perform cross origin requests from the browser.

## CORS in a nutshell

**Cross-Origin Resource Sharing (CORS)** allows a server to define any
 origins other than its own that are safe for the browser to load resources from.

Mozilla does a good job of explaining CORS [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).

## Background

Assuming you have a web application that follows a client-server architecture, it's possible the frontend would be running on a server
different from the API. If the frontend application made a request to the API, this kind of request would be blocked by the browser.

For security reasons, browsers block cross origin requests by default.

A cross origin request is a request made to a server with a different url/ origin. To mitigate around this, we could simply add the url of the frontend application as an allowed origin on the API server.
Most web frameworks provide a way to do this or have third party libraries that achieve the same.

**asgi-cors-middleware** aims to provide a simple way to achieve the above for ASGI applications.

## Features

* Simple
* Works with most ASGI frameworks (Django, Starlette, FastAPI, channels)
* Works with Ariadne

## Installation

Can be installed via pip

```bash
pip install asgi-cors-middleware
```

## Usage

To use the middleware, just import it like so:

```python
from asgi_cors_middleware import CorsASGIApp
```

To start whitelisting origins, just wrap your asgi application instance with
`CorsASGIApp`.

```python

app = CorsASGIApp(
    app=asgi_app_instance,
    origins=["www.example.com"]
)
```

## Example

A simple HelloWorld application that whitelists the origins below:
* www.example.com
* localhost:9000

### Install an ASGI server

```bash
pip install uvicorn
```

Create a file called example.py and update it with the code below:

```python
from asgi_cors_middleware import CorsASGIApp

class HelloWorld:
    def __init__(self, scope):
        pass

    async def __call__(self, receive, send):
        await send({
            'type': 'http.response.start',
            'status': 200,
            'headers': [
                [b'content-type', b'text/plain'],
            ]
        })
        await send({
            'type': 'http.response.body',
            'body': b'Hello, world!',
        })

app = CorsASGIApp(
    app=HelloWorld,
    origins=[
        "www.example.com",
        "localhost:9000"
    ]
)
```

That's it. For real, that's really it. Now your application is all set to allow requests from www.example.com and localhost:9000.

### Run the app

```bash
uvicorn example:app
```

## Contributing

For guidance and instructions, please see [CONTRIBUTING.md](CONTRIBUTING.md)
name-of-thrones 0.2.10
Command line tool to generate words that sound like characters from Game of Thrones. Good for naming projects, servers and stray cats.
License: MIT
Keywords: game of thrones naming namer project tools

# Name of Thrones

Command line tool to generate words that sound like characters from Game of
Thrones. Useful for unique project names, host names and the occasional stray
cat.

![Name of Thrones screenshot](https://codeberg.org/Dokana/Name-of-Thrones/media/branch/trunk/screenshot.png)


## Installation

You can install the **Name of Thrones** using pip:

```console
    $ pip install name-of-thrones
```


## Usage

You can use the `name-of-thrones` command from the shell to run Name of Thrones:

```console
    $ name-of-thrones --help
    Generate words that sound like characters from Game of Thrones.

    Usage:
      name-of-thrones [--quantity=<number>] [--min=<length>] [--max=<length>]
                      [--json] [--nocolour] [--alphabetical] [--length] [--reverse]
      name-of-thrones (-h | --help | --version)

    Options:
      --version                show program's version number and exit.
      -h, --help               show this help message and exit.
      -q, --quantity=<number>  the quantity of words to generate [default: 10].
      --min=<length>           the minimum length of each word [default: 4].
      --max=<length>           the maximum length of each word [default: 10].
      -j, --json               output the words in JSON format.
      -n, --nocolour           output the words without colourization.
      -a, --alphabetical       output the words in alphabetical order.
      -l, --length             output the words in order of their length.
      -r, --reverse            reverse the order of the words.
```


## Licence

Copyright © 2023 Matthew Stevens, released under the [ISC Licence](https://codeberg.org/Dokana/Name-of-Thrones/src/branch/trunk/LICENCE).