[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/toolkitr/tkr/blob/main/LICENSE)
[![Python Versions](https://img.shields.io/badge/python-%203.7+%20-blue)](https://www.python.org/downloads/)

## 🌸 [pollinations.ai](https://pollinations.ai/)
Pollinations are an effort to make generative art more approachable.
- A frontend hosting a set of [curated notebooks](https://github.com/pollinations/hive) that allow creating and experimenting with generative art.
- The Interplanetary Filesystem (IPFS) for decentralized censorship-resistant storage of models, code and generated content
- Pollinations are run on Google Colab at the moment (for the free cloud GPUs)

[Instructions](docs/instructions.md) on using Pollinations.AI.

🐍 Python Package

```python
# Usage Example

import pollinations as ai

model: object = ai.Model()

image: object = model.generate(
    prompt=f'Golden retriever puppy playing in the rain {ai.realistic}',
    model=ai.turbo,
    height=512,
    seed=57184
)
image.save('image-output.jpg')

print(image.url)
```
```javascript
// >>> https://image.pollinations.ai/prompt/Golden%20retriever%20puppy%20playing%20in%20the%20rain%20realistic,%20realism,%20real%20life,%20ultra%20realistic,%20high%20quality,%20real?model=turbo&width=1024&height=512&seed=57184
```
![image](https://github.com/flowa-ai/pollinations-patch/assets/152752280/448342b5-013f-4df9-a5a5-6d5f1f196cac)

## �👩💻 Development (outdated)

  Development of Pollinations.AI Web App

    `make dev` to start the development server of web app.%

    Enable logging:
    `localStorage.debug = "*"`

    If logs don't appear in Chrome enable logging "All Aevels" (including Verbose)

    ## Optionally it is possible to develop with a local IPFS node

    Enable connect to local IPFS:
    `localStorage.localIFS = true

    `make up` to start the releant services. See next section for details

  Development of Notebooks

   All notebooks at [pollinations/hive](https://github.com/pollinations/hive) are automatically deployed to Pollinations.

   We will add an easy way to include custom notebooks. For now, to use an external notebook it needs to be uploaded to IPFS wrapped in a folder in the form `input/notebook.ipynb`. The resulting IPFS hash can be used directly like so: `https://pollinations.ai/p/[hash]`

  Development with Local IPFS node

    Development environment requires `docker` & `docker-compose` for running a loca IPFS node. For docker installation, please navigate to https://docs.docker.com/get-docker/.

    After docker is setup, `make` is used for managing the IPFS and development environment.

    ## 🟡 Initialization

    To run pollinations development environment first time,

    - Run `make init`, this will initialize start the IPFS docker image and fill `tmp/ipfs` folder by migrating IPFS.

    ## 🟢 Running

    After IPFS migrated, to start development environment,
    - Run `make up`, this will start the dockerized IPFS instance and detach.
    - Run `make dev` to start the react application living under `/app`

    ## 🔴 Stopping

    - Run `make down` to stop running IPFS instance.
    - Run `make clean` to remove the `tmp` folder and its contents.

    ## ⚙ Configuration

    IPFS configuration can be found and updated in `docker/ipfs/config.json`. Every time the docker containers are started, the config file under `tmp/ipfs/config` is overwritten with this json file.

  Architecture Diagram

  The following diagram has an editable copy embedded. Use https://draw.io/#Hpollinations/pollinations/master/pollinations_architecture.png to edit the file.

  Export the results as PNG with "Include a copy of my diagram" option selected and replace the current diagram.

  ![Architecture Diagram](pollinations_architecture.png)

## 🔗 Links

- Frontend: https://pollinations.ai/
- Instructions: [docs/instructions.md](docs/instructions.md)
- Discord: https://discord.gg/azGuNpvPu8


Flexible and Extensible Question Answering Platform

SQuARE is a flexible and extensible Question Answering (QA) platform to enable users to easily implement, manage and share their custom QA pipelines (aka Skills in SQuARE).

Two ways are supported to use SQuARE:
1. 🌐 Get access to the existing QA Skills (and even deploy your Skill!) via our [demo page](https://square.ukp-lab.de/);
2. 💾 Or clone and install SQuARE to host services on a local machine.

## Why SQuARE?

Recent advances in NLP and information retrieval have given rise to a diverse set of question answering tasks that are of different formats (e.g., extractive, abstractive), require different model architectures (e.g., generative, discriminative) and setups (e.g., with or without retrieval). Despite having a large number of powerful, specialized QA pipelines (a.k.a., Skills) that consider a single domain, model or setup, there exists no framework where users can easily explore and compare such pipelines and can extend them according to their needs.

To address this issue, we present SQuARE, an extensible online QA platform for researchers which allows users to query and analyze a large collection of modern Skills via a user-friendly web interface and integrated behavioural tests. In addition, QA researchers can develop, manage and share their custom Skills using our microservices that support a wide range of models (Transformers, Adapters, ONNX), datastores and retrieval techniques (e.g., sparse and dense).

Find out more about the project on [UKPs Website](https://www.informatik.tu-darmstadt.de/ukp/research_ukp/ukp_research_projects/ukp_project_square/ukp_project_square_details.en.jsp).

## Get Started
👉 If you want to use the SQuARE public service online, you can refer to [Online Service](#Online-Service) for using the existing skills and refer to
[Add New Skills](#Add-New-Skills) for adding new skills.

👉 If you want to deploy SQuARE locally yourself, please refer to [Local Installation](#Local-Installation).

👉 For illustration of the architecture, please refer to [Architecture](#Architecture).

👉 And welcome to [contact us](#Contact).

## Online Service
Try out the on-the-go skills on the [demo page](https://square.ukp-lab.de/)! The existing skills include span-extraction, abstractive, multi-choice QA with contexts or without contexts (open QA based on retrieval).

    Screenshot

## Add New Skills
To add new skills, please see the [skills](https://github.com/UKP-SQuARE/square-core/tree/master/skills#add-new-skills) section.

## Local Installation
>*One can also refer to this [minimal version](README.min.md) for a simpler local setup.*
### Requirements
To run UKP-SQuARE locally, you need the following software:
* [docker](https://docs.docker.com/get-docker/)
* [docker-compose](https://docs.docker.com/compose/install/#install-compose)
* [ytt](https://carvel.dev/ytt/)
* [jq](https://stedolan.github.io/jq/download/)

### Install
Next change the `environment` to `local` and `os` to your operating system in the [config.yaml](https://github.com/UKP-SQuARE/square-core/tree/master/config.yaml).
Now, modify your `/etc/hosts` to contain:
```
127.0.0.1   square.ukp-lab.localhost
```
For installation we provide a script that takes care of the entire setup for you. After installing the previous [requirements](#requirements), simply run:
```bash
bash install.sh
```
### Run
Finally, you can run the full system with docker-compose. Before doing so, you might want to reduce the number of models running depending on your resources. To do so, remove the respective services from the docker-compose.
```bash
docker-compose up -d
```
Check with `docker-compose logs -f` if all systems have started successfully. Once they are up and running go to [square.ukp-lab.localhost](https://square.ukp-lab.localhost).
👉 Accept that the browser cannot verify the certificate.
### Add Skills
Add Skills according to the [Add New Skills](https://github.com/UKP-SQuARE/square-core/tree/master/skills/README.md#add-new-skills) section. Note that, for open-domain skills the datastore need to created first.

## Architecture
For a whole (open QA) skill pipeline, it requires 6 steps:
1. First a user selects a Skill and issues a query via the user interface;
2. The selected QA Skill forwards the query to the respective Datastore for document retrieval;
3. The Datastore gets the query embedding from the Models, uses it for semantic document retrieval and returns the top documents to the Skill;
4. The Skill sends the query and retrieved documents to the reader model for answer extraction;
5. Finally, the answers are shown to the user;
6. Optionally, the user can view the results of the predefined behavioural tests for the Skill.

## Contact

The current main contributors of this repository are:
- [Tim Baumgärtner](https://github.com/timbmg), [Kexin Wang](https://github.com/kwang2049), [Rachneet Singh Sachdeva](https://github.com/Rachneet), [Haritz Puerto](https://github.com/HaritzPuerto), [Hao Zhang](https://github.com/HaoZ-Work), [Sewin Tariverdian](https://github.com/SevenDaysDA)

Contact person: [Haritz Puerto](mailto:puerto@ukp.informatik.tu-darmstadt.de) (UI and general questions), [Tim Baumgärtner](mailto:baumgaertner@ukp.informatik.tu-darmstadt.de) (Skills), [Kexin Wang](mailto:kexin.wang.2049@gmail.com) (Datastores), [Rachneet Singh Sachdeva](mailto:sachdeva@ukp.informatik.tu-darmstadt.de) (Models),

Previous contributors:
- [Max Eichler](https://github.com/maexe), [Gregor Geigle](https://github.com/gregor-ge), [Clifton Poth](https://github.com/calpt), [Hannah Sterz](https://github.com/hSterz)

[https://www.ukp.tu-darmstadt.de/](https://www.ukp.tu-darmstadt.de/)

Don't hesitate to send us an e-mail or report an issue, if something is broken (and it shouldn't be) or if you have further questions.

## Citation
If you find our work useful, please consider citing our ACL and AACL papers.

[SQuARE v1@ACL 2022 Demo Track](https://aclanthology.org/2022.acl-demo.2/).
```bibtex
@inproceedings{baumgartner-etal-2022-ukp,
    title = "{UKP}-{SQ}u{ARE}: An Online Platform for Question Answering Research",
    author = {Baumg{\"a}rtner, Tim  and
      Wang, Kexin  and
      Sachdeva, Rachneet  and
      Geigle, Gregor  and
      Eichler, Max  and
      Poth, Clifton  and
      Sterz, Hannah  and
      Puerto, Haritz  and
      Ribeiro, Leonardo F. R.  and
      Pfeiffer, Jonas  and
      Reimers, Nils  and
      {\c{S}}ahin, G{\"o}zde  and
      Gurevych, Iryna},
    booktitle = "Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics: System Demonstrations",
    month = may,
    year = "2022",
    address = "Dublin, Ireland",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2022.acl-demo.2",
    doi = "10.18653/v1/2022.acl-demo.2",
    pages = "9--22",
}

```
[SQuARE v2@AACL 2022 Demo Track](https://aclanthology.org/2022.aacl-demo.4/).

```bibtex
@inproceedings{sachdeva-etal-2022-ukp,
    title = "{UKP}-{SQ}u{ARE} v2: Explainability and Adversarial Attacks for Trustworthy {QA}",
    author = {Sachdeva, Rachneet  and
      Puerto, Haritz  and
      Baumg{\"a}rtner, Tim  and
      Tariverdian, Sewin  and
      Zhang, Hao  and
      Wang, Kexin  and
      Saadi, Hossain Shaikh  and
      Ribeiro, Leonardo F. R.  and
      Gurevych, Iryna},
    booktitle = "Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing: System Demonstrations",
    month = nov,
    year = "2022",
    address = "Taipei, Taiwan",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2022.aacl-demo.4",
    pages = "28--38",
}

```

[SQuARE v3@ACL 2023 Demo Track](https://aclanthology.org/2023.acl-demo.55/).
```bibtex
@inproceedings{puerto-etal-2023-ukp,
    title = "{UKP}-{SQ}u{ARE} v3: A Platform for Multi-Agent {QA} Research",
    author = {Puerto, Haritz  and
      Baumg{\"a}rtner, Tim  and
      Sachdeva, Rachneet  and
      Fang, Haishuo  and
      Zhang, Hao  and
      Tariverdian, Sewin  and
      Wang, Kexin  and
      Gurevych, Iryna},
    editor = "Bollegala, Danushka  and
      Huang, Ruihong  and
      Ritter, Alan",
    booktitle = "Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)",
    month = jul,
    year = "2023",
    address = "Toronto, Canada",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.acl-demo.55",
    doi = "10.18653/v1/2023.acl-demo.55",
    pages = "569--580",
}

```

If you want to use SQuARE for teaching an NLP course, check our paper:
[UKP-SQuARE: An Interactive Tool for Teaching Question Answering](https://aclanthology.org/2023.bea-1.17/)
```bibtex
@inproceedings{fang-etal-2023-ukp,
    title = "{UKP}-{SQ}u{ARE}: An Interactive Tool for Teaching Question Answering",
    author = "Fang, Haishuo  and
      Puerto, Haritz  and
      Gurevych, Iryna",
    editor = {Kochmar, Ekaterina  and
      Burstein, Jill  and
      Horbach, Andrea  and
      Laarmann-Quante, Ronja  and
      Madnani, Nitin  and
      Tack, Ana{\"\i}s  and
      Yaneva, Victoria  and
      Yuan, Zheng  and
      Zesch, Torsten},
    booktitle = "Proceedings of the 18th Workshop on Innovative Use of NLP for Building Educational Applications (BEA 2023)",
    month = jul,
    year = "2023",
    address = "Toronto, Canada",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.bea-1.17",
    doi = "10.18653/v1/2023.bea-1.17",
    pages = "195--204",
}

```
> This repository contains experimental software and is published for the sole purpose of giving additional background details on the respective publication. We are not held responsible for errors, false, or offensive content generated by the deployed models.


[![Build Status](https://dev.azure.com/scverse/anndata/_apis/build/status/scverse.anndata?branchName=main)](https://dev.azure.com/scverse/anndata/_build)
[![Conda](https://img.shields.io/conda/vn/conda-forge/anndata.svg)](https://anaconda.org/conda-forge/anndata)
[![Coverage](https://codecov.io/gh/scverse/anndata/branch/main/graph/badge.svg?token=IN1mJN1Wi8)](https://codecov.io/gh/scverse/anndata)
[![Docs](https://readthedocs.com/projects/icb-anndata/badge/?version=latest)](https://anndata.readthedocs.io)
[![PyPI](https://img.shields.io/pypi/v/anndata.svg)](https://pypi.org/project/anndata)
[![Downloads](https://static.pepy.tech/badge/anndata/month)](https://pepy.tech/project/anndata)
[![Downloads](https://static.pepy.tech/badge/anndata)](https://pepy.tech/project/anndata)
[![Stars](https://img.shields.io/github/stars/scverse/anndata?logo=GitHub&color=yellow)](https://github.com/scverse/anndata/stargazers)
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](http://numfocus.org)

# anndata - Annotated data

anndata is a Python package for handling annotated data matrices in memory and on disk, positioned between pandas and xarray. anndata offers a broad range of computationally efficient features including, among others, sparse data support, lazy operations, and a PyTorch interface.

- Discuss development on [GitHub](https://github.com/scverse/anndata).
- Read the [documentation](https://anndata.readthedocs.io).
- Ask questions on the [scverse Discourse](https://discourse.scverse.org).
- Install via `pip install anndata` or `conda install anndata -c conda-forge`.
- See [Scanpy's documentation](https://scanpy.readthedocs.io/) for usage related to single cell data. anndata was initially built for Scanpy.

[//]: # (numfocus-fiscal-sponsor-attribution)

anndata is part of the scverse project ([website](https://scverse.org), [governance](https://scverse.org/about/roles)) and is fiscally sponsored by [NumFOCUS](https://numfocus.org/).
Please consider making a tax-deductible [donation](https://numfocus.org/donate-to-scverse) to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.

## Citation

If you use `anndata` in your work, please cite the `anndata` pre-print as follows:

> **anndata: Annotated data**
>
> Isaac Virshup, Sergei Rybakov, Fabian J. Theis, Philipp Angerer, F. Alexander Wolf
>
> _bioRxiv_ 2021 Dec 19. doi: [10.1101/2021.12.16.473007](https://doi.org/10.1101/2021.12.16.473007).

You can cite the scverse publication as follows:

> **The scverse project provides a computational ecosystem for single-cell omics data analysis**
>
> Isaac Virshup, Danila Bredikhin, Lukas Heumos, Giovanni Palla, Gregor Sturm, Adam Gayoso, Ilia Kats, Mikaela Koutrouli, Scverse Community, Bonnie Berger, Dana Pe’er, Aviv Regev, Sarah A. Teichmann, Francesca Finotello, F. Alexander Wolf, Nir Yosef, Oliver Stegle & Fabian J. Theis
>
> _Nat Biotechnol._ 2023 Apr 10. doi: [10.1038/s41587-023-01733-8](https://doi.org/10.1038/s41587-023-01733-8).


[![Stars](https://img.shields.io/github/stars/scverse/scanpy?style=flat&logo=GitHub&color=yellow)](https://github.com/scverse/scanpy/stargazers)
[![PyPI](https://img.shields.io/pypi/v/scanpy?logo=PyPI)](https://pypi.org/project/scanpy)
[![Downloads](https://static.pepy.tech/badge/scanpy)](https://pepy.tech/project/scanpy)
[![Conda](https://img.shields.io/conda/dn/conda-forge/scanpy?logo=Anaconda)](https://anaconda.org/conda-forge/scanpy)
[![Docs](https://readthedocs.com/projects/icb-scanpy/badge/?version=latest)](https://scanpy.readthedocs.io)
[![Build Status](https://dev.azure.com/scverse/scanpy/_apis/build/status/scverse.scanpy?branchName=main)](https://dev.azure.com/scverse/scanpy/_build)
[![Discourse topics](https://img.shields.io/discourse/posts?color=yellow&logo=discourse&server=https%3A%2F%2Fdiscourse.scverse.org)](https://discourse.scverse.org/)
[![Chat](https://img.shields.io/badge/zulip-join_chat-%2367b08f.svg)](https://scverse.zulipchat.com)
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org/)

# Scanpy – Single-Cell Analysis in Python

Scanpy is a scalable toolkit for analyzing single-cell gene expression data
built jointly with [anndata][].  It includes
preprocessing, visualization, clustering, trajectory inference and differential
expression testing.  The Python-based implementation efficiently deals with
datasets of more than one million cells.

Discuss usage on the scverse [Discourse][]. Read the [documentation][].
If you'd like to contribute by opening an issue or creating a pull request, please take a look at our [contribution guide][].

[anndata]: https://anndata.readthedocs.io
[discourse]: https://discourse.scverse.org/
[documentation]: https://scanpy.readthedocs.io

[//]: # (numfocus-fiscal-sponsor-attribution)

scanpy is part of the scverse project ([website](https://scverse.org), [governance](https://scverse.org/about/roles)) and is fiscally sponsored by [NumFOCUS](https://numfocus.org/).
If you like scverse and want to support our mission, please consider making a [donation](https://numfocus.org/donate-to-scverse) to support our efforts.

## Citation

If you use `scanpy` in your work, please cite the `scanpy` publication as follows:

> **SCANPY: large-scale single-cell gene expression data analysis**
>
> F. Alexander Wolf, Philipp Angerer, Fabian J. Theis
>
> _Genome Biology_ 2018 Feb 06. doi: [10.1186/s13059-017-1382-0](https://doi.org/10.1186/s13059-017-1382-0).

You can cite the scverse publication as follows:

> **The scverse project provides a computational ecosystem for single-cell omics data analysis**
>
> Isaac Virshup, Danila Bredikhin, Lukas Heumos, Giovanni Palla, Gregor Sturm, Adam Gayoso, Ilia Kats, Mikaela Koutrouli, Scverse Community, Bonnie Berger, Dana Pe’er, Aviv Regev, Sarah A. Teichmann, Francesca Finotello, F. Alexander Wolf, Nir Yosef, Oliver Stegle & Fabian J. Theis
>
> _Nat Biotechnol._ 2023 Apr 10. doi: [10.1038/s41587-023-01733-8](https://doi.org/10.1038/s41587-023-01733-8).

[contribution guide]: CONTRIBUTING.md


# Boto3 type annotations generator

[![PyPI - mypy-boto3-builder](https://img.shields.io/pypi/v/mypy-boto3-builder.svg?color=blue&label=mypy-boto3-builder)](https://pypi.org/project/mypy-boto3-builder)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/boto3-stubs.svg?color=blue)](https://pypi.org/project/boto3-stubs)
[![Docs](https://img.shields.io/readthedocs/mypy-boto3-builder.svg?color=blue&label=builder%20docs)](https://youtype.github.io/mypy_boto3_builder/)

[![PyPI - boto3-stubs](https://img.shields.io/pypi/v/boto3-stubs.svg?color=blue&label=boto3-stubs)](https://pypi.org/project/boto3-stubs)
[![PyPI - boto3](https://img.shields.io/pypi/v/boto3.svg?color=blue&label=boto3)](https://pypi.org/project/boto3)
[![Docs](https://img.shields.io/readthedocs/boto3-stubs.svg?color=blue&label=boto3-stubs%20docs)](https://youtype.github.io/boto3_stubs_docs/)
[![PyPI - Downloads](https://static.pepy.tech/badge/boto3-stubs)](https://pepy.tech/project/boto3-stubs)
[![PyPI - Monthly Downloads](https://img.shields.io/pypi/dm/boto3-stubs?color=blue)](https://pypistats.org/packages/boto3-stubs)

[![PyPI - types-aiobotocore](https://img.shields.io/pypi/v/types-aiobotocore.svg?color=blue&label=types-aiobotocore)](https://pypi.org/project/types-aiobotocore)
[![PyPI - aiobotocore](https://img.shields.io/pypi/v/aiobotocore.svg?color=blue&label=aiobotocore)](https://pypi.org/project/aiobotocore)
[![Docs](https://img.shields.io/readthedocs/types-aiobotocore.svg?color=blue&label=types-aiobotocore%20docs)](https://youtype.github.io/types_aiobotocore_docs/)
[![PyPI - Downloads](https://static.pepy.tech/badge/types-aiobotocore)](https://pepy.tech/project/types-aiobotocore)
[![PyPI - Monthly Downloads](https://img.shields.io/pypi/dm/types-aiobotocore?color=blue)](https://pypistats.org/packages/types-aiobotocore)

[![PyPI - types-aioboto3](https://img.shields.io/pypi/v/types-aioboto3.svg?color=blue&label=types-aioboto3)](https://pypi.org/project/types-aioboto3)
[![PyPI - aioboto3](https://img.shields.io/pypi/v/aioboto3.svg?color=blue&label=aioboto3)](https://pypi.org/project/aioboto3)
[![Docs](https://img.shields.io/readthedocs/types-aioboto3.svg?color=blue&label=types-aioboto3%20docs)](https://youtype.github.io/types_aioboto3_docs/)
[![PyPI - Downloads](https://static.pepy.tech/badge/types-aioboto3)](https://pepy.tech/project/types-aioboto3)
[![PyPI - Monthly Downloads](https://img.shields.io/pypi/dm/types-aioboto3?color=blue)](https://pypistats.org/packages/types-aioboto3)

![boto3.typed](https://github.com/youtype/mypy_boto3_builder/raw/main/logo.png)

Type annotations builder for [boto3-stubs](https://pypi.org/project/boto3-stubs/), [types-aiobotocore](https://pypi.org/project/types-aiobotocore/), and [types-aioboto3](https://pypi.org/project/types-aioboto3/) projects. Compatible with
[VSCode](https://code.visualstudio.com/),
[PyCharm](https://www.jetbrains.com/pycharm/),
[Emacs](https://www.gnu.org/software/emacs/),
[Sublime Text](https://www.sublimetext.com/),
[mypy](https://github.com/python/mypy),
[pyright](https://github.com/microsoft/pyright)
and other tools.

See how it helps to find and fix potential bugs:

![boto3-stubs demo](https://raw.githubusercontent.com/youtype/mypy_boto3_builder/main/demo.gif)

Do you want more? Check the [documentation](https://youtype.github.io/boto3_stubs_docs/) and use `boto3` like a pro!

- [Boto3 type annotations generator](#boto3-type-annotations-generator)
  - [Using built libraries](#using-built-libraries)
    - [boto3](#boto3)
    - [aiobotocore](#aiobotocore)
    - [aioboto3](#aioboto3)
  - [How to build type annotations](#how-to-build-type-annotations)
    - [Locally](#locally)
    - [With Docker image](#with-docker-image)
  - [Development](#development)
  - [Versioning](#versioning)
  - [Latest changes](#latest-changes)
  - [Thank you](#thank-you)
    - [Toolset](#toolset)
    - [Contributors](#contributors)

## Using built libraries

### boto3

Check [boto3-stubs](https://pypi.org/project/boto3-stubs/) project for installation
and usage instructions.

If you use VSCode, add [AWS Boto3](https://marketplace.visualstudio.com/items?itemName=Boto3typed.boto3-ide)
extension to your VSCode and run `AWS boto3: Quick Start` command.

If not, just install `boto3-stubs` with `pip`:

```bash
python -m pip install 'boto3-stubs[essential]'

# Lite version does not provide session.client/resource overloads
# it is more RAM-friendly, but requires explicit type annotations
python -m pip install 'boto3-stubs-lite[essential]'

# do not forget to install mypy or pyright
```

That's it! You should already have code completion and type checking in your IDE.

### aiobotocore

Check [types-aiobotocore](https://pypi.org/project/types-aiobotocore/) project for installation
and usage instructions.

Or just install `types-aiobotocore` with `pip`:

```bash
python -m pip install 'types-aiobotocore[essential]'

# Lite version does not provide session.create_client overloads
# it is more RAM-friendly, but requires explicit type annotations
python -m pip install 'types-aiobotocore-lite[essential]'

# do not forget to install mypy or pyright
```

Ready to go! Enjoy code completion and type checking in your `aiobotocore` project.

### aioboto3

Check [types-aioboto3](https://pypi.org/project/types-aioboto3/) project for installation
and usage instructions.

Or just install `types-aioboto3` with `pip`:

```bash
python -m pip install 'types-aioboto3[essential]'

# Lite version does not provide session.client/resource overloads
# it is more RAM-friendly, but requires explicit type annotations
python -m pip install 'types-aioboto3-lite[essential]'

# do not forget to install mypy or pyright
```

Whoa! All `aioboto3` methods and attributes are now type annotated and even code completion works.

## How to build type annotations

### Locally

```bash
# Install preferred version of `boto3`
python -m pip install boto3==1.16.25 botocore==1.19.25

# Install `mypy-boto3-builder`
python -m pip install mypy-boto3-builder

# Build all packages in mypy_boto3_output directory
python -m mypy_boto3_builder mypy_boto3_output

# Or specify required services explicitly
python -m mypy_boto3_builder mypy_boto3_output -s ec2 s3

# Install custom `boto3-stubs` packages
cd mypy_boto3_output
python -m pip install -e ./mypy_boto3_ec2_package
python -m pip install -e ./mypy_boto3_s3_package
python -m pip install -e ./boto3_stubs_package
```

### With Docker image

- Install [Docker](https://docs.docker.com/install/)
- Pull latest `mypy_boto3_builder` version and tag it

```bash
docker pull docker.pkg.github.com/youtype/mypy_boto3_builder/mypy_boto3_builder_stable:latest
docker tag docker.pkg.github.com/youtype/mypy_boto3_builder/mypy_boto3_builder_stable:latest mypy_boto3_builder
```

- Generate stubs in `output` directory

```bash
mkdir output

# generate stubs for all services
docker run -v `pwd`/output:/output -ti mypy_boto3_builder_stable

# generate stubs for s3 service
docker run -v `pwd`/output:/output -ti mypy_boto3_builder_stable -s s3

# generate stubs for a specific boto3 version
docker run -e BOTO3_VERSION=1.16.25 BOTOCORE_VERSION=1.19.25 -v `pwd`/output:/output -ti mypy_boto3_builder_stable
```

- Install packages from `output` directory as described above

## Development

- Install Python 3.11+, ideally with [pyenv](https://github.com/pyenv/pyenv)
- Install [poetry](https://python-poetry.org/): `pip install poetry`
- Install dependencies: `poetry install`
- Use scripts for repo to check if everything works: `./scripts/build.sh`
- Run manual pre-commit: `./scripts/before_commit.sh`

## Versioning

`mypy_boto3_builder` version is not related to `boto3` version and follows
[PEP 440](https://www.python.org/dev/peps/pep-0440/).

## Latest changes

Full changelog can be found in [Releases](https://github.com/youtype/mypy_boto3_builder/releases).

## Thank you

### Toolset

- [black](https://github.com/psf/black) developers for an awesome formatting tool
- [Timothy Edmund Crosley](https://github.com/timothycrosley) for
  [isort](https://github.com/PyCQA/isort) and how flexible it is
- [mypy](https://github.com/python/mypy) developers for doing all dirty work for us
- [pyright](https://github.com/microsoft/pyright) team for the new era of typed Python
- [ruff](https://github.com/astral-sh/ruff) developers for the fastest swiss knife for Python

### Contributors

- [Allie Fitter](https://github.com/alliefitter), author of original
  [boto3-type-annotations](https://pypi.org/project/boto3-type-annotations/)
- [jbpratt](https://github.com/jbpratt)
- [Chris Hollinworth](https://github.com/chrishollinworth)
- [Yoan Blanc](https://github.com/greut)
- [Kostya Leschenko](https://github.com/kleschenko)
- [pyto86](https://github.com/pyto86pri)
- [Ashton Honnecke](https://github.com/ahonnecke)
- [Mike Carey](https://github.com/mike-carey)
- [Ole-Martin Bratteng](https://github.com/omBratteng)
- [Nikhil Benesch](https://github.com/benesch)
- [Maksym Balatsko](https://github.com/mbalatsko)
- [Jacob](https://github.com/fivepapertigers)
- [Jakob Keller](https://github.com/jakob-keller)
- [Ari Pollak](https://github.com/aripollak)

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->


.. image:: docs/logos/jdaviz.svg
    :width: 400
    :alt: Jdaviz logo
    :align: center

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.5513927.svg
    :target: https://doi.org/10.5281/zenodo.5513927
    :alt: Zenodo DOI

.. image:: https://github.com/spacetelescope/jdaviz/workflows/CI/badge.svg
    :target: https://github.com/spacetelescope/jdaviz/actions
    :alt: GitHub Actions CI Status

.. image:: https://codecov.io/gh/spacetelescope/jdaviz/branch/main/graph/badge.svg
    :target: https://codecov.io/gh/spacetelescope/jdaviz

.. image:: https://readthedocs.org/projects/jdaviz/badge/?version=latest
    :target: https://jdaviz.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

.. image:: https://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
    :target: https://www.astropy.org
    :alt: Powered by Astropy

``jdaviz`` is a package of astronomical data analysis visualization tools based on the Jupyter platform. It is one tool that is a part of STScI's larger `Data Analysis Tools Ecosystem <https://jwst-docs.stsci.edu/jwst-post-pipeline-data-analysis>`_. These GUI-based tools link data
visualization and interactive analysis.  They are designed to work
within a Jupyter notebook cell, as a standalone desktop application,
or as embedded windows within a website -- all with nearly-identical
user interfaces. ``jdaviz`` is under active development, and users who
encounter bugs in existing features are encouraged to open issues in this
repository.

``jdaviz`` provides data viewers and analysis plugins that can be flexibly
combined as desired to create interactive applications that fit your workflow.
Three named preset configurations for common use cases are provided. **Specviz**
is a tool for visualization and quick-look analysis of 1D astronomical spectra.
**Mosviz** is a visualization tool for many astronomical spectra,
typically the output of a multi-object spectrograph (e.g., JWST
NIRSpec), and includes viewers for 1D and 2D spectra as well as
contextual information like on-sky views of the spectrograph slit.
**Cubeviz** provides a view of spectroscopic data cubes (like those to be
produced by JWST MIRI), along with 1D spectra extracted from the cube.
**Imviz** provides visualization and quick-look analysis for 2D astronomical
images.

This tool is designed with instrument modes from the James Webb Space Telescope (JWST) in mind, but
the tool should be flexible enough to read in data from many astronomical telescopes.  The documentation provides a complete `table of all supported modes <https://jdaviz.readthedocs.io/en/latest/#jwst-instrument-modes-in-jdaviz>`_.

Installing
----------

You may want to consider installing ``jdaviz`` in a new virtual or conda environment to avoid
version conflicts with other packages you may have installed, for example:

.. code-block:: bash

   conda create -n jdaviz-env python=3.12
   conda activate jdaviz-env

Installing the released version can be done using pip:

.. code-block:: bash

   pip install jdaviz --upgrade

For details on installing and using Jdaviz, see the
`Jdaviz Installation <https://jdaviz.readthedocs.io/en/latest/installation.html>`_.

Quick Start
-----------

Once installed, ``jdaviz`` can be run either as a standalone web application or in a Jupyter notebook.

As a Web Application
++++++++++++++++++++

``jdaviz`` provides a command-line tool to start the web application. To see the syntax and usage,
from a terminal, type:

.. code-block:: bash

    jdaviz --help
    jdaviz --layout=specviz /path/to/data/spectral_file

For more information on the command line interfaces for each tool, see the
`Jdaviz docs <https://jdaviz.readthedocs.io/en/latest/index.html>`_.

In a Jupyter Notebook
+++++++++++++++++++++

The power of ``jdaviz`` is that it can integrated into your Jupyter notebook workflow:

.. code-block:: python

    from jdaviz import Specviz

    specviz = Specviz()
    specviz.show()

To learn more about the various ``jdaviz`` application configurations and loading data, see the
`Specviz <https://jdaviz.readthedocs.io/en/latest/specviz/import_data.html>`_,
`Cubeviz <https://jdaviz.readthedocs.io/en/latest/cubeviz/import_data.html>`_,
`Mosviz <https://jdaviz.readthedocs.io/en/latest/mosviz/import_data.html>`_,
`Imviz <https://jdaviz.readthedocs.io/en/latest/imviz/import_data.html>`_,
or `Specviz2D <https://jdaviz.readthedocs.io/en/latest/specviz2d/import_data.html>`_ tools.

``jdaviz`` also provides a directory of `sample notebooks <https://jdaviz.readthedocs.io/en/latest/sample_notebooks.html>`_ to test the application, located in the ``notebooks`` sub-directory
of the git repository.  ``CubevizExample.ipynb`` is provided as an example that loads a JWST data cube with the
``Cubeviz`` configuration.  To run the provided example, start the Jupyter kernel with the notebook path:

.. code-block:: bash

    jupyter notebook /path/to/jdaviz/notebooks/CubevizExample.ipynb

Help
----

If you uncover any issues or bugs, you can
`open a GitHub issue <https://github.com/spacetelescope/jdaviz/issues/new/choose>`_
if they are not already reported. For faster responses, however, we encourage you to
submit a `JWST Help Desk Ticket <https://jwsthelp.stsci.edu>`_.

Recordings and instructional notebooks from live Jdaviz tutorials (as part of the JWebbinars series)
can be found at `the JWebbinar website <https://www.stsci.edu/jwst/science-execution/jwebbinars>`_
under the "Materials and Videos" expandable section. Scroll down to the bottom of that section to
find materials from the most recent session (JWebbinar 24, March 2023).

License & Attribution
---------------------

This project is Copyright (c) JDADF Developers and licensed under
the terms of the BSD 3-Clause license. This package is based upon
the `Astropy package template <https://github.com/astropy/package-template>`_
which is licensed under the BSD 3-clause licence. See the
`licenses <https://github.com/spacetelescope/jdaviz/tree/main/licenses>`_
folder for more information.

Cite ``jdaviz`` via our Zenodo record: https://doi.org/10.5281/zenodo.5513927.

Contributing
------------

We love contributions! ``jdaviz`` is open source,
built on open source, and we'd love to have you hang out in our community.

**Imposter syndrome disclaimer**: We want your help. No, really.

There may be a little voice inside your head that is telling you that you're not
ready to be an open source contributor; that your skills aren't nearly good
enough to contribute. What could you possibly offer a project like this one?

We assure you - the little voice in your head is wrong. If you can write code at
all, you can contribute code to open source. Contributing to open source
projects is a fantastic way to advance one's coding skills. Writing perfect code
isn't the measure of a good developer (that would disqualify all of us!); it's
trying to create something, making mistakes, and learning from those
mistakes. That's how we all improve, and we are happy to help others learn.

Being an open source contributor doesn't just mean writing code, either. You can
help out by writing documentation, tests, or even giving feedback about the
project (and yes - that includes giving feedback about the contribution
process). Some of these contributions may be the most valuable to the project as
a whole, because you're coming to the project with fresh eyes, so you can see
the errors and assumptions that seasoned contributors have glossed over.

Note: This disclaimer was originally written by
`Adrienne Lowe <https://github.com/adriennefriend>`_ for a
`PyCon talk <https://www.youtube.com/watch?v=6Uj746j9Heo>`_, and was adapted by
jdaviz based on its use in the README file for the
`MetPy project <https://github.com/Unidata/MetPy>`_.


# Setup Automator for SAP Business Technology Platform

[![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/btp-setup-automator)](https://api.reuse.software/info/github.com/SAP-samples/btp-setup-automator) [![Release Docker Image](https://github.com/SAP-samples/btp-setup-automator/actions/workflows/docker-release-build-and-push.yml/badge.svg)](https://github.com/SAP-samples/btp-setup-automator/actions/workflows/docker-release-build-and-push.yml)[![Dev Docker Image](https://github.com/SAP-samples/btp-setup-automator/actions/workflows/docker-dev-build-and-push.yml/badge.svg)](https://github.com/SAP-samples/btp-setup-automator/actions/workflows/docker-dev-build-and-push.yml)

## ⚠ ARCHIVED - NO MAINTENANCE ⚠

📢 **Please be aware that with tool is no longer maintained and the repository is archived**

As an alternative for the btp-setup-automator we recommend to use the [Terraform Provider for SAP BTP](https://github.com/SAP/terraform-provider-btp) as tool for the setup of infrastructure on the SAP BTP available in the [Hashicorp Terraform registry](https://registry.terraform.io/providers/SAP/btp/latest).

### Description

This repository provides the user with a script to **automate the setup** of an [SAP Business Technology Platform (SAP BTP) account](https://account.hana.ondemand.com/) and to **learn** how this is done with the various command line interfaces and tools that run inside a [Docker](https://www.docker.com/) container. It uses  JSON configuration files to automate this setup of SAP BTP accounts or do other administrative tasks.

This includes:

- Setup of your SAP BTP account
- Entitlement of services
- Subscriptions to applications and creation of service instances with service keys
- Addition of administrator users to global account and sub accounts
- Setup of roles and role collections, assignment of roles collections to users
- Deployment of complete applications
- Unrolling created setup

### Quick Overview

Get a quick overview & demo of the btp-setup-automator through this video:
[![Ask-the-expert video recording](https://img.youtube.com/vi/3pLNXsn-cLM/0.jpg)](https://www.youtube.com/watch?v=3pLNXsn-cLM)

### Documentation

Started as a small helper for basic SAP BTP setups the tool has grown since its start. This documentation should support you in getting started quickly and then dive into the depths of the btp-setup-automator. The documentation has the following outline:

- [Overview](./docs/OVERVIEW.md)
- [Basic setup](./docs/BASIC_SETUP.md) incl. the prerequisites
- [Detailed walk-through](./docs/README.md)
- [Detailed configuration](./docs/SAMPLECONFIG.md)
- [Overview of btpsa parameters](./docs/PARAMETERS_OVERVIEW.md)
- [FAQ](./docs/FAQ.md)

### Code of conduct

Checkout the [CODE_OF_CONDUCT.md file](CODE_OF_CONDUCT.md) for more details on the code of conduct for this open source project.

### License

Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the [LICENSE](LICENSES/Apache-2.0.txt) file.


# coredis

[![docs](https://readthedocs.org/projects/coredis/badge/?version=stable)](https://coredis.readthedocs.org)
[![codecov](https://codecov.io/gh/alisaifee/coredis/branch/master/graph/badge.svg)](https://codecov.io/gh/alisaifee/coredis)
[![Latest Version in PyPI](https://img.shields.io/pypi/v/coredis.svg)](https://pypi.python.org/pypi/coredis/)
[![ci](https://github.com/alisaifee/coredis/workflows/CI/badge.svg?branch=master)](https://github.com/alisaifee/coredis/actions?query=branch%3Amaster+workflow%3ACI)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/coredis.svg)](https://pypi.python.org/pypi/coredis/)

______________________________________________________________________

coredis is an async redis client with support for redis server, cluster & sentinel.

- The client API uses the specifications in the [Redis command documentation](https://redis.io/commands/) to define the API by using the following conventions:

  - Arguments retain naming from redis as much as possible
  - Only optional variadic arguments are mapped to variadic positional or keyword arguments.
    When the variable length arguments are not optional (which is almost always the case) the expected argument
    is an iterable of type [Parameters](https://coredis.readthedocs.io/en/latest/api/typing.html#coredis.typing.Parameters) or `Mapping`.
  - Pure tokens used as flags are mapped to boolean arguments
  - `One of` arguments accepting pure tokens are collapsed and accept a [PureToken](https://coredis.readthedocs.io/en/latest/api/utilities.html#coredis.tokens.PureToken)

- Responses are mapped between RESP and python types as closely as possible.

- For higher level concepts such as Pipelines, LUA Scripts, PubSub & Streams
  abstractions are provided to encapsulate recommended patterns.
  See the [Handbook](https://coredis.readthedocs.io/en/latest/handbook/index.html)
  and the [API Documentation](https://coredis.readthedocs.io/en/latest/api/index.html)
  for more details.

> **Warning**
> The command API does NOT mirror the official python [redis client](https://github.com/redis/redis-py). For details about the high level differences refer to [Divergence from aredis & redis-py](https://coredis.readthedocs.io/en/latest/history.html#divergence-from-aredis-redis-py)

______________________________________________________________________

<!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->

- [Installation](#installation)
- [Feature Summary](#feature-summary)
  - [Deployment topologies](#deployment-topologies)
  - [Application patterns](#application-patterns)
  - [Server side scripting](#server-side-scripting)
  - [Redis Modules](#redis-modules)
  - [Miscellaneous](#miscellaneous)
- [Quick start](#quick-start)
  - [Single Node or Cluster client](#single-node-or-cluster-client)
  - [Sentinel](#sentinel)
- [Compatibility](#compatibility)
  - [Supported python versions](#supported-python-versions)
  - [Redis-like backends](#redis-like-backends)
- [References](#references)

<!-- /TOC -->

## Installation

To install coredis:

```bash
$ pip install coredis
```

## Feature Summary

### Deployment topologies

- [Redis Cluster](https://coredis.readthedocs.org/en/latest/handbook/cluster.html#redis-cluster)
- [Sentinel](https://coredis.readthedocs.org/en/latest/api/clients.html#sentinel)

### Application patterns

- [Connection Pooling](https://coredis.readthedocs.org/en/latest/handbook/connections.html#connection-pools)
- [PubSub](https://coredis.readthedocs.org/en/latest/handbook/pubsub.html)
- [Sharded PubSub](https://coredis.readthedocs.org/en/latest/handbook/pubsub.html#sharded-pub-sub) \[`>= Redis 7.0`\]
- [Stream Consumers](https://coredis.readthedocs.org/en/latest/handbook/streams.html)
- [Pipelining](https://coredis.readthedocs.org/en/latest/handbook/pipelines.html)
- [Client side caching](https://coredis.readthedocs.org/en/latest/handbook/caching.html)

### Server side scripting

- [LUA Scripting](https://coredis.readthedocs.org/en/latest/handbook/scripting.html#lua_scripting)
- [Redis Libraries and functions](https://coredis.readthedocs.org/en/latest/handbook/scripting.html#library-functions) \[`>= Redis 7.0`\]

### Redis Modules

- [RedisJSON](https://coredis.readthedocs.org/en/latest/handbook/modules.html#redisjson)
- [RediSearch](https://coredis.readthedocs.org/en/latest/handbook/modules.html#redisearch)
- [RedisGraph](https://coredis.readthedocs.org/en/latest/handbook/modules.html#redisgraph)
- [RedisBloom](https://coredis.readthedocs.org/en/latest/handbook/modules.html#redisbloom)
- [RedisTimeSeries](https://coredis.readthedocs.org/en/latest/handbook/modules.html#redistimeseries)

### Miscellaneous

- Public API annotated with type annotations
- Optional [Runtime Type Validation](https://coredis.readthedocs.org/en/latest/handbook/typing.html#runtime-type-checking) (via [beartype](https://github.com/beartype/beartype))

## Quick start

### Single Node or Cluster client

```python
import asyncio
from coredis import Redis, RedisCluster

async def example():
    client = Redis(host='127.0.0.1', port=6379, db=0)
    # or with redis cluster
    # client = RedisCluster(startup_nodes=[{"host": "127.0.01", "port": 7001}])
    await client.flushdb()
    await client.set('foo', 1)
    assert await client.exists(['foo']) == 1
    assert await client.incr('foo') == 2
    assert await client.incrby('foo', increment=100) == 102
    assert int(await client.get('foo')) == 102

    assert await client.expire('foo', 1)
    await asyncio.sleep(0.1)
    assert await client.ttl('foo') == 1
    assert await client.pttl('foo') < 1000
    await asyncio.sleep(1)
    assert not await client.exists(['foo'])

asyncio.run(example())
```

### Sentinel

```python
import asyncio
from coredis.sentinel import Sentinel

async def example():
    sentinel = Sentinel(sentinels=[("localhost", 26379)])
    primary = sentinel.primary_for("myservice")
    replica = sentinel.replica_for("myservice")

    assert await primary.set("fubar", 1)
    assert int(await replica.get("fubar")) == 1

asyncio.run(example())
```

To see a full list of supported redis commands refer to the [Command
compatibility](https://coredis.readthedocs.io/en/latest/compatibility.html)
documentation

Details about supported Redis modules and their commands can be found
[here](https://coredis.readthedocs.io/en/latest/handbook/modules.html)

## Compatibility

coredis is tested against redis versions `6.2.x`, `7.0.x` & `7.2.x`.
The test matrix status can be reviewed
[here](https://github.com/alisaifee/coredis/actions/workflows/main.yml)

coredis is additionally tested against:

- ` uvloop >= 0.15.0`

### Supported python versions

- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- PyPy 3.8
- PyPy 3.9

### Redis-like backends

**coredis** is known to work with the following databases that have redis protocol compatibility:

- [KeyDB](https://docs.keydb.dev/)
- [Dragonfly](https://dragonflydb.io/)
- [Redict](https://redict.io/)
- [Valkey](https://github.com/valkey-io/valkey)

## References

- [Documentation (Stable)](http://coredis.readthedocs.org/en/stable)
- [Documentation (Latest)](http://coredis.readthedocs.org/en/latest)
- [Changelog](http://coredis.readthedocs.org/en/stable/release_notes.html)
- [Project History](http://coredis.readthedocs.org/en/stable/history.html)


[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Coverage Status](https://coveralls.io/repos/github/IntelPython/numba-dpex/badge.svg?branch=main)](https://coveralls.io/github/IntelPython/numba-dpex?branch=main)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Join the chat at https://matrix.to/#/#Data-Parallel-Python_community:gitter.im](https://badges.gitter.im/Join%20Chat.svg)](https://app.gitter.im/#/room/#Data-Parallel-Python_community:gitter.im)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/29068/badge.svg)](https://scan.coverity.com/projects/intelpython-numba-dpex)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/IntelPython/numba-dpex/badge)](https://securityscorecards.dev/viewer/?uri=github.com/IntelPython/numba-dpex)

Data Parallel Extension for Numba* (numba-dpex) is an open-source standalone
extension for the [Numba](http://numba.pydata.org) Python JIT compiler.
Numba-dpex provides a [SYCL*](https://sycl.tech/)-like API for kernel
programming Python. SYCL* is an open standard developed by the [Unified
Acceleration Foundation](https://uxlfoundation.org/) as a vendor-agnostic way of
programming different types of data-parallel hardware such as multi-core CPUs,
GPUs, and FPGAs. Numba-dpex's kernel-programming API brings the same programming
model and a similar API to Python. The API allows expressing portable
data-parallel kernels  in Python and then JIT compiling them for different
hardware targets. JIT compilation is supported for hardware that use the
[SPIR-V](https://www.khronos.org/spir/) intermediate representation format that
includes [OpenCL](https://www.khronos.org/opencl/) CPU (Intel, AMD) devices,
OpenCL GPU (Intel integrated and discrete GPUs) devices, and [oneAPI Level
Zero](https://spec.oneapi.io/level-zero/latest/index.html) GPU (Intel integrated
and discrete GPUs) devices.

The kernel programming API does not yet support every SYCL* feature. Refer to
the [SYCL* and numba-dpex feature comparison](https://intelpython.github.io/numba-dpex/latest/supported_sycl_features.html)
page to get a summary of supported features.
Numba-dpex only implements SYCL*'s kernel programming API, all SYCL runtime
Python bindings are provided by the [dpctl](https://github.com/IntelPython/dpctl)
package.

Along with the kernel programming API, numba-dpex extends Numba's
auto-parallelizer to bring device offload capabilities to `prange` loops and
NumPy-like vector expressions. The offload functionality is supported via the
NumPy drop-in replacement library: [dpnp](https://github.com/IntelPython/dpnp).
Note that `dpnp` and NumPy-based expressions can be used together in the same
function, with `dpnp` expressions getting offloaded by `numba-dpex` and NumPy
expressions getting parallelized by Numba.

Refer the [documentation](https://intelpython.github.io/numba-dpex) and examples
to learn more.

# Getting Started

Numba-dpex is part of the Intel® Distribution of Python (IDP) and Intel®
oneAPI AIKit, and can be installed along with oneAPI. Additionally, we support
installing it from Anaconda cloud. Please refer the instructions
on our [documentation page](https://intelpython.github.io/numba-dpex/latest/getting_started.html)
for more details.

Once the package is installed, a good starting point is to run the examples in
the `numba_dpex/examples` directory. The test suite may also be invoked as
follows:

```bash
python -m pytest --pyargs numba_dpex.tests
```

## Conda

To install `numba_dpex` from the Intel(R) channel on Anaconda
cloud, use the following command:

```bash
conda install numba-dpex -c intel -c conda-forge
```

## Pip

The `numba_dpex` can be installed using `pip` obtaining wheel packages either from PyPi or from Intel(R) channel on Anaconda.
To install `numba_dpex` wheel package from Intel(R) channel on Anaconda, run the following command:

```bash
python -m pip install --index-url https://pypi.anaconda.org/intel/simple numba-dpex
```

# Contributing

Please create an issue for feature requests and bug reports. You can also use
the GitHub Discussions feature for general questions.

If you want to chat with the developers, join the
[#Data-Parallel-Python_community](https://app.gitter.im/#/room/#Data-Parallel-Python_community:gitter.im) room on Gitter.im.

Also refer our [CONTRIBUTING](https://github.com/IntelPython/numba-dpex/blob/main/CONTRIBUTING.md) page.


# Credmark Models and Model Framework

Credmark has created a Model Framework for creators to allow them easy access to Credmark's in-house integrated, curated, and historical blockchain data via standard data models and to enable creators to leverage these models to build their own models and publish them.

It contains dependencies to the [Credmark Model Framework repo](https://github.com/credmark/credmark-model-framework-py) as well as the credmark-dev command-line tool, that lets you list the models in the local repo and run local models as you develop. It will also run remote non-local models on the server by automatically doing API calls when models are not present locally. Once the Credmark model framework is installed you can use this command-line tool.

# Get Started
### Quickstart
To install the Model Framework, please follow these [instructions](https://docs.credmark.com/cmf-model-guide/getting-started/installation-and-setup).

### Command Line Tool
Please find more details on the CLI [here](https://developer-docs.credmark.com/en/latest/credmark_dev.html).

### Jupyter Notebook
You can as well configure the Credmark Model Framework to run within a Jupyter Notebook. Please have a look [here](https://docs.credmark.com/cmf-model-guide/getting-started/setup-of-jupyter-notebook).

# How to...
After installation, please follow the instructions on how to
- [create](https://docs.credmark.com/cmf-model-guide/how-to-build-a-model/create-the-model-skeleton),
- [run](https://docs.credmark.com/cmf-model-guide/how-to-build-a-model/create-the-output-and-run-the-model),
- [test](https://docs.credmark.com/cmf-model-guide/testing/unit-tests),
- [submit new models](https://docs.credmark.com/cmf-model-guide/how-to-submit-a-model/model-submission-process)

Please also have a look at our [modeling guidelines](https://docs.credmark.com/cmf-model-guide/model-guidelines/the-good-model-checklist).

# Credmark API
The Credmark Framework provides access to remote models and access to on-chain data via the different Credmark APIs. Currently there are three APIs for token, portfolio and DeFi data.

### API Basics
To get started with the setup of the API keys, please refer to our [get-started guide](https://docs.credmark.com/api-how-to-guide/account-setup/initial-sign-up) and learn how to make some first [API Calls](https://docs.credmark.com/api-how-to-guide/make-an-api-call/request).

### Token API
Understand the [core concepts](https://docs.credmark.com/token-api-concepts/basics/introduction) of the Token API and find an [interactive technical documentation](https://gateway.credmark.com/api/#/Token%20API) of every endpoint.

### Portfolio API
Coming soon...

### DeFi API
Understand the [core concepts](https://docs.credmark.com/defi-api-concepts/basics/introduction) of the DeFi API and find an [interactive technical documentation](https://gateway.credmark.com/api/#/DeFi%20API) of every endpoint.

# Additional resources

### Model Overview
You can browse the models that are already deployed at the [Credmark Model Documentation](https://gateway.credmark.com/model-docs) site.

### Model Error Handling
When running a model, the top level framework code will catch any exceptions, convert it to a ModelRunError if needed, and output an error object in the response. Please find more details on this [here](https://developer-docs.credmark.com/en/latest/errors.html#).

### Bugs, Issues and Support
The Credmark Model Framework is under active development, thus there will be some bugs or issues that may cause problems.

We encourage all modelers to join our [Discord](https://discord.com/invite/3dSfMqP3d4), pick the role "Engineering" and post any issues the in the channel [#product-help](https://discord.com/channels/827615638540910622/965655586513485835). The Discord shall be the place to ask general questions about how to do something or if you have data-related questions.

If you want to report a bug, unexpected behavior, or feature request, you can raise an issue in Github directly but we encourage you in this case as well to notify the community in Discord.

# Docker

### Build the Image

You can build the image by running the following command at the root level of the directory:

```{bash}
docker build -t credmark/credmark-cli .
```

### Run the Container

You can either run the container in an interactive shell process by running:

```{bash}
docker run -it --entrypoint /bin/bash credmark/credmark-cli
```

And then form within the container you can now run `credmark-dev` commands.

Alternatively, you can run the container each time you want to run a `credmark-dev` command:

```{bash}
docker run credmark/credmark-cli credmark-dev list
```


火山引擎SDK for Python

欢迎使用火山引擎SDK for Python，本文档为您介绍如何获取及调用SDK。

## 前置准备
### 服务开通
请确保您已开通了您需要访问的服务。您可前往[火山引擎控制台](https://console.volcengine.com/ )，在左侧菜单中选择或在顶部搜索栏中搜索您需要使用的服务，进入服务控制台内完成开通流程。
### 获取安全凭证
Access Key（访问密钥）是访问火山引擎服务的安全凭证，包含Access Key ID（简称为AK）和Secret Access Key（简称为SK）两部分。您可登录[火山引擎控制台](https://console.volcengine.com/ )，前往“[访问控制](https://console.volcengine.com/iam )”的“[访问密钥](https://console.volcengine.com/iam/keymanage/ )”中创建及管理您的Access Key。更多信息可参考[访问密钥帮助文档](https://www.volcengine.com/docs/6291/65568 )。
### 环境检查
Python版本需要不低于2.7。

## 获取与安装

使用pip安装SDK for Python：
```
    pip install --user volcengine
```
如果已经安装volcengine包，则用下面命令升级即可：
```
    pip install --upgrade volcengine
```

## 相关配置
### 安全凭证配置
火山引擎SDK for Python支持以下几种方式进行凭证管理：

*注意：代码中Your AK及Your SK需要分别替换为您的AK及SK。*

**方式一**：在Client中设置AK/SK **（推荐）**
  ```python
      iam_service = IamService()
      iam_service.set_ak('Your AK')
      iam_service.set_sk('Your SK')
  ```

**方式二**：从环境变量加载AK/SK
  ```bash
  VOLC_ACCESSKEY="Your AK"
  VOLC_SECRETKEY="Your SK"
  ```
**方式三**：从HOME文件加载AK/SK

在本地的~/.volc/config中添加如下内容：
  ```json
    {
      "ak": "Your AK",
      "sk": "Your SK"
    }
  ```

##其它资源
###部分SDK服务目录及示例

- 【视觉智能】请点击[这里](volcengine/visual/README.md)
- 【智能语义】请点击[这里](volcengine/nlp/README.md)


---

![OS Linux](https://img.shields.io/badge/OS-Linux-blue)
![OS MacOS](https://img.shields.io/badge/OS-MacOs-blue)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/memray)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/memray)
![PyPI](https://img.shields.io/pypi/v/memray)
![PyPI - Downloads](https://img.shields.io/pypi/dm/memray)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/memray.svg)](https://anaconda.org/conda-forge/memray)
[![Tests](https://github.com/bloomberg/memray/actions/workflows/build.yml/badge.svg)](https://github.com/bloomberg/memray/actions/workflows/build.yml)
![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)

Memray is a memory profiler for Python. It can track memory allocations in Python code, in native extension
modules, and in the Python interpreter itself. It can generate several different types of reports to help you
analyze the captured memory usage data. While commonly used as a CLI tool, it can also be used as a library to
perform more fine-grained profiling tasks.

Notable features:

- 🕵♀ Traces every function call so it can accurately represent the call stack, unlike sampling profilers.
- ℭ Also handles native calls in C/C++ libraries so the entire call stack is present in the results.
- 🏎 Blazing fast! Profiling slows the application only slightly. Tracking native code is somewhat slower,
  but this can be enabled or disabled on demand.
- 📈 It can generate various reports about the collected memory usage data, like flame graphs.
- 🧵 Works with Python threads.
- 👽🧵 Works with native-threads (e.g. C++ threads in C extensions).

Memray can help with the following problems:

- Analyze allocations in applications to help discover the cause of high memory usage.
- Find memory leaks.
- Find hotspots in code that cause a lot of allocations.

> **Note**
> Memray only works on Linux and MacOS, and cannot be installed on other platforms.

# Help us improve Memray!

We are constantly looking for feedback from our awesome community ❤. If you
have used Memray to solve a problem, profile an application, find a memory leak
or anything else, please let us know! We would love to hear about your
experience and how Memray helped you.

Please, consider writing your story in the [Success
Stories discussion page](https://github.com/bloomberg/memray/discussions/226).

It really makes a difference!

# Installation

Memray requires Python 3.7+ and can be easily installed using most common Python
packaging tools. We recommend installing the latest stable release from
[PyPI](https://pypi.org/project/memray/) with pip:

```shell
    python3 -m pip install memray
```

Notice that Memray contains a C extension so releases are distributed as binary
wheels as well as the source code. If a binary wheel is not available for your system
(Linux x86/x64 or macOS), you'll need to ensure that all the dependencies are satisfied on the
system where you are doing the installation.

## Building from source

If you wish to build Memray from source you need the following binary dependencies in your system:

- libdebuginfod-dev (for Linux)
- libunwind (for Linux)
- liblz4

Check your package manager on how to install these dependencies (for example `apt-get install build-essential python3-dev libdebuginfod-dev libunwind-dev liblz4-dev` in Debian-based systems
or `brew install lz4` in MacOS). Note that you may need to teach the compiler where to find the header and library files of the dependencies. For
example, in MacOS with `brew` you may need to run:

```shell
export CFLAGS="-I$(brew --prefix lz4)/include" LDFLAGS="-L$(brew --prefix lz4)/lib -Wl,-rpath,$(brew --prefix lz4)/lib"
```

before installing `memray`. Check the documentation of your package manager to know the location of the header and library
files for more detailed information.

If you are building on MacOS, you will also need to set the deployment target.

```shell
export MACOSX_DEPLOYMENT_TARGET=10.14
```

Once you have the binary dependencies installed, you can clone the repository and follow with the normal building process:

```shell
git clone git@github.com:bloomberg/memray.git memray
cd memray
python3 -m venv ../memray-env/  # just an example, put this wherever you want
source ../memray-env/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -e . -r requirements-test.txt -r requirements-extra.txt
```

This will install Memray in the virtual environment in development mode (the `-e` of the last `pip install` command).

If you plan to contribute back, you should install the pre-commit hooks:

```shell
pre-commit install
```

This will ensure that your contribution passes our linting checks.

# Documentation

You can find the latest documentation available [here](https://bloomberg.github.io/memray/).

# Usage

There are many ways to use Memray. The easiest way is to use it as a command line tool to run your script, application, or library.

```
usage: memray [-h] [-v] {run,flamegraph,table,live,tree,parse,summary,stats} ...

Memory profiler for Python applications

Run `memray run` to generate a memory profile report, then use a reporter command
such as `memray flamegraph` or `memray table` to convert the results into HTML.

Example:

    $ python3 -m memray run -o output.bin my_script.py
    $ python3 -m memray flamegraph output.bin

positional arguments:
  {run,flamegraph,table,live,tree,parse,summary,stats}
                        Mode of operation
    run                 Run the specified application and track memory usage
    flamegraph          Generate an HTML flame graph for peak memory usage
    table               Generate an HTML table with all records in the peak memory usage
    live                Remotely monitor allocations in a text-based interface
    tree                Generate a tree view in the terminal for peak memory usage
    parse               Debug a results file by parsing and printing each record in it
    summary             Generate a terminal-based summary report of the functions that allocate most memory
    stats               Generate high level stats of the memory usage in the terminal

optional arguments:
  -h, --help            Show this help message and exit
  -v, --verbose         Increase verbosity. Option is additive and can be specified up to 3 times
  -V, --version         Displays the current version of Memray

Please submit feedback, ideas, and bug reports by filing a new issue at https://github.com/bloomberg/memray/issues
```

To use Memray over a script or a single python file you can use:

```shell
python3 -m memray run my_script.py
```

If you normally run your application with `python3 -m my_module`, you can use the `-m` flag with `memray run`:

```shell
python3 -m memray run -m my_module
```

You can also invoke Memray as a command line tool without having to use `-m` to invoke it as a module:

```shell
memray run my_script.py
memray run -m my_module
```

The output will be a binary file (like `memray-my_script.2369.bin`) that you can analyze in different ways. One way is to use the `memray flamegraph` command to generate a flame graph:

```shell
memray flamegraph my_script.2369.bin
```

This will produce an HTML file with a flame graph of the memory usage that you can inspect with your favorite browser. There are multiple other reporters that you can use to generate other types of reports, some of them generating terminal-based output and some of them generating HTML files. Here is an example of a Memray flamegraph:

## Pytest plugin

If you want an easy and convenient way to use `memray` in your test suite, you can consider using [pytest-memray](https://github.com/bloomberg/pytest-memray). Once installed, this pytest plugin allows you to simply add `--memray` to the command line invocation:

```shell
pytest --memray tests/
```

And will automatically get a report like this:

```
python3 -m pytest tests --memray
=============================================================================================================================== test session starts ================================================================================================================================
platform linux -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /mypackage, configfile: pytest.ini
plugins: cov-2.12.0, memray-0.1.0
collected 21 items

tests/test_package.py .....................                                                                                [100%]

================================================================================================================================= MEMRAY REPORT ==================================================================================================================================
Allocations results for tests/test_package.py::some_test_that_allocates

	 📦 Total memory allocated: 24.4MiB
	 📏 Total allocations: 33929
	 📊 Histogram of allocation sizes: |▂   █    |
	 🥇 Biggest allocating functions:
		- parse:/opt/bb/lib/python3.8/ast.py:47 -> 3.0MiB
		- parse:/opt/bb/lib/python3.8/ast.py:47 -> 2.3MiB
		- _visit:/opt/bb/lib/python3.8/site-packages/astroid/transforms.py:62 -> 576.0KiB
		- parse:/opt/bb/lib/python3.8/ast.py:47 -> 517.6KiB
		- __init__:/opt/bb/lib/python3.8/site-packages/astroid/node_classes.py:1353 -> 512.0KiB
```

You can also use some of the included markers to make tests
fail if the execution of said test allocates more memory than allowed:

```python
@pytest.mark.limit_memory("24 MB")
def test_foobar():
    # do some stuff that allocates memory
```

To learn more on how the plugin can be used and configured check out [the plugin documentation](https://pytest-memray.readthedocs.io).

# Native mode

Memray supports tracking native C/C++ functions as well as Python functions. This can be especially useful when profiling applications that have C extensions (such as `numpy` or `pandas`) as this gives a holistic vision of how much memory is allocated by the extension and how much is allocated by Python itself.

To activate native tracking, you need to provide the `--native` argument when using the `run` subcommand:

```shell
memray run --native my_script.py
```

This will automatically add native information to the result file and it will be automatically used by any reporter (such the flamegraph or table reporters). This means that instead of seeing this in the flamegraphs:

You will now be able to see what's happening inside the Python calls:

Reporters display native frames in a different color than Python frames. They can also be distinguished by looking at the file location in a frame (Python frames will generally be generated from files with a .py extension while native frames will be generated from files with extensions like .c, .cpp or .h).

# Live mode

Memray's live mode runs a script or a module in a terminal-based interface that allows you to interactively inspect its memory usage while it runs. This is useful for debugging scripts or modules that take a long time to run or that exhibit multiple complex memory patterns. You can use the `--live` option to run the script or module in live mode:

```shell
    memray run --live my_script.py
```

or if you want to execute a module:

```shell
    memray run --live -m my_module
```

This will show the following TUI interface in your terminal:

## Sorting results

The results are displayed in descending order of total memory allocated by a function and the subfunctions called by it. You can change the ordering with the following keyboard shortcuts:

- t (default): Sort by total memory

- o: Sort by own memory

- a: Sort by allocation count

In most terminals you can also click the "Sort by Total", "Sort by Own", and "Sort by Allocations" buttons on the footer.

The sorted column's heading is underlined.

## Viewing different threads

By default, the live command will present the main thread of the program. You can look at different threads of the program by pressing the greater than and less than keys, `<` and `>`. In most terminals you can also click the "Previous Thread" and "Next Thread" buttons on the footer.

# API

In addition to tracking Python processes from a CLI using `memray run`, it is also possible to programmatically enable tracking within a running Python program.

```py
import memray

with memray.Tracker("output_file.bin"):
    print("Allocations will be tracked until the with block ends")
```

For details, see the [API documentation](https://bloomberg.github.io/memray/api.html).

# License

Memray is Apache-2.0 licensed, as found in the [LICENSE](LICENSE) file.

# Code of Conduct

- [Code of Conduct](https://github.com/bloomberg/.github/blob/main/CODE_OF_CONDUCT.md)

This project has adopted a Code of Conduct. If you have any concerns about the Code, or behavior that you have experienced in the project, please contact us at opensource@bloomberg.net.

# Security Policy

- [Security Policy](https://github.com/bloomberg/memray/security/policy)

If you believe you have identified a security vulnerability in this project, please send an email to the project team at opensource@bloomberg.net, detailing the suspected issue and any methods you've found to reproduce it.

Please do NOT open an issue in the GitHub repository, as we'd prefer to keep vulnerability reports private until we've had an opportunity to review and address them.

# Contributing

We welcome your contributions to help us improve and extend this project!

Below you will find some basic steps required to be able to contribute to the project. If you have any questions about this process or any other aspect of contributing to a Bloomberg open source project, feel free to send an email to opensource@bloomberg.net and we'll get your questions answered as quickly as we can.

## Contribution Licensing

Since this project is distributed under the terms of an [open source license](LICENSE), contributions that
you make are licensed under the same terms. In order for us to be able to accept your contributions,
we will need explicit confirmation from you that you are able and willing to provide them under
these terms, and the mechanism we use to do this is called a Developer's Certificate of Origin
[(DCO)](https://github.com/bloomberg/.github/blob/main/DCO.md). This is very similar to the process
used by the Linux kernel, Samba, and many other major open source projects.

To participate under these terms, all that you must do is include a line like the following as the
last line of the commit message for each commit in your contribution:

    Signed-Off-By: Random J. Developer <random@developer.example.org>

The simplest way to accomplish this is to add `-s` or `--signoff` to your `git commit` command.

You must use your real name (sorry, no pseudonyms, and no anonymous contributions).

## Steps

- Create an Issue, select 'Feature Request', and explain the proposed change.
- Follow the guidelines in the issue template presented to you.
- Submit the Issue.
- Submit a Pull Request and link it to the Issue by including "#<issue number>" in the Pull Request summary.


        Website
        •
        Docs
        •
        Community Slack

# 💡 What is NannyML?

NannyML is an open-source python library that allows you to **estimate post-deployment model performance** (without access to targets), detect data drift, and intelligently link data drift alerts back to changes in model performance. Built for data scientists, NannyML has an easy-to-use interface, interactive visualizations, is completely model-agnostic and currently supports all tabular use cases, classification and **regression**.

The core contributors of NannyML have researched and developed multiple novel algorithms for estimating model performance: [confidence-based performance estimation (CBPE)](https://nannyml.readthedocs.io/en/stable/how_it_works/performance_estimation.html#confidence-based-performance-estimation-cbpe) and [direct loss estimation (DLE)](https://nannyml.readthedocs.io/en/stable/how_it_works/performance_estimation.html#direct-loss-estimation-dle).
The nansters also invented a new approach to detect [multivariate data drift](https://nannyml.readthedocs.io/en/stable/how_it_works/multivariate_drift.html#data-reconstruction-with-pca) using PCA-based data reconstruction.

If you like what we are working on, be sure to become a Nanster yourself, join our [community slack](https://join.slack.com/t/nannymlbeta/shared_invite/zt-16fvpeddz-HAvTsjNEyC9CE6JXbiM7BQ)  and support us with a GitHub  star ⭐.

# ☔ Why use NannyML?

NannyML closes the loop with performance monitoring and post deployment data science, empowering data scientist to quickly understand and **automatically detect silent model failure**. By using NannyML, data scientists can finally maintain complete visibility and trust in their deployed machine learning models.
Allowing you to have the following benefits:

-   End sleepless nights caused by not knowing your model performance 😴
-   Analyse data drift and model performance **over time**
-   Discover the **root cause** to why your models are not performing as expected
-   **No alert fatigue!** React only when necessary if model performance is impacted
-   **Painless** setup in any environment

# 🧠 GO DEEP

| NannyML Resources                                                                                | Description                                                                            |
| --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| ☎ **[NannyML 101]**                                                                                | New to NannyML? Start here!                                                            |
| 🔮 **[Performance estimation]**                                                                                | How the magic works.                                                                   |
| 🌍 **[Real world example]**                                                                                | Take a look at a real-world example of NannyML.                                        |
| 🔑 **[Key concepts]**                                                                                | Glossary of key concepts we use.                                                       |
| 🔬 **[Technical reference]**                                                                                | Monitor the performance of your ML models.                                             |
| 🔎 **[Blog]**                                                                                | Thoughts on post-deployment data science from the NannyML team.                        |
| 📬 **[Newsletter]**                                                                                | All things post-deployment data science. Subscribe to see the latest papers and blogs. |
| 💎 **[New in v0.10.7]**                                                                                | New features, bug fixes.                                                               |
| 🧑💻 **[Contribute]**                                                                                | How to contribute to the NannyML project and codebase.                                 |
|  **[Join slack]** | Need help with your specific use case? Say hi on slack!                                |

[nannyml 101]: https://nannyml.readthedocs.io/en/stable/
[performance estimation]: https://nannyml.readthedocs.io/en/stable/how_it_works/performance_estimation.html
[key concepts]: https://nannyml.readthedocs.io/en/stable/glossary.html
[technical reference]: https://nannyml.readthedocs.io/en/stable/nannyml/modules.html
[new in v0.10.7]: https://github.com/NannyML/nannyml/releases/latest/
[real world example]: https://nannyml.readthedocs.io/en/stable/examples/california_housing.html
[blog]: https://www.nannyml.com/blog
[newsletter]: https://mailchi.mp/022c62281d13/postdeploymentnewsletter
[join slack]: https://join.slack.com/t/nannymlbeta/shared_invite/zt-16fvpeddz-HAvTsjNEyC9CE6JXbiM7BQ
[contribute]: https://github.com/NannyML/nannyml/blob/main/CONTRIBUTING.rst

# 🔱 Features

### 1. Performance estimation and monitoring

When the actual outcome of your deployed prediction models is delayed, or even when post-deployment target labels are completely absent, you can use NannyML's [CBPE-algorithm](https://nannyml.readthedocs.io/en/stable/how_it_works/performance_estimation.html#confidence-based-performance-estimation-cbpe) to **estimate model performance** for classification or NannyML's [DLE-algorithm](https://nannyml.readthedocs.io/en/stable/how_it_works/performance_estimation.html#direct-loss-estimation-dle) for regression. These algorithms provide you with any estimated metric you would like, i.e. ROC AUC or RSME. Rather than estimating the performance of future model predictions, CBPE and DLE estimate the expected model performance of the predictions made at inference time.

NannyML can also **track the realised performance** of your machine learning model once targets are available.

### 2. Data drift detection

To detect **multivariate feature drift** NannyML uses [PCA-based data reconstruction](https://nannyml.readthedocs.io/en/stable/how_it_works/multivariate_drift.html#data-reconstruction-with-pca). Changes in the resulting reconstruction error are monitored over time and data drift alerts are logged when the reconstruction error in a certain period exceeds a threshold. This threshold is calculated based on the reconstruction error observed in the reference period.

NannyML utilises statistical tests to detect **univariate feature drift**. We have just added a bunch of new univariate tests including Jensen-Shannon Distance and L-Infinity Distance, check out the [comprehensive list](https://nannyml.readthedocs.io/en/stable/how_it_works/univariate_drift_detection.html#methods-for-continuous-features). The results of these tests are tracked over time, properly corrected to counteract multiplicity and overlayed on the temporal feature distributions. (It is also possible to visualise the test-statistics over time, to get a notion of the drift magnitude.)

NannyML uses the same statistical tests to detected **model output drift**.

**Target distribution drift** can also be monitored using the same statistical tests. Bear in mind that this operation requires the presence of actuals.

### 3. Intelligent alerting

Because NannyML can estimate performance, it is possible to weed out data drift alerts that do not impact expected performance, combatting alert fatigue. Besides linking data drift issues to drops in performance it is also possible to prioritise alerts according to other criteria using NannyML's Ranker.

# 🚀 Getting started

### Install NannyML

NannyML depends on [LightGBM](https://github.com/microsoft/LightGBM). This might require you to set install additional
OS-specific binaries. You can follow the [official installation guide](https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html).

From PyPI:

```bash
pip install nannyml
```

From Conda:

```bash
 conda install -c conda-forge nannyml
```

Running via [Docker](https://hub.docker.com/r/nannyml/nannyml):

```bash
docker -v /local/config/dir/:/config/ run nannyml/nannyml nml run
```

**Here be dragons!** Use the latest development version of NannyML at your own risk:

```bash
python -m pip install git+https://github.com/NannyML/nannyml
```

### Quick Start

_The following snippet is based on our [latest release](https://github.com/NannyML/nannyml/releases/latest)_.

```python
import nannyml as nml
import pandas as pd
from IPython.display import display

# Load real-world data:
reference_df, analysis_df, _ = nml.load_us_census_ma_employment_data()
display(reference_df.head())
display(analysis_df.head())

# Choose a chunker or set a chunk size:
chunk_size = 5000

# initialize, specify required data columns, fit estimator and estimate:
estimator = nml.CBPE(
    problem_type='classification_binary',
    y_pred_proba='predicted_probability',
    y_pred='prediction',
    y_true='employed',
    metrics=['roc_auc'],
    chunk_size=chunk_size,
)
estimator = estimator.fit(reference_df)
estimated_performance = estimator.estimate(analysis_df)

# Show results:
figure = estimated_performance.plot()
figure.show()

# Define feature columns:
features = ['AGEP', 'SCHL', 'MAR', 'RELP', 'DIS', 'ESP', 'CIT', 'MIG', 'MIL', 'ANC',
       'NATIVITY', 'DEAR', 'DEYE', 'DREM', 'SEX', 'RAC1P']

# Initialize the object that will perform the Univariate Drift calculations:
univariate_calculator = nml.UnivariateDriftCalculator(
    column_names=features,
    chunk_size=chunk_size
)

univariate_calculator.fit(reference_df)
univariate_drift = univariate_calculator.calculate(analysis_df)

# Get features that drift the most with count-based ranker:
alert_count_ranker = nml.AlertCountRanker()
alert_count_ranked_features = alert_count_ranker.rank(univariate_drift)
display(alert_count_ranked_features.head())

# Plot drift results for top 3 features:
figure = univariate_drift.filter(column_names=['RELP','AGEP', 'SCHL']).plot()
figure.show()

# Compare drift of a selected feature with estimated performance
uni_drift_AGEP_analysis = univariate_drift.filter(column_names=['AGEP'], period='analysis')
figure = estimated_performance.compare(uni_drift_AGEP_analysis).plot()
figure.show()

# Plot distribution changes of the selected features:
figure = univariate_drift.filter(period='analysis', column_names=['RELP','AGEP', 'SCHL']).plot(kind='distribution')
figure.show()

# Get target data, calculate, plot and compare realized performance with estimated performance:
_, _, analysis_targets_df = nml.load_us_census_ma_employment_data()

analysis_with_targets_df = pd.concat([analysis_df, analysis_targets_df], axis=1)
display(analysis_with_targets_df.head())

performance_calculator = nml.PerformanceCalculator(
    problem_type='classification_binary',
    y_pred_proba='predicted_probability',
    y_pred='prediction',
    y_true='employed',
    metrics=['roc_auc'],
    chunk_size=chunk_size)

performance_calculator.fit(reference_df)
calculated_performance = performance_calculator.calculate(analysis_with_targets_df)

figure = estimated_performance.filter(period='analysis').compare(calculated_performance).plot()
figure.show()

```

# 📖 Documentation

-   Performance monitoring
    -   [Estimated performance](https://nannyml.readthedocs.io/en/main/tutorials/performance_estimation.html)
    -   [Realized performance](https://nannyml.readthedocs.io/en/main/tutorials/performance_calculation.html)
-   Drift detection
    -   [Multivariate feature drift](https://nannyml.readthedocs.io/en/main/tutorials/detecting_data_drift/multivariate_drift_detection.html)
    *   [Univariate feature drift](https://nannyml.readthedocs.io/en/main/tutorials/detecting_data_drift/univariate_drift_detection.html)

# 🦸 Contributing and Community

We want to build NannyML together with the community! The easiest to contribute at the moment is to propose new features or log bugs under [issues](https://github.com/NannyML/nannyml/issues). For more information, have a look at [how to contribute](CONTRIBUTING.rst).

# 🙋 Get help

The best place to ask for help is in the [community slack](https://join.slack.com/t/nannymlbeta/shared_invite/zt-16fvpeddz-HAvTsjNEyC9CE6JXbiM7BQ). Feel free to join and ask questions or raise issues. Someone will definitely respond to you.

# 🥷 Stay updated

If you want to stay up to date with recent changes to the NannyML library, you can subscribe to our [release notes](https://nannyml.substack.com). For thoughts on post-deployment data science from the NannyML team, feel free to visit our [blog](https://www.nannyml.com/blog). You can also sing up for our [newsletter](https://mailchi.mp/022c62281d13/postdeploymentnewsletter), which brings together the best papers, articles, news, and open-source libraries highlighting the ML challenges after deployment.

# 📍 Roadmap

Curious what we are working on next? Have a look at our [roadmap](https://bit.ly/nannymlroadmap). If you have any questions or if you would like to see things prioritised in a different way, let us know!

# 📝 Citing NannyML

To cite NannyML in academic papers, please use the following BibTeX entry.

### Version 0.10.7

```
    @misc{nannyml,
        title = {{N}anny{ML} (release 0.10.7)},
        howpublished = {\url{https://github.com/NannyML/nannyml}},
        month = mar,
        year = 2023,
        note = {NannyML, Belgium, OHL.},
        key = {NannyML}
    }
```

# 📄 License

NannyML is distributed under an Apache License Version 2.0. A complete version can be found [here](LICENSE). All contributions will be distributed under this license.


[![Stargazers][stars-shield]][stars-url]
[![Pypi Version][pypi-shield]][pypi-url]
[![Pypi Downloads][pypi-dl-shield]][pypi-stats-url]
[![Python Versions][python-shield]][pypi-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]

  Watch everything from your terminal.

  Report Bug
  ·
  Request Feature

> [!Note]
> v4 is constantly changing so be sure to **keep the tool and your plugins up to date**. Also, I would advise not using it as a library yet as the API still has many breaking changes.

## What is mov-cli? 💫

**mov-cli** is a command line tool with plugin support that streamlines the process of streaming media from the comfort of your terminal; ~~*so you can show off to your friends the superiority of the command line.*~~ 💪 The tool is sort of a framework that handles metadata, configuration and scraping of the media to be streamed in your media player of choice.

**mov-cli** [is **not** a piracy tool](./disclaimer.md); in fact, we encourage the opposite through the existence of our plugins [mov-cli-fs](https://github.com/mov-cli/mov-cli-files) and [mov-cli-media-server](https://github.com/mov-cli/mov-cli-ms). 🫵 You obtain the media. You pick the plugins.

## Installation 🛠

> [!TIP]
> For in-depth installation instructions hit the [wiki](https://github.com/mov-cli/mov-cli/wiki/Installation).

### Prerequisites
- **A supported platform:**
  - Linux
  - Windows
  - Android (via [Termux](https://termux.dev/en/))
  - iOS (via [iSH Shell](https://ish.app/))
  - MacOS
- **[python](https://www.python.org/downloads/)** (**required**, with pip)
- **[lxml](https://pypi.org/project/lxml/)** (optional, ⚡ faster scraping)
- **[fzf](https://github.com/junegunn/fzf?tab=readme-ov-file#installation)** (optional but **highly recommended**)
- **[mpv](https://mpv.io/installation/)** (recommended & default media player)

To get running these are all the prerequisites you'll need.

With the prerequisites installed, mov-cli can be installed via the pip command on all platforms with Python version 3.8 or above.

```sh
pip install mov-cli -U
```
> Check out the [wiki on installation](https://github.com/mov-cli/mov-cli/wiki/Installation) for more in-depth guidance on installing mov-cli.

## Usage 🖱
[!showcase video](https://github.com/mov-cli/mov-cli/assets/132799819/d924c3f5-775c-46a3-97f5-ff27433b69dd)

mov-cli comes packaged with a CLI interface via the `mov-cli` command you can use in your respective terminal.

> [!NOTE]
> You may notice mov-cli doesn't ship with any scrapers (or previously known as providers) by default, this is because v4 is plugin-based and scrapers are now part of plugins that must be chosen to be installed.
> Find out how to do so at the [wiki](https://github.com/mov-cli/mov-cli/wiki#plugins).

1. Install the scraper plugin of your choice. Visit this [wiki page](https://github.com/mov-cli/mov-cli/wiki/Plugins) on how to do so and the [mov-cli-plugin](https://github.com/topics/mov-cli-plugin) topic for a list of **third-party** mov-cli plugins.
```sh
mov-cli -e
```
Alternatively, you may also edit by manually opening the config file. See this [Wiki page](https://github.com/mov-cli/mov-cli/wiki/Configuration#introduction) on that.
```toml
[mov-cli.plugins]
youtube = "mov-cli-youtube"
```

2. Scrape away!
```sh
mov-cli -s youtube blender studio
```

> The command above searches for `blender studio` with our [youtube](https://github.com/mov-cli/mov-cli-youtube) plugin, **however once again mov-cli is plugin based and there are many of them [in the wild](https://github.com/topics/mov-cli-plugin). 😉**

## Star Graph ⭐
[![Star Graph Chart](https://api.star-history.com/svg?repos=mov-cli/mov-cli&type=Date)](https://star-history.com/#mov-cli/mov-cli&Date)

## Contributing ✨
Pull requests are welcome and *appreciated*. For major changes, please open an issue first to discuss what you would like to change.

## Inspiration 🌟
Inspired by [ani-cli](https://github.com/pystardust/ani-cli), [lobster](https://github.com/justchokingaround/lobster) and [animdl](https://github.com/justfoolingaround/animdl)

[contributors-shield]: https://img.shields.io/github/contributors/mov-cli/mov-cli.svg?style=for-the-badge
[contributors-url]: https://github.com/mov-cli/mov-cli/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/mov-cli/mov-cli.svg?style=for-the-badge
[forks-url]: https://github.com/mov-cli/mov-cli/network/members
[stars-shield]: https://img.shields.io/github/stars/mov-cli/mov-cli?style=flat
[stars-url]: https://github.com/mov-cli/mov-cli/stargazers
[pypi-shield]: https://img.shields.io/pypi/v/mov-cli?style=flat
[pypi-url]: https://pypi.org/project/mov-cli/
[pypi-stats-url]: https://pypistats.org/packages/mov-cli
[python-shield]: https://img.shields.io/pypi/pyversions/mov-cli?style=flat
[issues-shield]: https://img.shields.io/github/issues/mov-cli/mov-cli?style=flat
[issues-url]: https://github.com/mov-cli/mov-cli/issues
[license-shield]: https://img.shields.io/github/license/mov-cli/mov-cli?style=flat
[license-url]: ./LICENSE
[pypi-dl-shield]: https://img.shields.io/pypi/dm/mov-cli?color=informational&label=pypi%20downloads


A Django app to download, extract and load campaign finance and lobbying activity data from the California Secretary of State's [CAL-ACCESS](http://www.sos.ca.gov/prd/cal-access/) database

-  Documentation: [django-calaccess.californiacivicdata.org](https://django-calaccess.californiacivicdata.org/en/latest/)
-  Issues: [github.com/california-civic-data-coalition/django-calaccess-raw-data/issues](https://github.com/california-civic-data-coalition/django-calaccess-raw-data/issues)
-  Packaging: [pypi.python.org/pypi/django-calaccess-raw-data](https://pypi.python.org/pypi/django-calaccess-raw-data)
-  Testing: [github.com/california-civic-data-coalition/django-calaccess-raw-data/actions/](https://github.com/california-civic-data-coalition/django-calaccess-raw-data/actions/workflows/tests.yaml)


    Features •
    Developer Docs •
    Code of Conduct •
    Downloads •
    Marketplace

    "Life is short, eat more biscuits."

Biscuit is a lightweight, awesome code editor for any language. Biscuit supports essential language features such as Smart Code Completions, Syntax highlighting, etc. We wrote it in python, using only tkinter for GUI. It's a great alternative to [insert funny thing here]! Scroll down to see [some of the features](https://github.com/billyeatcookies/Biscuit/tree/main?tab=readme-ov-file#features).

- Explore all community made extensions & authors at [Biscuit Extensions Marketplace](https://billyeatcookies.github.io/biscuit-extensions/)
- For developer/user guides or API reference, read the [documentation](https://billyeatcookies.github.io/biscuit).

## Installing
- Download latest **stable builds** from [**releases page**](https://github.com/billyeatcookies/Biscuit/releases).
- Nightly builds from [github actions page](https://github.com/billyeatcookies/Biscuit/actions).

To compile Biscuit for your platform, see [compiling guide](https://github.com/billyeatcookies/Biscuit/tree/main/scripts).

## Contributing
Your contributions are greatly appreciated! please have a look at our [**developer docs**](https://github.com/billyeatcookies/Biscuit/blob/main/CONTRIBUTING.md) for an outline of the project and to setup the environment.

- For feature suggestions and bug reports, please check [issue tracker](https://github.com/billyeatcookies/Biscuit/issues)
- Community made Extensions can be published at: [**Biscuit Extensions Repository**](https://github.com/billyeatcookies/biscuit-extensions)

## Features
## Smart Auto-completions
When the opened file have a recognized and supported file type, and also have language extensions installed, the autocomplete widget will automatically turn on LSP mode, the completions will be handled by registered language server afterwards. LSP mode enables smart and context sensitive code suggestions, as demonstrated below.
When there are no language extensions available/installed, autocomplete widget goes to word mode, the completions will not be context sensitive and can be unexpected.

![Autocompletions](https://github.com/billyeatcookies/biscuit/assets/70792552/885ebf36-ce18-45a3-ae57-9a4b709331f7)

## Hover for Documentation
Identifiers when hovered pops up a floating window on top, containing the documentation (if there is) of that symbol.

![hover](https://github.com/billyeatcookies/biscuit/assets/70792552/4f0ba532-4ec0-49c3-ad08-19e8a622a416)

## Goto Definitions by `ctrl` + clicking on symbols
User can jump directly into symbol definitions by  `ctrl` + clicking on them, the definition containing script will open up in new/existing tab. If there are multiple definitions, window containing all the definitions will popup right below the symbol to pick from

![gotodef](https://github.com/billyeatcookies/biscuit/assets/70792552/fb3a012f-1e93-4c00-930c-843a9728b958)

## **Git Support**

![image](https://github.com/billyeatcookies/Biscuit/assets/70792552/ea231a77-7899-4560-ab97-95828bb96932)

## **Integrated Terminals, Extension center**

![image](https://github.com/billyeatcookies/Biscuit/assets/70792552/2531ea77-a1e0-4a81-96c9-66ad6b6b0c6d)

## **Split-Pane Markdown Editor**

![image](https://github.com/billyeatcookies/Biscuit/assets/70792552/2e58ff22-2412-4cb1-b183-673591200308)

## **Command Palette for Quick Access**

![ezgif com-video-to-gif](https://github.com/billyeatcookies/Biscuit/assets/70792552/e0868336-a15f-4b98-a62e-a822e2211e57)

## **PathView for the Breadcrumbs!**

![pathview](https://imgur.com/CztWtni.jpg)

# License
Biscuit uses the MIT License, please check [LICENSE](https://github.com/billyeatcookies/Biscuit/blob/main/LICENSE.md).