semvec/pypi-packages huggingface dataset:
sponge-pyplugin 0.1.8
This is the python plugin of SPONGE

# SPONGE_PYPLUGIN
SPONGE的python接口

该插件将SPONGE视为一个python解释器，运行python脚本

# 依赖

该插件依赖于cupy。请自行安装好适配你CUDA版本的cupy。

## 为什么需要cupy？

SPONGE的GPU代码需要适配GPU的python端的库，许多库都能满足，如`cupy`、`jax`、`torch`以及`mindspore`。而`cupy`是上述里唯一一个支持“野”指针的库，也即`cupy.cuda.UnownedMemory`，使得它能直接调用SPONGE的内存地址作为自变量，而不需要显式地同步。另外`cupy`作为一个中介，它的数组也可以比较方便地转化为其他库的数组。

# 安装

安装方法：

## 1. pip 安装

使用命令

```
pip install sponge-pyplugin --root 安装地址的绝对路径
```

其中`--root`后请给出安装地址的绝对路径，使用绝对路径的原因是，`pip`会在临时文件夹中进行安装任务，如果你使用相对路径那么就会安装到临时文件夹的相对路径中，然后你就找不到它了。

## 2. 源码安装

前往gitee库下载解压或克隆源码

```
git clone https://gitee.com/gao_hyp_xyj_admin/sponge_pyplugin.git
```

打开下载并解压或克隆后的文件夹，在有`setup.py`的文件夹内呼出合适的shell终端，如windows下的powershell或linux下的shell

```
python setup.py install --root 安装地址的绝对路径
```

此处`--root`仍然需要给出安装路径的绝对路径，主要是为了与pip安装方式对齐。

# 使用

## SPONGE命令

目前本插件适用的版本为：1.4a3，也即SPONGE的1.4版本第3内部测试版。

在SPONGE的mdin.txt文件夹中加入：
```
plugin =  D:\SPONGE_pyplugin\sponge_pyplugin.so #你安装的本插件地址
py = D:\SPONGE_pyplugin\example.py #你需要使用的python脚本地址
```
此处的`D:\SPONGE_pyplugin`仅为示例，请修改为你对应的地址。

## SPONGE获取python信息

SPONGE读取python信息使用的方式是读取函数名。
首先，SPONGE会直接逐行运行一遍该python脚本，由此可进行初始化。
然后，SPONGE会读取python脚本里的`After_Initial()`、`Calculate_Force()`和`Mdout_Print()`，分别在其他模块初始完毕、力计算和打印信息的时候调用。例如下面是一个简单的`Example.py`
```python
def Mdout_Print():
    print("Hellow SPONGE World!")
```

## python获取SPONGE信息

python由模块`Sponge`获取SPONGE信息。模块`Sponge`是SPONGE作为解释器时的内置模块，在外部用python调用是没有的。

`Sponge`模块内包含四个子模块`controller`（程序控制）、`cv_controller`（CV定义）、`md_info`（MD信息）、`mol_map`（分子周期性映射）。这4个子模块的定义与C++版本的定义相同。可以使用`help()`寻求帮助。
```
import Sponge
help(Sponge.controller)
help(Sponge.cv_controller)
help(Sponge.md_info)
help(Sponge.mol_map)
```

# 简单例子

以下是一个简单的steer MD的例子，对第一个原子的y方向加上一个力。
```python
import Sponge
my_force_factor = 1
if Sponge.controller.Command_Exist("my_force_factor"):
    my_force_factor = float(Sponge.controller.Command("my_force_factor"))
Sponge.controller.Step_Print_Initial("My_Force_Potential", "%2f")

def Calculate_Force():
    Sponge.md_info.frc[0][1] += my_force_factor

def Mdout_Print():
    Sponge.controller.Step_Print("My_Force_Potential", -my_force_factor * Sponge.md_info.crd[0][1])
```
dxz 0.0.6
An exact cover solver that returns all solutions for a given problem
Requires Python: >=3.7

# DXZ

