semvec/pypi-packages huggingface dataset:
csharpyml 0.1.43
Tools to use C# + Python mostly from Python.
License: MIT
Keywords: csharpyml


.. _l-README:

README
======

.. image:: https://travis-ci.org/sdpython/csharpyml.svg?branch=master
    :target: https://travis-ci.org/sdpython/csharpyml
    :alt: Build status

.. image:: https://ci.appveyor.com/api/projects/status/ldrgt6sxeyfwtoo2?svg=true
    :target: https://ci.appveyor.com/project/sdpython/csharpyml
    :alt: Build Status Windows

.. image:: https://circleci.com/gh/sdpython/csharpyml/tree/master.svg?style=svg
    :target: https://circleci.com/gh/sdpython/csharpyml/tree/master

.. image:: https://badge.fury.io/py/csharpyml.svg
    :target: http://badge.fury.io/py/csharpyml

.. image:: http://img.shields.io/github/issues/sdpython/csharpyml.png
    :alt: GitHub Issues
    :target: https://github.com/sdpython/csharpyml/issues

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
    :alt: MIT License
    :target: http://opensource.org/licenses/MIT

.. image:: https://coveralls.io/repos/sdpython/csharpyml/badge.svg?branch=master&service=github
    :target: https://coveralls.io/github/sdpython/csharpyml?branch=master

.. image:: https://requires.io/github/sdpython/csharpyml/requirements.svg?branch=master
     :target: https://requires.io/github/sdpython/csharpyml/requirements/?branch=master
     :alt: Requirements Status

.. image:: https://codecov.io/github/sdpython/csharpyml/coverage.svg?branch=master
    :target: https://codecov.io/github/sdpython/csharpyml?branch=master

.. image:: http://www.xavierdupre.fr/app/csharpyml/helpsphinx/_images/nbcov.png
    :target: http://www.xavierdupre.fr/app/csharpyml/helpsphinx/all_notebooks_coverage.html
    :alt: Notebook Coverage

**Links:**

* `GitHub/csharpyml <https://github.com/sdpython/csharpyml/>`_
* `documentation <http://www.xavierdupre.fr/app/csharpyml/helpsphinx2/index.html>`_
* `Blog <http://www.xavierdupre.fr/app/csharpyml/helpsphinx/blog/main_0000.html#ap-main-0>`_

Introduction
------------

Helpers to play with *C#*, *Python* and *ML.net*.
The module also relies on
`pythonnet <https://github.com/pythonnet/pythonnet>`_ and
`csharpy <http://www.xavierdupre.fr/app/csharpy/helpsphinx/index.html>`_.

Installation
------------

*Windows*

::

    pip install csharpyml

*Linux*

Follow the instructions described in
`config.yml <https://github.com/sdpython/csharpyml/blob/master/.circleci/config.yml>`_.
prehashed 1.0.1
Prehashing keys for memory saving.
License: MIT
Requires Python: >=3.6

# Prehashed

[<img src="https://travis-ci.com/blester125/prehashed.svg?branch=master" alt="Build Status">](https://travis-ci.com/blester125/prehashed)

A python dictionary that hashes keys before they are inserted to the dict. This yields substantial memory savings when the keys of a dictionary are quite large (for example long stings).

The point of this is that we can store keys that are really large (long strings) cheaply. For example when storing the documents in the tokenized Dailymail dataset the keys take up 1.018 GB while this implementation takes 10.53 MB. A small space saving (7.79 MB vs 10.53 MB) can be found using the built in `hash` function but the results of this are not shareable across runs because python changes the seed across runs.

### Collisions

Obviously we want to know __What is the probability that I will have a hash collision?__. We can figure this out by asking the reverse. What is the probability that all of keys are unique? Once we have this we can answer the original question by subtracting this from 1.

Given N possible hash values (`2 ** 160` for sha1) we know the first hash will be unique, Then for the second one we know there are `N - 1` hashes we could use and still be unique, this means our probability is `N - 1 / N`. This continues for `N - 2, 3` etc. So if we are hashing `k` keys we can find the probability of them all being unique with `PI i=1 -> k-1 (N - i) / N`. This can be approximated with `e^((-k * (k - 1)) / (2 * N))`. This can be further approximated with (k * (k - 1) / (2 * N)) for small k because `1 - e^x ~= x` and when N is 2 ** 160 most k is small.

Graph

To sum this up here is a table with some of the probabilities of your keys colliding.

| k | Odds |
| - | ---- |
|`1.71x10^15` | `1 in 10 ^ 18` |
|`1.71x10^19` | `1 in 10 billion` |
|`1.71x10^21` | `1 in a million` |
|`1.71x10^23` | `1 in 100` |
|`1.42x10^24` | `1 in 2` |

So unless you plan use put `171,000,000,000,000,000,000,000` keys into this dict or people will die if your code has bugs I wouldn't worry about collisions.

There is a small chance that keys will collide. When this happens this dictionary cannot detect that and as a result these keys will overwrite each other. This is so rare that git doesn't have a mitigation strategy either.

While a collisions are super rare if you are worried about it I would suggest that all of your values are the same type so that you aren't expecting a string and get an int in the super unlikely case if a collision.

If you are still scared about collisions there is also a function `initial_add(k, v)` that will modify your key until it doesn't have a collision, adds it to the dictionary, and returns the new key to use. You need to keep this key to get the value later so this kind of breaks the point of this dict where you want to be able to throw away your keys.
docker-nuke 0.2.2
Remove all Docker containers, images, and volumes
License: MIT
Keywords: docker docker-utils

Docker Nuke
===========

|PyPIVersion| |TravisCI| |CoverageStatus| |CodeHealth| |PythonVersions|

.. |TravisCI| image:: https://travis-ci.org/levi-rs/docker-nuke.svg?branch=master
    :target: https://travis-ci.org/levi-rs/docker-nuke
.. |CoverageStatus| image:: https://coveralls.io/repos/github/levi-rs/docker-nuke/badge.svg
   :target: https://coveralls.io/github/levi-rs/docker-nuke
.. |CodeHealth| image:: https://landscape.io/github/levi-rs/docker-nuke/master/landscape.svg?style=flat
   :target: https://landscape.io/github/levi-rs/docker-nuke/master
.. |PyPIVersion| image:: https://badge.fury.io/py/docker-nuke.svg
    :target: https://badge.fury.io/py/docker-nuke
.. |PythonVersions| image:: https://img.shields.io/pypi/pyversions/docker-nuke.svg
    :target: https://wiki.python.org/moin/Python2orPython3

docker-nuke, for when you want to blow away every docker object in sight


Installation
------------
docker-nuke is availiable on PyPI and can be pip installed

.. code-block:: bash

    $ pip install docker-nuke

Running
-------

.. code-block:: bash

    $ docker-nuke
    Stopping container 50bd26e339: Succeeded
    Removing container 50bd26e339: Succeeded
    Removing container 913061d931: Succeeded
    Removing image     59507b30b4: Failed (retry with "--force")
    Removing image     3fd9065eaf: Failed (retry with "--force")
    Removing volume    140bb8e5cc: Succeeded


Use the ``--force`` option to force remove docker objects:

.. code-block:: bash

    $ docker-nuke --force
    Removing image     59507b30b4: Succeeded
    Removing image     3fd9065eaf: Succeeded