semvec/pypi-packages huggingface dataset:
redislightning 0.2
A small production ready client library that emulates redis and used gRPC for communication
Keywords: redis,gRPC

---

# RedisLightning 🔥

by Gautam Sharma http://gsharma.dev

RedisLightning 🔥 is a client library that emulates Redis-like features by leveraging gRPC communication. It provides a lightweight and efficient way to interact with a Redis-like server implemented using gRPC, offering developers a fast and seamless experience.

## Features

- Emulates Redis-like functionality
- Utilizes gRPC for communication
- Written in Python for ease of use and integration
- Lightweight and efficient

## Installation

To install the redislightning Python client library, you can use pip:

```bash
pip install redislightning==0.1
```

## Usage

Here's an example demonstrating how to use the redislightning client library:

```python
from __future__ import print_function
import logging
from redislightning import redislightning as rl


def run():
    # Initialize the Client with the server port
    c = rl.Client(50051)
    # Initialize the connection
    c.init_connection()
    
    # Perform some Redis-like operations
    for idx in range(1, 10):
        k = input("Set Key: ")
        v = input("Set Value: ")
        c.set(k, v)
        # Get the cached value back
        cached_val = c.get(k)
        print("Cached value of key {} is {}".format(k, cached_val))

if __name__ == "__main__":
    # Configure logging
    logging.basicConfig()
    # Run the example
    run()
```

## About

The redislightning-server is a library written purely in C++, utilizing gRPC as its communication layer. Despite its small size, this library is powerful and suitable for use in production environments. The aim is to provide developers with the best possible experience while maintaining extreme speed and efficiency.

## Contributing

Contributions to redislightning are welcome! Whether it's reporting bugs, suggesting new features, or contributing code, your input is valuable.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---
.
pymqttusb 1.1.8
Connexion USB <-> MQTT ssl ou wss
Requires Python: >=3.4

#pymqttusb

Permet la connexion d'un microprocesseur branché sur un port usb vers un serveur MQTT.<br />

Un fichier json de configuration "arduino_mqtt_data.json" doit être présent dans le répertoire.<br />
Contenu du fichier "arduino_mqtt_data.json" :<br />

{<br />
  "broker_url":"url_de_votre_broker_mqtt",<br />
  "broker_protocol_mqtt_mqtts_ws_wss":"wss",<br />
  "broker_port":443,<br />
  "salle":"maSalle",<br />
  "KEY":"bureau/lumiere1"<br />
}<br />
<br />
-----------<br />

Le topic de réception sera : salle/KEY/out<br />

Le topic d'envoi sera : salle/KEY/in<br />

Les protocoles possibles sont "wss" websockets sécurisés avec login et mot de passe ( pas de certificat)
ou "tcp" pour ssl avec login et mot de passe ( pas de certificats client) <br />

Lancement du programme :<br />

	En indiquant le nom du port usb (vitesse par défaut 9600 bauds)
	py -m pymqttusb.main com8 <br />

	En modifiant la vitesse de communication par défaut du port série :
	py -m pymqttusb.main com8 57600<br />
<br />
JaxDecompiler 0.0.7
Jax Decompiler
Requires Python: >=3.8

# JaxDecompiler
Jax Decompiler

The JAX decompiler takes jaxpr code and produces Python code. Even if some information about the original function is lost (obfuscated code) like variable names being lost, it is an important tool for reverse-engineering. There are many applications where decompiling gradient functions are useful. 

Associated pr:
https://github.com/google/jax/issues/13398
## Requirements

jax==0.4.0

jaxlib==0.4.0

## Installation

```bash
pip3 install JaxDecompiler
```

## Usage example

Given any jaxpr function, here "df", we want to generate the associated Python code.

```python
import jax

def f(x, smooth_rate):
    local_minimums = (1 - smooth_rate) * jax.numpy.cos(x)
    global_minimum = smooth_rate * x**2
    return global_minimum + local_minimums


df = jax.grad(f, (0,))
```

Function df is implemented with jaxpr code. You can display it with:

```python

from JaxDecompiler import decompiler

decompiler.display_wrapped_jaxpr(df, (1.0, 1.0))
```
returns:
```
===== HEADER =======
invars: [a, b]
outvars: [p]
constvars: []
===== CODE =======
{ lambda ; a:f32[] b:f32[]. let
    c:f32[] = sub 1.0 b
    d:f32[] = cos a
    e:f32[] = sin a
[...]
```

The below code decompiles it automatically. It generates the python function and its python code as text.

```python

from JaxDecompiler import decompiler

decompiled_df, python_code = decompiler.python_jaxpr_python(
    df, (1.0, 1.0), is_python_returned=True
)
```

Let's check df and decompiled_df behave the same:
```python
print("df: ", df(4.0, 0.99)) # ~7.927568
print("decompiled df: ", decompiled_df(4.0, 0.99))  # ~7.927568
```
They produce the same result in spite to be written in different languages!

Now Let's display what is inside decompiled_df:
```python
print(python_code)
```
Display:
```python
def f(a, b):
    c = 1.0 - b
    d = cos(a)
    e = sin(a)
    f = c * d
    g = a ** 2
    h = a ** 1
    i = 2.0 * h
    j = b * g
    _ = j + f
    k = c * 1.0
    l = -k
    m = l * e
    n = b * 1.0
    o = n * i
    p = m + o
    return p
```
Now, the user owns its derivative code and may easily refactor/edit it! This is a reverse-engineering tool, for example, we can now improving arithemtic stability, manually optimize the code, ...

Notice: python_jaxpr_python create out/ folder in the current directory.

## Next steps

There are the next steps:
* **More operators**. Today >70 jaxpr operators are implemented ('add', 'mul', 'cos', ...). The exhaustive list of the implemented operators is in the file "primitive_mapping.py". This python file aims to map jaxpr operator (the name of the functions) into python code (string returned by the function).

* **Automatic refactoring**. There is room for improvement to make the automatically produced Python code easier to read/maintain. 
An automatic refactoring tool should be able to translate this low-level Python style into a more readable one for humans.

* **Automatic detection of useless codes**. In the example above, "j" variable is useless.