dxz is a Python package that implements the dxz algorithm that is described in the paper [Dancing with Decision Diagrams: A Combined Approach to Exact Cover](https://ojs.aaai.org/index.php/AAAI/article/view/10662). The algorithms returns all solutions to a given exact cover problem.

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install dxz.

```bash
pip install dxz
```

## The Algorithm

dxz is an algorithm for solving an exact cover problem. It build a [zdd](https://en.wikipedia.org/wiki/Zero-suppressed_decision_diagram) that represents all solutions for a given problem. This module converts the zdd to to a list of lists of ints. Each list in the list represents one solution.

For more details about dxz read the paper [Dancing with Decision Diagrams: A Combined Approach to Exact Cover](https://ojs.aaai.org/index.php/AAAI/article/view/10662).

## Usage

```python
import dxz

rows = 8
columns = 5

# A flatten matrix of boolean values. Row 0 is 1,0,0,1,1 row 2 is 0,1,1,0,0 and so on.
matrix = [
    1,0,0,1,1, # 0
    0,1,1,0,0, # 1
    0,0,0,1,1, # 2
    0,1,0,1,0, # 3
    1,0,1,0,0, # 4
    0,0,0,0,1, # 5
    0,0,0,1,0, # 6
    1,0,0,0,0, # 7
]

# Get all solutions to the exact cover problem.
solutions = dxz.dxz_solve(rows, columns, matrix, 0)

print(solutions)
# [
#   [1,0],
#   [1,7,2],
#   [1,7,6,5],
#   [3,4,5]
# ]
# One solutions is row 1 and 2 another solution is row 1, 7 and 2.

# Get only the number of solutions
number_of_solutions = dxz.dxz_count(rows, columns, matrix)


# Get only 3 solutions.
solutions = dxz.dxz_solve(rows, columns, matrix, 3)

```

## Contributing

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

## License

[MIT](https://choosealicense.com/licenses/mit/)
locked-dict 2023.10.22
Implementation of dict supporting context managed thread safe and mutable iterations through a lock.
Requires Python: >=3.9
Keywords: developer-tools,validation,verification

# Locked-dict

Implementation of dict supporting context managed thread safe and mutable iterations through a lock.

[License: MIT](https://github.com/sthagen/locked-dict/blob/default/LICENSE) | 
[Country of origin: Switzerland](https://git.sr.ht/~sthagen/locked-dict/tree/default/item/COUNTRY-OF-ORIGIN) | 
[Export control classification number(ECCN): EAR99](https://git.sr.ht/~sthagen/locked-dict/tree/default/item/EXPORT-CONTROL-CLASSIFICATION-NUMBER)

Third party dependencies are documented in the folder [third-party](docs/third-party/README.md).

[![version](https://img.shields.io/pypi/v/locked-dict.svg?style=flat)](https://pypi.python.org/pypi/locked-dict/)
[![downloads](https://static.pepy.tech/badge/locked-dict/month)](https://pepy.tech/project/locked-dict)
[![wheel](https://img.shields.io/pypi/wheel/locked-dict.svg?style=flat)](https://pypi.python.org/pypi/locked-dict/)
[![supported-versions](https://img.shields.io/pypi/pyversions/locked-dict.svg?style=flat)](https://pypi.python.org/pypi/locked-dict/)
[![supported-implementations](https://img.shields.io/pypi/implementation/locked-dict.svg?style=flat)](https://pypi.python.org/pypi/locked-dict/)
[![maintenance-status](https://img.shields.io/github/commit-activity/y/sthagen/locked-dict.svg?style=flat)](https://git.sr.ht/~sthagen/locked-dict/log)

## Documentation

User and developer [documentation of locked-dict](https://codes.dilettant.life/docs/locked-dict).

## Bug Tracker

Any feature requests or bug reports shall go to the [todos of locked-dict](https://todo.sr.ht/~sthagen/locked-dict).

## Primary Source repository

The main source of `locked-dict` is on a mountain in central Switzerland.
We use distributed version control (git).
There is no central hub.
Every clone can become a new source for the benefit of all.
The preferred public clones of `locked-dict` are:

* [on codeberg](https://codeberg.org/sthagen/locked-dict) - a democratic community-driven, non-profit software development platform operated by Codeberg e.V.
* [at sourcehut](https://git.sr.ht/~sthagen/locked-dict) - a collection of tools useful for software development.

## Contributions

Please do not submit "pull requests" (I found no way to disable that "feature" on GitHub).
If you like to share small changes under the repositories license please kindly do so by sending a patchset.
You can either send such a patchset per email using [git send-email](https://git-send-email.io) or 
if you are a sourcehut user by selecting "Prepare a patchset" on the summary page of your fork at [sourcehut](https://git.sr.ht/).

# Status

Production/stable.

**Note** The default branch is `default`.
concealed 2.0.0
python util module to provide encryption and decryption using steganography using the least significant bits of the RGB values of an image on top of advanced encryption standard.

# concealed

## about

python util module to provide encryption and decryption using steganography using the least significant bits of the RGB values of an image on top of advanced encryption standard. [reference for advanced encryption standard](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard).

## installation

> pip install concealed

## usage

[reference python file](./example.py)

## Supported formats

### input

- png
- jpeg
- webp

> note: apng or other animated image inputs will have unintended transformations in the encoded image.

### output

- png

> note: output image will be in rgb / rgba color modes only.

## configs

1. concealed\data\config.ini

## env

- python>=3.9.6

## changelog

### v2.0.0

- initial implementation as a python module.
- removed fastapi.
- validated webp support in input images.

### v1.0.0

- initial implementation using fastapi server.

## Feedback is appreciated. Thank you!