semvec/pypi-packages huggingface dataset:
quick-sketches 1.0.0
A Library with Fast Sketching Primitives

# Quick Sketches

While implementing a paper, we had to create a new library for Count-Min Sketches and Count-Sketches, as current solutions were inadequate. C++ libraries are difficult to use, and Python packages tend to be slow. Thus, we wrote a Python package that contains Python bindings to a C++ library to calculate the predictions of the count-min sketch and count sketches. In short, you can take advantage of C++ code to get predictions for the count-min sketch and count sketch while writing just Python!

- [Quick Sketches](#quick-sketches)
  - [Installation](#installation)
  - [Usage](#usage)

## Installation

To install the package, one simply only needs to run

```
pip install quick_sketches
```

## Usage

Consider the following example to get the count-min sketch when there is three of an element, four of another element, and finally five of a last element. There are five levels in the sketch, and each level contains 100 counters.

```
import quick_sketches as m
import numpy as np

a = np.array([3, 4, 5])
m.cm_sketch_preds(5, a, 100, 1) # usually [3, 4, 5], but sometimes not!
```

```
[numpy array of long longs] cm_sketch_preds(int nhashes, [numpy array of long longs] np_input, ll width, int seed)
```

takes as input

1. **nhashes:** The number of hash functions used in the sketch
2. **np_input:** The numpy array containing the frequencies of each key (note that order doesn't matter)
3. **width:** The width of the sketch, or the number of entries in each row of the sketch
4. **seed:** A random seed.

Then, it outputs what a count-min sketch would give as predicted frequencies with that particular set of parameters, where the output prediction at index i corresponds to the key in np_input at index i. For example, if np_input was [3, 4, 5], the output might also be [3, 4, 5], but it could not be [4, 3, 5], by the conservative nature of the sketch.

```
[numpy array of doubles] count_sketch_preds(int nhashes, [numpy array of long longs] np_input, ll width, int seed)
```

performs the same function for the Count-Sketch, with parameters:

1. **nhashes:** The number of hash functions used in the sketch
1. **np_input:** The numpy array containing the frequencies of each key (note that order doesn't matter)
1. **width:** The width of the sketch, or the number of entries in each row of the sketch
1. **seed:** A random seed.

Note one key difference, however: the output is in **doubles**, because the count-sketch takes medians, which sometimes leads to half-integer outputs!
k8s-diagram 0.1.8
Creates a preview diagram of Kubernetes Resources without the need to apply them.
Requires Python: >=3.8.2,<4.0.0

# K8s Diagram Previewer

This project exists to help developers take some of the guesswork
out of deploying Kubernetes definitions by providing a preview of
what will actually be deployed with a set of YAML definitions.

## Installation

Run `pip install k8s-diagram`

You may also need to install [graphviz](https://graphviz.org/download/).

## Running

This script takes one argument, a path to a folder containing K8s 
YAML definitions and outputs a PNG diagram at kubernetes.png 
representing those definitions, as well as a python file at 
create_diagram.py if you would like to extend the diagram with 
other infrastructure surrounding your project. To automatically
open the image upon completion, add the `--show` flag.

`k8s-diagram <path_to_folder>`

To try out the example, run `k8s-diagram ./examples/yaml`

For Helm Charts, simply run with the --helm flag and your chart will be
templated and placed into `/tmp/helm_preview_yaml/chart.yaml` before the script runs.

You can also pass in a context from kubeconfig with the `--cluster-context` flag to pull in all supported resources from
the target context prior to diagram generation. The resources found at the context will be copied into the target folder 
prior to chart generation. 

Run `k8s-diagram --help` to see other available options.

## Docker

You can alternatively run this project by running the docker image and mounting the yaml you want to use to /target. The image will be saved into the folder mounted to /target.

Ex: `docker run -v "$(pwd)/k8s_yaml:/target" jimmymills/k8s-diagram /target`

For Helm: `docker run -v "$(pwd):/target" -v "$(pwd)/example_helm:/helm" diagram /helm --helm`

## Support

This tool currently supports the following Kubernetes resource types:

* Deployment
* Service
* Ingress
* Pod
* CronJob
* Job
* DaemonSet
* StatefulSet
* ConfigMap
* Secret
* PersistentVolumeClaim

There is partial support for all node types listed at https://diagrams.mingrammer.com/docs/nodes/k8s but links will not be formed.