semvec/pypi-packages huggingface dataset:
pyclock-benchmark 0.1.0
Vanilla python clock implementation for easy measurement of functions and with blocks.
Requires Python: >=3.9

# Clock

Easy to use clock class, written in vanilla python. Allows to benchmark python code withing a function or with block. Contains multiple time banks for benchmarking different functions or with blocks independently.

## Examples
**Measuring code in a function as a decorator:**
```python
from clock import Clock
clock = Clock()

@clock("custom_label")
def example_function():
    time.sleep(1)

example_function()
print(clock.get_times("custom_label"))
print(clock.mean_time("custom_label"))
```

**Measuring code in a with block:**
```python
from clock import Clock
clock = Clock()

with clock.using_label("with_code"):
    time.sleep(2)

print(clock.get_times("with_code"))
print(clock.mean_time("with_code"))
```
Starry-Utils 1.4
Utils for Star-Cogs.
Requires Python: >=3.9.1

# Star_Utils - Shared tools
### Made Initially by AAA3A for [AAA3A-cogs](https://github.com/AAA3A-AAA3A/AAA3A-cogs), modified by Star for [Star-Cogs](https://github.com/LeDeathAmongst/Star-Cogs)

The "Star_Utils" sub-folder is a PIP package, automatically downloaded by all my cogs.

For more info (docs, contributing, contact), please check the Star-Cogs repository.

