semvec/pypi-packages huggingface dataset:
judo 0.0.15
API and data structures for efficient AI research.
License: MIT
Keywords: Machine learning,artificial intelligence

# judo
[![Travis build status](https://travis-ci.com/fragiletech/judo.svg)](https://travis-ci.com/fragiletech/judo)
[![Documentation Status](https://readthedocs.org/projects/fragile/badge/?version=latest)](https://judo.readthedocs.io/en/latest/?badge=latest)
[![Code coverage](https://codecov.io/github/fragiletech/judo/coverage.svg)](https://codecov.io/github/fragiletech/judo)
[![PyPI package](https://badgen.net/pypi/v/judo)](https://pypi.org/project/judo/)
[![Latest docker image](https://badgen.net/docker/pulls/fragiletech/judo)](https://hub.docker.com/r/fragiletech/judo/tags)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![license: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)

Common API for working with tensors in the context of machine learning research
qunetsim 0.1.3.post1
A Quantum Network Simulation Framework
License: MIT
Requires Python: >=3.6
Keywords: quantum,networks,simulator,internet,QuNetSim

[![Unitary Fund](https://img.shields.io/badge/Supported%20By-UNITARY%20FUND-brightgreen.svg?style=for-the-badge)](http://unitary.fund)
# QuNetSim 

![QuNetSim Tests](https://github.com/tqsd/QuNetSim/workflows/QuNetSim%20Tests/badge.svg)

QuNetSim is a quantum-enabled network simulator that adds common quantum networking tasks like teleportation, superdense coding, sharing EPR pairs, etc. With QuNetSim, one can design and test robust quantum network protocols under various network conditions.

## Installation and Documentation

See https://tqsd.github.io/QuNetSim/ for documentation. To install the latest release via pip:
```
pip install qunetsim
```

## Quick Start Guide

### Templater

The QuNetSim pip package comes with a templater. After installing the library, simply type `template` and follow the instructions. A template QuNetSim example will be generated. 

### Quick Example

```
from qunetsim.components import Host, Network

network = Network.get_instance()
network.start()

alice = Host('Alice')
bob = Host('Bob')

alice.add_connection(bob.host_id)
bob.add_connection(alice.host_id)

alice.start()
bob.start()

network.add_hosts([alice, bob])

# Block Alice to wait for qubit arrive from Bob
alice.send_epr(bob.host_id, await_ack=True)
q_alice = alice.get_epr(bob.host_id)
q_bob = bob.get_epr(alice.host_id)

print("EPR is in state: %d, %d" % (q_alice.measure(), q_bob.measure()))
network.stop(True)
```

## Contributing 

Feel free to contribute by adding Github issues and pull requests. Adding test cases for any contributions is a requirement for any pull request to be merged. 

## Citation
```
@article{diadamo2020qunetsim,
  title={QuNetSim: A Software Framework for Quantum Networks},
  author={DiAdamo, Stephen and N{\"o}tzel, Janis and Zanger, Benjamin and Be{\c{s}}e, Mehmet Mert},
  journal={IEEE Transactions on Quantum Engineering},
  year={2021},
  doi={10.1109/TQE.2021.3092395}
}
```
django-vite-react 0.0.3
An easy way to Write React Component with Django.
License: MIT
Requires Python: >=3.8

Django + React
==============

An easy way to use React with Django.

QuickStart
----------

Install
~~~~~~~

.. code:: bash

   pip install django-vite-react

Update Settings.py
~~~~~~~~~~~~~~~~~~

.. code:: python

   INSTALLED_APPS = [
       ...
       'react',
       ...
   ]

Setup Vite
~~~~~~~~~~

Create file package.json

.. code:: json

   {
     "name": "django-react",
     "version": "1.0.0",
     "description": "use react.js in django templates",
     "main": "index.js",
     "scripts": {
       "dev": "vite",
       "build": "vite build",
       "test": "echo \"Error: no test specified\" && exit 1"
     },
     "keywords": [],
     "author": "ChanMo",
     "license": "ISC",
     "devDependencies": {
       "@vitejs/plugin-react": "^3.1.0",
       "vite": "^4.1.1"
     },
     "dependencies": {
       "react": "^18.2.0",
       "react-dom": "^18.2.0"      
     }
   }

Create file vite.config.js

.. code:: javascript

   import { defineConfig } from 'vite'
   import react from '@vitejs/plugin-react'

   // https://vitejs.dev/config/
   export default defineConfig({
     plugins: [react()],
     build: {
       outDir: 'static/dist/',
       manifest: true,
       rollupOptions: {
         input: [
           'components/app.jsx',
         ]
       }
     }
   })

Install npm package

.. code:: bash

   npm install
   npm run dev

Create your jsx file
~~~~~~~~~~~~~~~~~~~~

Example ``components/app.jsx``

.. code:: javascript

   import React from 'react';
   import ReactDom from 'react-dom/client';

   function App(props) {
     return (
       <h1>{props.title}</h1>
     )
   }

   const root = ReactDom.createRoot(document.getElementById("app"));
   root.render(
     <App {...window.props} />
   );

Use ReactMixin in your ClassView
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   from django.views.generic import TemplateView
   from react.mixins import ReactMixin


   class IndexView(ReactMixin, TemplateView):
       app_root = 'components/app.jsx'
       def get_props_data(self):
           return {
               'title': 'Hello'
           }

Visit url in your brower
~~~~~~~~~~~~~~~~~~~~~~~~

http://localhost:8000/

Build js
~~~~~~~~

Before deploy, run ``yarn dev``,

Final Structure
---------------

::

   .
   ├── backend
   │   ├── asgi.py
   │   ├── __init__.py
   │   ├── settings.py
   │   ├── urls.py
   │   └── wsgi.py
   ├── db.sqlite3
   ├── manage.py
   ├── node_modules
   ├── package.json
   ├── todo
   │   ├── admin.py
   │   ├── apps.py
   │   ├── components
   │   │   └── todo.jsx
   │   ├── __init__.py
   │   ├── migrations
   │   │   └── __init__.py
   │   ├── models.py
   │   ├── tests.py
   │   ├── urls.py
   │   └── views.py
   ├── static
   │   └── dist
   │       ├── assets
   │       │   └── todo-1cc3d04a.js
   │       └── manifest.json
   └── vite.config.js  

Todo
----

-  [ ] easier to integrate
-  [ ] decorate function
python-mid 1.0.0
MID module
License: MIT

# python-mid
Efficient ID generation, lexicographically sortable, contains time information.

## Structure

* 4 bytes for the timestamp
* 8 bytes of randomness
* encoded as urlsafe base64
* 16 characters
* Example: `ZEDpWWfGaXNR_0rs`

## Usage

```python
>>> import mid
>>> mid.generate_mid()
'ZEDpWWfGaXNR_0rs'
>>> mid.get_date_time("ZEDpWWfGaXNR_0rs")
datetime.datetime(2017, 12, 28, 20, 22, 24)
>>> mid.get_time("ZEDpWWfGaXNR_0rs")
1514474944
```

## Performance

Bench #1: Generate 1.000.000 IDs

|                | UUID1     | UUID4     | ULID      | ObjectID   | MID        |
|----------------|-----------|-----------|-----------|------------|------------|
| Execution Time | 2.96s     | 3.55s     | 5.88s     | 5.43s      | 0.28s      |
| Executions/s   | 337612.24 | 281647.68 | 170118.74 | 184101.31  | 3556948.61 |

## FAQ

### Are the resulting IDs always lexographically sortable?

Yes, the resulting MIDs generated by the generate_mid function in the C extension code I provided earlier are always lexicographically sortable.

The first four bytes of each MID represent the current time in seconds since the epoch. These bytes are stored in big-endian order, which means that MIDs generated at later times will have a larger numerical value for these first four bytes. Since the base64 encoding used to encode the MIDs preserves the lexicographical order of the input data, this means that MIDs generated at later times will also be lexicographically greater than MIDs generated at earlier times.

The remaining eight bytes of each MID are filled with random data and do not affect the lexicographical order of the MIDs.

Therefore, if you generate multiple MIDs using the generate_mid function and sort them lexicographically, they will be sorted in chronological order based on their creation time.

### What about January 19, 2038?

The generate_mid function stores the current time in seconds since the epoch as a 4-byte integer in big-endian order. This means that the maximum value that can be represented by these 4 bytes is 2^32 - 1, or 4294967295.

Since the epoch is defined as January 1, 1970, this means that the latest time that can be represented by these 4 bytes is 4294967295 seconds after the epoch, or approximately 07:14:07 UTC on February 7, 2106.

After this time, the value of the current time in seconds since the epoch will no longer fit into 4 bytes and will overflow. This will cause the time value stored in the MIDs to wrap around and start counting from zero again.