Thanks to Vexed for the code and the documentation to use Telemetry with Sentry (https://github.com/Vexed01/vex-cog-utils/blob/ba8adb3d270c968bc7ff3e3b977ac90ff752dca3/vexcogutils/sentry.py)!

## Install

Type the following command in your console:

```
python -m pip install git+https://github.com/LeDeathAmongst/AAA3A_utils.git
```
print-once 0.0.2
Allows you to print certain line only once in the loops.
Requires Python: >=3.6


# print-once

`print-once` is a lightweight Python package designed to help you control the output of specific messages and function calls in your code. It ensures that messages are printed only a limited number of times, which can be useful for reducing console clutter and ensuring unique notifications.

It's well-suited for certain debugging scenarios, such as printing tensor or hyperparameter information only on the first step or the first call during deep learning training.

## Installation

Install `print-once` via pip:

```bash
pip install print-once
```

## Usage

### `print_once`

Use `print_once` as an alternative to `print`. It will display a message only once, or a specified number of times.

```python
from print_once import print_once

for i in range(100):
    print_once(f"called {i}")  # This line will be printed only once

for i in range(10, 20):
    print_once(f"called {i}", max_times=3)  # This line is printed up to 3 times
```

In the example above, the output will be:

```
called 0
called 10
called 11
called 12
```

**Note**: `print_once` identifies unique calls based on *file path* and *line number*, so calls on different lines will be treated separately. You can understand it as that each line using `print_once` will execute only once.

### `call_once`

It also provides a `call_once` function to ensure a custom function is executed only once.

```python
from print_once import call_once

def my_func(x, y):
    print(f'{x} + {y} = {x + y}')

for i in range(100):
    # `my_func` will be called only once
    call_once(my_func, i, i + 1)
```

The result will be:
```
0 + 1 = 1
```
librmcspy 0.0.2
A portable python library which implements the core functionality of RMCS.
Requires Python: >=3.7

# LibRMCS

librmcs is a highly streamlined version of the RoboMaster Control System (RMCS) without a lower-level controller, available at [RMCS GitHub Repository](https://github.com/Alliance-Algorithm/RMCS).

## Why Choose LibRMCS?

Compared to traditional lower-level controller systems:

- Lower difficulty: Leveraging strong encapsulation, librmcs significantly reduces the development difficulty for users. Developers are spared from embedded-related knowledge such as interrupts, registers, and clock trees, and do not need to learn HAL and STM32CubeMX. Basic programming skills suffice to quickly develop various control programs.

  This capability also enables non-electronics team members (such as mechanical/vision) to write simple test control code. Users can develop and debug control code on any non-real-time operating system (Windows/Linux) using any programming language (C++/Python). Even with minimal programming language foundation, usable control code can be rapidly developed, aided by modern AI tools.

- Access to more resources: Running on desktop computers, librmcs can harness the computing power and storage capacity of desktop systems. For instance, when tuning parameters for mechanisms (like gimbals), librmcs facilitates writing test control code to gather information directly into CSV files on the hard drive, easing further analysis using tools like Matlab.

- Better language ecosystem: As a lightweight lower-level control library, librmcs seamlessly integrates with ecosystems of various programming languages. For example, when testing newly fabricated mechanical structures, librmcs can be used to develop test control code, with results transmitted in real-time via Python's requests library to collaboration tools like Feishu for information gathering and sharing.

Compared to the full RoboMaster Control System (RMCS):

- Easier learning curve: RMCS, designed for comprehensive control across all units, entails a larger codebase and introduces complex concepts (components, subcomponents, plugins, dependency analysis, update sequences), posing significant cognitive load for beginners. 

  librmcs, on the other hand, simplifies the learning process by removing these complexities, exposing concise core interfaces to users, offering greater flexibility, and smoothing the learning curve.

- Extremely lightweight and cross-platform: For convenience in development, RMCS heavily depends on tools like ROS2, OpenCV, and Eigen, and uses Docker containers for both development and deployment environments. This restricts RMCS to specific operating systems and languages, mandating development on Linux using C++.

  librmcs addresses these limitations by removing all removable dependencies, making it more suitable than RMCS for rapid development in small-scale projects such as testing and data collection.
crowdsourcehinter-xblock 0.8
crowdsourcehinter XBlock
Keywords: crowdsourcehinter xblock

This is the repository for the Crowdsource Hinter XBlock. The Crowdsource Hinter serves to provide students with hints when they incorrectly answer a problem within a course. The hinter is compatible with numerical input and text input type problems.

This XBlock is still a prototype. 

An example of a student recieving a hint 
![CrowdSourceHinter Hint Screenshot](crowdsourcehinter_hint.png)


An example of after a student corrects their answer
![CrowdSourceHinter Screenshot](crowdsourcehinter_correct.png)

To bring the crowd sourced hinter into a demo course:

Follow https://github.com/openedx/edx-platform/wiki/Installing-a-new-XBlock for basic xblock installation. The name of the module to set in the advanced settings tab is "crowdsourcehinter".

In studio view, edit the hinter so that the "Problem Element" is set to the "data-usage-id" of the problem block (findable by inspecting element of the problem block). If no problem element is set manually, the hinter will default to respond to the first problem block on the page.

![CrowdSourceHinter Installation Screenshot](crowdsourcehinter_setup.png)

The two key features of the crowdsource hinter are the abilities to show students hints and to have the students themselves create hints to be shown to future students. 

When a student incorrectly answers a problem, the hinter will look through its database to search for a hint that has been stored for that exact incorrect answer input (i.e. when the database is large enough, two different incorrect answers would not receive the same hint). If hints exist for a student's incorrect answer, this hint is shown to the student. The student then may have the opportunity to input their answer again, which may prompt another hint to be displayed.

After a student re-submits an answer correctly, they can rate hints for their usefulness or contribute a new hint to be used by other students. Rating hints works by upvoting, downvoting, or reporting hints. The new hint that is contributed by a student is specific to the incorrect answer that they make (currently the first incorrect answer will be prompted for contributing new hints).
perry-cdom-api-community 0.1.2
This is a Python client for the Perry Electric CDOM/CRM4.0 API.
Requires Python: >=3.10

# perry-cdom-api-community
![Version](https://img.shields.io/github/v/release/ivancoppa/perry-cdom-api-community?include_prereleases)
![PyPi](https://img.shields.io/pypi/v/perry-cdom-api-community?label=latest%20pypi)
![Downloads PyPi](https://img.shields.io/pypi/dm/perry-cdom-api-community)

# Perry Electric CDOM/CRM4.0

**UNOFFICIAL** library for communicating with Perry Electric CDOM/CRM4.0 apis.

## Disclaimer :warning:

This project is unofficial and is not affiliated with, endorsed by, or supported by Perry Electric, Use this library and integration at your own risk. I am not responsible for any damages, malfunctions, or issues that may arise from using this software with your thermostat or any other device.

This project is unofficial and not affiliated with, endorsed by, or supported by Perry Electric. It is a personal initiative created to facilitate interaction with Perry Electric thermostats through a Python library and Home Assistant integration.
### Important Notice :warning:

Users assume all responsibility and legal liability for using this software. This library is intended to provide convenient access to thermostat controls for developers and hobbyists. It is not an official Perry Electric package, and excessive or commercial usage may lead to restrictions on your device or account.

Please note that using this software may involve risks, including possible malfunctions or compatibility issues with future updates by Perry Electric. Use at your own risk.

# Installation
Use poetry install --extras cli to install dependencies for CLI and the library itself.

# Listing devices
To get the thermostat, use the list command:

poetry run python3 src/cli.py list -s [cdom_serial_number] -p [pin]
minkassess 0.1.0
Add your description here
Requires Python: >=3.8

# Statistical Knowledge Assessment for Large Language Models
A minimal implementation of KaRR knowledge assessment method from the following paper:

> [**Statistical Knowledge Assessment for Large Language Models**](https://arxiv.org/abs/2305.10519),            
> Qingxiu Dong, Jingjing Xu, Lingpeng Kong, Zhifang Sui, Lei Li   
> *arXiv preprint ([arxiv_version](https://arxiv.org/abs/2305.10519))*   

This is a fork of the [official implementation](https://github.com/dqxiu/KAssess) released by the authors.

## How to use?

First setup the conda environment using the following command

```bash
conda env create -f environment.yml
conda init bash
conda activate KAssess
```

Here is a simple example of **how to quantify the knowledge of a fact by an LLM using KaRR**
```python
from karr import KaRR
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = 'gpt2'
device = 'cuda'
model = AutoModelForCausalLM.from_pretrained(model_name, device_map = device)
tokenizer = AutoTokenizer.from_pretrained(model_name)

karr = KaRR(model, tokenizer, device)

# Testing the fact: (France, capital, Paris)
# You can find other facts by looking into Wikidata
fact = ('Q142', 'P36', 'Q90')

karr, does_know = karr.compute(fact)
print('Fact %s' % str(fact))
print('KaRR = %s' % karr)
ans = 'Yes' if does_know else 'No'
print('According to KaRR, does the model knows this fact? Answer: %s' % ans)
# Output:
# KaRR = 3.338972442145268
# According to KaRR, does the model knows this fact? Answer: No
```

## Difference with original repo

- Easy-to-use
- Clean code
- Minimalistic implementation: I kept only the portion of the code needed to compute KaRR and removed the rest
- This implementation can compute KaRR on a single fact (the original implementation went through all facts)

## Citation
Cite the original authors using:
```
@misc{dong2023statistical,
      title={Statistical Knowledge Assessment for Large Language Models}, 
      author={Qingxiu Dong and Jingjing Xu and Lingpeng Kong and Zhifang Sui and Lei Li},
      year={2023},
      journal = {Proceedings of NeurIPS},
}
```
mldsa 2024.0
Module-Lattice-Based Digital Signature Algorithm (ML-DSA)
Requires Python: >=3.9

# `hkdfref` - HMAC-based key derivation function
Key derivation functions (KDFs) take as input certain *initial keying material* and return certain *cryptographically strong secret keys*. Cryptographic systems require KDFs. This tool provides a reference implementation of the HMAC-based KDF described in [RFC 5869](https://datatracker.ietf.org/doc/html/rfc5869) (HKDF).

<hr>

## Details
The HKDF is modular, consisting of
 
 - *extract* (the function `hkdfref.extract`)
 - and *expand* (the function `hkdfref.expand`) parts.
 
In the *extract part*, a fixed-length psuedorandom key is extracted from the *initial keying material*. The extract part aims to increase informational uniformity of the inital keying material. Scenarios where this step is helpful in particular include: when an attacker might have partial knowledge or control of these input materials. Scenarios where this step is less helpful include: the initial keying material is of sufficiently high informational uniformity. The RFC describes the extract part as optional.
 
In the *expand part*, the fixed-length pseudorandom key is exapnded into several additional pseudorandom keys. These *several additional pseudorandom keys* are the output of HKDF. The aim of this part is to ensure the output keys are suitable for a specific cyrptographic algorithm.

The differentiation of extract and expand parts is viewed in this RFC as circumventing possible shortcomings in KDF design. Further, the RFC's stated goal is to "accomodate a wide range of KDF requirements while minimizing the assumptions about the underlying hash function". The two parts can be executed together as described, using `hkdfref.hkdf`.

## Usage
A simple example:
```python
from hkdfref import hkdf


# input keying material
ikm = b"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"

# some salt bytes to pass to extract
salt = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c"

# information padding bytes
info = b"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9"

# desired output key material length
l = 42


# a secure cryptographic key (uses sha512)
okm = hkdf(ikm, salt=salt, info=info, l=l)
```

## Installation
Depends only on the standard library. Sources available on [GitHub](https://github.com/wfatherley/hkdfref.git) and [PyPI](). Use `pip` to install:

```python3 -m pip install hkdfref```

## References
 - Implements [RFC 5869](https://datatracker.ietf.org/doc/html/rfc5869)
 - See also [python-hkdf](https://github.com/casebeer/python-hkdf/tree/master)