# packages

pkgId: 9e25d7d693f28535911c83d1378b7f4fac462941e3fac7a2bbf076dc2c8f24df
name: python-allianceauth-oidc-provider
arch: src
version: 0.0.1b7
epoch: 0
release: 1
summary: Alliance Auth OIDC Provider
url: https://github.com/Solar-Helix-Independent-Transport/allianceauth-oidc-provider
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allianceauth-oidc-provider-0.0.1b7-1.src.rpm
checksum_type: sha256
description:
  - OIDC / OAuth2
    - Scopes Available
      - openid
      - email
      - profile
        - Includes `groups` claim with all a members groups and state as a list of strings
  - Application level permissions
    - global access
    - State access
    - group access



  ![Imgur](https://i.imgur.com/gcrFcRL.png)



  1. `pip install allianceauth-oidc-provider`
  1. add to INSTALLED_APPS

     ```
         'allianceauth_oidc',
         'oauth2_provider',
     ```

  1. Extra Settings Required

  ```python

   
   from pathlib import Path

   
  OAUTH2_PROVIDER_APPLICATION_MODEL='allianceauth_oidc.AllianceAuthApplication'
  OAUTH2_PROVIDER = {
  "OIDC_ENABLED": True, # https://django-oauth-toolkit.readthedocs.io/en/stable/oidc.html#creating-rsa-private-key
  "OIDC_RSA_PRIVATE_KEY": Path("/path/to/key/file").read_text(), ## Load your private key
  "OAUTH2_VALIDATOR_CLASS": "allianceauth_oidc.auth_provider.AllianceAuthOAuth2Validator",
  "SCOPES": {
  "openid": "User Profile",
  "email": "Registered email",
  "profile": "Main Character affiliation and Auth groups"
  },
  "PKCE_REQUIRED": False,
  "APPLICATION_ADMIN_CLASS": "allianceauth_oidc.admin.ApplicationAdmin",
  'ACCESS_TOKEN_EXPIRE_SECONDS': 60,
  'REFRESH_TOKEN_EXPIRE_SECONDS': 24*60*60,
  'ROTATE_REFRESH_TOKEN': True,
  }
  ```

  Please see [this](https://django-oauth-toolkit.readthedocs.io/en/stable/oidc.html#creating-rsa-private-key) for more info on creating and managing a private key

  1. Add the endpoints to your `urls.py`

  ```

         path('o/', include('allianceauth_oidc.urls', namespace='oauth2_provider')),

  ```

  1. run migrations
  1. restart auth





  - Authorization: `https://your.url/o/authorize/`
  - Token: `https://your.url/o/token/`
  - Profile: `https://your.url/o/userinfo/`
  - Issuer `https://your.url/o`



  - `openid profile email`



  - `name` Eve Main Character Name ( Profile Grant? )
  - `email` Registered email on auth ( Email Grant )
  - `groups` List of all groups with the members state thrown in too ( Profile Grant )
  - `sub` PK of user model



  Manually create and groups you care for your users to have in the wiki and the service will map them for you. This greatly cuts down on group spam.
  in auth create `Administrators` to give access to the full wiki admin site.



  - Skip User Profile `off`
  - Email claim `email`
  - Display Name Claim `name`
  - Map Groups `on`
  - Groups Claim `groups`
  - Allow Self Registration `on`



  Tested only with access no group mapping as yet

  Group>Team mapping requires Grafana cloud or Enterprise and is outside of the scope of this doc.



  ```ini
  [auth.generic_oauth]
  enabled = true
  name = Your Site Name
  allow_sign_up = true
  client_id = ******
  client_secret = *****
  scopes = openid,email,profile
  empty_scopes = false
  email_attribute_path = email
  name_attribute_path = name
  auth_url = https://your.url/o/authorize/
  token_url = https://your.url/o/token/
  api_url = https://your.url/o/userinfo/
  ```



  1.  Enable _Debug Mode_ for the specific application in the auth admin site.
  1.  then in your `gunicorn.log` look for long lines similar to this after you attempt to log in,

  ```
  [01/Jan/2099 00:00:05] WARNING [allianceauth_oidc.signals:12] {"access_token": "abcdefghijklmnopqrstuvwxyz", "expires_in": 60, "token_type": "Bearer", "scope": "openid profile email", "refresh_token": "abcdefghijklmnopqrstuvwxyz", "id_token": "long ass string here"}
  ```

  1.  take the `id_token` field and paste it into https://jwt.io/ to debug the data being sent to the application. it should be fairly self explanitory expect for these 2 fields.

  - `iss` is the issuer that must match exactly in the applications own settings.
  - `sub` is your user id if you need to debug why user is being sent.


pkgId: 7877f30151e6d7980fe736aef7a07a71b1965278310d6d1816966df9c675ce6c
name: python-allianceauth-pve
arch: src
version: 1.16.0
epoch: 0
release: 1
summary: PvE tool for AllianceAuth
url: https://github.com/Maestro-Zacht/allianceauth-pve
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allianceauth-pve-1.16.0-1.src.rpm
checksum_type: sha256
description:
  This package aims at helping groups of people manage PvE sessions, centralized loot management and loot taxes.


pkgId: 0f9af6190eb5e7ec7e78364ccbe7e88cccec723ff28c94a70625f70df632f26d
name: python-allianceauth-wiki-js
arch: src
version: 0.1.1
epoch: 0
release: 1
summary: Simple User and group management for Wiki JS as a service of AllianceAuth
url: https://github.com/Solar-Helix-Independent-Transport/allianceauth-wiki-js
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allianceauth-wiki-js-0.1.1-1.src.rpm
checksum_type: sha256
description:
  Simple User and group management for [Wiki JS](https://wiki.js.org/) as a service of AllianceAuth



  0. install and setup your Wiki.js instance [from the Wiki Docs](https://docs.requarks.io/)
  1. activate venv
  2. `pip install -U allianceauth-wiki-js`
  3. add `'wikijs',` to your `INSTALLED_APPS` in your projects `local.py`
  4. generate a `Full Access` API key iun the wiki with maximum expiration be sure to copy it as the key wont be shown again.
  5. add the settings ( outlined below ) to your `local.py`
  6. run migrations and restart auth
  7. setup permissions ( outlined below )



  | Perm                          | Codename      | Admin        | Frontend                        |
  | ----------------------------- | ------------- | ------------ | ------------------------------- |
  | Can access the WikiJS service | access_wikijs | -            | Gives access to Wiki.js service |
  | Can add wiki js               | -             | Admin add    | -                               |
  | Can change wiki js            | -             | Admin Edit   | -                               |
  | Can delete wiki js            | -             | Admin Delete | -                               |
  | Can view wiki js              | -             | Admin View   | -                               |



  | Setting                         | default | Description                                                     |
  | ------------------------------- | ------- | --------------------------------------------------------------- |
  | WIKIJS_API_KEY                  | ""      | your global API key from the wiki admin section                 |
  | WIKIJS_URL                      | ""      | You Wiki's base URL                                             |
  | WIKIJS_AADISCORDBOT_INTEGRATION | True    | Enables an AADiscordbot cog with the ability to search the wiki |

  If you have issues with auth not being able to access the wiki due to SSL/redirection or similar. ( Cloudlfair can cause issues)

  | Setting        | default    | Description                |
  | -------------- | ---------- | -------------------------- |
  | WIKIJS_API_URL | WIKIJS_URL | URL Overide for API access |

  add this setting to your local py with a direct link to the wiki

  ```python

  WIKIJS_API_URL = "http://localhost:3000"


  WIKIJS_API_URL = "http://10.0.0.150:3000"
  ```



  - I lost admin when i registered my admin user.
    - add a group called `Administrators` to your auth instance and give it to anyone who needs admin on the wiki.
  - I cant lock down my wiki to registered members only.
    - i had to delete a row from the database manually to remove the guest roles permissions. Ask in the AA discord.


pkgId: 8b775f4c0c766109bab6eadbca2c55e13465d9624e6dca44d1ba8911ec63833e
name: python-alligator
arch: src
version: 1.0.0
epoch: 0
release: 1
summary: Simple offline task queues.
url: https://github.com/toastdriven/alligator
rpm_license: BSD-3-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alligator-1.0.0-1.src.rpm
checksum_type: sha256
description:
  Simple offline task queues. For Python.
  `"See you later, alligator."`
  Latest documentation at http://alligator.readthedocs.org/en/latest/.


pkgId: 3c789e9ec0b03bfaf180802031e5a4fbf8d4f64e1d4693220858ce0774109b2c
name: python-allin1
arch: src
version: 1.1.0
epoch: 0
release: 1
summary: All-In-One Music Structure Analyzer
url: https://pypi.org/project/allin1/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allin1-1.1.0-1.src.rpm
checksum_type: sha256
description:
  **Table of Contents**
  - [Installation](#installation)
  - [Usage for CLI](#usage-for-cli)
  - [Usage for Python](#usage-for-python)
  - [Visualization & Sonification](#visualization--sonification)
  - [Available Models](#available-models)
  - [Speed](#speed)
  - [Advanced Usage for Research](#advanced-usage-for-research)
  - [Concerning MP3 Files](#concerning-mp3-files)
  - [Training](TRAINING.md)
  - [Citation](#citation)


  Visit [PyTorch](https://pytorch.org/) and install the appropriate version for your system.

  * **Linux**: Download from [NATTEN website](https://www.shi-labs.com/natten/)
  * **macOS**: Auto-installs with `allin1`.
  * **Windows**: Build from source:
  ```shell
  pip install ninja # Recommended, not required
  git clone https://github.com/SHI-Labs/NATTEN
  cd NATTEN
  make
  ```

  ```shell
  pip install git+https://github.com/CPJKU/madmom  # install the latest madmom directly from GitHub
  pip install allin1  # install this package
  ```

  For ubuntu:
  ```shell
  sudo apt install ffmpeg
  ```
  For macOS:
  ```shell
  brew install ffmpeg
  ```

  To analyze audio files:
  ```shell
  allin1 your_audio_file1.wav your_audio_file2.mp3
  ```
  Results will be saved in the `./struct` directory by default:
  ```shell
  ./struct
  └── your_audio_file1.json
  └── your_audio_file2.json
  ```
  The analysis results will be saved in JSON format:
  ```json
  {
    "path": "/path/to/your_audio_file.wav",
    "bpm": 100,
    "beats": [ 0.33, 0.75, 1.14, ... ],
    "downbeats": [ 0.33, 1.94, 3.53, ... ],
    "beat_positions": [ 1, 2, 3, 4, 1, 2, 3, 4, 1, ... ],
    "segments": [
      {
        "start": 0.0,
        "end": 0.33,
        "label": "start"
      },
      {
        "start": 0.33,
        "end": 13.13,
        "label": "intro"
      },
      {
        "start": 13.13,
        "end": 37.53,
        "label": "chorus"
      },
      {
        "start": 37.53,
        "end": 51.53,
        "label": "verse"
      },
    ]
  }
  ```
  All available options are as follows:
  ```shell
  $ allin1 -h
  usage: allin1 [-h] [-o OUT_DIR] [-v] [--viz-dir VIZ_DIR] [-s] [--sonif-dir SONIF_DIR] [-a] [-e] [-m MODEL] [-d DEVICE] [-k]
                [--demix-dir DEMIX_DIR] [--spec-dir SPEC_DIR]
                paths [paths ...]
  positional arguments:
    paths                 Path to tracks
  options:
    -h, --help            show this help message and exit
    -o OUT_DIR, --out-dir OUT_DIR
                          Path to a directory to store analysis results (default: ./struct)
    -v, --visualize       Save visualizations (default: False)
    --viz-dir VIZ_DIR     Directory to save visualizations if -v is provided (default: ./viz)
    -s, --sonify          Save sonifications (default: False)
    --sonif-dir SONIF_DIR
                          Directory to save sonifications if -s is provided (default: ./sonif)
    -a, --activ           Save frame-level raw activations from sigmoid and softmax (default: False)
    -e, --embed           Save frame-level embeddings (default: False)
    -m MODEL, --model MODEL
                          Name of the pretrained model to use (default: harmonix-all)
    -d DEVICE, --device DEVICE
                          Device to use (default: cuda if available else cpu)
    -k, --keep-byproducts
                          Keep demixed audio files and spectrograms (default: False)
    --demix-dir DEMIX_DIR
                          Path to a directory to store demixed tracks (default: ./demix)
    --spec-dir SPEC_DIR   Path to a directory to store spectrograms (default: ./spec)
  ```

  Available functions:
  - [`analyze()`](#analyze)
  - [`load_result()`](#load_result)
  - [`visualize()`](#visualize)
  - [`sonify()`](#sonify)

  Analyzes the provided audio files and returns the analysis results.
  ```python
  import allin1

  result = allin1.analyze('your_audio_file.wav')

  results = allin1.analyze(['your_audio_file1.wav', 'your_audio_file2.mp3'])
  ```
  A result is a dataclass instance containing:
  ```python
  AnalysisResult(
    path='/path/to/your_audio_file.wav',
    bpm=100,
    beats=[0.33, 0.75, 1.14, ...],
    beat_positions=[1, 2, 3, 4, 1, 2, 3, 4, 1, ...],
    downbeats=[0.33, 1.94, 3.53, ...],
    segments=[
      Segment(start=0.0, end=0.33, label='start'),
      Segment(start=0.33, end=13.13, label='intro'),
      Segment(start=13.13, end=37.53, label='chorus'),
      Segment(start=37.53, end=51.53, label='verse'),
      Segment(start=51.53, end=64.34, label='verse'),
      Segment(start=64.34, end=89.93, label='chorus'),
      Segment(start=89.93, end=105.93, label='bridge'),
      Segment(start=105.93, end=134.74, label='chorus'),
      Segment(start=134.74, end=153.95, label='chorus'),
      Segment(start=153.95, end=154.67, label='end'),
    ]),
  ```
  Unlike CLI, it does not save the results to disk by default. You can save them as follows:
  ```python
  result = allin1.analyze(
    'your_audio_file.wav',
    out_dir='./struct',
  )
  ```

  - `paths` : `Union[PathLike, List[PathLike]]`
  List of paths or a single path to the audio files to be analyzed.
  - `out_dir` : `PathLike` (optional)
  Path to the directory where the analysis results will be saved. By default, the results will not be saved.
  - `visualize` : `Union[bool, PathLike]` (optional)
  Whether to visualize the analysis results or not. If a path is provided, the visualizations will be saved in that directory. Default is False. If True, the visualizations will be saved in './viz'.
  - `sonify` : `Union[bool, PathLike]` (optional)
  Whether to sonify the analysis results or not. If a path is provided, the sonifications will be saved in that directory. Default is False. If True, the sonifications will be saved in './sonif'.
  - `model` : `str` (optional)
  Name of the pre-trained model to be used for the analysis. Default is 'harmonix-all'. Please refer to the documentation for the available models.
  - `device` : `str` (optional)
  Device to be used for computation. Default is 'cuda' if available, otherwise 'cpu'.
  - `include_activations` : `bool` (optional)
  Whether to include activations in the analysis results or not.
  - `include_embeddings` : `bool` (optional)
  Whether to include embeddings in the analysis results or not.
  - `demix_dir` : `PathLike` (optional)
  Path to the directory where the source-separated audio will be saved. Default is './demix'.
  - `spec_dir` : `PathLike` (optional)
  Path to the directory where the spectrograms will be saved. Default is './spec'.
  - `keep_byproducts` : `bool` (optional)
  Whether to keep the source-separated audio and spectrograms or not. Default is False.
  - `multiprocess` : `bool` (optional)
  Whether to use multiprocessing for extracting spectrograms. Default is True.

  - `Union[AnalysisResult, List[AnalysisResult]]`
  Analysis results for the provided audio files.

  Loads the analysis results from the disk.
  ```python
  result = allin1.load_result('./struct/24k_Magic.json')
  ```

  Visualizes the analysis results.
  ```python
  fig = allin1.visualize(result)
  fig.show()
  ```

  - `result` : `Union[AnalysisResult, List[AnalysisResult]]`
  List of analysis results or a single analysis result to be visualized.
  - `out_dir` : `PathLike` (optional)
  Path to the directory where the visualizations will be saved. By default, the visualizations will not be saved.

  - `Union[Figure, List[Figure]]`
  List of figures or a single figure containing the visualizations. `Figure` is a class from `matplotlib.pyplot`.

  Sonifies the analysis results.
  It will mix metronome clicks for beats and downbeats, and event sounds for segment boundaries
  to the original audio file.
  ```python
  y, sr = allin1.sonify(result)


  ```

  - `result` : `Union[AnalysisResult, List[AnalysisResult]]`
  List of analysis results or a single analysis result to be sonified.
  - `out_dir` : `PathLike` (optional)
  Path to the directory where the sonifications will be saved. By default, the sonifications will not be saved.

  - `Union[Tuple[NDArray, float], List[Tuple[NDArray, float]]]`
  List of tuples or a single tuple containing the sonified audio and the sampling rate.

  This package provides a simple visualization (`-v` or `--visualize`) and sonification (`-s` or `--sonify`) function for the analysis results.
  ```shell
  allin1 -v -s your_audio_file.wav
  ```
  The visualizations will be saved in the `./viz` directory by default:
  ```shell
  ./viz
  └── your_audio_file.pdf
  ```
  The sonifications will be saved in the `./sonif` directory by default:
  ```shell
  ./sonif
  └── your_audio_file.sonif.wav
  ```
  For example, a visualization looks like this:
  ![Visualization](./assets/viz.png)
  You can try it at [Hugging Face Space](https://huggingface.co/spaces/taejunkim/all-in-one).

  The models are trained on the [Harmonix Set](https://github.com/urinieto/harmonixset) with 8-fold cross-validation.
  For more details, please refer to the [paper](http://arxiv.org/abs/2307.16425).
  * `harmonix-all`: (Default) An ensemble model averaging the predictions of 8 models trained on each fold.
  * `harmonix-foldN`: A model trained on fold N (0~7). For example, `harmonix-fold0` is trained on fold 0.
  By default, the `harmonix-all` model is used. To use a different model, use the `--model` option:
  ```shell
  allin1 --model harmonix-fold0 your_audio_file.wav
  ```

  With an RTX 4090 GPU and Intel i9-10940X CPU (14 cores, 28 threads, 3.30 GHz),
  the `harmonix-all` model processed 10 songs (33 minutes) in 73 seconds.

  This package provides researchers with advanced options to extract **frame-level raw activations and embeddings**
  without post-processing. These have a resolution of 100 FPS, equivalent to 0.01 seconds per frame.


  The `--activ` option also saves frame-level raw activations from sigmoid and softmax:
  ```shell
  $ allin1 --activ your_audio_file.wav
  ```
  You can find the activations in the `.npz` file:
  ```shell
  ./struct
  └── your_audio_file1.json
  └── your_audio_file1.activ.npz
  ```
  To load the activations in Python:
  ```python
  >>> import numpy as np
  >>> activ = np.load('./struct/your_audio_file1.activ.npz')
  >>> activ.files
  ['beat', 'downbeat', 'segment', 'label']
  >>> beat_activations = activ['beat']
  >>> downbeat_activations = activ['downbeat']
  >>> segment_boundary_activations = activ['segment']
  >>> segment_label_activations = activ['label']
  ```
  Details of the activations are as follows:
  * `beat`: Raw activations from the **sigmoid** layer for **beat tracking** (shape: `[time_steps]`)
  * `downbeat`: Raw activations from the **sigmoid** layer for **downbeat tracking** (shape: `[time_steps]`)
  * `segment`: Raw activations from the **sigmoid** layer for **segment boundary detection** (shape: `[time_steps]`)
  * `label`: Raw activations from the **softmax** layer for **segment labeling** (shape: `[label_class=10, time_steps]`)
  You can access the label names as follows:
  ```python
  >>> allin1.HARMONIX_LABELS
  ['start',
   'end',
   'intro',
   'outro',
   'break',
   'bridge',
   'inst',
   'solo',
   'verse',
   'chorus']
  ```

  This package also provides an option to extract raw embeddings from the model.
  ```shell
  $ allin1 --embed your_audio_file.wav
  ```
  You can find the embeddings in the `.npy` file:
  ```shell
  ./struct
  └── your_audio_file1.json
  └── your_audio_file1.embed.npy
  ```
  To load the embeddings in Python:
  ```python
  >>> import numpy as np
  >>> embed = np.load('your_audio_file1.embed.npy')
  ```
  Each model embeds for every source-separated stem per time step,
  resulting in embeddings shaped as `[stems=4, time_steps, embedding_size=24]`:
  1. The number of source-separated stems (the order is bass, drums, other, vocals).
  2. The number of time steps (frames). The time step is 0.01 seconds (100 FPS).
  3. The embedding size of 24.
  Using the `--embed` option with the `harmonix-all` ensemble model will stack the embeddings,
  saving them with the shape `[stems=4, time_steps, embedding_size=24, models=8]`.

  The Python API `allin1.analyze()` offers the same options as the CLI:
  ```python
  >>> allin1.analyze(
        paths='your_audio_file.wav',
        include_activations=True,
        include_embeddings=True,
      )
  AnalysisResult(
    path='/path/to/your_audio_file.wav',
    bpm=100,
    beats=[...],
    downbeats=[...],
    segments=[...],
    activations={
      'beat': array(...),
      'downbeat': array(...),
      'segment': array(...),
      'label': array(...)
    },
    embeddings=array(...),
  )
  ```

  Due to variations in decoders, MP3 files can have slight offset differences.
  I recommend you to first convert your audio files to WAV format using FFmpeg (as shown below),
  and use the WAV files for all your data processing pipelines.
  ```shell
  ffmpeg -i your_audio_file.mp3 your_audio_file.wav
  ```
  In this package, audio files are read using [Demucs](https://github.com/facebookresearch/demucs).
  To my understanding, Demucs converts MP3 files to WAV using FFmpeg before reading them.
  However, using a different MP3 decoder can yield different offsets.
  I've observed variations of about 20~40ms, which is problematic for tasks requiring precise timing like beat tracking,
  where the conventional tolerance is just 70ms.
  Hence, I advise standardizing inputs to the WAV format for all data processing,
  ensuring straightforward decoding.

  Please refer to [TRAINING.md](TRAINING.md).

  If you use this package for your research, please cite the following paper:
  ```bibtex
  @inproceedings{taejun2023allinone,
    title={All-In-One Metrical And Functional Structure Analysis With Neighborhood Attentions on Demixed Audio},
    author={Kim, Taejun and Nam, Juhan},
    booktitle={IEEE Workshop on Applications of Signal Processing to Audio and Acoustics (WASPAA)},
    year={2023}
  }
  ```


pkgId: ff3b7e5055952fc06d853749e0979d0d938496abfd6bc5228c4646088303b7dd
name: python-allms
arch: src
version: 1.0.10
epoch: 0
release: 1
summary: please add a summary manually as the author left a blank one
url: https://pypi.org/project/allms/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allms-1.0.10-1.src.rpm
checksum_type: sha256
description:
  ___


  allms is a versatile and powerful library designed to streamline the process of querying Large Language Models
  (LLMs) 🤖💬

  Developed by the Allegro engineers, allms is based on popular libraries like transformers, pydantic, and langchain. It takes care
  of the boring boiler-plate code you write around your LLM applications, quickly enabling you to prototype ideas, and eventually helping you to scale up
  for production use-cases!

  Among the allms most notable features, you will find:

  * **😊 Simple and User-Friendly Interface**: The module offers an intuitive and easy-to-use interface, making it straightforward to work with the model.

  * **🔀 Asynchronous Querying**: Requests to the model are processed asynchronously by default, ensuring efficient and non-blocking interactions.

  * **🔄 Automatic Retrying Mechanism** : The module includes an automatic retrying mechanism, which helps handle transient errors and ensures that queries to the model are robust.

  * **🛠️ Error Handling and Management**: Errors that may occur during interactions with the model are handled and managed gracefully, providing informative error messages and potential recovery options.

  * **⚙️ Output Parsing**: The module simplifies the process of defining the model's output format as well as parsing and working with it, allowing you to easily extract the information you need.

  ___



  | LLM Family  | Hosting             | Supported LLMs                                                   |
  |-------------|---------------------|------------------------------------------------------------------|
  | GPT(s)      | OpenAI endpoint     | `gpt-3.5-turbo`, `gpt-4`, `gpt-4-turbo`, `gpt4-o`, `gpt4-o mini` |
  | Google LLMs | VertexAI deployment | `text-bison@001`, `gemini-pro`, `gemini-flash`                   |
  | Llama2      | Azure deployment    | `llama2-7b`, `llama2-13b`, `llama2-70b`                          |
  | Mistral     | Azure deployment    | `Mistral-7b`, `Mixtral-7bx8`                                     |
  | Gemma       | GCP deployment      | `gemma`                                                          |

  * Do you already have a subscription to a Cloud Provider for any the models above? Configure
  the model using your credentials and start querying!
  * Are you interested in knowing how to self-deploy open-source models in Azure and GCP?
  Consult our [guide](https://allms.allegro.tech/usage/deploy_open_source_models/)

  ___



  Full documentation available at **[allms.allegro.tech](https://allms.allegro.tech/)**

  Get familiar with allms 🚀: [introductory jupyter notebook](https://github.com/allegro/allms/blob/main/examples/introduction.ipynb)

  ___





  Install the package via pip:

  ```
  pip install allms
  ```



  Configure endpoint credentials and start querying the model with any prompt:

  ```python
  from allms.models import AzureOpenAIModel
  from allms.domain.configuration import AzureOpenAIConfiguration

  configuration = AzureOpenAIConfiguration(
     api_key="your-secret-api-key",
     base_url="https://endpoint.openai.azure.com/",
     api_version="2023-03-15-preview",
     deployment="gpt-35-turbo",
     model_name="gpt-3.5-turbo"
  )

  gpt_model = AzureOpenAIModel(config=configuration)
  gpt_response = gpt_model.generate(prompt="Plan me a 3-day holiday trip to Italy")
  ```

  You can pass also a system prompt:

  ```python
  gpt_response = gpt_model.generate(
      system_prompt="You are an AI assistant acting as a trip planner",
      prompt="Plan me a 3-day holiday trip to Italy"
  )
  ```





  If you want to generate responses for a batch of examples, you can achieve this by preparing a prompt with symbolic
  variables and providing input data that will be injected into the prompt. Symbolic variables can be more than one.

  ```python
  positive_review_0 = "Very good coffee, lightly roasted, with good aroma and taste. The taste of sourness is barely noticeable (which is good because I don't like sour coffees). After grinding, the aroma spreads throughout the room. I recommend it to all those who do not like strongly roasted and pitch-black coffees. A very good solution is to close the package with string, which allows you to preserve the aroma and freshness."
  positive_review_1 = "Delicious coffee!! Delicate, just the way I like it, and the smell after opening is amazing. It smells freshly roasted. Faithful to Lavazza coffee for years, I decided to look for other flavors. Based on the reviews, I blindly bought it and it was a 10-shot, it outperformed Lavazze in taste. For me the best."
  negative_review = "Marketing is doing its job and I was tempted too, but this coffee is nothing above the level of coffees from the supermarket. And the method of brewing or grinding does not help here. The coffee is simply weak - both in terms of strength and taste. I do not recommend."

  prompt = "You'll be provided with a review of a coffe. Decide if the review is positive or negative. Review: {review}"
  input_data = [
      InputData(input_mappings={"review": positive_review_0}, id="0"),
      InputData(input_mappings={"review": positive_review_1}, id="1"),
      InputData(input_mappings={"review": negative_review}, id="2")
  ]

  responses = model.generate(prompt=prompt, input_data=input_data)







  ```



  Through pydantic integration, in allms you can pass an output dataclass and force the LLM to provide
  you the response in a structured way.

  ```python
  from pydantic import BaseModel, Field

  class ReviewOutputDataModel(BaseModel):
      summary: str = Field(description="Summary of a product description")
      should_buy: bool = Field(description="Recommendation whether I should buy the product or not")
      brand_name: str = Field(description="Brand of the coffee")
      aroma:str = Field(description="Description of the coffee aroma")
      cons: list[str] = Field(description="List of cons of the coffee")


  review = "Marketing is doing its job and I was tempted too, but this Blue Orca coffee is nothing above the level of coffees from the supermarket. And the method of brewing or grinding does not help here. The coffee is simply weak - both in terms of strength and taste. I do not recommend."

  prompt = "Summarize review of the coffee. Review: {review}"
  input_data = [InputData(input_mappings={"review": review}, id="0")]

  responses = model.generate(
      prompt=prompt,
      input_data=input_data,
      output_data_model_class=ReviewOutputDataModel
  )
  response = responses[0].response















  ```
  ___





  We assume that you have python `3.10.*` installed on your machine.
  You can set it up using [pyenv](https://github.com/pyenv/pyenv#installationbrew)
  ([How to install pyenv on MacOS](https://jordanthomasg.medium.com/python-development-on-macos-with-pyenv-2509c694a808)). To install allms env locally:

  * Activate your pyenv;
  * Install Poetry via:

  ```bash
  make install-poetry
  ```

  * Install allms dependencies with the command:

  ```bash
  make install-env
  ```

  * Now you can use this venv for development. You can activate it in your shell by running:

  ```bash
  make activate-env # or simply, poetry shell
  ```



  In order to execute tests, run:

  ```bash
  make tests
  ```



  Run `mkdocs serve` to serve a local instance of the documentation.

  Modify the content of `docs` directory to update the documentation. The updated content will be deployed
  via the github action `.github/workflows/docs.yml`



  When a new version of allms is ready to be released, do the following operations:

  1. **Merge to master** the dev branch in which the new version has been specified:
      1. In this branch, `version` under `[tool.poetry]` section in `pyproject.toml` should be updated, e.g `0.1.0`;
      2. Update the CHANGELOG, specifying the new release.

  2. **Tag the new master** with the name of the newest version:
      1. e.g `v0.1.0`.

  3. **Publish package to PyPI**:
      1. Go to _Actions_ → _Manual Publish To PyPI_;
      2. Select "master" as branch and click _Run workflow_;
      3. If successful, you will find the package under # TODO: open-source.

  4. **Make a GitHub release**:
      1. Go to _Releases_ → _Draft a new release_;
      2. Select the recently created tag in _Choose a tag_ window;
      3. Copy/paste all the content present in the CHANGELOG under the version you are about to release;
      4. Upload `allms-<NEW-VERSION>.whl` and `allms-<NEW-VERSION>.tar.gz` as assets;
      5. Click `Publish release`.


pkgId: 3da08ce90aca701c11b0990d68b180d0a7b488c59aa4b013a8b16673dca8d90d
name: python-allocmd
arch: src
version: 2.0.10
epoch: 0
release: 1
summary: A CLI tool for creating Allora Chain Worker Nodes
url: https://pypi.org/project/allocmd/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allocmd-2.0.10-1.src.rpm
checksum_type: sha256
description:
  ![Docker!](https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge&logo=docker&logoColor=white)
  ![Python!](https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python&logoColor=blue)
  ![Apache License](https://img.shields.io/badge/Apache%20License-D22128?style=for-the-badge&logo=Apache&logoColor=white)

  The `allocmd` is a CLI tool that handles seamless creation of Allora external resources built to integrate with Allora chain. With this tool, you do not need to write the worker or reputer node or even a validator from scratch, the CLI tool will help you bootstrap all the needed components to get resource working.

  The following are the list of stuff that can don with this tool at the moment
  1. Generating worker node files
  2. Genrating reputer node files
  3. Generating validator node files
  4. Funding of edgenet account addresses

  for all the files generation commands, the tool will help in generation of the needed files and their respective docker files and you can spin them up as usual docker containers with docker-compose



  You will begin with installing the tool on your machine.

  ```shell
  pip install allocmd
  ```

  > you should use version 1.0.0 for Allora Chain v1 and version 2.0.0 for Allora Chain v2. Run `allocmd --help` to get general help or `allocmd [command] --help` to get help relating to a particular command.



  > Note that all commands here will pass for both worker or reputer node

  The next step is initializing the CLI to bootstrap all the needed components to get your worker or reputer running. The following command will handle the initialization process. It will create all the files in the appropriate directories and generate identities for your node to be used for local development.

  ```shell
  allocmd generate worker --name <preffered name> --topic <topic id> --env dev
  ```

  Before running this command you will have to [pick the topic Id ](https://docs.allora.network/devs/existing-topics) you wish to generate inference for after which you can run this command with the topic Id. The command will auto-create some files, the most important of which is the `dev-docker-compose.yaml`file which is an already complete docker-compose that you can run immediately to see your worker/reputer and head nodes running perfectly on your local machine. You can edit the files as you wish. for instance the `main.py` is meant for you to call your inference server, hence you will have to edit the sample code with actual URLs and logic as you prefer.

  When you run the docker-compose (`docker-compose -f dev-docker-compose.yaml up --build`), maybe after you have written and tested your logic in `main.py`, you then should be seeing the logs from the nodes, and you should be able to make a request to your head node and see it get a response from the worker/reputer node. Note that in production, you won't be the one to make the inference request, as the Allora chain will do this at the cadence provided by the topic creator.

  You can test your node by running the following curl command:

  ```
  curl --location 'http://localhost:6000/api/v1/functions/execute' --header 'Accept: application/json, text/plain, */*' --header 'Content-Type: application/json;charset=UTF-8' --data '{
      "function_id": "bafybeigpiwl3o73zvvl6dxdqu7zqcub5mhg65jiky2xqb4rdhfmikswzqm",
      "method": "allora-inference-function.wasm",
      "parameters": null,
      "topic": "<TOPIC_ID>",
      "config": {
          "env_vars": [
              {
                  "name": "BLS_REQUEST_PATH",
                  "value": "/api"
              },
              {
                  "name": "ALLORA_ARG_PARAMS",
                  "value": "<argument>"
              }
          ],
          "number_of_nodes": -1,
          "timeout" : 2
      }
  }' | jq
  ```

  The `<TOPIC_ID>` needs to be [an existing topic on the chain](https://docs.allora.network/devs/existing-topics). The `<argument>` is what the topic is expecting to receive to perform the inference (as an indication to test, you can use the `DefaultArg`  value from the topic on-chain, e.g. for ETH prediction topic, it should be `"ETH"`).



  Your worker/reputer node is now ready to be deployed, the `main.py` has been modified, all env variables passed, and the worker/reputer node is running locally and you are now ready to deploy your worker/reputer to run in the production environment. The following command will handle the generation of the `prod-docker-compose.yaml` file which contains all the keys and parameters needed for your worker/reputer to function perfectly in production.

  ```shell
  allocmd generate worker --env prod
  ```

  By running this command, `prod-docker-compose.yaml` will be generated with appropriate keys and parameters. You can now run the docker-compose file or deploy the whole codebase in your preferred cloud instance. At this stage, your worker should be responding to inference request from the Allora Chain.


  ```shell
  allocmd generate validator --name <validator-name> --network <edgenet>
  ```
  The above command can generate validator files and you can then use docker-compose to deploy


  ```shell
  allocmd fund <address>
  ```
  The above command takes address and fund the account with Allora Faucet


pkgId: 0d5e6fe2adcd6180d99081d96f1009ba9446151daeff450262d0751a5af4a745
name: python-allofplos
arch: src
version: 1.0.1
epoch: 0
release: 1
summary: Get and analyze all PLOS articles
url: https://pypi.org/project/allofplos/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allofplos-1.0.1-1.src.rpm
checksum_type: sha256
rpm_license:
  MIT License  Copyright (c) 2017 Public Library of Science (PLOS)  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


pkgId: 9dda5a9588aede8c846d0ea3ea34d815ba59dd94bb4309460337c220618c88b8
name: python-allonias3
arch: src
version: 1.5.2
epoch: 0
release: 1
summary: Class to interact with S3 in a similar fashion as pathlib.Path
url: https://pypi.org/project/allonias3/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allonias3-1.5.2-1.src.rpm
checksum_type: sha256
description:
  This project contains the :obj:`~allonias3.s3_path.S3Path` class that allows the user to interact with
  its S3 repository in a similar fashion as [pathlib.Path](https://docs.python.org/3/library/pathlib.html)

  Even though it is a public package, it is not intended to be used outside
  AllOnIA's plateform.

  You can find the user documentation at [this URL](https://aleia-team.gitlab.io/public/allonias3)

  This is a public project. Everyone is welcome to contribute to it.



  See :ref:`basicusage`



  ```bash
  pip install allonias3[boto,datatypehandler]
  ```

   * By default, :obj:`~allonias3.s3_path.S3Path` will use a Minio client by
     inheriting from :obj:`~allonias3.minio.minio_path.MinioPath`. You can choose to use
     boto instead, by choosing "boto" as an optional dependency and `USE_BOTO=True`
     in your environment variables. Then, :obj:`~allonias3.s3_path.S3Path`
     will inherit from :obj:`~allonias3.boto.boto_path.BotoPath`. In both cases
     the methods will take exactly the same input and return the same output.
   * Writing and reading data to S3 can be enhanced to support many data types,
     like :obj:`~pandas.DataFrame` to/from *.csv* files, by specifying
     "datatypehandler" as an optional dependency.



  This is an open-source project. Everyone is welcome to contribute to it. To do
  so, fork the repository, add your features/fixes on your forked repository,
  then open a merge request to the original repository.



  This project uses [Poetry](https://python-poetry.org/) to manage its
  working environment. Install it before coding in the project.

  Then, run

   ```bash
  poetry env use python3.12
  poetry install
  poetry run pre-commit install
  ```

  This package has two sets of optional libraries, that you can install with

  ```bash
  poetry install -E boto

  poetry install -E datatypehandler

  poetry install -E datatypehandler -E boto
  ```



  Tests are separated into several groups, that can require different packages.

  You can run them all using tox:

  ```bash
  poetry run tox
  ```

  You can also run them individually by running commands that you can find
  in [tox.ini](tox.ini).

  Some tests can not be run un parallel, the "-n 0" args is then require. Refer
  to the [tox.ini](tox.ini) file to find which tests are concerned.



  We use `pytest-cov` to display the coverage, so, after run
  tests you can check the reports (term, html, xml are enabled), if you want to
  improve your coverage, the better thing to do is to check the html report in
  your browser:

  ```bash
  open htmlcov/index.html
  ```



  To run the linters used by this project, you can run:

  ```bash
  poetry run pre-commit run # Run lint only on staged files


  poetry run pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
  ```



  The documentation source files are located in [here](docs/source/). If you add
  new features, please add them to the documentation as well.

  You can buid the documentation locally by doing

  ```bash
  cd docs
  make html
  ```

  The produced documentation should then be readable by opening the file in
  docs/build/html/index.html in a web browser.


pkgId: 84f9dba5023b75224e0f9c52912aeec135302764e80fc2b28e454101821e5011
name: python-allora-wkr
arch: src
version: 0.1.34
epoch: 0
release: 1
summary: A CLI tool for creating Allora Chain Worker Nodes
url: https://pypi.org/project/allora-wkr/
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allora-wkr-0.1.34-1.src.rpm
checksum_type: sha256
description:
  Find the comprehensive documentation [here](<https://docs.allora.network/docs/how-to-build-and-deploy-inference-worker#building-a-worker-node-with-the-allora-wkr-cli>)


pkgId: 159fd1e0d776401aeae65bb2fb2d12ee38174b671c74de41ea957513f69b8860
name: python-allotropy
arch: src
version: 0.1.61
epoch: 0
release: 1
summary: Converts to ASM (Allotrope Simple Model) from various file formats.
url: https://pypi.org/project/allotropy/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allotropy-0.1.61-1.src.rpm
checksum_type: sha256
description:
  \*Allotrope® is a registered trademark of the Allotrope Foundation; no affiliation with the Allotrope Foundation is claimed or implied.


  Welcome to `allotropy` -- a Python library by Benchling for converting instrument data into the Allotrope Simple Model (ASM).

  The objective of this library is to read text or Excel based instrument software output and return a JSON representation that conforms to the published ASM schema. Note that some schemas do not yet match the published ASM schema, in these cases the CHANGE_NOTES.md file included alongside the schema details the differences and proposed changes to ASM or the library schema. The code in this library does not convert from proprietary/binary output formats and so has no need to interact with any of the specific vendor softwares.

  If you aren't familiar with Allotrope, we suggest you start by reading the [Allotrope Product Overview](https://www.allotrope.org/product-overview).

  We have chosen to have this library output ASM since JSON is easy to read and consume in most modern systems and can be checked by humans without any special tools needed. All of the published open source ASMs can be found in the [ASM Gitlab repository](https://gitlab.com/allotrope-public/asm).

  We currently have parser support for the following instruments:


    - Agilent Gen5
    - Agilent Gen5 Image
    - Agilent TapeStation Analysis
    - AppBio AbsoluteQ
    - AppBio QuantStudio Design & Analysis
    - AppBio QuantStudio RT-PCR
    - BMG MARS
    - Beckman PharmSpec
    - Beckman Vi-Cell BLU
    - Beckman Vi-Cell XR
    - Bio-Rad Bio-Plex Manager
    - CTL ImmunoSpot
    - ChemoMetec Nucleoview
    - Chemometec NC View
    - Luminex xPONENT
    - Mabtech Apex
    - Methodical Mind
    - Molecular Devices SoftMax Pro
    - NovaBio Flex2
    - PerkinElmer Envision
    - Qiacuity dPCR
    - Revvity Kaleido
    - Revvity Matrix
    - Roche Cedex BioHT
    - Roche Cedex HiRes
    - Thermo Fisher Genesys30
    - Thermo Fisher NanoDrop 8000
    - Thermo Fisher NanoDrop Eight
    - Thermo Fisher Nanodrop One
    - Thermo Fisher Qubit 4
    - Thermo Fisher Qubit Flex
    - Thermo SkanIt
    - Unchained Labs Lunatic





  The parsers follow maturation levels of: Recommended, Candidate Release, Working Draft - see [release_state.py](https://github.com/Benchling-Open-Source/allotropy/blob/main/src/allotropy/parsers/release_state.py) for additional details.

  This code is published under the permissive MIT license because we believe that standardized instrument data is a benefit for everyone in science.



  We welcome community contributions to this library and we hope that together we can expand the coverage of ASM-ready data for everyone. If you are interested, please read our [contribution guidelines](CONTRIBUTING.md).




  Convert a file to an ASM dictionary:

  ```sh
  from allotropy.parser_factory import Vendor
  from allotropy.to_allotrope import allotrope_from_file

  asm_schema = allotrope_from_file("filepath.txt", Vendor.MOLDEV_SOFTMAX_PRO)
  ```

  or, convert any IO:

  ```sh
  from allotropy.parser_factory import Vendor
  from allotropy.to_allotrope import allotrope_from_io

  with open("filename.txt") as f:
      asm_schema = allotrope_from_io(f, Vendor.MOLDEV_SOFTMAX_PRO)

  bytes_io = BytesIO(file_stream)
  asm_schema = allotrope_from_io(bytes_io, Vendor.MOLDEV_SOFTMAX_PRO)
  ```



  `.gitignore`: used standard GitHub Python template and added their recommended JetBrains lines




  Install Hatch: https://hatch.pypa.io/latest/
  Install Python: https://www.python.org/downloads/
  This library supports Python 3.10 or higher. Hatch will install a matching version of Python (defined in `pyproject.toml`) when it sets up your environment.

  Tell git to use .githooks:
  ```sh
  git config core.hooksPath .githooks
  ```



  To add requirements used by the library, update `dependencies` in `pyproject.toml`:
  - For project dependencies, update `dependencies` under `[project]`.
  - For script dependencies, update `dependencies` under `[tool.hatch.envs.default]`.
  - For lint dependencies, update `dependencies` under `[tool.hatch.envs.lint]`.
  - For test dependencies, update `dependencies` under `[tool.hatch.envs.test]`.


  List all environments:
  ```sh
  hatch env show
  ```

  Run all lint:
  ```sh
  hatch run lint:all
  ```

  Auto-fix all possible lint issues:
  ```sh
  hatch run fix
  ```

  Run all tests:
  ```sh
  hatch run test
  ```

  Run a specific test file (replace the filepath with your own):
  ```sh
  hatch run test tests/allotrope/allotrope_test.py
  ```

  Run all tests with coverage:
  ```sh
  hatch run test:cov
  ```

  Spawn a shell within an environment for development:
  ```sh
  hatch shell
  ```



  NOTE: only package admins can publish allotropy.

  To publish a new version:

  ```sh
  hatch run scripts:update-version
  ```

  Merge the resulting PR, and then run on `main`:
  ```
  hatch build
  hatch publish
  ```


pkgId: 5533c11f6516aa69791c4f16aa62915fb3347e6cbd0bd21dd2a97c589796a028
name: python-allotropy
arch: src
version: 0.1.64
epoch: 0
release: 1
summary: Converts to ASM (Allotrope Simple Model) from various file formats.
url: https://pypi.org/project/allotropy/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allotropy-0.1.64-1.src.rpm
checksum_type: sha256
description:
  \*Allotrope® is a registered trademark of the Allotrope Foundation; no affiliation with the Allotrope Foundation is claimed or implied.


  Welcome to `allotropy` -- a Python library by Benchling for converting instrument data into the Allotrope Simple Model (ASM).

  View the list of instrument software currently supported in [SUPPORTED_INSTRUMENT_SOFTWARE](https://github.com/Benchling-Open-Source/allotropy/blob/main/SUPPORTED_INSTRUMENT_SOFTWARE.adoc).

  The objective of this library is to read text or Excel based instrument software output and return a JSON representation that conforms to the published ASM schema. Note that some schemas do not yet match the published ASM schema, in these cases the CHANGE_NOTES.md file included alongside the schema details the differences and proposed changes to ASM or the library schema. The code in this library does not convert from proprietary/binary output formats and so has no need to interact with any of the specific vendor softwares.

  If you aren't familiar with Allotrope, we suggest you start by reading the [Allotrope Product Overview](https://www.allotrope.org/product-overview).

  We have chosen to have this library output ASM since JSON is easy to read and consume in most modern systems and can be checked by humans without any special tools needed. All of the published open source ASMs can be found in the [ASM Gitlab repository](https://gitlab.com/allotrope-public/asm).

  This code is published under the permissive MIT license because we believe that standardized instrument data is a benefit for everyone in science.


  We welcome community contributions to this library and we hope that together we can expand the coverage of ASM-ready data for everyone. If you are interested, please read our [contribution guidelines](CONTRIBUTING.md).




  Convert a file to an ASM dictionary:

  ```sh
  from allotropy.parser_factory import Vendor
  from allotropy.to_allotrope import allotrope_from_file

  asm_schema = allotrope_from_file("filepath.txt", Vendor.MOLDEV_SOFTMAX_PRO)
  ```

  or, convert any IO:

  ```sh
  from allotropy.parser_factory import Vendor
  from allotropy.to_allotrope import allotrope_from_io

  with open("filename.txt") as f:
      asm_schema = allotrope_from_io(f, Vendor.MOLDEV_SOFTMAX_PRO)

  bytes_io = BytesIO(file_stream)
  asm_schema = allotrope_from_io(bytes_io, Vendor.MOLDEV_SOFTMAX_PRO)
  ```



  `.gitignore`: used standard GitHub Python template and added their recommended JetBrains lines




  Install Hatch: https://hatch.pypa.io/latest/
  Install Python: https://www.python.org/downloads/
  This library supports Python 3.10 or higher. Hatch will install a matching version of Python (defined in `pyproject.toml`) when it sets up your environment.

  Tell git to use .githooks:
  ```sh
  git config core.hooksPath .githooks
  ```



  To add requirements used by the library, update `dependencies` in `pyproject.toml`:
  - For project dependencies, update `dependencies` under `[project]`.
  - For script dependencies, update `dependencies` under `[tool.hatch.envs.default]`.
  - For lint dependencies, update `dependencies` under `[tool.hatch.envs.lint]`.
  - For test dependencies, update `dependencies` under `[tool.hatch.envs.test]`.


  List all environments:
  ```sh
  hatch env show
  ```

  Run all lint:
  ```sh
  hatch run lint:all
  ```

  Auto-fix all possible lint issues:
  ```sh
  hatch run fix
  ```

  Run all tests in the default python enviroment (currently: 3.11.9)
  ```sh
  hatch run test
  ```

  Run all tests against all supported python versions (currently 3.10-3.12)
  Note: this is checked against in CI - your change must pass this to merge.
  ```sh
  hatch run test_all:test
  ```

  Run against a specific python version (useful for debugging if a test is failing in one environment)
  ```sh
  hatch run test_all.py3.12:test
  ```

  Run a specific test file (replace the filepath with your own):
  ```sh
  hatch run test tests/allotrope/allotrope_test.py
  ```

  Run all tests with coverage:
  ```sh
  hatch run test:cov
  ```

  Spawn a shell within an environment for development:
  ```sh
  hatch shell
  ```



  NOTE: only package admins can publish allotropy.

  To publish a new version:

  ```sh
  hatch run scripts:update-version
  ```

  Merge the resulting PR, and then run on `main`:
  ```
  hatch build
  hatch publish
  ```


pkgId: 656e615471f00d0653d4526d06bf896c9d621e9c8d5fc57b7c17b72a22b81667
name: python-allotropy
arch: src
version: 0.1.65
epoch: 0
release: 1
summary: Converts to ASM (Allotrope Simple Model) from various file formats.
url: https://pypi.org/project/allotropy/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allotropy-0.1.65-1.src.rpm
checksum_type: sha256
description:
  \*Allotrope® is a registered trademark of the Allotrope Foundation; no affiliation with the Allotrope Foundation is claimed or implied.


  Welcome to `allotropy` -- a Python library by Benchling for converting instrument data into the Allotrope Simple Model (ASM).

  View the list of instrument software currently supported in [SUPPORTED_INSTRUMENT_SOFTWARE](https://github.com/Benchling-Open-Source/allotropy/blob/main/SUPPORTED_INSTRUMENT_SOFTWARE.adoc).

  The objective of this library is to read text or Excel based instrument software output and return a JSON representation that conforms to the published ASM schema. Note that some schemas do not yet match the published ASM schema, in these cases the CHANGE_NOTES.md file included alongside the schema details the differences and proposed changes to ASM or the library schema. The code in this library does not convert from proprietary/binary output formats and so has no need to interact with any of the specific vendor softwares.

  If you aren't familiar with Allotrope, we suggest you start by reading the [Allotrope Product Overview](https://www.allotrope.org/product-overview).

  We have chosen to have this library output ASM since JSON is easy to read and consume in most modern systems and can be checked by humans without any special tools needed. All of the published open source ASMs can be found in the [ASM Gitlab repository](https://gitlab.com/allotrope-public/asm).

  This code is published under the permissive MIT license because we believe that standardized instrument data is a benefit for everyone in science.


  We welcome community contributions to this library and we hope that together we can expand the coverage of ASM-ready data for everyone. If you are interested, please read our [contribution guidelines](CONTRIBUTING.md).




  Convert a file to an ASM dictionary:

  ```sh
  from allotropy.parser_factory import Vendor
  from allotropy.to_allotrope import allotrope_from_file

  asm_dict = allotrope_from_file("filepath.txt", Vendor.MOLDEV_SOFTMAX_PRO)
  ```

  or, convert any IO:

  ```sh
  from allotropy.parser_factory import Vendor
  from allotropy.to_allotrope import allotrope_from_io

  with open("filename.txt") as f:
      asm_dict = allotrope_from_io(f, Vendor.MOLDEV_SOFTMAX_PRO)

  bytes_io = BytesIO(file_stream)
  asm_dict = allotrope_from_io(bytes_io, Vendor.MOLDEV_SOFTMAX_PRO)
  ```



  `.gitignore`: used standard GitHub Python template and added their recommended JetBrains lines




  Install Hatch: https://hatch.pypa.io/latest/
  Install Python: https://www.python.org/downloads/
  This library supports Python 3.10 or higher. Hatch will install a matching version of Python (defined in `pyproject.toml`) when it sets up your environment.

  Tell git to use .githooks:
  ```sh
  git config core.hooksPath .githooks
  ```



  To add requirements used by the library, update `dependencies` in `pyproject.toml`:
  - For project dependencies, update `dependencies` under `[project]`.
  - For script dependencies, update `dependencies` under `[tool.hatch.envs.default]`.
  - For lint dependencies, update `dependencies` under `[tool.hatch.envs.lint]`.
  - For test dependencies, update `dependencies` under `[tool.hatch.envs.test]`.


  List all environments:
  ```sh
  hatch env show
  ```

  Run all lint:
  ```sh
  hatch run lint:all
  ```

  Auto-fix all possible lint issues:
  ```sh
  hatch run fix
  ```

  Run all tests in the default python enviroment (currently: 3.11.9)
  ```sh
  hatch run test
  ```

  Run all tests against all supported python versions (currently 3.10-3.12)
  Note: this is checked against in CI - your change must pass this to merge.
  ```sh
  hatch run test_all:test
  ```

  Run against a specific python version (useful for debugging if a test is failing in one environment)
  ```sh
  hatch run test_all.py3.12:test
  ```

  Run a specific test file (replace the filepath with your own):
  ```sh
  hatch run test tests/allotrope/allotrope_test.py
  ```

  Run all tests with coverage:
  ```sh
  hatch run test:cov
  ```

  Spawn a shell within an environment for development:
  ```sh
  hatch shell
  ```



  NOTE: only package admins can publish allotropy.

  To publish a new version:

  ```sh
  hatch run scripts:update-version
  ```

  Merge the resulting PR, and then run on `main`:
  ```
  hatch build
  hatch publish
  ```


pkgId: 52b77ef218981a3a22a11255eca917727d2d20a490c8a412b45e3d05420ce248
name: python-allow-extra-kwargs
arch: src
version: 0.1.1.post1
epoch: 0
release: 1
summary: A plugin for mypy that allows extra kwargs in function calls
url: https://pypi.org/project/allow-extra-kwargs/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allow-extra-kwargs-0.1.1.post1-1.src.rpm
checksum_type: sha256
description:
  ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/alexdrydew/allow-extra-kwargs/tests.yml)
  ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/allow-extra-kwargs)

  A plugin for mypy that allows extra kwargs in function calls.



  `allow-extra-kwargs` is a Python package that provides a decorator and a mypy plugin to allow functions to accept extra
  keyword arguments in a type-safe way.



  You can install `allow-extra-kwargs` using pip:

  ```bash
  pip install allow-extra-kwargs
  ```





  To use the `allow_extra_kwargs` decorator in your code:

  ```python
  from allow_extra_kwargs import allow_extra_kwargs


  @allow_extra_kwargs
  def my_function(a: int) -> int:
      return a



  result = my_function(1, extra_arg="value")
  ```



  To enable the mypy plugin, add the following to your pyproject.toml:

  ```
  [tool.mypy]
  plugins = ["allow_extra_kwargs.mypy"]
  ```


pkgId: e8df96169e2410e045bc635a869bc8c08a4e08d787e270f75eecc7ad5415aea0
name: python-allowed
arch: src
version: 1.5.1
epoch: 0
release: 1
summary: Check if a program only uses a subset of the Python language.
url: https://dsa-ou.github.io/allowed
rpm_license: BSD-3-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allowed-1.5.1-1.src.rpm
checksum_type: sha256
description:
  Courses often use a restricted subset of a programming language and its library,
  to reduce cognitive load, focus on concepts, simplify marking, etc.

  `allowed` is a program that checks if your code files and Jupyter notebooks only
  use the Python constructs that were taught.

  `allowed` enables instructors to check in advance their examples, exercises and assessment
  for inadvertent use of constructs that weren't taught. It also allows students
  and instructors to check submitted code against the taught constructs.
  To do its job, `allowed` requires a short file that lists which constructs were
  introduced in which 'unit' of the course. That file can be used as a reference
  document to onboard new tutors and to discuss the design of the course, e.g.
  to check if important constructs are missing or if some units are overloaded.

  Like all static analysis tools, `allowed` isn't perfect and will never be.
  There may be false positives (code reported to be a violation, but isn't)
  and false negatives (code that uses disallowed constructs but isn't reported).

  To refer to `allowed` in a publication, please cite
  > Michel Wermelinger.
  > [_Checking Conformance to a Subset of the Python Language_](https://oro.open.ac.uk/88862).
  > Proceedings of the Conference on Innovation and Technology in
  > Computer Science Education (ITiCSE), vol. 2, pp. 573–574. ACM, 2023.



  If you're an M269 student or tutor, follow the
  [M269 software](https://dsa-ou.github.io/m269-installer) installation instructions,
  and use the M269 technical forum or the tutor forum to report issues and ask questions.

  Otherwise, follow the [instructions](https://dsa-ou.github.io/allowed/docs/installation.html)
  on how to install, use and configure `allowed`.
  If you need help, post your query in the
  [Q & A discussion forum](https://github.com/dsa-ou/allowed/discussions/categories/q-a).



  Any help to improve `allowed` is welcome and appreciated.

  - If you use `allowed`, please share your experience and tips in the
    [show & tell forum](https://github.com/dsa-ou/allowed/discussions/categories/show-and-tell).
  - If you require a new feature, please suggest it in the
    [ideas discussion forum](https://github.com/dsa-ou/allowed/discussions/categories/ideas).
  - If you spot an error in the code or documentation, please check if it
    [has been reported](https://github.com/dsa-ou/allowed/issues), before creating a new issue.
  - If you want to contribute code or documentation that addresses
    an [open issue](https://github.com/dsa-ou/allowed/issues),
    please read first our [code contribution guide](https://dsa-ou.github.io/allowed/docs/contribution.html).
    Your contribution will become available under the terms below.



  The code and text in this repository are
  Copyright © 2023 by The Open University, UK.
  The code is licensed under a [BSD 3-clause licence](https://github.com/dsa-ou/allowed/blob/main/LICENCE.MD).
  The text is licensed under a
  [Creative Commons Attribution 4.0 International Licence](http://creativecommons.org/licenses/by/4.0).


pkgId: 74ba17abf87d256425d9a24c09325136c00e7fa2d10e22118d59bffdb877a3ea
name: python-allpairspy
arch: src
version: 2.5.1
epoch: 0
release: 1
summary: Pairwise test combinations generator
url: https://github.com/thombashi/allpairspy
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allpairspy-2.5.1-1.src.rpm
checksum_type: sha256
description:
  AllPairs is an open source test combinations generator written in
  Python, developed and maintained by MetaCommunications Engineering.
  The generator allows one to create a set of tests using "pairwise
  combinations" method, reducing a number of combinations of variables
  into a lesser set that covers most situations.
  For more info on pairwise testing see http://www.pairwise.org.


pkgId: 4139baf093733ca0d3305e9e068921677b376060df4c50f416c0a806c9651876
name: python-allspeak
arch: src
version: 1.4.2
epoch: 0
release: 1
summary: A pythonic internationalization and localization solution.
url: https://jpscaletti.com/allspeak
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allspeak-1.4.2-1.src.rpm
checksum_type: sha256
description:
  [![Build Status](https://travis-ci.org/jpscaletti/allspeak.svg?branch=master)](https://travis-ci.org/jpscaletti/allspeak)



  *Allspeak* is a pythonic (yet ironically inspired by Rails) internationalization and localization solution for Python web applications.

  It's flexible, easy to use and, unlike gettext, independent of any external compilation tool.

  This library **does not** use gettext -we find it cumbersome, to say the least-, but instead it works with translations in **YAML** files, compatible by those used with the Rails internationalization system, so you can use any third-party service already compatible with them (for example, [Transifex](https://www.transifex.com/)).

  It is powered by the [Babel](http://babel.pocoo.org/) and [pytz](http://pythonhosted.org/pytz/) libraries and tested with Python 3.5+

  Read the documentation here: <http://allspeak.lucuma.co>




  > "When Thor speaks with the All-Speak anyone who hears him will hear
  > him speak their native language in their hearts"
  > ------(from Thor's wiki page)




      $  pip install .
      $  pip install .[testing]

  To run the tests in your current Python version do:

      $  make test

  To run them in every supported Python version do:

      $  tox

  It might be also necessary to run the coverage report to make sure all lines
  of code are touch by the tests:

      $  make coverage

  Our test suite [runs continuously on Travis
  CI](https://travis-ci.org/jpscaletti/Allspeak) with every update.


pkgId: 6c25ee58e50aa4263b8578088bf5d03162c81d468017111451decd0ee7900c16
name: python-alluka
arch: src
version: 0.4.0
epoch: 0
release: 1
summary: A type based dependency injection framework for Python 3.9+.
url: https://github.com/FasterSpeeding/Alluka
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alluka-0.4.0-1.src.rpm
checksum_type: sha256
description:
  A type based dependency injection framework for Python 3.11.



  For how to get started with this library, see the [documentation](https://alluka.cursed.solutions/usage).



  You can install Alluka from PyPI using the following command in any Python 3.11 or above environment.

  ```
  python -m pip install -U alluka
  ```



  Before contributing you should read through the
  [contributing guidelines](https://github.com/FasterSpeeding/Alluka/blob/master/CONTRIBUTING.md) and
  the [code of conduct](https://github.com/FasterSpeeding/Alluka/blob/master/CODE_OF_CONDUCT.md).


pkgId: 432455a0661e40c88de5bd1de1c99e69463a5524f9c44899a8e9888e01754b62
name: python-allure-api-client
arch: src
version: 1.3.4
epoch: 0
release: 1
url: https://pypi.org/project/allure-api-client/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allure-api-client-1.3.4-1.src.rpm
checksum_type: sha256
summary:
  API Client for Python ^3.10 and Pytest projects. It includes the Allure request/response hooks and the status code checking inside the main method. Request hook generates cURL, Response hook represents the useful information.

description:
  The `allure-api-client` library is a Python package designed to facilitate API testing and reporting in Allure. Built on
  top of the `httpx` library, it provides both synchronous and asynchronous clients for making HTTP requests, complete
  with automatic request and response logging for Allure reports. The library also includes utilities for bearer token
  authentication and status code verification.



  - Synchronous and Asynchronous API Clients
  - Automatic logging of requests and responses in Allure reports
  - Bearer Token Authentication
  - Status Code Verification



  To install `allure-api-client`, you will need Python installed on your system. You can install the library using pip:

  ```bash
  pip install allure-api-client
  ```





  ```python
  from api_client import APIClient


  client = APIClient(
      base_url="https://api.example.com",
      auth=BearerToken("YOUR_ACCESS_TOKEN"),  # Optional
      verify=False  # Optional
  )


  response = client.send_request(
      method="GET",
      path="/endpoint"
  )
  ```



  ```python
  from api_client import AsyncAPIClient


  async with AsyncAPIClient(
          base_url="https://api.example.com",
          auth=BearerToken("YOUR_ACCESS_TOKEN"),  # Optional
          verify=False  # Optional
  ) as client:
      
      response = await client.send_request(
          method="GET",
          path="/endpoint"
      )
  ```



  ```python
  from api_client import BearerToken


  auth = BearerToken("YOUR_ACCESS_TOKEN")


  ```



  ```python
  from api_client import check_status_code


  check_status_code(response, 200)  # Verifies that the status code is 200
  ```



  Contributions to `allure-api-client` are welcome! Please follow the standard procedures to submit issues, pull requests,
  etc.



  `allure-api-client` is released under the [MIT License](LICENSE).


pkgId: f5132c5ca2195f2a7db5e70b67a8a1c981bc8f0021e2901606ea821316376df6
name: python-allure-behave
arch: src
version: 2.13.5
epoch: 0
release: 1
summary: Allure behave integration
url: https://allurereport.org/
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allure-behave-2.13.5-1.src.rpm
checksum_type: sha256
description:
  ```shell
  $ pip install allure-behave
  $ behave -f allure_behave.formatter:AllureFormatter -o %allure_result_folder% ./features
  $ allure serve %allure_result_folder%
  ```

  The current implementation of behave-parallel makes some allure features inaccessible.
  In this case you need to patch your environment.py files instead of using the formatter.
  If you don't use environment.py, just create a new one that calls Allure Behave like that:
  ```python
  from allure_behave.hooks import allure_report

  allure_report("path/to/result/dir")
  ```

  Learn more from [Allure behave's official documentation](https://allurereport.org/docs/behave/).


pkgId: a2ad10fe5099a83a3054459bb82b748629e99474ba6621ce5c36a2877fb95e91
name: python-allure-combine
arch: src
version: 1.0.11
epoch: 0
release: 1
summary: Generate single HTML file from allure report.
url: https://github.com/MihanEntalpo/allure-single-html-file
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allure-combine-1.0.11-1.src.rpm
checksum_type: sha256
description:
  Tool to build allure generated folder into a single html file



  After run by console command, or by call from python code, it:

  1. Reads contents of allure-generated folder
  2. Creates server.js file, which has all the data files inside and code to start fake XHR server
  3. Patches index.html file, so it's using server.js and sinon-9.2.4.js (Taken from [here](https://sinonjs.org/)), and could be run in any browser without --allow-file-access-from-files parameter of chrome browser
  4. Creates file complete.html with all files built-in in a single file



  * Python 3.6+
  * You need to have your allure report folder generated (`allure generate './some/path/to/allure/generated/folder'`)






  ```shell
  pip install allure-combine
  ```

  or:



  1. Clone repo

  ```bash
  git clone git@github.com:MihanEntalpo/allure-single-html-file.git
  cd allure-single-html-file
  ```

  2. Install requirements (actually there are only BeautifulSoup)

  ```bash
  pip install -r ./requirements.txt
  python setup.py install
  ```



  If you have cloned repo, not installed module via pip, replace `allure-combine` with `python ./allure_combine/combine.py` in following commands:

  1) Create complete.html file inside the allure folder itself

  ```bash
  allure-combine ./some/path/to/allure/generated/folder
  ```

  2) Create complete.html file inside specified folder:

  ```bash
  allure-combine ./some/path/to/allure/generated/folder --dest /tmp
  ```

  3) Ensure that specified dest folder exists (create if not)

  ```bash
  allure-combine ./some/path/to/allure/generated/folder --dest /tmp/allure-2022-05-05_12-20-01/result --auto-create-folders
  ```

  4) Remove sinon.js and server.js from allure folder after complete.html is generated:


  ```bash
  allure-combine ./some/path/to/allure/generated/folder --remove-temp-files
  ```

  5) If html/json files what should be utf-8 is has broken encoding, ignore errors:
  ```bash
  allure-combine ./some/path/to/allure/generated/folder --ignore-utf8-errors
  ```




  ```shell
  pip install allure-combine
  ```

  ```python
  from allure_combine import combine_allure


  combine_allure("./some/path/to/allure/generated/folder")


  combine_allure("./some/path/to/allure/generated/folder", dest_folder="/tmp")


  combine_allure(
      "./some/path/to/allure/generated/folder",
      dest_folder="/tmp/allure-2022-05-05_12-20-01/result",
      auto_create_folders=True
  )


  combine_allure(
      "./some/path/to/allure/generated/folder",
      remove_temp_files=True
  )


  combine_allure(
      "./some/path/to/allure/generated/folder",
      ignore_utf8_errors=True
  )


  ```



  * Functionality to open image or video in new browser tab doesn't work yet.
  * Need functionality to return combined file as a string, not saving it to a file directly
  * Functionality to not change source files at all, work in a read-only filesystem



  * Javascript port: https://github.com/aruiz-caritsqa/allure-single-html-file-js


pkgId: 902cc07eddd0751d2aa6e16fdfa953085a5b50404d8f94695d9ebaa0f5d11c58
name: python-allure-custom
arch: src
version: 2024.5.24
epoch: 0
release: 1
summary: allure custom
url: https://pypi.org/project/allure-custom/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allure-custom-2024.5.24-1.src.rpm
checksum_type: sha256
description:
  **Documentation**: <a href="https://funny-dream.github.io/allure-custom" target="_blank">https://funny-dream.github.io/allure-custom</a>


pkgId: 5736af2237904f6aa465768118fb9f2bc144a6ce5cd4ed283254ada59a6b6a0b
name: python-allure-pytest
arch: src
version: 2.13.5
epoch: 0
release: 1
summary: Allure pytest integration
url: https://allurereport.org/
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allure-pytest-2.13.5-1.src.rpm
checksum_type: sha256
description:
  ```shell
  $ pip install allure-pytest
  $ pytest --alluredir=%allure_result_folder% ./tests
  $ allure serve %allure_result_folder%
  ```

  Learn more from [Allure pytest's official documentation](https://allurereport.org/docs/pytest/).


pkgId: 3a9027f9c7969388f8f6a33d47ce5456e15a1f7a98db624d647d1842b2ca8416
name: python-allure-pytest-bdd
arch: src
version: 2.13.5
epoch: 0
release: 1
summary: Allure pytest-bdd integration
url: https://allurereport.org/
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allure-pytest-bdd-2.13.5-1.src.rpm
checksum_type: sha256
description:
  ```shell
  $ pip install allure-pytest-bdd
  $ pytest --alluredir=%allure_result_folder% ./tests
  $ allure serve %allure_result_folder%
  ```


pkgId: 61bbb29cb7ec9c3a38b60590a140860ed8b66e4ac0dada3a50e03c04d75816de
name: python-allure-python-commons
arch: src
version: 2.13.5
epoch: 0
release: 1
url: https://allurereport.org/
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allure-python-commons-2.13.5-1.src.rpm
checksum_type: sha256
summary:
  ('Contains the API for end users as well as helper functions and classes to build Allure adapters for Python test frameworks',)

description:
  Install an adapter that suits your test framework. You can then add more
  information to the report by using functions from the `allure` module.

  Use these functions as decorators of your own functions, e.g.:
  ```python
  import allure
  @allure.title("My test")
  def test_fn():
      pass
  ```
  The full list of decorators:
    - `allure.title`
    - `allure.description`
    - `allure.description_html`
    - `allure.label`
    - `allure.severity`
    - `allure.epic`
    - `allure.feature`
    - `allure.story`
    - `allure.suite`
    - `allure.parent_suite`
    - `allure.sub_suite`
    - `allure.tag`
    - `allure.id`
    - `allure.manual`
    - `allure.link`
    - `allure.issue`
    - `allure.testcase`
    - `allure.step`
  Refer to the adapter's documentation for the information about what decorators
  are supported and what functions they can be applied to.

  Most of the functions of Runtime API can be accessed via `allure.dynamic.*`.
  Call them at runtime from your code.
  The full list includes:
    - `allure.dynamic.title`
    - `allure.dynamic.description`
    - `allure.dynamic.description_html`
    - `allure.dynamic.label`
    - `allure.dynamic.severity`
    - `allure.dynamic.epic`
    - `allure.dynamic.feature`
    - `allure.dynamic.story`
    - `allure.dynamic.suite`
    - `allure.dynamic.parent_suite`
    - `allure.dynamic.sub_suite`
    - `allure.dynamic.tag`
    - `allure.dynamic.id`
    - `allure.dynamic.manual`
    - `allure.dynamic.link`
    - `allure.dynamic.issue`
    - `allure.dynamic.testcase`
    - `allure.dynamic.parameter`
    - `allure.attach`
    - `allure.attach.file`
    - `allure.step`
  Refer to the adapter's documentation for the information about what functions
  are supported and where you can use them.

  You may use `allure-pytest-commons` to build your own Allure adapter. The key
  elements of the corresponding API are:
    - `allure_python_commons.model2`: the object model of Allure Report.
    - `allure_python_commons.logger`: classes that are used to emit Allure Report objects (tests, containers, attachments):
        - `AllureFileLogger`: emits to the file system.
        - `AllureMemoryLogger`: collects the objects in memory. Useful for
          testing.
    - `allure_python_commons.lifecycle.AllureLifecycle`: an implementation of
      Allure lifecycle that doesn't isolate the state between threads.
    - `allure_python_commons.reporter.AllureReporter`: an implementation of
      Allure lifecycle that supports some multithreaded scenarios.
  A new version of the API is likely to be released in the future as we need
  a decent support for multithreaded and async-based concurrency (see
  [here](https://github.com/allure-framework/allure-python/issues/697) and
  [here](https://github.com/allure-framework/allure-python/issues/720)).


pkgId: cfcae4040cec6d9734326363edcbe14d262e9c68edd3477fa401e1f0d5d6b94b
name: python-allure-python-commons-test
arch: src
version: 2.13.5
epoch: 0
release: 1
summary: A collection of PyHamcrest matchers to test Allure adapters for Python test frameworks
url: https://allurereport.org/
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allure-python-commons-test-2.13.5-1.src.rpm
checksum_type: sha256
description:
  Here is the list of available matchers. Refer to [https://github.com/allure-framework/allure-python/tree/master/tests](https://github.com/allure-framework/allure-python/tree/master/tests) for usage examples.
  |Module|Matcher|Check|
  |------|-------|-----|
  |container|`has_container`|The report contains a container that matches all the provided matchers.|
  |container|`has_same_container`|The report contains a container that has all the specified tests as its children|
  |container|`has_before`|The container has a before fixture with the specified name that matches all the provided matchers|
  |container|`has_after`|The container has an after fixture with the specified name that matches all the provided matchers|
  |content|`csv_equivalent`|The string (typically, an attachment's content) contains a CSV document that is equvalent to the provided one|
  |label|`has_label`|The test contains a label with the specified name and (optionaly) the value|
  |label|`has_severity`|The test has the specified severity label|
  |label|`has_epic`|The test has the specified epic label|
  |label|`has_feature`|The test has the specified feature label|
  |label|`has_story`|The test has the specified story label|
  |label|`has_tag`|The test has the specified tag label|
  |label|`has_package`|The test has the specified package label|
  |label|`has_suite`|The test has the specified suite label|
  |label|`has_parent_suite`|The test has the specified parentSuite label|
  |label|`has_sub_suite`|The test has the specified subSuite label|
  |report|`has_test_case`|The report contains a test whose fullName ends, or name starts with the specified name. Additionally, the test must match all the provided matchers|
  |report|`has_only_testcases`|Each test of the report matches at least one of the provided matchers|
  |report|`has_only_n_test_cases`|Same as `has_test_case` but also checks if the number of matched tests is equal to the expected one|
  |result|`has_title`|The test has an expected name|
  |result|`has_description`|The test has a description that matches all the provided matchers|
  |result|`has_description_html`|The test has a descriptionHtml that matches all the provided matchers|
  |result|`has_step`|The test or step has a step with the specified name that matches all the provided matchers|
  |result|`has_parameter`|The test or step has a parameter with the specified name whose value matches the provided matchers|
  |result|`doesnt_have_parameter`|The test or step doesn't have a parameter with the specified name|
  |result|`has_link`|The test has a link with the expected url, type (if provided) and name (if provided)|
  |result|`has_issue_link`|The test has an issue link with the expected url and name (if provided)|
  |result|`has_test_case_link`|The test has an issue link with the expected url and name (if provided)|
  |result|`has_attachment`|The test or step has an attachment with the expected name and type.|
  |result|`has_attachment_with_content`|The test or step has an attachment with the expected name and type. In addition, the content must match the provided matcher.|
  |result|`with_id`|The test or container has the expected uuid|
  |result|`with_status`|The test or step has the expected status|
  |result|`has_status_details`|The status details of the test or step matches all the provided matchers|
  |result|`with_message_contains`|The status details' message contains the provided text|
  |result|`with_trace_contains`|The status details' trace contains the provided text|
  |result|`with_excluded`|The parameter is excluded from the historyId calculation|
  |result|`with_mode`|The parameter has the specified mode|
  |result|`has_history_id`|The test has historyId|


pkgId: ca849c40a2c07068f84a542eedfc133f092cdfdbee37a8bfa2ad05110d1b0031
name: python-allure-robotframework
arch: src
version: 2.13.5
epoch: 0
release: 1
summary: Allure Robot Framework integration
url: https://allurereport.org/
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allure-robotframework-2.13.5-1.src.rpm
checksum_type: sha256
description:
  ```shell
  $ pip install allure-robotframework
  $ robot --listener allure_robotframework ./my_robot_test
  ```
  The default output directory is `output/allure`.
  Use the listener's argument to change it:
  ```shell
  $ robot --listener allure_robotframework:/set/your/path/here ./my_robot_test
  ```
  The listener supports [the robotframework-pabot library](https://pypi.python.org/pypi/robotframework-pabot):
  ```shell
  $ pabot --listener allure_robotframework ./my_robot_test
  ```
  The advanced listener settings:
    - ALLURE_MAX_STEP_MESSAGE_COUNT=5. If a robotframework step contains less
      messages than has been specified by this setting, each message is shown as a substep.
      This reduces the number of attachments in large projects. The default value
      is zero - all messages are displayed as attachments.

  See the usage examples [here](https://github.com/allure-framework/allure-python/tree/master/allure-robotframework/examples).

  This project exists thanks to all the people who contribute. Especially to
  [Megafon](https://corp.megafon.com) and [@skhomuti](https://github.com/skhomuti)
  who has initially started allure-robotframework and has been maintaining it
  since then.


pkgId: 641e36ebc7e4e4d69be91b64db0e6e2ef73750eb0456f28c081294f5d40b3ac6
name: python-alluxiofs
arch: src
version: 1.0.4
epoch: 0
release: 1
summary: Alluxio Fsspec provides Alluxio filesystem spec implementation.
url: https://github.com/fsspec/alluxiofs
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alluxiofs-1.0.4-1.src.rpm
checksum_type: sha256
description:
  This quickstart shows how you can use the FSSpec interface to connect to [Alluxio](https://github.com/Alluxio/alluxio).
  For more information on what to expect, please read the blog [Accelerate data loading in large scale ML training with Ray and Alluxio](https://www.alluxio.io/blog/accelerating-data-loading-in-large-scale-ml-training-with-ray-and-alluxio/).





  Alluxio version >= 309

  Launch Alluxio clusters with the example configuration
  ```config

  alluxio.master.hostname=localhost
  alluxio.worker.hostname=localhost



  alluxio.dora.client.ufs.root=s3://example_bucket/datasets/

  alluxio.worker.page.store.dirs=/tmp/page_ufs

  alluxio.worker.page.store.sizes=10GB

  alluxio.worker.membership.manager.type=ETCD

  alluxio.etcd.endpoints=http://localhost:2379

  alluxio.user.consistent.hash.virtual.node.count.per.worker=5


  alluxio.job.batch.size=200
  alluxio.master.journal.type=NOOP
  alluxio.master.scheduler.initial.wait.time=10s
  alluxio.network.netty.heartbeat.timeout=5min
  alluxio.underfs.io.threads=50
  ```



  Python in range of [3.8, 3.9, 3.10]
  ray >= 2.8.2
  fsspec released after 2023.6



  Alluxio fsspec acts as a cache on top of an existing underlying data lake storage connection.
  The fsspec implementation corresponding to the underlying data lake storage needs to be installed.
  In the below Alluxio configuration example, Amazon S3 is the data lake storage where the dataset is read from.

  To connect to an existing underlying storage, there are two requirements
  - Install the underlying storage fsspec
    - For all [built-in storage fsspec](https://filesystem-spec.readthedocs.io/en/latest/api.html#built-in-implementations), no extra python libraries are needed to be installed.
    - For all [third-party storage fsspec](https://filesystem-spec.readthedocs.io/en/latest/api.html#other-known-implementations), the third-party fsspec python libraries are needed to be installed.
  - Set credentials for the underlying data lake storage

  Example: Deploy S3 as the underlying data lake storage
  [Install third-party S3 fsspec](https://s3fs.readthedocs.io/en/latest/)

  ```commandline
  pip install s3fs
  ```



  Directly install the latest published alluxiofs
  ```
  pip install alluxiofs
  ```

  [Optional] Install from the source code
  ```commandline
  git clone git@github.com:fsspec/alluxiofs.git
  cd alluxiofs && python3 setup.py bdist_wheel && \
       pip3 install dist/alluxiofs-<alluxiofs_version>-py3-none-any.whl
  ```







  ````commandline
  bin/alluxio job load --path s3://example_bucket/datasets/ --submit
  ````
  This will trigger a load job asynchronously with a job ID specified. You can wait until the load finishes or check the progress of this loading process using the following command:

  ````commandline
  bin/alluxio job load --path s3://example_bucket/datasets/ --progress
  ````



  Create the Alluxio Filesystem with data backed in S3

  ```
  import fsspec
  from alluxiofs import AlluxioFileSystem


  fsspec.register_implementation("alluxiofs", AlluxioFileSystem, clobber=True)


  alluxio_fs = fsspec.filesystem("alluxiofs", etcd_hosts="localhost", etcd_port=2379, target_protocol="s3")
  ```



  Similar to [fsspec examples](https://filesystem-spec.readthedocs.io/en/latest/usage.html#use-a-file-system) and [alluxiofs](https://github.com/fsspec/alluxiofs/blob/main/tests/test_alluxio_fsspec.py) examples.
  Note that all the read operations can only succeed if the parent folder has been loaded into Alluxio.
  ```

  contents = alluxio_fs.ls("s3://apc999/datasets/nyc-taxi-csv/green-tripdata/", detail=True)


  with alluxio_fs.open("s3://apc999/datasets/nyc-taxi-csv/green-tripdata/green_tripdata_2021-01.csv", "rb") as f:
      data = f.read()
  ```



  ```
  import fsspec
  import ray
  from alluxiofs import AlluxioFileSystem


  fsspec.register_implementation("alluxiofs", AlluxioFileSystem, clobber=True)
  alluxio_fs = fsspec.filesystem(
    "alluxiofs", etcd_hosts="localhost", target_protocol="s3"
  )


  ds = ray.data.read_csv("s3://example_bucket/datasets/example.csv", filesystem=alluxio_fs)


  ds.count()


  ds.schema()


  ds.take(1)


  ds.take(2)


  ds2 = ray.data.read_csv("s3://apc999/datasets/csv_dir/", filesystem=alluxio_fs)


  ds2.count()


  ```



  alluxiocommon package is a native enhancement module for alluxiofs based on PyO3 rust bindings.
  Currently it enhances big reads (multi-page reads from alluxio) by issuing multi-threaded requests to alluxio.

  to enable it, first install alluxiocommon package:
  ```
  pip install alluxiocommon
  ```
  and when start the Alluxio fsspec instance, add an additional option flag:
  ```
  alluxio_options = {"alluxio.common.extension.enable" : "True"}
  alluxio_fs = fsspec.filesystem(
    "alluxiofs", etcd_hosts="localhost", target_protocol="s3",
    options=alluxio_options
  )
  ```



  ```
  import fsspec
  from alluxiofs import AlluxioFileSystem


  fsspec.register_implementation("alluxiofs", AlluxioFileSystem, clobber=True)
  alluxio_fs = fsspec.filesystem(
    "alluxiofs", etcd_hosts="localhost", target_protocol="s3"
  )



  import pyarrow.dataset as ds
  dataset = ds.dataset("s3://example_bucket/datasets/example.parquet", filesystem=alluxio_fs)


  dataset.count_rows()


  dataset.schema


  dataset.take(0)



  py_fs = PyFileSystem(FSSpecHandler(alluxio_file_system))


  with py_fs.open_input_file("s3://example_bucket/datasets/example.parquet") as f:
      alluxio_file_data = f.read()


  ```


pkgId: c74b2d4c13b9c985a57d2b92350cf334739c1e413826b13e57693249eea0af41
name: python-allwhatspy-awp
arch: src
version: 0.2.1.3
epoch: 0
release: 1
summary: Whatsapp Wrapper - Envio de Mensagem Automática - PT-BR.
url: https://pypi.org/project/allwhatspy-awp/
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-allwhatspy-awp-0.2.1.3-1.src.rpm
checksum_type: sha256
description:
  O AllWhatsPy Ã© uma biblioteca Python revolucionÃ¡ria que oferece um controle sem precedentes sobre o WhatsApp. Seja para fins profissionais ou pessoais, essa ferramenta versÃ¡til e poderosa foi projetada para otimizar sua experiÃªncia de automaÃ§Ã£o no aplicativo de mensagens mais popular do mundo.

  Por que AllWhatsPy? Ã€ medida que nossa dependÃªncia do WhatsApp se torna incontestÃ¡vel, surge a necessidade de aprimorar a maneira como utilizamos essa ferramenta essencial. O AllWhatsPy Ã© a resposta a essa demanda crescente. Inspirado por projetos notÃ¡veis como o PyWhatsapp e o PyWhatKit, o AllWhatsPy Ã© o resultado de uma jornada de exploraÃ§Ã£o e pesquisa profunda em bots e APIs do WhatsApp.

  O desenvolvimento do AllWhatsPy envolveu milhares de linhas de cÃ³digo e testes meticulosos para garantir um desempenho perfeito. O resultado? Uma biblioteca versÃ¡til e flexÃ­vel que permite que vocÃª faÃ§a praticamente qualquer coisa no WhatsApp, proporcionando um novo nÃ­vel de eficiÃªncia e automaÃ§Ã£o.




  - Proteja suas mensagens com a clÃ¡ssica criptografia de Cifra de Caesar, garantindo que apenas os destinatÃ¡rios certos possam lÃª-las.
  Cifra de VigenÃ¨re: Aumente a seguranÃ§a de suas comunicaÃ§Ãµes com a sofisticada criptografia de Cifra de VigenÃ¨re.



  - Envio de Mensagens com 4 meios diferentes de realizaÃ§Ã£o. Cada uma delas com seu foco especÃ­fico.



  - AnÃ¡lise de Mensagens Recebidas: Obtenha insights valiosos a partir da anÃ¡lise de mensagens recebidas, facilitando o entendimento do conteÃºdo.


  - Agendamento de Tarefas: Programe mensagens e aÃ§Ãµes para serem executadas em horÃ¡rios especÃ­ficos, aumentando a eficiÃªncia de suas comunicaÃ§Ãµes.


  - Gerenciamento de Contatos: Controle seus contatos com facilidade, localize usuÃ¡rios, arquive conversas e marque mensagens como nÃ£o lidas.

  Flexibilidade e PersonalizaÃ§Ã£o: O AllWhatsPy oferece diversas opÃ§Ãµes de configuraÃ§Ã£o para atender Ã s suas necessidades especÃ­ficas, desde a geraÃ§Ã£o de JSON atÃ© a geraÃ§Ã£o de logs detalhados.

  Quer saber mais? [Acesse meu GitHub](https://github.com/DevLucasLourenco/AllWhatsPy) para explorar todas as possibilidades que o AllWhatsPy oferece. Automatize suas interaÃ§Ãµes no WhatsApp e leve a eficiÃªncia da automaÃ§Ã£o para um novo nÃ­vel!


pkgId: 569a699ec9d82fac62c17a22b878244f6a5fc547a6c7ca5c9c46ed96751a1869
name: python-ally-ai
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: ally for your ai
url: https://github.com/users/tugbayatilla/projects/3/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ally-ai-0.2.0-1.src.rpm
checksum_type: sha256
description:
  ```yaml
  llm:
    api_key: '<private-key>'
    api_version: "<api-version>"
    endpoint: "<endpoint>"
    model: "<model-name>"
    deployment_name: '<deployment-name>'
    temperature: 0.7
    streaming: true

  embeddings:
    api_key: '<private-key>'
    api_version: "<api-version>"
    endpoint: "<endpoint>"
    model: "<model-name>"
    deployment_name: '<deployment-name>'
  ```





  ```python
  from ally_ai.langchain import LLM

  llm = LLM()
  response = llm.invoke('What is an ally?')
  print(response)
  ```



  ```yaml
  my_llm:
    api_key: '<private-key>'
    api_version: "<api-version>"
  ```

  ```python
  from ally_ai.langchain import LLM, Settings

  settings = Settings(section='my_llm')
  llm = LLM(settings=settings)
  print(llm.settings.path)
  print(llm.settings.section)
  ```



  ```python
  from ally_ai.langchain import LLM, Settings

  settings = Settings(section='my_llm', api_key='<new-api-key>')
  llm = LLM(settings=settings)
  response = llm.invoke('What is an ally?')
  print(response)
  ```




  ```python
  from ally_ai.langchain import Embeddings

  embeddings = Embeddings()
  response = embeddings.embed_query('What is an ally?')
  print(response)
  ```


pkgId: 0ecc996b43f47dd311a3397a937950434cbe2e74ac8560167d648466f71d1dac
name: python-ally-ai-core
arch: src
version: 0.5.4
epoch: 0
release: 1
summary: Core package for ally
url: https://github.com/users/tugbayatilla/projects/3/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-ally-ai-core-0.5.4-1.src.rpm
checksum_type: sha256
description:
  ```yaml
  llm:
    api_key: '<private-key>'
    api_version: "<api-version>"
    endpoint: "<endpoint>"
    model: "<model-name>"
    deployment_name: '<deployment-name>'
    temperature: 0.7
    streaming: true

  embeddings:
    api_key: '<private-key>'
    api_version: "<api-version>"
    endpoint: "<endpoint>"
    model: "<model-name>"
    deployment_name: '<deployment-name>'
  ```





  ```yaml
  my_llm:
    api_key: '<private-key>'
    api_version: "<api-version>"
  ```

  ```python
  from ally_ai_core import Settings

  settings = Settings(section='my_llm')

  ```



  ```python
  from ally_ai_core import Settings

  settings = Settings(section='my_llm', api_key='<new-api-key>')
  ```


pkgId: df29733acd42e273145d1506ae1dde43e0a907d9ed6084b71cde7ca38e882101
name: python-alma-cdk.cross-region-parameter
arch: src
version: 0.0.14
epoch: 0
release: 1
summary: Store AWS SSM Parameter Store Parameters into another AWS Region with AWS CDK
url: https://github.com/alma-cdk/cross-region-parameter.git
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alma-cdk.cross-region-parameter-0.0.14-1.src.rpm
checksum_type: sha256
description:
  <div align="center">
  	<br/>
  	<br/>
    <h1>
  	<img height="140" src="assets/alma-cdk-cross-region-parameter.svg" alt="Alma CDK Cross-Region Parameter" />
    <br/>
    <br/>
    </h1>

  ```sh
  npm i -D @alma-cdk/cross-region-parameter
  ```

    <div align="left">

  Store [AWS SSM Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) Parameters into another AWS Region with AWS CDK.

    </div>
    <br/>
  </div><br/><div align="center">

  ![diagram](assets/diagram.svg)

  </div><br/>



  ![experimental](https://img.shields.io/badge/stability-experimental-yellow)

  This construct is still versioned with `v0` major version and breaking changes might be introduced if necessary (without a major version bump), though we aim to keep the API as stable as possible (even within `v0` development). We aim to publish `v1.0.0` soon and after that breaking changes will be introduced via major version bumps.

  <br/>



  ```python
  import { CrossRegionParameter } from "@alma-cdk/cross-region-parameter";

  new CrossRegionParameter(this, 'SayHiToSweden', {
    region: 'eu-north-1',
    name: '/parameter/path/message',
    description: 'Some message for the Swedes',
    value: 'Hej då!',
  });
  ```


pkgId: 298342f0f1f624965f7ddc406e562c88f59b7438a4d418fbcb7f1c870d57ce3d
name: python-alma-cdk.openapix
arch: src
version: 0.0.50
epoch: 0
release: 1
summary: Combine the power of AWS CDK & OpenAPI YAML Schema Definitions
url: https://github.com/alma-cdk/openapix.git
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alma-cdk.openapix-0.0.50-1.src.rpm
checksum_type: sha256
description:
  <div align="center">
  	<br/>
  	<br/>
    <h1>
  	<img height="140" src="assets/alma-cdk-openapix.svg" alt="Alma CDK OpenApiX" />
    <br/>
    <br/>
    </h1>

  ```sh
  npm i -D @alma-cdk/openapix
  ```

    <div align="left">

  Generate AWS Api Gateway REST APIs via [OpenAPI](https://www.openapis.org/) (formely known as “Swagger”) Schema Definitions by consuming "clean" OpenAPI schemas and inject `x-amazon-apigateway-` extensions *with type-safety*.

    </div>
    <br/>
  </div><br/><div align="center">

  ![diagram](assets/diagram.svg)

  </div><br/>



  ![experimental](https://img.shields.io/badge/stability-experimental-yellow)

  This construct is still versioned with `v0` major version and breaking changes might be introduced if necessary (without a major version bump), though we aim to keep the API as stable as possible (even within `v0` development). We aim to publish `v1.0.0` soon and after that breaking changes will be introduced via major version bumps.

  There are also some incomplete or buggy features, such as CORS and `CognitoUserPoolsAuthorizer`.

  <br/>



  1. Install `npm i -D @alma-cdk/openapix`
  2. Define your API OpenApi Schema Definition in a `.yaml` file<br/>*without* any `x-amazon-apigateway-` extensions
  3. Use `openapix` constructs in CDK to consume the `.yaml` file and then assign API Gateway integrations using CDK

  <br/>



  Given the following [`http-proxy.yaml` OpenApi schema definition](https://github.com/alma-cdk/openapix/blob/main/examples/http-proxy/schema/http-proxy.yaml), *without* any AWS API Gateway OpenApi extensions:

  ```yaml
  openapi: 3.0.3
  info:
    title: HTTP Proxy
    description: Proxies requests to example.com
    version: "0.0.1"
  paths:
    "/":
      get:
        summary: proxy
        description: Proxies example.com
  ```

  You may then define API Gateway HTTP integration (within your stack):

  ```python
  new openapix.Api(this, 'HttpProxy', {
    source: path.join(__dirname, '../schema/http-proxy.yaml'),

    paths: {
      '/': {
        get: new openapix.HttpIntegration(this, 'http://example.com', {
            httpMethod: 'get',
        }),
      },
    },
  });
  ```

  See [`/examples/http-proxy`](https://github.com/alma-cdk/openapix/tree/main/examples/http-proxy) for full OpenApi definition (with response models) and an example within a CDK application.

  <br/>



  Given the following [`hello-api.yaml` OpenApi schema definition](https://github.com/alma-cdk/openapix/blob/main/examples/hello-api/schema/hello-api.yaml), *without* any AWS API Gateway OpenApi extensions:

  ```yaml
  openapi: 3.0.3
  info:
    title: Hello API
    description: Defines an example “Hello World” API
    version: "0.0.1"
  paths:
    "/":
      get:
        operationId: sayHello
        summary: Say Hello
        description: Prints out a greeting
        parameters:
        - name: name
          in: query
          required: false
          schema:
            type: string
            default: "World"
        responses:
          "200":
            description: Successful response
            content:
              "application/json":
                schema:
                  $ref: "#/components/schemas/HelloResponse"

  components:
    schemas:
      HelloResponse:
        description: Response body
        type: object
        properties:
          message:
            type: string
            description: Greeting
            example: Hello World!
  ```

  You may then define API Gateway AWS Lambda integration (within your stack):

  ```python
  const greetFn = new NodejsFunction(this, 'greet');

  new openapix.Api(this, 'HelloApi', {
    source: path.join(__dirname, '../schema/hello-api.yaml'),
    paths: {
      '/': {
        get: new openapix.LambdaIntegration(this, greetFn),
      },
    },
  })
  ```

  See [`/examples/hello-api`](https://github.com/alma-cdk/openapix/tree/main/examples/hello-api) for full OpenApi definition (with response models) and an example within a CDK application.

  <br/>



  Given [`books-api.yaml` OpenApi schema definition](https://github.com/alma-cdk/openapix/blob/main/examples/books-api/schema/books-api.yaml), *without* any AWS API Gateway OpenApi extensions, You may then define API Gateway AWS service integration such as DynamoDB (within your stack):

  ```python
  new openapix.Api(this, 'BooksApi', {
    source: path.join(__dirname, '../schema/books-api.yaml'),
    paths: {
      '/': {
        get: new openapix.AwsIntegration(this, {
          service: 'dynamodb',
          action: 'Scan',
          options: {
            credentialsRole: role, // role must have access to DynamoDB table
            requestTemplates: {
              'application/json': JSON.stringify({
                TableName: table.tableName,
              }),
            },
            integrationResponses: [
              {
                statusCode: '200',
                responseTemplates: {
                  // See /examples/http-proxy/lib/list-books.vtl
                  'application/json': readFileSync(__dirname+'/list-books.vtl', 'utf-8'),
                },
              }
            ],
          },
        }),
      },
      '/{isbn}': {
        get: new openapix.AwsIntegration(this, {
          service: 'dynamodb',
          action: 'GetItem',
          options: {
            credentialsRole: role, // role must have access to DynamoDB table
            requestTemplates: {
              'application/json': JSON.stringify({
                TableName: table.tableName,
                Key: {
                  item: {
                    "S": "$input.params('isbn')"
                  }
                }
              }),
            },
            integrationResponses: [
              {
                statusCode: '200',
                responseTemplates: {
                  // See /examples/http-proxy/lib/get-book.vtl
                  'application/json': readFileSync(__dirname+'/get-book.vtl', 'utf-8'),
                },
              }
            ],
          },
        }),
      },
    },
  });
  ```

  See [`/examples/books-api`](https://github.com/alma-cdk/openapix/tree/main/examples/books-api) for full OpenApi definition (with response models) and an example within a CDK application.

  <br/>



  Given the following [`mock-api.yaml` OpenApi schema definition](https://github.com/alma-cdk/openapix/blob/main/examples/mock-api/schema/mock-api.yaml), *without* any AWS API Gateway OpenApi extensions:

  ```yaml
  openapi: 3.0.3
  info:
    title: Hello API
    description: Defines an example “Hello World” API
    version: "0.0.1"
  paths:
    "/":
      get:
        operationId: sayHello
        summary: Say Hello
        description: Prints out a greeting
        parameters:
        - name: name
          in: query
          required: false
          schema:
            type: string
            default: "World"
        responses:
          "200":
            description: Successful response
            content:
              "application/json":
                schema:
                  $ref: "#/components/schemas/HelloResponse"

  components:
    schemas:
      HelloResponse:
        description: Response body
        type: object
        properties:
          message:
            type: string
            description: Greeting
            example: Hello World!
  ```

  You may then define API Gateway Mock integration (within your stack):

  ```python
  new openapix.Api(this, 'MockApi', {
    source: path.join(__dirname, '../schema/mock-api.yaml'),
    paths: {
      '/': {
        get: new openapix.MockIntegration(this, {
          requestTemplates: {
            "application/json": JSON.stringify({ statusCode: 200 }),
          },
          passthroughBehavior: apigateway.PassthroughBehavior.NEVER,
          requestParameters: {
            'integration.request.querystring.name': 'method.request.querystring.name',
          },
          integrationResponses: [
            {
              statusCode: '200',
              responseTemplates: {
                // see /examples/mock-api/lib/greet.vtl
                'application/json': readFileSync(__dirname+'/greet.vtl', 'utf-8'),
              },
              responseParameters: {},
            },
          ],
        }),
      },
    },
  });
  ```

  See [`/examples/mock-api`](https://github.com/alma-cdk/openapix/tree/main/examples/mock-api) for full OpenApi definition (with response models) and an example within a CDK application.

  <br/>



  API Gateway REST APIs can perform [request parameter and request body validation](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html). You can provide both default validator and integration specific validator (which will override the default for given integration).

  See [`/examples/todo-api`](https://github.com/alma-cdk/openapix/tree/main/examples/todo-api) for complete example within a CDK application.

  Given [`todo-api.yaml` OpenApi schema definition](https://github.com/alma-cdk/openapix/blob/main/examples/todo-api/schema/todo-api.yaml) you may define the API Gateway validators for your integration in CDK:

  ```python
  new openapix.Api(this, 'MyApi', {
    source: path.join(__dirname, '../schema/todo-api.yaml'),

    validators: {
      'all': {
        validateRequestBody: true,
        validateRequestParameters: true,
        default: true, // set this as the "API level" default validator (there can be only one)
      },
      'params-only' : {
        validateRequestBody: false,
        validateRequestParameters: true,
      },
    },

    paths: {
      '/todos': {
        // this one uses the default 'all' validator
        post:  new openapix.HttpIntegration(this, baseUrl, { httpMethod: 'post' }),
      },
      '/todos/{todoId}': {
        // this one has validator override and uses 'params-only' validator
        get: new openapix.HttpIntegration(this, `${baseUrl}/{todoId}`, {
          validator: 'params-only',
          options: {
            requestParameters: {
              'integration.request.path.todoId': 'method.request.path.todoId',
            },
          },
        }),
      },
    },
  })
  ```

  <br/>



  🚧 Work-in-Progress

  There are multiple ways to [control & manages access to API Gateway REST APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-to-api.html) such as [resource policies](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-resource-policies.html), [IAM permissions](https://docs.aws.amazon.com/apigateway/latest/developerguide/permissions.html) and [usage plans with API keys](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html) but this section focuses on [Cognito User Pools ](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html) and [Lambda authorizers](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html).

  <br/>



  In this example we're defining a Congito User Pool based authorizer.

  Given the following `schema.yaml` OpenApi definition:

  ```yaml
  openapi: 3.0.3
  paths:
    /:
      get:
        security:
          - MyAuthorizer: ["test/read"] # add scope
  components:
    securitySchemes:
      MyCognitoAuthorizer:
        type: apiKey
        name: Authorization
        in: header
  ```

  You can define the Cognito Authorizer in CDK with:

  ```python
  const userPool: cognito.IUserPool;

  new openapix.Api(this, 'MyApi', {
    source: './schema.yaml',

    authorizers: [
      new openapix.CognitoUserPoolsAuthorizer(this, 'MyCognitoAuthorizer', {
        cognitoUserPools: [userPool],
        resultsCacheTtl: Duration.minutes(5),
      })
    ],
  })
  ```

  <br/>



  In this example we're defining a custom Lambda authorizer. The authorizer function code is not relevant for the example but the idea in the example is that an API caller sends some "secret code" in query parameters (`?code=example123456`) which then the authorizer function somehow evaluates.

  Given the following `schema.yaml` OpenApi definition:

  ```yaml
  openapi: 3.0.3
  paths:
    /:
      get:
        security:
          - MyAuthorizer: [] # note the empty array
  components:
    securitySchemes:
      MyCustomAuthorizer:
        type: apiKey
        name: code
        in: query
  ```

  You can define the custom Lambda Authorizer in CDK with:

  ```python
  const authFn: lambda.IFunction;

  new openapix.Api(this, 'MyApi', {
    source: './schema.yaml',

    authorizers: [

      new openapix.LambdaAuthorizer(this, 'MyCustomAuthorizer', {
        fn: authFn,
        identitySource: apigateway.IdentitySource.queryString('code'),
        type: 'request',
        authType: 'custom',
        resultsCacheTtl: Duration.minutes(5),
      }),
    ],


  })
  ```

  <br/>



  You may modify the generated OpenAPI definition (which is used to define API Gateway REST API) by injecting or rejecting values from the source OpenAPI schema definition:

  ```python
  new openapix.Api(this, 'MyApi', {
    source: './schema.yaml',

    // Add any OpenAPI v3 data.
    // Can be useful for passing values from CDK code.
    // See https://swagger.io/specification/
    injections: {
      "info.title": "FancyPantsAPI"
    },

    // Reject fields by absolute object path from generated definition
    rejections: ['info.description'],

    // Reject all matching fields from generated definition
    rejectionsDeep: ['example', 'examples'],
  });
  ```

  <br/>



  🚧 Work-in-Progress

  Using `openapix.CorsIntegration` creates a Mock integration which responds with correct response headers:

  ```python
  new openapix.Api(this, 'MyApi', {
    source: './schema.yaml',

    paths: {
      '/foo': {
        options: new openapix.CorsIntegration(this, {
          // using helper method to define explicit values:
          headers: CorsHeaders.from(this, 'Content-Type', 'X-Amz-Date', 'Authorization'),
          origins: CorsOrigins.from(this, 'https://www.example.com'),
          methods: CorsMethods.from(this, 'options','post','get'),
        }),
      },
      '/bar': {
        options: new openapix.CorsIntegration(this, {
          // using regular string values:
          headers: 'Content-Type,X-Amz-Date,Authorization',
          origins: '*',
          methods: 'options,get',
        }),
      },
      '/baz': {
        options: new openapix.CorsIntegration(this, {
          // using helper constant for wildcard values:
          headers: CorsHeaders.ANY,
          origins: CorsOrigins.ANY,
          methods: CorsMethods.ANY,
        }),
      },
    },
  });
  ```

  When specifying multiple `origins` the mock integration uses [VTL magic](https://medium.com/@srikanth650/use-api-gateway-with-mock-integration-to-allow-cors-from-multiple-origins-bdcb431d07d3) to respond with the correct `Access-Control-Allow-Origin` header.



  If you wish to define same CORS options to every path, you may do so by providing a default `cors` value:

  ```python
  new openapix.Api(this, 'MyApi', {
    source: './schema.yaml',

    defaultCors: new openapix.CorsIntegration(this, {
      headers: CorsHeaders.ANY,
      origins: CorsOrigins.ANY,
      methods: CorsMethods.ANY,
    }),

    paths: {/*...*/},
  });
  ```

  This will apply the given `cors` configuration to *every* path as `options` method. You may still do path specific overrides by adding an `options` method to specific paths.

  <br/>



  AWS CDK API Gateway constructs default to [*Edge-optimized API endpoints*](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-endpoint-types.html#api-gateway-api-endpoint-types-edge-optimized) by using [`EndpointType.EDGE`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApi.html#endpointtypes) as the default.

  This construct `@alma-cdk/openapix` instead defaults to using [*Regional API endpoints*](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-endpoint-types.html#api-gateway-api-endpoint-types-regional) by setting `EndpointType.REGIONAL` as the default value. This is because we believe that in most cases you're better of by configuring your own CloudFront distribution in front the API. If you do that, you might also be interested in [`@alma-cdk/origin-verify` construct](https://github.com/alma-cdk/origin-verify).

  You MAY override this default in `@alma-cdk/openapix` by providing your preferred endpoint types via `restApiProps`:

  ```python
  new openapix.Api(this, 'MyApi', {
    source: './schema.yaml',

    paths: {/*...*/},

    restApiProps: {
      endpointConfiguration: {
        types: [ apigateway.EndpointType.EDGE ],
      },
    },
  });
  ```


pkgId: f207a497681d9af5620408c66704405a12be06b99fac76913217d2d4b504a7a0
name: python-alma-cdk.origin-verify
arch: src
version: 0.0.34
epoch: 0
release: 1
summary: Enforce origin traffic via CloudFront.
url: https://github.com/alma-cdk/origin-verify.git
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alma-cdk.origin-verify-0.0.34-1.src.rpm
checksum_type: sha256
description:
  <div align="center">
  	<br/>
  	<br/>
    <h1>
  	<img height="140" src="assets/alma-cdk-origin-verify.svg" alt="Alma CDK Origin Verify" />
    <br/>
    <br/>
    </h1>

  ```sh
  npm i -D @alma-cdk/origin-verify
  ```

    <div align="left">

  Enforce API Gateway REST API, AppSync GraphQL API, or Application Load Balancer traffic via CloudFront by generating a Secrets Manager secret value which is used as a CloudFront Origin Custom header and a WAFv2 WebACL header match rule.

    </div>
    <br/>
  </div><br/>

  ![diagram](assets/diagram.svg)

  <br/>

  Essentially this is an implementation of *AWS Solution* “[Enhance Amazon CloudFront Origin Security with AWS WAF and AWS Secrets Manager](https://aws.amazon.com/blogs/security/how-to-enhance-amazon-cloudfront-origin-security-with-aws-waf-and-aws-secrets-manager/)” without the secret rotation.

  <br/>



  ![experimental](https://img.shields.io/badge/stability-experimental-yellow)

  This construct is still versioned with `v0` major version and breaking changes might be introduced if necessary (without a major version bump), though we aim to keep the API as stable as possible (even within `v0` development). We aim to publish `v1.0.0` soon and after that breaking changes will be introduced via major version bumps.

  <br/>



  ```python
  import { OriginVerify } from '@alma-cdk/origin-verify';
  import { Distribution } from 'aws-cdk-lib/aws-cloudfront';
  ```

  ```python
  const api: RestApi; // TODO: implement the RestApi
  const apiDomain: string; // TODO: implement the domain

  const verification = new OriginVerify(this, 'OriginVerify', {
    origin: api.deploymentStage,
  });

  new Distribution(this, 'CDN', {
    defaultBehavior: {
      origin: new HttpOrigin(apiDomain, {
        customHeaders: {
          [verification.headerName]: verification.headerValue,
        },
        protocolPolicy: OriginProtocolPolicy.HTTPS_ONLY,
      })
    },
  })
  ```

  For more detailed example usage see [`/examples`](https://github.com/alma-cdk/origin-verify/tree/main/examples/) directory.

  <br/>



  Additionally, you may pass in custom `secretValue` if you don't want to use a generated secret (which you should use in most cases):

  ```python
  const myCustomValue = SecretValue.unsafePlainText('foobar');

  const verification = new OriginVerify(this, 'OriginVerify', {
    origin: api.deploymentStage,
    secretValue: myCustomValue,
  });
  ```

  <br/>





  In your CloudFront distribution Origin configuration use `OriginProtocolPolicy.HTTPS_ONLY` to avoid exposing the `verification.headerValue` secret to the world.



  Internally this construct creates the `headerValue` by using AWS Secrets Manager but the secret value is exposed directly by using `secretValue.unsafeUnwrap()` method: This is:

  * **required**, because we must be able to set it into the WAFv2 WebACL rule
  * **required**, because you must be able to set it into the CloudFront Origin Custom Header
  * **okay**, because it's meant to protect the API externally and it's *not* considered as a secret that should be kept – well – secret within *your* AWS account


pkgId: ffcd3ee379bada66e5abd57c9072fe3972074408ee96f0c7474ee601f67491d6
name: python-alma-cdk.project
arch: src
version: 0.0.31
epoch: 0
release: 1
summary: Opinionated CDK Project “Framework”
url: https://github.com/alma-cdk/project.git
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alma-cdk.project-0.0.31-1.src.rpm
checksum_type: sha256
description:
  <br/><br/><br/>

  🚧 **Work-in-Progress**: Breaking changes may occur at any given point during `v0.x`.

  <br/><br/><br/>

  <div align="center">
  	<br/>
  	<br/>
    <h1>
  	<img width="300" src="assets/alma-cdk-project.svg" alt="Alma CDK Project" />
    <br/>
    <br/>
    </h1>

  ```sh
  npm i -D @alma-cdk/project
  ```

    <div align="left">

  Opinionated CDK “framework” with constructs & utilities for:

  * deploying multiple environments to multiple accounts (with many-to-many relationship)
  * managing account configuration through standardized props (no more random config files)
  * querying account and/or environment specific information within your CDK code
  * enabling dynamic & short-lived “feature-environments”
  * enabling well-defined tagging
  * providing structure & common conventions to CDK projects
  * choosing the target account & environment by passing in runtime context:

    ```sh
    npx cdk deploy -c account=dev -c environment=feature/abc-123
    ```

    ... which means you don't need to define all the possibile environments ahead of time!

    </div>
    <br/>
  </div>



  Depending on the use case, you may choose a configuration between 1-3 AWS accounts with the following environments:

  1. **Shared account (`shared`)**:

     ![default-multi](assets/accounts-1x.svg)
     <br/>
  2. **Multi-account (`dev`+`prod`)***– RECOMMENDED*:

     ![default-multi](assets/accounts-2x.svg)
     <br/>

  <br/>
  </details>

  1. **Multi-account (`dev`+`preprod`+`prod`)**:

     ![default-multi](assets/accounts-3x.svg)
     <br/>

  <br/>



  Steps required to define a *environmental* project resources; At first, it might seem complex but once you get into the habbit of defining your projects this way it starts to make sense:

  1. Choose your [Account Strategy](#account-strategies)
  2. Initialize a new `Project` instead of `cdk.App`:

     ```python
     // bin/app.ts
     import { Project, AccountStrategy } from '@alma-cdk/project';

     const project = new Project({
       // Basic info, you could also read these from package.json if you want
       name: 'my-cool-project',
       author: {
         organization: 'Acme Corp',
         name: 'Mad Scientists',
         email: 'mad.scientists@acme.example.com',
       },

       // If not set, defaults to one of: $CDK_DEFAULT_REGION, $AWS_REGION or us-east-1
       defaultRegion: 'eu-west-1',

       // Configures the project to use 2 AWS accounts (recommended)
       accounts: AccountStrategy.two({
         dev: {
           id: '111111111111',
           config: {
             // whatever you want here as [string]: any
             baseDomain: 'example.net',
           },
         },
         prod: {
           id: '222222222222',
           config: {
             // whatever you want here as [string]: any
             baseDomain: 'example.com',
           },
         },
       }),
     })
     ```
  3. Define a stack which `extends SmartStack` with resources:

     ```python
     // lib/my-stack.ts
     import { Construct } from 'constructs';
     import { StackProps, RemovalPolicy } from 'aws-cdk-lib';
     import { SmartStack, Name, UrlName, PathName, EC } from '@alma-cdk/project';

     export class MyStack extends SmartStack {
       constructor(scope: Construct, id: string, props?: StackProps) {
         super(scope, id, props);

         new dynamodb.Table(this, 'Table', {
           removalPolicy: EC.isStable(this) ? RemovalPolicy.RETAIN : RemovalPolicy.DESTROY,

           tableName: Name.it(this, 'MyTable'),
           partitionKey: {
             type: dynamodb.AttributeType.STRING,
             name: 'pk',
           },
           // StagingMyTable
         });

         new events.EventBus(this, 'EventBus', {
           eventBusName: Name.withProject(this, 'MyEventBus'),
           // MyCoolProjectStagingMyEventBus
         });

         new s3.Bucket(this, 'Bucket', {

           removalPolicy: EC.isStable(this) ? RemovalPolicy.RETAIN : RemovalPolicy.DESTROY,
           autoDeleteObjects: EC.isStable(this) ? false : true,

           bucketName: UrlName.globally(this, 'MyBucket'),
           // acme-corp-my-cool-project-feature-foo-bar-my-bucket
         });

         new ssm.StringParameter(this, 'Parameter', {
           stringValue: 'Foo',
           tier: ssm.ParameterTier.ADVANCED,
           parameterName: PathName.withProject(this, 'MyNamespace/MyParameter'),
           // /MyCoolProject/Staging/MyNamespace/MyParameter
         });
       }
     }
     ```
  4. Define a new *environmental* which `extends EnvironmentWrapper` and initialize all your environmental `SmartStack` stacks within:

     ```python
     // lib/environment.ts
     import { Construct } from 'constructs';
     import { EnvironmentWrapper } from '@alma-cdk/project';
     import { MyStack } from './my-stack';

     export class Environment extends EnvironmentWrapper {
       constructor(scope: Construct) {
         super(scope);
         new MyStack(this, 'MyStack', { description: 'This is required' });
       }
     }
     ```

     Resulting Stack properties (given `environment=staging`):

     |        Property         |                    Example value                     |
     | :---------------------- | :--------------------------------------------------- |
     | `stackName`             | `"MyCoolProject-Environment-Staging-MyExampleStack"` |
     | `terminationProtection` | `true`                                               |
     | `env.account`           | `"111111111111"`                                     |
     | `env.region`            | `"eu-west-1"`                                        |

     Resulting Tags for the Stack and its resources (given `environment=staging`):

     |        Property         |           Example value           |
     | :---------------------- | :-------------------------------- |
     | `Account`               | `dev`                             |
     | `Environment`           | `staging`                         |
     | `Project`               | `my-cool-project`                 |
     | `Author`                | `Mad Scientists`                  |
     | `Organization`          | `Acme Corp`                       |
     | `Contact`               | `mad.scientists@acme.example.com` |
  5. Finally initialize the environment with the `Project` scope:

     ```python
     // bin/app.ts
     import { Project, Accounts } from '@alma-cdk/project';
     import { Environment } from '../lib/environment';

     const project = new Project({/* removed for brevity, see step 1 */})

     new Environment(project);
     ```

  <br/>



  See detailed documentation for specific classes & methods at [constructs.dev](http://constructs.dev/packages/@alma-cdk/project).

  Generally speaking you would be most interested in the following:

  * Project
  * AccountStrategy
  * SmartStack
  * AccountWrapper & EnvironmentWrapper
  * AccountContext (AC)
  * EnvironmentContext (EC)
  * Name / UrlName / PathName


pkgId: dc93777661eca08f6d9a55ee4e9b5618ca185f092e9e815f59d003e4dfe9434a
name: python-alma-torch
arch: src
version: 0.1.17
epoch: 0
release: 1
summary: A package for benchmarking the speed of different PyTorch conversion options
url: https://github.com/saifhaq/alma
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alma-torch-0.1.17-1.src.rpm
checksum_type: sha256
description:
  A Python library for benchmarking PyTorch model speed for different conversion options.

  The motivation is to make it easy for people to benchmark their models for different conversion options,
  e.g. eager, tracing, scripting, torch.compile, torch.export, ONNX, Tensort, etc. The library is
  designed to be simple to use, with benchmarking provided via a single API call, and to be easily
  extensible for adding new conversion options.

  Beyond just benchmarking, `alma` is designed to be a one-stop-shop for all model conversion options,
  so that one can learn about the different conversion options, how to implement them, and how they
  affect model speed and performance.


  `alma` is available as a Python package.

  One can install the package from python package index by running
  ```bash
  pip install alma
  ```

  Alternatively, it can be installed from the root of this repository (save level as this README) by
  running:
  ```bash
  pip install -e .
  ```




  The core API is `benchmark_model`, which is used to benchmark the speed of a model for different
  conversion options. The usage is as follows:

  ```python
  from alma import benchmark_model
  from alma.benchmark.log import display_all_results

  device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")


  model = ...
  model = model.to(device)


  data_loader = ...


  config = {
      "batch_size": 128,
      "n_samples": 4096,
  }


  conversions = ["EAGER", "EXPORT+EAGER"]


  results = benchmark_model(model, config, conversions, data_loader=data_loader)


  display_all_results(results)
  ```

  The results will look like this, depending on one's model, dataloader, and hardware.

  ```bash
  EAGER results:
  device: cuda:0
  Total elapsed time: 0.4148 seconds
  Total inference time (model only): 0.0436 seconds
  Total samples: 5000
  Throughput: 12054.50 samples/second

  EXPORT+EAGER results:
  device: cuda:0
  Total elapsed time: 0.3906 seconds
  Total inference time (model only): 0.0394 seconds
  Total samples: 5000
  Throughput: 12800.82 samples/second
  ```


  We also provide the option to feed in a single `data` tensor instead of a dataloader. This is useful
  for cases where one does not want to go throuhg the trouble of setting up a dataloader, and is happy
  to just benchmark the model on random data of a given shape.
  If no `data_loader` argument is provided and a `data` tensor is fed in, `benchmark_model`
  will automatically generate a dataloader of random tensors, of the same shape as `data`.
  `data` should be fed in WITHOUT a batch dimension.
  The batch size of the dataloader will be equal to the `batch_size` in the `config` dict.

  ```python
  from alma import benchmark_model
  from alma.benchmark.log import display_all_results

  device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")


  model = ...
  model = model.to(device)



  data = torch.randn(1, 3, 224, 224).to(device)


  config = {
      "batch_size": 128,
      "n_samples": 4096,
  }


  conversions = ["EAGER", "EXPORT+EAGER"]


  results = benchmark_model(model, config, conversions, data=data.squeeze())


  display_all_results(results)
  ```




  In case where the benchmarking of a given conversion fails, it will return a dict for that conversion
  which contains the error message as well as the full traceback. This is useful for debugging and
  understanding why a given conversion failed, e.g. because of hardware incompatabilities, missing
  dependencies, etc.

  For example, if the `FAKE_QUANTIZED` conversion fails because it's not currently supported for Apple
  silicon, the default results may look like this:

  ```bash
  CONVERT_QUANTIZED results:
  Device: cpu
  Total elapsed time: 0.8287 seconds
  Total inference time (model only): 0.4822 seconds
  Total samples: 5000 - Batch size: 50
  Throughput: 6033.89 samples/second


  FAKE_QUANTIZED results:
  Benchmarking failed, error: The operator 'aten::_fake_quantize_learnable_per_tensor_affine' is not
  currently implemented for the MPS device. If you want this op to be added in priority during the
  prototype phase of this feature, please comment on
  https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment
  variable `PYTORCH_ENABLE_MPS_FALLBACK=1` to use the CPU as a fallback for this op. WARNING: this
  will be slower than running natively on MPS.
  ```

  The traceback of the error is also stored in the results dict, and can be accessed via
  `results[CONVERSION_NAME]["traceback"]`.

  In this example, `print(results["FAKE_QUANTIZED"]["traceback"])` gives us:

  ```bash
  Traceback (most recent call last):
    File "/Users/oscarsavolainen/Coding/Mine/Alma-Saif/src/alma/benchmark_model.py", line 88, in benchmark_model
      result: Dict[str, float] = benchmark(
                                 ^^^^^^^^^^
    File "/Users/oscarsavolainen/Coding/Mine/Alma-Saif/src/alma/benchmark/benchmark.py", line 63, in benchmark
      warmup(forward_call, data_loader, conversion_device)
    File "/Users/oscarsavolainen/Coding/Mine/Alma-Saif/src/alma/benchmark/warmup.py", line 26, in warmup
      _ = forward_call(data)
          ^^^^^^^^^^^^^^^^^^
    File "<eval_with_key>.173", line 5, in forward
      activation_post_process_0 = self.activation_post_process_0(x);  x = None
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/homebrew/Caskroom/miniconda/base/envs/quantization-tuts/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
      return self._call_impl(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/homebrew/Caskroom/miniconda/base/envs/quantization-tuts/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
      return forward_call(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/homebrew/Caskroom/miniconda/base/envs/quantization-tuts/lib/python3.11/site-packages/torch/ao/quantization/_learnable_fake_quantize.py", line 160, in forward
      X = torch._fake_quantize_learnable_per_tensor_affine(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  NotImplementedError: The operator 'aten::_fake_quantize_learnable_per_tensor_affine' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment variable `PYTORCH_ENABLE_MPS_FALLBACK=1` to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.
  ```

  By default `display_all_results` only logs the error from the conversion, but one can also
  include the traceback in `display_all_results` via the `include_traceback_for_errors` argument
  E.g. `display_all_results(results, include_traceback_for_errors=True)`.

  Incidentally, this Apple-silicon-quantization issue can be solved by setting the environmental variable:
  ```bash
  PYTORCH_ENABLE_MPS_FALLBACK=1
  ```



  A lot of the imported modules have verbose logging, and so `alma` provides some logging functions
  to help manage the logging level. The `setup_logging` function is provided for convenience, but one
  can use whatever logging one wishes, or none.
  We also provide a `silence_logging` function to silence the logging of all imported modules.

  Furthermore, as we have highlighted prior, we provide a `display_all_results` function to print
  the results in a nice format.There is also a `save_dict_to_json` function to save the results to a
  JSON file for easy CI integration.



  For convenience, we provide a `parse_benchmark_args` function that parses the command line arguments
  for the user. One can of course also just pass in non-CLI arguments directly to the
  `benchmark_model` API. The `parse_benchmark_args` function is used as follows:

  ```python
  from alma import benchmark_model
  from alma.arguments.benchmark_args import parse_benchmark_args
  from alma.utils.setup_logging import setup_logging
  from typing import Dict



  setup_logging(level="INFO")




  args, device = parse_benchmark_args()


  model = ...
  model = model.to(device)


  data_loader = ...


  config = {
      "batch_size": args.batch_size,
      "n_samples": args.n_samples,
  }


  results: Dict[str, Dict[str, float]] = benchmark_model(
      model, config, args.conversions, data_loader=data_loader
  )
  ```

  One can then run the script from the command line with the following command:

  ```bash
  python YOUR_BENCHMARK_SCRIPT.py --conversions EAGER,EXPORT+EAGER --batch-size 10
  --n-samples 5000 --ipdb
  ```

  This will run the EXPORT+EAGER conversion option and the EAGER conversion option, benchmarking the
  model speed for each conversion option.
  The batch size of the data loader is controlled via then`batch_size` argument.
  The number of samples to run the benchmark on is controlled via the `n_samples` argument.
  The `--ipdb` creates a magic breakpoint that throws one into an ipdb debugging session if and wherever
  an Exception occurs in one's code, making debugging much easier (see this
  [blog post](https://medium.com/@oscar-savolainen/my-favourite-python-snippets-794d5653af38)).

  All of the command line arguments are optional, subject to one using the `parse_benchmark_args` API.
  The defaults are set in `alma/arguments/benchmark_args.py`. These include standard arguments for
  convenience, e.g. `--model-path` for model weight loading, and `--data-dir` for data loading.

  To see all of the arguments, run the following command:

  ```bash
  cd examples/mnist
  python benchmark_with_dataloader.py --help
  ```



  For extensive examples on how to use `alma`, as well as simple clean examples on how train a model and
  quantize it, see the [`examples`](./examples/README.md#overview) directory.





  The currently supported conversion options are:

  ```bash
  XXX
  YYY
  ```

  These conversion options are also all hard-coded in the `alma/conversions/select.py` file, which
  is the source of truth.



  The naming convention for conversion options is to use short but descriptive names, e.g. `EAGER`,
  `EXPORT+EAGER`, `EXPORT+TENSORRT`, etc. If multiple "techniques" are used in a
  single conversion option, then the names are separated by a `+` sign in chronological order of operation.
  Underscores `_` are used within each technique name to seperate the words for readability,
  e.g. `EXPORT+AOT_INDUCTOR`, where `EXPORT` and `AOT_INDUCTOR` are considered seperate steps.




  - Add more conversion options. This is a work in progress, and we are always looking for more conversion options.
  - Multi-device benchmarking. Currently `alma` only supports single-device benchmarking, but ideally a model
    could be split across multiple devices.
  - Integrating conversion options beyond PyTorch, e.g. HuggingFace, JAX, llama.cpp, etc.



  Contributions are welcome! If you have a new conversion option or feature you would like to add, so that the whole community can benefit,
  please open a pull request! We are always looking for new conversion options, and we are happy to help
  you get started with adding a new conversion option/feature!



  All conversion options are set in `src/alma/conversions/`. In that directory, one can find the conversion
  option code inside `options/`, where each file contains a conversion option (or sometimes closely related
  family of options). At the risk of some code duplication, we have chosen to keep the conversion options
  separate, so that one can easily add new conversion options without having to modify the existing ones.
  It also makes it easier for the user to see what conversion options are available, and to understand what
  each conversion option does.

  The conversion options are then selected for benchmarking in the `src/alma/conversions/select.py` file.
  This is just a glorified match-case statement that returns the forward calls of each model conversion option,
  which is returned to the benchmarking loop. It is that simple!

  If adding any conversion options, follow the naming convention in [Naming Conventions](#naming-conventions).



  Some conversion options may require package dependencies, which should be added to the Docker image and/or
  `requirements.txt` file.



  - **Black**: Ensures consistency following a strict subset of PEP 8.
  - **isort**: Organizes Python imports systematically.



  1. From the repo root, run:

  ```bash
  pre-commit install
  ```



  If you want to manually run all hooks on all files, you can do:

  ```bash
  git stage .
  pre-commit run --all-files
  ```


pkgId: b8aa2e4b2be089ee0ba329fdd0c09992d56661cc57aba219db0819a65d109b14
name: python-alma-torch
arch: src
version: 0.1.19
epoch: 0
release: 1
summary: A package for benchmarking the speed of different PyTorch conversion options
url: https://github.com/saifhaq/alma
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alma-torch-0.1.19-1.src.rpm
checksum_type: sha256
description:
  A Python library for benchmarking PyTorch model speed for different conversion options.

  The motivation is to make it easy for people to benchmark their models for different conversion options,
  e.g. eager, tracing, scripting, torch.compile, torch.export, ONNX, Tensort, etc. The library is
  designed to be simple to use, with benchmarking provided via a single API call, and to be easily
  extensible for adding new conversion options.

  Beyond just benchmarking, `alma` is designed to be a one-stop-shop for all model conversion options,
  so that one can learn about the different conversion options, how to implement them, and how they
  affect model speed and performance.


  `alma` is available as a Python package.

  One can install the package from python package index by running
  ```bash
  pip install alma
  ```

  Alternatively, it can be installed from the root of this repository (save level as this README) by
  running:
  ```bash
  pip install -e .
  ```




  The core API is `benchmark_model`, which is used to benchmark the speed of a model for different
  conversion options. The usage is as follows:

  ```python
  from alma import benchmark_model
  from alma.benchmark.log import display_all_results

  device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")


  model = ...
  model = model.to(device)


  data_loader = ...


  config = {
      "batch_size": 128,
      "n_samples": 4096,
  }


  conversions = ["EAGER", "EXPORT+EAGER"]


  results = benchmark_model(model, config, conversions, data_loader=data_loader)


  display_all_results(results)
  ```

  The results will look like this, depending on one's model, dataloader, and hardware.

  ```bash
  EAGER results:
  device: cuda:0
  Total elapsed time: 0.4148 seconds
  Total inference time (model only): 0.0436 seconds
  Total samples: 5000
  Throughput: 12054.50 samples/second

  EXPORT+EAGER results:
  device: cuda:0
  Total elapsed time: 0.3906 seconds
  Total inference time (model only): 0.0394 seconds
  Total samples: 5000
  Throughput: 12800.82 samples/second
  ```


  We also provide the option to feed in a single `data` tensor instead of a dataloader. This is useful
  for cases where one does not want to go throuhg the trouble of setting up a dataloader, and is happy
  to just benchmark the model on random data of a given shape.
  If no `data_loader` argument is provided and a `data` tensor is fed in, `benchmark_model`
  will automatically generate a dataloader of random tensors, of the same shape as `data`.
  `data` should be fed in WITHOUT a batch dimension.
  The batch size of the dataloader will be equal to the `batch_size` in the `config` dict.

  ```python
  from alma import benchmark_model
  from alma.benchmark.log import display_all_results

  device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")


  model = ...
  model = model.to(device)



  data = torch.randn(1, 3, 224, 224).to(device)


  config = {
      "batch_size": 128,
      "n_samples": 4096,
  }


  conversions = ["EAGER", "EXPORT+EAGER"]


  results = benchmark_model(model, config, conversions, data=data.squeeze())


  display_all_results(results)
  ```




  In case where the benchmarking of a given conversion fails, it will return a dict for that conversion
  which contains the error message as well as the full traceback. This is useful for debugging and
  understanding why a given conversion failed, e.g. because of hardware incompatabilities, missing
  dependencies, etc.

  For example, if the `FAKE_QUANTIZED` conversion fails because it's not currently supported for Apple
  silicon, the default results may look like this:

  ```bash
  CONVERT_QUANTIZED results:
  Device: cpu
  Total elapsed time: 0.8287 seconds
  Total inference time (model only): 0.4822 seconds
  Total samples: 5000 - Batch size: 50
  Throughput: 6033.89 samples/second


  FAKE_QUANTIZED results:
  Benchmarking failed, error: The operator 'aten::_fake_quantize_learnable_per_tensor_affine' is not
  currently implemented for the MPS device. If you want this op to be added in priority during the
  prototype phase of this feature, please comment on
  https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment
  variable `PYTORCH_ENABLE_MPS_FALLBACK=1` to use the CPU as a fallback for this op. WARNING: this
  will be slower than running natively on MPS.
  ```

  The traceback of the error is also stored in the results dict, and can be accessed via
  `results[CONVERSION_NAME]["traceback"]`.

  In this example, `print(results["FAKE_QUANTIZED"]["traceback"])` gives us:

  ```bash
  Traceback (most recent call last):
    File "/Users/oscarsavolainen/Coding/Mine/Alma-Saif/src/alma/benchmark_model.py", line 88, in benchmark_model
      result: Dict[str, float] = benchmark(
                                 ^^^^^^^^^^
    File "/Users/oscarsavolainen/Coding/Mine/Alma-Saif/src/alma/benchmark/benchmark.py", line 63, in benchmark
      warmup(forward_call, data_loader, device)
    File "/Users/oscarsavolainen/Coding/Mine/Alma-Saif/src/alma/benchmark/warmup.py", line 26, in warmup
      _ = forward_call(data)
          ^^^^^^^^^^^^^^^^^^
    File "<eval_with_key>.173", line 5, in forward
      activation_post_process_0 = self.activation_post_process_0(x);  x = None
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/homebrew/Caskroom/miniconda/base/envs/quantization-tuts/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
      return self._call_impl(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/homebrew/Caskroom/miniconda/base/envs/quantization-tuts/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
      return forward_call(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/homebrew/Caskroom/miniconda/base/envs/quantization-tuts/lib/python3.11/site-packages/torch/ao/quantization/_learnable_fake_quantize.py", line 160, in forward
      X = torch._fake_quantize_learnable_per_tensor_affine(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  NotImplementedError: The operator 'aten::_fake_quantize_learnable_per_tensor_affine' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764. As a temporary fix, you can set the environment variable `PYTORCH_ENABLE_MPS_FALLBACK=1` to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.
  ```

  By default `display_all_results` only logs the error from the conversion, but one can also
  include the traceback in `display_all_results` via the `include_traceback_for_errors` argument
  E.g. `display_all_results(results, include_traceback_for_errors=True)`.

  Incidentally, this Apple-silicon-quantization issue can be solved by setting the environmental variable:
  ```bash
  PYTORCH_ENABLE_MPS_FALLBACK=1
  ```



  A lot of the imported modules have verbose logging, and so `alma` provides some logging functions
  to help manage the logging level. The `setup_logging` function is provided for convenience, but one
  can use whatever logging one wishes, or none.
  We also provide a `silence_logging` function to silence the logging of all imported modules.

  Furthermore, as we have highlighted prior, we provide a `display_all_results` function to print
  the results in a nice format.There is also a `save_dict_to_json` function to save the results to a
  JSON file for easy CI integration.

  If one is debugging, it is highly recommended that one use the `setup_logging` function and set one's
  level to DEBUG. This will, among other things, log any torch.compile warnings and errors thrown by
  torch.inductor that can point to isses in triton kernels, and print the model graphs where
  appropriate.



  For convenience, we provide a `parse_benchmark_args` function that parses the command line arguments
  for the user. One can of course also just pass in non-CLI arguments directly to the
  `benchmark_model` API. The `parse_benchmark_args` function is used as follows:

  ```python
  from alma import benchmark_model
  from alma.arguments.benchmark_args import parse_benchmark_args
  from alma.utils.setup_logging import setup_logging
  from typing import Dict



  setup_logging(level="INFO")




  args, device = parse_benchmark_args()


  model = ...
  model = model.to(device)


  data_loader = ...


  config = {
      "batch_size": args.batch_size,
      "n_samples": args.n_samples,
  }


  results: Dict[str, Dict[str, float]] = benchmark_model(
      model, config, args.conversions, data_loader=data_loader
  )
  ```

  One can then run the script from the command line with the following command:

  ```bash
  python YOUR_BENCHMARK_SCRIPT.py --conversions EAGER,EXPORT+EAGER --batch-size 10
  --n-samples 5000 --ipdb
  ```

  This will run the EXPORT+EAGER conversion option and the EAGER conversion option, benchmarking the
  model speed for each conversion option.
  The batch size of the data loader is controlled via then`batch_size` argument.
  The number of samples to run the benchmark on is controlled via the `n_samples` argument.
  The `--ipdb` creates a magic breakpoint that throws one into an ipdb debugging session if and wherever
  an Exception occurs in one's code, making debugging much easier (see this
  [blog post](https://medium.com/@oscar-savolainen/my-favourite-python-snippets-794d5653af38)).

  All of the command line arguments are optional, subject to one using the `parse_benchmark_args` API.
  The defaults are set in `alma/arguments/benchmark_args.py`. These include standard arguments for
  convenience, e.g. `--model-path` for model weight loading, and `--data-dir` for data loading.

  To see all of the arguments, run the following command:

  ```bash
  cd examples/mnist
  python benchmark_with_dataloader.py --help
  ```



  For extensive examples on how to use `alma`, as well as simple clean examples on how train a model and
  quantize it, see the [`examples`](./examples/README.md#overview) directory.





  The currently supported conversion options are:

  ```bash
  XXX
  YYY
  ```

  These conversion options are also all hard-coded in the `alma/conversions/select.py` file, which
  is the source of truth.



  The naming convention for conversion options is to use short but descriptive names, e.g. `EAGER`,
  `EXPORT+EAGER`, `EXPORT+TENSORRT`, etc. If multiple "techniques" are used in a
  single conversion option, then the names are separated by a `+` sign in chronological order of operation.
  Underscores `_` are used within each technique name to seperate the words for readability,
  e.g. `EXPORT+AOT_INDUCTOR`, where `EXPORT` and `AOT_INDUCTOR` are considered seperate steps.




  - Add more conversion options. This is a work in progress, and we are always looking for more conversion options.
  - Multi-device benchmarking. Currently `alma` only supports single-device benchmarking, but ideally a model
    could be split across multiple devices.
  - Integrating conversion options beyond PyTorch, e.g. HuggingFace, JAX, llama.cpp, etc.



  Contributions are welcome! If you have a new conversion option or feature you would like to add, so that the whole community can benefit,
  please open a pull request! We are always looking for new conversion options, and we are happy to help
  you get started with adding a new conversion option/feature!



  All conversion options are set in `src/alma/conversions/`. In that directory, one can find the conversion
  option code inside `options/`, where each file contains a conversion option (or sometimes closely related
  family of options). At the risk of some code duplication, we have chosen to keep the conversion options
  separate, so that one can easily add new conversion options without having to modify the existing ones.
  It also makes it easier for the user to see what conversion options are available, and to understand what
  each conversion option does.

  The conversion options are then selected for benchmarking in the `src/alma/conversions/select.py` file.
  This is just a glorified match-case statement that returns the forward calls of each model conversion option,
  which is returned to the benchmarking loop. It is that simple!

  If adding any conversion options, follow the naming convention in [Naming Conventions](#naming-conventions).



  Some conversion options may require package dependencies, which should be added to the Docker image and/or
  `requirements.txt` file.



  - **Black**: Ensures consistency following a strict subset of PEP 8.
  - **isort**: Organizes Python imports systematically.



  1. From the repo root, run:

  ```bash
  pre-commit install
  ```



  If you want to manually run all hooks on all files, you can do:

  ```bash
  git stage .
  pre-commit run --all-files
  ```


pkgId: bba3e3d1dc38e542ef56f438744c7547d6f728f8eaffbf8a4f5111e548a3cd4a
name: python-almasru
arch: src
version: 2.2.15
epoch: 0
release: 1
summary: This python module is a tool to use Alma SRU. it manages the logs and the backup of the records.
url: https://github.com/Swiss-Library-Service-Platform/almasru
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-almasru-2.2.15-1.src.rpm
checksum_type: sha256
description:
  *********************
  Alma SRU helper |doc|
  *********************

  This python module is a tool to use Alma SRU. It manages the logs and the
  backup of the records.

  * Author: Raphaël Rey (raphael.rey@slsp.ch)
  * Year: 2023
  * Version: 0.1
  * License: GNU General Public License v3.0
  * `Documentation <https://almasru.readthedocs.io/en/latest/>`_

  .. |doc| image:: https://readthedocs.org/projects/almapi-wrapper/badge/?version=latest
      :target: https://almasru.readthedocs.io/en/latest/
      :alt: Documentation Status


pkgId: cf5275a31e9a601576f8f33af2726953d92ca04893fe0602df0871a9ff963446
name: python-almoststatic
arch: src
version: 1.0.5
epoch: 0
release: 1
summary: Use Jinja2 template system to build static pages with Flask integration
url: https://gitlab.com/claudio.driussi/almoststatic
rpm_license: LGPL
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-almoststatic-1.0.5-1.src.rpm
checksum_type: sha256
description:
  **Almoststatic** is a static sites and web pages generator engine written in
  [Python](https://python.org) which utilizes the
  [Jinja2 template system](https://jinja.palletsprojects.com) to render pages.
  It can be integrated with [Flask](https://flask.palletsprojects.com) apps to
  serve static contents on dynamic sites or used standalone for static sites
  development.

  Pages are declared in [YAML](https://yaml.org/) files and rendered with Jinja2
  template files. The HTML contents can be written in [Markdown](https://www.markdownguide.org/)
  markup language or in plain HTML. The “content” folder contains all data needed
  to do the job, and the “config.yaml” is used to share global parameters and to
  set up configuration.

  It is loosely inspired by [Hugo](https://gohugo.io/) static site generator, but
  it differs in many ways.



  There are many static site generators such as [Next.js](https://nextjs.org/),
  [Hugo](https://gohugo.io/) or [Jekyll](https://jekyllrb.com/), but you can
  prefer Almostatic because:

  - **It's perfect for pythonist.** It uses Jinja2 and Flask which are widely
    used by python community, so you don\'t need to learn other programming
    languages or template engines.
  - **It's easy!** In fact the rules are very few and this mean few things to
    learn and great flexibility.
  - **It's versatile.** It's engine has a powerful recursive system for embedding
    and including contents. This helps you to build rich contents and also to
    split them in small pieces called *"widgets"* easier to maintain.
  - **It has blog capabilities.** Contain functions used to query metadata info
    useful to organize blog pages by categories and tags.
  - **You can deliver static and dynamic contents at same time.** With Flask you
    can build your dynamic content and let Almoststatic to render the rest of
    page or the whole page, if it is full static.
  - **Write static sites.** Static sites are composed only by text files and media
    contents. They are easy to deliver on the web, are secure by design, require
    less maintenance and resources and are faster. If you have no need for dynamic
    contents, with **Almoststatic** you can write all pages as static.
  - **Not only for pythonists.** Basic knowledge of python is needed, but once
    your developer environment is ready, Almoststatic lets you to focus on
    writing yaml and karkdown\'s contents and to create your own widgets in html
    and Jinja2.



  The simplest way to see if **Almoststatic** is what you're looking for, is to
  try the sample provided with source code package and explore the source code.

  The following tutorial is tested on Linux Ubuntu, but it's easy to port on
  other platforms such other Linux distros, Windows or Mac.

  You need git and python3, install them with:
  ```bash
  $ sudo apt install git python3
  ```
  Last linux's releases comes with python3 already installed and you have only to
  check if your version is 3.6 or higher:

  ```bash
  $ python3 --version
  ```

  Now clone Almoststatic with git and enter into the directory:

  ```bash
  $ git clone https://gitlab.com/claudio.driussi/almoststatic.git
  $ cd almoststatic
  ```
  It's common in python using virtualenv for development, to do so and to install
  Almoststatic, write:

  ```bash
  $ python3 -m venv myvenv
  $ source myvenv/bin/activate
  $ pip install almoststatic
  $ pip install pyftpsync
  ```

  Done! Now you can try the sample, cd into sample directory and run flaskapp.py:

  ```bash
  $ cd sample/
  $ python flaskapp.py
  ```

  A local host Flask App instance server is executed and you can test
  Almoststatic features.

  Open your browser and copy and paste the following URL: `http://127.0.0.1:5000/`
  or `localhost:5000`

  You will be redirected to the static site showing some widgets and feature
  of Almostatic, you can navigate to see some examples.

  You can always exit from server pressing CTRL-C on your terminal.

  To build static site run:

  ```bash
  $ python write_static.py
  $ ls -l ../_static_site/
  ```
  As you can see, your pages are written as *.html files, but this is not enough
  to get a really static site, to do this you have to tune writing parameters and
  copy media files on appropriate location. When you are done the site can be
  published as static site.

  If you wish, you can run tests:

  ```bash
  $ cd ../test
  $ python as_test.py
  ```
  This do some tests and write a simpler static site.

  Now if you decide that **Almoststatic** is right for you, you can dig into
  source code of sample and tests and read the documentation at:
  [https://almoststatic.readthedocs.io](https://almoststatic.readthedocs.io)



  Almoststatic is young but stable! It has all planned features and always gave me
  the right results so it can be considered "production ready"

  At the moment there are only a few themes, we are developing a "rolling theme"
  with some beautiful widgets ready to use.
  See [Flatstep theme](https://gitlab.com/almoststatic-themes/flatstep)
  and follow the tutorial.

  I'm not a designer so the result is of average quality. But I'm sure that good
  designers can write great themes.




  If you appreciate Almoststatic, you can make a donation via PayPal

  [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/donate?hosted_button_id=JYJ6EMFY7YWJQ)


pkgId: 8dbebc647ee57377466502c8078661a8e4d147a1476d0de3ce2989b0c5359152
name: python-alnoda-wrk
arch: src
version: 0.4.33
epoch: 0
release: 1
summary: A tool to build Alnoda workspaces
url: https://pypi.org/project/alnoda-wrk/
rpm_license: AGPL-3.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alnoda-wrk-0.4.33-1.src.rpm
checksum_type: sha256
description:
  A tool to build alnoda workspaces


  Roadmap candidates:

  - https://github.com/timvisee/ffsend
  - https://github.com/schollz/croc
  - https://github.com/KuroLabs/Airshare


pkgId: b70686608ff877f6d915dce53b9f6b03e1a4afcd8e1655c7c2f422aea9320c7e
name: python-alns
arch: src
version: 7.0.0
epoch: 0
release: 1
summary: A flexible implementation of the adaptive large neighbourhood search (ALNS) algorithm.
url: https://github.com/N-Wouda/ALNS
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alns-7.0.0-1.src.rpm
checksum_type: sha256
description:
  ![ALNS logo](docs/source/assets/images/logo.svg)

  [![PyPI version](https://badge.fury.io/py/alns.svg)](https://badge.fury.io/py/alns)
  [![ALNS](https://github.com/N-Wouda/ALNS/actions/workflows/alns.yaml/badge.svg)](https://github.com/N-Wouda/ALNS/actions/workflows/alns.yaml)
  [![Documentation Status](https://readthedocs.org/projects/alns/badge/?version=latest)](https://alns.readthedocs.io/en/latest/?badge=latest)
  [![codecov](https://codecov.io/gh/N-Wouda/ALNS/branch/master/graph/badge.svg)](https://codecov.io/gh/N-Wouda/ALNS)
  [![DOI](https://joss.theoj.org/papers/10.21105/joss.05028/status.svg)](https://doi.org/10.21105/joss.05028)

  ``alns`` is a general, well-documented and tested implementation of the adaptive
  large neighbourhood search (ALNS) metaheuristic in Python. ALNS is an algorithm
  that can be used to solve difficult combinatorial optimisation problems. The
  algorithm begins with an initial solution. Then the algorithm iterates until a
  stopping criterion is met. In each iteration, a destroy and repair operator are
  selected, which transform the current solution into a candidate solution. This
  candidate solution is then evaluated by an acceptance criterion, and the
  operator selection scheme is updated based on the evaluation outcome.



  The `alns` package depends on `numpy` and `matplotlib`. It may be installed in the
  usual way as
  ```
  pip install alns
  ```
  Additionally, to enable more advanced operator selection schemes using
  multi-armed bandit algorithms, `alns` may be installed with the optional
  [MABWiser][12] dependency:
  ```
  pip install alns[mabwiser]
  ```



  The documentation is available [here][1]. If you are new to metaheuristics or
  ALNS, you might benefit from reading the [introduction to ALNS][11] page.

  The `alns` library provides the ALNS algorithm and various acceptance criteria,
  operator selection schemes, and stopping criteria. To solve your own problem,
  you should provide the following:

  - A solution state for your problem that implements an `objective()` function.
  - An initial solution.
  - One or more destroy and repair operators tailored to your problem.

  A "quickstart" code template is available [here][10].



  We provide several example notebooks showing how the ALNS library may be used.
  These include:

  - The travelling salesman problem (TSP), [here][2]. We solve an instance of 131
    cities using very simple destroy and repair heuristics.
  - The capacitated vehicle routing problem (CVRP), [here][8]. We solve an
    instance with 241 customers using a combination of a greedy repair operator,
    and a _slack-induced substring removal_ destroy operator.
  - The cutting-stock problem (CSP), [here][4]. We solve an instance with 180
    beams over 165 distinct sizes in only a very limited number of iterations.
  - The resource-constrained project scheduling problem (RCPSP), [here][6]. We
    solve an instance with 90 jobs and 4 resources using a number of different
    operators and enhancement techniques from the literature.
  - The permutation flow shop problem (PFSP), [here][9]. We solve an instance with
    50 jobs and 20 machines. Moreover, we demonstrate multiple advanced features
    of ALNS, including auto-fitting the acceptance criterion and adding local
    search to repair operators. We also demonstrate how one could tune ALNS
    parameters.

  Finally, the features notebook gives an overview of various options available in
  the `alns` package. In the notebook we use these different options to solve a
  toy 0/1-knapsack problem. The notebook is a good starting point for when you
  want to use different schemes, acceptance or stopping criteria yourself. It is
  available [here][5].



  We are very grateful for any contributions you are willing to make. Please have
  a look [here][3] to get started. If you aim to make a large change, it is
  helpful to discuss the change first in a new GitHub issue. Feel free to open
  one!



  Feel free to open an issue or a new discussion thread here on GitHub.
  Please do not e-mail us with questions, modelling issues, or code examples.
  Those are much easier to discuss via GitHub than over e-mail.
  When writing your issue or discussion, please follow the instructions [here][7].



  If you use `alns` in your research, please consider citing the following paper:

  > Wouda, N.A., and L. Lan (2023).
  > ALNS: a Python implementation of the adaptive large neighbourhood search metaheuristic.
  > _Journal of Open Source Software_, 8(81): 5028.
  > https://doi.org/10.21105/joss.05028

  Or, using the following BibTeX entry:

  ```bibtex
  @article{Wouda_Lan_ALNS_2023,
    doi = {10.21105/joss.05028},
    url = {https://doi.org/10.21105/joss.05028},
    year = {2023},
    publisher = {The Open Journal},
    volume = {8},
    number = {81},
    pages = {5028},
    author = {Niels A. Wouda and Leon Lan},
    title = {{ALNS}: a {P}ython implementation of the adaptive large neighbourhood search metaheuristic},
    journal = {Journal of Open Source Software}
  }
  ```

  [1]: https://alns.readthedocs.io/en/latest/

  [2]: https://alns.readthedocs.io/en/latest/examples/travelling_salesman_problem.html

  [3]: https://alns.readthedocs.io/en/latest/setup/contributing.html

  [4]: https://alns.readthedocs.io/en/latest/examples/cutting_stock_problem.html

  [5]: https://alns.readthedocs.io/en/latest/examples/alns_features.html

  [6]: https://alns.readthedocs.io/en/latest/examples/resource_constrained_project_scheduling_problem.html

  [7]: https://alns.readthedocs.io/en/latest/setup/getting_help.html

  [8]: https://alns.readthedocs.io/en/latest/examples/capacitated_vehicle_routing_problem.html

  [9]: https://alns.readthedocs.io/en/latest/examples/permutation_flow_shop_problem.html

  [10]: https://alns.readthedocs.io/en/latest/setup/template.html

  [11]: https://alns.readthedocs.io/en/latest/setup/introduction_to_alns.html

  [12]: https://github.com/fidelity/mabwiser


pkgId: 3c7f3a77a7303cfe12b25fb7a73b422c94835bfd64bfac4ebdcf47fafef405ae
name: python-aloe-django
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: Package for testing Django applications with Aloe
url: https://github.com/aloetesting/aloe_django
rpm_license: GNU General Public License v3 or later (GPLv3+)
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-aloe-django-0.2.0-1.src.rpm
checksum_type: sha256
description:
  [![Build status](https://img.shields.io/travis/aloetesting/aloe_django.svg)](https://travis-ci.org/aloetesting/aloe_django)
  [![Coverage](https://img.shields.io/coveralls/aloetesting/aloe_django.svg)](https://coveralls.io/github/aloetesting/aloe_django)
  [![PyPI](https://img.shields.io/pypi/v/aloe_django.svg)](https://pypi.python.org/pypi/aloe_django)
  Utilities for using [Aloe](https://github.com/aloetesting/aloe) with
  [Django](http://djangoproject.com):
  - A `harvest` command to run Gherkin tests
  - A collection of steps to aid in testing Django applications
  Install:
      pip install aloe_django
  Read the [documentation](http://aloe.readthedocs.io/projects/aloe-django/).
  Aloe and Aloe-Django are based on [Lettuce](http://lettuce.it/).


pkgId: 10e0e72031d1095362778dd93ffcc8467d1abb981afdb8974da3eff46cc8a01d
name: python-aloe-webdriver
arch: src
version: 0.6.0
epoch: 0
release: 1
summary: Selenium webdriver extension for Aloe
url: https://github.com/aloetesting/aloe_webdriver/
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-aloe-webdriver-0.6.0-1.src.rpm
checksum_type: sha256
description:
  [![Build status](https://img.shields.io/travis/aloetesting/aloe_webdriver.svg)](https://travis-ci.org/aloetesting/aloe_webdriver)
  [![Coverage](https://img.shields.io/coveralls/aloetesting/aloe_webdriver.svg)](https://coveralls.io/github/aloetesting/aloe_webdriver)
  [![PyPI](https://img.shields.io/pypi/v/aloe_webdriver.svg)](https://pypi.python.org/pypi/aloe_webdriver)
  A set of [Gherkin][gherkin] steps for use with [Aloe][aloe] to test Web
  applications using Selenium.
  Based on [lettuce_webdriver][lettuce_webdriver] which, in turn, is inspired by
  [cucumber_watir][cucumber_watir].
  Install:
      pip install aloe_webdriver
  Read the [documentation][documentation].


pkgId: cf98f7ff0056e2be382be78d2ecbdd0e5b09934fb6270c8a5e22f590feaa7f32
name: python-alog
arch: src
version: 1.2.0
epoch: 0
release: 1
summary: Your goto Python logging without panic on context swtich
url: https://github.com/keitheis/alog
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alog-1.2.0-1.src.rpm
checksum_type: sha256
description:
  Your goto Python logging without panic on context swtich.
  **Warning:** No more ``logger = logging.getLogger(__name__)`` in your every file.
    >>> import alog
    >>> alog.info("Hi.")
    2016-12-18 20:44:30 INFO  <stdin> Hi.
    >>> def test():
    >>> test()
    2016-12-18 20:45:19 INFO  <stdin:2> Test 1
    2016-12-18 20:45:19 ERROR <stdin:3> Test 2
    >>> alog.set_level("ERROR")
    >>> test()
    2016-12-18 20:45:41 ERROR <stdin:3> Test 2
  If you're new to logging, see `Why should you use logging instead of print`_.


pkgId: bf577f500143dae05b2e00bca818fd6b0459785e3576e6e1e233158fdf8fcc18
name: python-alohomora
arch: src
version: 3.1.1
epoch: 0
release: 1
summary: Get AWS API keys for a SAML-federated identity
url: https://github.com/Viasat/alohomora
rpm_license: (c) 2024 Viasat, Inc. See the LICENSE file for more details.
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alohomora-3.1.1-1.src.rpm
checksum_type: sha256
description:
  Your new access key pair has been stored in the AWS configuration file /Users/myuser/.aws/credentials under the saml profile.


pkgId: 07eb521b7118a63e5772e2516fcdaca1d47a5a88fb6bbacb5de5cebebb30de9f
name: python-alpaca
arch: src
version: 1.0.0
epoch: 0
release: 1
summary: UNKNOWN
url: https://github.com/activesys/alpaca-llama
rpm_license: BSD
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alpaca-1.0.0-1.src.rpm
checksum_type: sha256
description:
  将一个描述词法的正则表达式转换成最小化的DFA，以dot语言形式输出。

  将描述语法的范式转换成分析转换表，以图形的方式输出，同时能够根据不同的语法分析算法检查范式的定义错误，并且能够修正错误。
  详情请参考[alpace-llama wiki](https://github.com/activesys/alpaca-llama/wiki)。


pkgId: 2ee42a764dff307c317c2b283fcd72bd8f7bf1c6daf0a76d02e572885a3b7e76
name: python-alpaca-farm
arch: src
version: 0.2.0
epoch: 0
release: 1
summary: please add a summary manually as the author left a blank one
url: https://pypi.org/project/alpaca-farm/
rpm_license: Apache Software License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alpaca-farm-0.2.0-1.src.rpm
checksum_type: sha256
description:
  Research and development on learning from human feedback is difficult because methods
  like [RLHF](https://arxiv.org/abs/2203.02155) are complex and costly to run.
  AlpacaFarm is a simulator that enables research and development on learning from feedback at a fraction of the usual
  cost, promoting accessible research on instruction following and alignment.
  Please read our [paper](https://arxiv.org/abs/2305.14387)
  and [blog post](https://crfm.stanford.edu/2023/05/22/alpaca-farm.html) for details on our research findings.
  This repo contains code for
  - [simulating preference feedback from language models such as GPT-4](#simulating-pairwise-preference)
  - [automated evaluation for instruction-following models](#running-automatic-evaluation)
  - [validated reference implementations of baseline methods such as PPO and best-of-n](#running-reference-methods)
  The data needed to run our code is hosted on HuggingFace: <https://huggingface.co/datasets/tatsu-lab/alpaca_farm>.
  **Usage and License Notices**: AlpacaFarm is intended and licensed for research use only.
  The dataset is CC BY NC 4.0 (allowing only non-commercial use) and models trained using the dataset should not be used
  outside of research purposes.
  The weight diff is also CC BY NC 4.0 (allowing only non-commercial use).

  <br>
  <p style="text-align:center;">
    <img style="max-width:70%; height:auto;" src="./assets/fig1.jpg" alt="Workflow">
  </p>
  Instruction-following models are typically developed in 3 steps
  1. Supervised fine-tuning with demonstrations
  2. Learning from human feedback; usually pairwise preferences
  3. Human evaluation with interaction
  The goal of AlpacaFarm is to provide three key components that tackles steps 2 and 3:
  Low-cost simulation of pairwise feedback from API models (e.g. GPT-4, ChatGPT), automated evaluations for methods
  development, and reference implementations of
  learning algorithms for comparison and modification.

  To install the stable release, run
  ```bash
  pip install alpaca-farm
  ```
  To install from the latest commit on `main` branch, run
  ```bash
  pip install git+https://github.com/tatsu-lab/alpaca_farm.git
  ```
  To enable FlashAttention and other optimizations, install
  the [`flash-attn`](https://github.com/HazyResearch/flash-attention) and [`apex`](https://github.com/NVIDIA/apex)
  packages.

  **Notebook
  example:** [![Using](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tatsu-lab/alpaca_farm/blob/main/examples/auto_annotations.ipynb)
  For all the evaluation and annotations we use [**AlpacaEval**](https://github.com/tatsu-lab/alpaca_eval/tree/main#making-a-new-evaluator) with our pool of automatic annotators and additional noise to simulate the variance of human annotations.
  To get started, set the environment variable `OPENAI_API_KEY` to your OpenAI API key, and (optionally) `OPENAI_ORG` to
  the
  organization ID.
  You can do this by running
  ```bash
  export OPENAI_API_KEY="sk..."
  ```
  To annotate the pairs of outputs of your model use the following code.
  For more details or functions to use if you have outputs in different formats refer to
  the [example notebook](https://github.com/tatsu-lab/alpaca_farm/blob/main/examples/auto_annotations.ipynb).
  ```python
  from alpaca_farm.auto_annotations import PairwiseAutoAnnotator
  import json

  with open("examples/data/outputs_pairs.json") as f:
      outputs_pairs = json.load(f)[:6]
  print(outputs_pairs[-1:])




  annotator = PairwiseAutoAnnotator()
  annotated = annotator.annotate_pairs(outputs_pairs)
  print(annotated[-1:])






  ```
  If instead of pairs you have a list of sampled outputs, you can use the following.
  ```python
  multisample_outputs = [dict(instruction="repeat the following", input="yes", output=["yes", "no", "maybe", "repeat"])]
  print(annotator.annotate_samples(multisample_outputs))







  ```

  For all the evaluation we use [**AlpacaEval**](https://github.com/tatsu-lab/alpaca_eval/tree/main#making-a-new-evaluator) with our pool of automatic annotators.
  To get started, set the environment variable OPENAI_API_KEY to your OpenAI API key, and (optionally) OPENAI_ORG to the
  organization ID. You can do this by running
  ```bash
  export OPENAI_API_KEY="sk..."
  ```
  The easiest to add your model to the Alpaca Leaderboard is to run the following code, which only requires having outputs
  for your model on our eval data.
  ```python
  from alpaca_farm.auto_annotations import alpaca_leaderboard
  import datasets

  alpaca_eval_data = datasets.load_dataset("tatsu-lab/alpaca_farm", "alpaca_farm_evaluation")["eval"]
  path_to_outputs = "examples/data/eval_gpt-3.5-turbo-0301.json"



  alpaca_leaderboard(path_to_outputs, name="My fancy model")







  ```

  We provide reference implementations of several methods for learning from pairwise feedback.
  Example code to run these methods can be found in the `examples/` directory.
  This includes [supervised fine-tuning](examples/supervised.py), [reward modeding](examples/reward_modeling.py)
  , [RLHF with PPO](examples/rlhf_ppo.py), [best-of-n decoding](examples/best_of_n.py) and more.
  Below we give example commands for reproducing the model artifacts in our paper. Notes:
  - All training code are tested with FlashAttention enabled on a machine with 8 80GB A100 GPUs.
  - Best-of-n decoding was tested with a single 80GB GPU.
  - Supervised fine-tuning and reward modeling can fit on 4 80GB A100 GPUs, while PPO training currently requires at least
    8
    80GB GPUs.
  - Before running the code below, make sure to convert your LLaMA checkpoint and tokenizer into HuggingFace format and
    store it at `<your_path_to_hf_converted_llama_ckpt_and_tokenizer>`.

  To replicate our SFT10k model fine-tuned from LLaMA in the paper, run
  ```bash
  bash examples/scripts/sft.sh \
    <your_output_dir_for_sft10k> \
    <your_wandb_run_name> \
    <your_path_to_hf_converted_llama_ckpt_and_tokenizer>
  ```
  The SFT10k model will be saved at `<your_output_dir>`, and the name of the wandb run will be `<your_wandb_run_name>`.

  To replicate our reward models trained in the paper, run
  ```bash
  bash examples/scripts/reward_modeling.sh \
    <your_output_dir_for_reward_model> \
    <your_wandb_run_name> \
    <your_output_dir_for_sft10k> \
    <preference_dataset_name>
  ```
  Set `<preference_dataset_name>` to `"alpaca_noisy_multi_preference"` for simulated preference reward model, and
  `"alpaca_human_preference"` for human preference reward model.

  To replicate our RLHF PPO model trained with simulated reward model in the paper, run
  ```bash
  bash examples/scripts/rlhf_ppo.sh \
    <your_output_dir_for_ppo> \
    <your_wandb_run_name> \
    <your_output_dir_for_reward_model> \
    <your_output_dir_for_sft10k> \
    <kl_coef>
  ```
  `<your_output_dir_for_reward_model>` should point to either simulated reward model or human reward model trained
  according
  to the previous step.
  Note the KL penalty coefficient for human reward PPO is much larger than for simulated PPO.
  Set `<kl_coef>` to `0.0067` for simulated PPO, and `0.02` for human PPO to recover our original results.
  Performance of the PPO model is typically much better than SFT at 20-80 PPO steps (less than 4 passes through the entire
  set of instructions) and starts to decay with more PPO steps.

  To replicate our best-of-n inference-time decoding results for the AlpacaFarm evaluation suite, run
  ```bash
  python examples/best_of_n.py \
    --task "run_best_of_n" \
    --decoder_name_or_path <your_output_dir_for_decoder> \  # Can be SFT model or even PPO tuned model.
    --scorer_name_or_path <your_output_dir_for_reward_model> \
    --num_return_sequences 16 \  # This is the n in best-of-n.
    --per_device_batch_size 4 \  # Reduce this if you don't have enough memory.
    --split "eval" \
    --mixed_precision "bf16" \
    --tf32 True \
    --flash_attn True \
    --output_path <your_output_path_to_store_samples>
  ```
  You can then use the generated samples at `<your_output_path_to_store_samples>` directly with our automated evaluation.

  To replicate our expert iteration results for the AlpacaFarm evaluation suite, first produce best-of-n samples. Run
  ```bash
  python examples/best_of_n.py \
    --task "run_best_of_n" \
    --decoder_name_or_path <your_output_dir_for_decoder> \  # SFT10k model.
    --scorer_name_or_path <your_output_dir_for_reward_model> \
    --num_return_sequences 16 \  # This is the n in best-of-n.
    --per_device_batch_size 4 \  # Reduce this if you don't have enough memory.
    --split "unlabeled" \
    --mixed_precision "bf16" \
    --tf32 True \
    --flash_attn True \
    --output_path '<your_output_dir_for_expiter_data>/best_of_n_samples.json'
  ```
  Then perform supervised fine-tuning from the SFT10k checkpoint with the best-of-n samples
  ```bash
  bash examples/scripts/expiter.sh \
    <your_output_dir_for_expiter> \
    <your_wandb_run_name> \
    <your_output_dir_for_sft10k> \
    <your_output_dir_for_expiter_data>
  ```

  To replicate our Quark results for the AlpacaFarm evaluation suite, run
  ```bash
  bash examples/scripts/rlhf_quark.sh \
    <your_output_dir_for_quark> \
    <your_wandb_run_name> \
    <your_output_dir_for_reward_model> \
    <your_output_dir_for_sft10k> \
    <kl_coef>
  ```

  To replicate our DPO results for the AlpacaFarm evaluation suite, run
  ```bash
  bash examples/scripts/dpo.sh \
    <your_output_dir_for_dpo> \
    <your_wandb_run_name> \
    <your_output_dir_for_sft10k>
  ```

  To run the OpenAI reference models with our prompts and decoding hyperparameters, run
  ```bash
  python examples/oai_baselines.py \
    --model_name <oai_model_name> \
    --save_path <save_path>
  ```
  You can then use the generated samples at `<save_path>` directly with our automated evaluation.

  We provide model checkpoints for reward models and all our reference methods, listed in Table 2 of
  our [paper](https://arxiv.org/abs/2305.14387). Concretely, we tune each reference method in AlpacaFarm simulation and on
  human preference data and release both versions. The current list of models
  (available [here](https://huggingface.co/tatsu-lab)) includes:
  - `sft10k`, the supervised learning base model that we collect preference data with.
  - `reward-model-sim`, the reward model trained on AlpacaFarm preference data.
  - `reward-model-human`, the reward model trained on human preference data.
  - `ppo-sim`, the best PPO checkpoint trained in simulation.
  - `ppo-human`, the best PPO checkpoint trained on human data.
  - `expiter-sim`, the best expert iteration checkpoint trained in simulation.
  - `expiter-human`, the best expert iteration checkpoint trained on human data.
  - `feedme-sim`, the FeedME method trained on simulated preferences.
  - `feedme-human`, the FeedME method trained on human preferences.
  - `reward-condition-sim`, the reward conditioning method trained on simulated preferences.
  To download and recover these checkpoints, first make sure to have a LLaMA-7B
  checkpoint [converted into the Hugging Face format](https://huggingface.co/docs/transformers/main/model_doc/llama)
  **with transformers>=4.29.2**.
  Then, run the following to download all AlpacaFarm models:
  ```
  python -m pretrained_models.recover_model_weights \
    --llama-7b-hf-dir <your_path_to_hf_converted_llama_ckpt_and_tokenizer> \
    --alpaca-farm-model-name all
  ```
  Or, specify a particular model name to download just that model:
  ```
  python -m pretrained_models.recover_model_weights \
    --llama-7b-hf-dir <your_path_to_hf_converted_llama_ckpt_and_tokenizer> \
    --alpaca-farm-model-name <one_of_the_model_names_from_above> \
    --models-save-dir <dir_to_save_all_models>
  ```
  To download either of the reward models individually, you'll need to have `sft10k` downloaded first
  to `<dir_to_save_all_models>`.

  Please consider citing our work if you use the data or code in this repo.
  ```
  @misc{dubois2023alpacafarm,
        title={AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedback},
        author={Yann Dubois and Xuechen Li and Rohan Taori and Tianyi Zhang and Ishaan Gulrajani and Jimmy Ba and Carlos Guestrin and Percy Liang and Tatsunori B. Hashimoto},
        year={2023},
        eprint={2305.14387},
        archivePrefix={arXiv},
        primaryClass={cs.LG}
  }
  ```
  If you use `alpaca-farm>=0.2.0` make sure to specify that the annotator changed (as `text-davinci-003` is depreciated). The preferences and win-rates are now from AlpacaEval 1 and are not comparable to the numbers from our paper. You can cite AlpacaEval as:
  ```
  @misc{alpaca_eval,
    author = {Xuechen Li and Tianyi Zhang and Yann Dubois and Rohan Taori and Ishaan Gulrajani and Carlos Guestrin and Percy Liang and Tatsunori B. Hashimoto },
    title = {AlpacaEval: An Automatic Evaluator of Instruction-following Models},
    year = {2023},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\url{https://github.com/tatsu-lab/alpaca_eval}}
  }
  ```


pkgId: c029e74c1946aa4d0346d19f56a21ca99b0ea6430bfd861db9e4b01aef6ebe5c
name: python-alpaca-historical-extract
arch: src
version: 1.25.0
epoch: 0
release: 1
summary: README.md
url: https://github.com/Cole-Dylewski/Alpaca-Stock-Algo
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alpaca-historical-extract-1.25.0-1.src.rpm
checksum_type: sha256
description:
  Library for extracting full list of active tradeable stocks available, and creating detailed data of trends and statistics in daily, weekly, monthly, and yearly intervals. Requires Alpaca trading account for stock data extraction


pkgId: 229998df5752b8caa101e23c8342625b046938e3d7604a2de06feef99293a0a2
name: python-alpaca-py
arch: src
version: 0.31.0
epoch: 0
release: 1
summary: The Official Python SDK for Alpaca APIs
url: https://github.com/alpacahq/alpaca-py
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alpaca-py-0.31.0-1.src.rpm
checksum_type: sha256
description:
  [![Alpaca-py](https://github.com/alpacahq/alpaca-py/blob/master/docs/images/alpaca-py-banner.png?raw=true)](https://alpaca.markets/docs/python-sdk)

  [![Downloads](https://pepy.tech/badge/alpaca-py/month)](https://pepy.tech/project/alpaca-py)
  [![Python Versions](https://img.shields.io/pypi/pyversions/alpaca-py.svg?logo=python&logoColor=white)](https://pypi.org/project/alpaca-py)
  [![GitHub](https://img.shields.io/github/license/alpacahq/alpaca-py?color=blue)](https://github.com/alpacahq/alpaca-py/blob/master/LICENSE.md)
  [![PyPI](https://img.shields.io/pypi/v/alpaca-py?color=blue)](https://pypi.org/project/alpaca-py/)



  - [About](#about)
  - [Documentation](#documentation)
  - [Installation](#installation)
  - [Update](#update)
  - [What's New?](#whats-new)
    1.  [Broker API](#broker-api-new)
    2.  [OOP Design](#oop-design)
    3.  [Data Validation](#data-validation)
    4.  [Many Clients](#many-clients)
  - [API Keys](#api-keys)
    1.  [Trading and Market Data API Keys](#trading-api-keys)
    2.  [Broker API Keys](#trading-api-keys)
  - [Usage](#usage)
    1.  [Broker API Example](#broker-api-example)
    2.  [Trading API Example](#trading-api-example)
    3.  [Market Data API Example](#data-api-example)
  - [Contributing](https://github.com/alpacahq/alpaca-py/blob/master/CONTRIBUTING.md)
  - [License](https://github.com/alpacahq/alpaca-py/blob/master/LICENSE)



  Alpaca-py provides an interface for interacting with the API products Alpaca offers. These API products are provided as various REST, WebSocket and SSE endpoints that allow you to do everything from streaming market data to creating your own investment apps.

  Learn more about the API products Alpaca offers at https://alpaca.markets.



  Alpaca-py has a supplementary documentation site which contains references for all clients, methods and models found in this codebase. The documentation
  also contains examples to get started with alpaca-py.

  You can find the documentation site here: https://alpaca.markets/sdks/python/getting_started.html

  You can also find the API Reference of Alpaca APIs: https://docs.alpaca.markets/reference



  Alpaca-py is supported on Python 3.8+.  You can install Alpaca-py using pip.

  Run the following command in your terminal.

  ```shell
    pip install alpaca-py
  ```



  If you already have Alpaca-py installed, and would like to use the latest version available...

  Run the following command in your terminal:

  ```shell
    pip install alpaca-py --upgrade
  ```



  If you’ve used the previous python SDK alpaca-trade-api, there are a few key differences to be aware of.



  Alpaca-py lets you use Broker API to start building your investment apps! Learn more at the [Broker](https://docs.alpaca.markets/docs/about-broker-api) page.



  Alpaca-py uses a more OOP approach to submitting requests compared to the previous SDK. To submit a request, you will most likely need to create a request object containing the desired request data. Generally, there is a unique request model for each method.

  Some examples of request models corresponding to methods:

  - `GetOrdersRequest` for `TradingClient.get_orders()`
  - `CryptoLatestOrderbookRequest` for `CryptoHistoricalDataClient.get_crypto_latest_orderbook()`

  **Request Models Usage Example**

  To get historical bar data for crypto, you will need to provide a `CryptoBarsRequest` object.

  ```python
  from alpaca.data.historical import CryptoHistoricalDataClient
  from alpaca.data.requests import CryptoBarsRequest
  from alpaca.data.timeframe import TimeFrame
  from datetime import datetime


  client = CryptoHistoricalDataClient()

  request_params = CryptoBarsRequest(
                          symbol_or_symbols=["BTC/USD", "ETH/USD"],
                          timeframe=TimeFrame.Day,
                          start=datetime(2022, 7, 1)
                   )

  bars = client.get_crypto_bars(request_params)
  ```



  Alpaca-py uses _pydantic_ to validate data models at run-time. This means if you are receiving request data via JSON from a client. You can handle parsing and validation through Alpaca’s request models. All request models can be instantiated by passing in data in dictionary format.

  Here is a rough example of what is possible.

  ```python

   @app.route('/post_json', methods=['POST'])
   def do_trade():
       

       order_data_json = request.get_json()

       
       MarketOrderRequest(**order_data_json)

       
  ```



  Alpaca-py has a lot of client classes. There is a client for each API and even asset class specific clients (`StockHistoricalDataClient`, `CryptoDataStream`, `OptionHistoricalDataClient`). This requires you to pick and choose clients based on your needs.

  **Broker API:** `BrokerClient`

  **Trading API:** `TradingClient`

  **Market Data API:** `StockHistoricalDataClient`, `CryptoHistoricalDataClient`, `NewsClient`, `OptionHistoricalDataClient`, `CryptoDataStream`, `StockDataStream`, `NewsDataStream`, `OptionDataStream`





  In order to use Alpaca’s services you’ll need to sign up for an Alpaca account and retrieve your API keys. Signing up is completely free and takes only a few minutes. Sandbox environments are available to test out the API. To use the sandbox environment, you will need to provide sandbox/paper keys. API keys are passed into Alpaca-py through either `TradingClient`, `StockHistoricalDataClient`, `CryptoHistoricalDataClient`, `NewsClient`, `OptionHistoricalDataClient`, `StockDataStream`, `CryptoDataStream`,`NewsDataStream`, or `OptionDataStream`.



  To use the Broker API, you will need to sign up for a broker account and retrieve your Broker API keys. The API keys can be found on the dashboard once you’ve logged in. Alpaca also provides a sandbox environment to test out Broker API. To use the sandbox mode, provide your sandbox keys. Once you have your keys, you can pass them into `BrokerClient` to get started.



  Alpaca’s APIs allow you to do everything from building algorithmic trading strategies to building a full brokerage experience for your own end users. Here are some things you can do with Alpaca-py.

  To view full descriptions and examples view the [documentation page](https://alpaca.markets/sdks/python/).

  **Market Data API**: Access live and historical market data for 5000+ stocks, 20+ crypto, and options.

  **Trading API**: Trade stock and crypto with lightning fast execution speeds.

  **Broker API & Connect**: Build investment apps - from robo-advisors to brokerages.



  **Listing All Accounts**

  The `BrokerClient.list_accounts` method allows you to list all the brokerage accounts under your management. The method takes an optional parameter `search_parameters` which requires a `ListAccountsRequest` object. This parameter allows you to filter the list of accounts returned.

  ```python
  from alpaca.broker.client import BrokerClient
  from alpaca.broker.requests import ListAccountsRequest
  from alpaca.broker.enums import AccountEntities

  broker_client = BrokerClient('api-key', 'secret-key')



  filter = ListAccountsRequest(
                      created_after=datetime.datetime.strptime("2022-01-30", "%Y-%m-%d"),
                      entities=[AccountEntities.CONTACT, AccountEntities.IDENTITY]
                      )

  accounts = broker_client.list_accounts(search_parameters=filter)
  ```



  **Submitting an Order**

  To create an order on Alpaca-py you must use an `OrderRequest` object. There are different `OrderRequest` objects based on the type of order you want to make. For market orders, there is `MarketOrderRequest`, limit orders have `LimitOrderRequest`, stop orders `StopOrderRequest`, and trailing stop orders have `TrailingStopOrderRequest`. Each order type have their own required parameters for a successful order.

  ```python
  from alpaca.trading.client import TradingClient
  from alpaca.trading.requests import MarketOrderRequest
  from alpaca.trading.enums import OrderSide, TimeInForce

  trading_client = TradingClient('api-key', 'secret-key')



  market_order_data = MarketOrderRequest(
                        symbol="BTC/USD",
                        qty=0.0001,
                        side=OrderSide.BUY,
                        time_in_force=TimeInForce.DAY
                    )


  market_order = trading_client.submit_order(
                  order_data=market_order_data
                  )
  ```



  **Querying Historical Bar Data**

  You can request bar data via the HistoricalDataClients. In this example, we query daily bar data for “BTC/USD” and “ETH/USD” since July 1st 2022. You can convert the response to a multi-index pandas dataframe using the `.df` property. There are `StockHistoricalDataClient` and `OptionHistoricalDataClient` that you also could use to fetch equity/options historical data.

  ```python
  from alpaca.data.historical import CryptoHistoricalDataClient
  from alpaca.data.requests import CryptoBarsRequest
  from alpaca.data.timeframe import TimeFrame
  from datetime import datetime


  client = CryptoHistoricalDataClient()

  request_params = CryptoBarsRequest(
                          symbol_or_symbols=["BTC/USD", "ETH/USD"],
                          timeframe=TimeFrame.Day,
                          start=datetime.strptime("2022-07-01", '%Y-%m-%d')
                          )

  bars = client.get_crypto_bars(request_params)


  bars.df

  ```

  **Querying News Data** <a name="news-client-example"></a>

  You can query news data via the NewsClient. In this example, we query news data for “TSLA” since July 1st 2022. You can convert the response to a pandas dataframe using the `.df` property.

  ```python
  from alpaca.data.historical.news import NewsClient
  from alpaca.data.requests import NewsRequest
  from datetime import datetime


  client = NewsClient()

  request_params = NewsRequest(
                          symbols="TSLA",
                          start=datetime.strptime("2022-07-01", '%Y-%m-%d')
                          )

  news = client.get_news(request_params)


  news.df

  ```



  We're excited to support options trading! Use this section to read up on Alpaca's options trading capabilities.
  For more details, please refer to [our documentation page for options trading](https://docs.alpaca.markets/docs/options-trading)

  There is an example jupyter notebook to explain methods of alpaca-py for options trading.

  * [jupyter notebook: options trading basic example with alpaca-py](https://github.com/alpacahq/alpaca-py/blob/master/examples/options-trading-basic.ipynb)



  We have put together some examples in jupyter notebooks so that you can start developing today with alpaca-py right away!

  * [Stocks](https://github.com/alpacahq/alpaca-py/blob/master/examples/stocks-trading-basic.ipynb)
  * [Options](https://github.com/alpacahq/alpaca-py/blob/master/examples/options-trading-basic.ipynb)
  * [Crypto](https://github.com/alpacahq/alpaca-py/blob/master/examples/crypto-trading-basic.ipynb)


pkgId: ecf9d86c610cfd9280a051e79096ee4c7d943ec1d94110c1f7ccc9f2dcaa1789
name: python-alpacloud-ansible-builder
arch: src
version: 0.1.3
epoch: 0
release: 1
summary: This tool automatically builds and installs Ansible Collections
url: https://github.com/lilatomic/alpacloud
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alpacloud-ansible-builder-0.1.3-1.src.rpm
checksum_type: sha256
description:
  This tool automatically builds and installs Ansible Collections.

  This is useful for testing out purpose built collections. It's also nice for testing collections. I think it's most useful for repositories with collections alongside deployments:

  ```
  - collections
  	- our_monitoring
  - deployments
  	- our_monitoring_staging
  	- our_monitoring_team_0
  	- our_monitoring_team_1
  	- our_monitoring_team_2
  ```



  The Ansible builder can be used to build all collections in a directory:

  ```shell
  alpacloud-ansible-builder .
  ```

  It can also be used to watch collections for changes and rebuild them.

  ```shell
  alpacloud-ansible-builder --watch .
  ```

  The `--debounce` option lets you customise the time between the last change happening to a collection and a build being triggered.


pkgId: 9da804abd375ee3f66bd0fc199148e631b52e0df458b1a3b1c44a72cc65a4759
name: python-alph
arch: src
version: 0.4.12
epoch: 0
release: 1
summary: alph
url: https://github.com/connectedcompany/alph
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alph-0.4.12-1.src.rpm
checksum_type: sha256
description:
  - [NetworkX layouts](https://networkx.org/documentation/stable/reference/drawing.html#module-networkx.drawing.layout): Spring, Fruchterman-Reingold, etc
  - NetworkX-wrapped [graphviz layouts](https://networkx.org/documentation/stable/reference/generated/networkx.drawing.nx_agraph.graphviz_layout.html):
    dot, neato etc. You can use `args` for specific layouts - for example, for neato: `args="-Goverlap=scale -Gstart=123"`
  - Gephi ForceAtlas2 based on the
    [forceatlas2 Python implementation](https://github.com/bhargavchippada/forceatlas2) -
    see [layout.py](./alph/layout.py) for configuration options, and
    [this paper](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679)
    for more detail
  - ForceAtlas implementation within [scikit-network](https://github.com/sknetwork-team/scikit-network)
  - Any other that returns a NetworkX-style node positions dictionary

  | arg                              | type(s)                | default              | description                                                                                                                                                                                 |
  | -------------------------------- | ---------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | G                                | Networkx Graph         |                      | graph to visualise                                                                                                                                                                          |
  | weight_attr                      | str                    |                      | edge weight attribute, for weighted graphs                                                                                                                                                  |
  | layout_fn                        | function               | ForceAtlas2          | Function that, given a graph, returns a layout                                                                                                                                              |
  | node args                        | dict                   |                      | See below                                                                                                                                                                                   |
  | edge args                        | dict                   |                      | See below                                                                                                                                                                                   |
  | combo_group_by                   | str or list            |                      | Attribute to use to create grouped combo nodes                                                                                                                                              |
  | combo_layout_fn                  | function               | Fruchterman-Reingold | Layout function for combo nodes                                                                                                                                                             |
  | combo_node_args                  | dict                   |                      | See below                                                                                                                                                                                   |
  | combo_edge_args                  | dict                   |                      | See below                                                                                                                                                                                   |
  | combo_edge_weight_agg_attr       | dict                   |                      | Attribute to use to weigh combo edges; if set, overrides weight_attr. Can use values given via combo_edge_agg_attrs. If not set and weight_attr not given, falls back to simple edge count. |
  | combo_edge_agg_attrs             | dict                   |                      | Pandas groupby-style dict, describing how to aggregate edge attributes that span nodes - for example `{"combo_edge_attr_name": ("edge_attr_name", "sum")}`                                  |
  | combo_edge_weight_threshold      | dict                   |                      | Drop edges below this weight                                                                                                                                                                |
  | include_edgeless_combo_nodes     | dict                   |                      | Whether or not to incorporate disconnected combo nodes                                                                                                                                      |
  | combo_node_additional_attrs      | dict                   |                      | Attributes to add to combo nodes                                                                                                                                                            |
  | edge_node_additional_attrs       | dict                   |                      | Attributes to add to combo node edges, like `{"edge_attr_name": agg_fn}`; agg fn is applied across all attr values for edges that link grouped nodes                                        |
  | combo_empty_attr_action          | drop, group or promote | `drop`               | What to do with nodes that have an empty value for the combo_group_by attribute                                                                                                             |
  | combo_size_scale_domain          | 2-item list or tuple   | `[0, 25]`            | Lower/upper bound of num nodes to apply to combo node size range                                                                                                                            |
  | combo_size_scale_range           | 2-item list or tuple   | `[6**2, 180**2]`     | Combo node size range                                                                                                                                                                       |
  | combo_inner_graph_scale_factor   | float                  | `0.6`                | Scale down inner graph to fit inside combo nodes by this factor - normally <1                                                                                                               |
  | non_serializable_datetime_format | str                    | `%d %b %Y`           | Format string for non-serialisable date / time types that otherwise break Altair                                                                                                            |
  | width                            | int                    | `800`                | Figure width (px)                                                                                                                                                                           |
  | height                           | int                    | `600`                | Figure height (px)                                                                                                                                                                          |
  | prop_kwargs                      | dict                   |                      | Optional properties such as title                                                                                                                                                           |
  | padding                          | int                    |                      | Padding inside figure edges. No node centres will be placed outside this boundary.                                                                                                          |
  | nodes_layer_params               | selection or other     |                      | Altair params to be added to the nodes layer via `.add_params()` - typically a selection                                                                                                    |

  | arg              | type(s)       | default   |
  | ---------------- | ------------- | --------- |
  | size             | int, alt.\*   | `400`     |
  | tooltip_attrs    | list          |           |
  | fill             | str, alt.\*   | `#000`    |
  | opacity          | float, alt.\* | `1`       |
  | stroke           | str, alt.\*   | `#565656` |
  | strokeWidth      | int, alt.\*   | `0`       |
  | halo_offset      | int           |           |
  | halo_opacity     | float, alt.\* | `1`       |
  | halo_stroke      | str, alt.\*   | `#343434` |
  | halo_strokeWidth | int, alt.\*   | `2`       |
  | label_attr       | str           |           |
  | label_offset     | int           | `6`       |
  | label_size       | int           | `10`      |
  | label_color      | str           | `black`   |

  | arg         | type(s)        | default                                                                            |
  | ----------- | -------------- | ---------------------------------------------------------------------------------- |
  | weight_attr | str            | `weight`                                                                           |
  | color       | str, alt.\*    | `#606060`                                                                          |
  | opacity     | float , alt.\* | `alt.Size(weight_attr, scale=alt.Scale(range=[0.3, 1])` if weighted, `1` otherwise |


pkgId: 9d2b0efd2ad16e0c1f68dd3ba253f1d701c6f4cd3395a529541cecd973d5d08a
name: python-alpha-data-py
arch: src
version: 1.0.14
epoch: 0
release: 1
summary: client to communicate with alphaticks
url: https://gitlab.com/alphaticks/alpha-data-py
rpm_license: copyright
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alpha-data-py-1.0.14-1.src.rpm
checksum_type: sha256
description:
  You can install alpha-data-py using the following command:
  ```shell
  pip install alpha-data-py
  ```



  In order to use the library, you need an API key from alphaticks. Go to [alphaticks.io](https://alphaticks.io),
  Account -> Licenses -> AlphaData and click on **Add credentials**.

  Now that you have your credentials ready, you can create a client, fetch a security, and fetch the data you need for
  that security.

  ```py
  import datetime
  from adata import Client, FREQ_1M

  c = Client(API_KEY, API_SECRET)
  secs = c.get_securities()
  for s in secs:
      if s.symbol == "BTCUSDT" and s.exchange == "fbinance":
          sec = s

  start = datetime.datetime(2022, 1, 1)
  end = datetime.datetime(2022, 1, 5)
  it = c.get_historical_ohlcv(sec, FREQ_1M, start, end)
  while it.next():
      print(it.o, it.h, it.l, it.c, it.v)
  ```


pkgId: 74027c8c1269464b9cf6ff46b7e432cfbf4dacebda8078d9f0e94615cd7f6650
name: python-alpha-shapes
arch: src
version: 1.1.1
epoch: 0
release: 1
summary: reconstruct the shape of a 2D point cloud.
url: https://github.com/panosz/alpha_shapes
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alpha-shapes-1.1.1-1.src.rpm
checksum_type: sha256
description:
  A Python package for reconstructing the shape of a 2D point cloud on the plane.


  Given a finite set of points (or point cloud) in the Euclidean plane, [alpha shapes](https://en.wikipedia.org/wiki/Alpha_shape) are members of a family of closed polygons on the 2D plane associated with the shape of this point cloud. Each alpha shape is associated with a single non negative parameter **α**.

  Intuitively an alpha shape can be conceptualized as follows. Imagine carving out the plane using a cookie scoop of radius 1/**α**, without removing any of the points in the point cloud. The shape that remains **is** the shape of the point cloud. If we replace the arc-like edges, due to the circular rim of the scoop, with straight segments, we are left with the alpha shape of parameter **α**.


  Given a finite set of points (or point cloud) in the Euclidean plane, [alpha shapes](https://en.wikipedia.org/wiki/Alpha_shape) are members of a family of closed polygons on the 2D plane associated with the shape of this point cloud. Each alpha shape is associated with a single non negative parameter **α**.

  Intuitively an alpha shape can be conceptualized as follows. Imagine carving out the plane using a cookie scoop of radius 1/**α**, without removing any of the points in the point cloud. The shape that remains **is** the shape of the point cloud. If we replace the arc-like edges, due to the circular rim of the scoop, with straight segments, we are left with the alpha shape of parameter **α**.


  ```console
  pip install alpha_shapes
  ```




  ```python
  import matplotlib.pyplot as plt
  from alpha_shapes import Alpha_Shaper, plot_alpha_shape
  ```

  Define a set of points. Care must be taken to avoid duplicate points:


  ```python
  points = [(0.,     0.),    (0.,    1.),    (1.,     1.1),
            (1.,     0.),    (0.25,  0.15),  (0.65,   0.45),
            (0.75,   0.75),  (0.5,   0.5),   (0.5,    0.25),
            (0.5,    0.75),  (0.25,  0.5),   (0.75,   0.25),
            (0.,     2.),    (0.,    2.1),   (1.,     2.1),
            (0.5,    2.5),   (-0.5,  1.5),   (-0.25,  1.5),
            (-0.25,  1.25),  (0,     1.25),  (1.5,    1.5),
            (1.25,   1.5),   (1.25,  1.25),  (1,      1.25),
            (1.,    2.),    (0.25,   2.15),
            (0.65,   2.45),  (0.75,  2.75),  (0.5,    2.25),
            (0.5,    2.75),  (0.25,  2.5),   (0.75,   2.25)]
  ```

  Create the alpha shaper


  ```python
  shaper = Alpha_Shaper(points)
  ```

  For the alpha shape to be calculated, the user must choose a value for the `alpha` parameter.
  Here, let us set `alpha` to 5.3:


  ```python

  alpha = 5.3
  alpha_shape = shaper.get_shape(alpha=alpha)
  ```

  Visualize the result:


  ```python
  fig, (ax0, ax1) = plt.subplots(1, 2)
  ax0.scatter(*zip(*points))
  ax0.set_title('data')
  ax1.scatter(*zip(*points))
  plot_alpha_shape(ax1, alpha_shape)
  ax1.set_title(f"$\\alpha={alpha:.3}$")

  for ax in (ax0, ax1):
      ax.set_aspect('equal')
  ```



  ![png](README_files/README_10_0.png)



  Good results depend on a successful choise for the value of `alpha`. If for example we choose a smaller value, e.g. $\alpha = 3.7$:


  ```python

  alpha = 3.7
  alpha_shape = shaper.get_shape(alpha=alpha)

  fig, (ax0, ax1) = plt.subplots(1, 2)
  ax0.scatter(*zip(*points))
  ax0.set_title('data')
  ax1.scatter(*zip(*points))
  plot_alpha_shape(ax1, alpha_shape)
  ax1.set_title(f"$\\alpha={alpha:.3}$")

  for ax in (ax0, ax1):
      ax.set_aspect('equal')
  ```



  ![png](README_files/README_12_0.png)



  We find out that the hole is no longer there.
  On the other hand, for larger alpha values, e.g. $\alpha = 5.6$


  ```python

  alpha = 5.6
  alpha_shape = shaper.get_shape(alpha=alpha)

  fig, (ax0, ax1) = plt.subplots(1, 2)
  ax0.scatter(*zip(*points))
  ax0.set_title('data')
  ax1.scatter(*zip(*points))
  plot_alpha_shape(ax1, alpha_shape)
  ax1.set_title(f"$\\alpha={alpha:.3}$")

  for ax in (ax0, ax1):
      ax.set_aspect('equal')
  ```



  ![png](README_files/README_14_0.png)



  We find out that mabe we have cut out too much. The point on the bottom right is no longer incuded in the shape





  A satisfactory calculation of the alpha shape requires a successful guess of the alpha parameter. While trial and error might work well in some cases, users can let the `Alpha_Shaper` choose a value for them. That is what the `optimize` method is about. It calculates the largest possible value for `alpha`, so that no points from the point cloud are left out.


  ```python
  alpha_opt, alpha_shape = shaper.optimize()
  alpha_opt
  ```




      5.391419185032161




  ```python
  fig, (ax0, ax1) = plt.subplots(1, 2)
  ax0.scatter(*zip(*points))
  ax0.set_title('data')
  ax1.scatter(*zip(*points))
  plot_alpha_shape(ax1, alpha_shape)
  ax1.set_title(f"Optimal $\\alpha={alpha_opt:.3}$")

  for ax in (ax0, ax1):
      ax.set_aspect('equal')
  ```



  ![png](README_files/README_18_0.png)



  The optimize method runs efficiently for relatively large point clouds. Here we calculate the optimal alpha shape of an ensemble of 1000 random points uniformly distributed on the unit square.


  ```python
  from time import time
  import numpy as np

  np.random.seed(42)  # for reproducibility


  points = np.random.random((1000, 2))

  alpha_shaper = Alpha_Shaper(points)


  ts = time()
  alpha_opt, alpha_shape = alpha_shaper.optimize()
  te = time()
  print(f'optimization took: {te-ts:.2} sec')

  fig, axs = plt.subplots(1,
                          2,
                          sharey=True,
                          sharex=True,
                          constrained_layout=True)

  for ax in axs:
      ax.plot(*zip(*points),
              linestyle='',
              color='k',
              marker='.',
              markersize=1)

      ax.set_aspect('equal')

  _ = axs[0].set_title('data')

  plot_alpha_shape(axs[1], alpha_shape)
  axs[1].triplot(alpha_shaper)
  _ = axs[1].set_title(r'$\alpha_{\mathrm{opt}}$')


  ```

      optimization took: 0.081 sec




  ![png](README_files/README_20_1.png)





  The Alpha_Shaper class implements the interface of matplotlib.tri.Triangulation. This means that it will work with algorithms that expect a triangulation as input (e.g. for contour plotting or interpolation)


  ```python


  np.random.seed(42)  # for reproducibility

  points = np.random.random((1000, 2))

  x = points[:, 0]
  y = points[:, 1]

  z = x**2 * np.cos(5 * x * y - 8 * x + 9*y) + y**2 * np.sin(5 * x * y - 8 * x + 9*y)



  shaper = Alpha_Shaper(points, normalize=True)
  alpha_opt, alpha_shape_scaled = shaper.optimize()



  fig, ax = plt.subplots()

  ax.tricontourf(shaper, z)
  ax.triplot(shaper)
  ax.plot(x, y, ".k", markersize=2)
  ax.set_aspect('equal')

  ```



  ![png](README_files/README_22_0.png)




  Before calculating the alpha shape, Alpha_Shaper normalizes by default the input points so that they are distributed on the unit square. When there is a scale separation along the x and y direction, deactivating this feature may yield surprising results.


  ```python

  points = [
      (0.0, 2.1),
      (-0.25, 1.5),
      (0.25, 0.5),
      (-0.25, 1.25),
      (0.75, 2.75),
      (0.75, 2.25),
      (0.0, 2.0),
      (1.0, 0.0),
      (0.25, 0.15),
      (1.25, 1.5),
      (1.25, 1.25),
      (1.0, 2.1),
      (0.65, 2.45),
      (0.25, 2.5),
      (0.0, 1.0),
      (0.5, 0.5),
      (0.5, 0.25),
      (0.5, 0.75),
      (0, 1.25),
      (1.5, 1.5),
      (1.0, 2.0),
      (0.25, 2.15),
      (1.0, 1.1),
      (0.75, 0.75),
      (0.75, 0.25),
      (0.0, 0.0),
      (-0.5, 1.5),

      (1, 1.25),
      (0.5, 2.5),
      (0.5, 2.25),
      (0.5, 2.75),
      (0.65, 0.45),
  ]


  x_scale = 1e-3
  points = np.array(points)
  points[:, 0] *= x_scale


  unnormalized_shaper = Alpha_Shaper(points, normalize=False)
  _, alpha_shape_unscaled = unnormalized_shaper.optimize()




  shaper = Alpha_Shaper(points, normalize=True)
  alpha_opt, alpha_shape_scaled = shaper.optimize()



  fig, (ax0, ax1, ax2) = plt.subplots(
      1, 3, sharey=True, sharex=True, constrained_layout=True
  )
  ax0.scatter(*zip(*points))
  ax0.set_title("data")
  ax1.scatter(*zip(*points))
  ax2.scatter(*zip(*points))

  plot_alpha_shape(ax1, alpha_shape_scaled)

  ax1.set_title("with normalization")
  ax2.set_title("without normalization")
  plot_alpha_shape(ax2, alpha_shape_unscaled)

  for ax in (ax1, ax2):
      ax.set_axis_off()
  for ax in (ax0, ax1, ax2):
      ax.set_aspect(x_scale)

  ```



  ![png](README_files/README_24_0.png)





  This library is inspired by the [alphashape](https://github.com/bellockk/alphashape) library.


pkgId: 6343b9a767113b796dc7d3d08458af25ecbdc6294f8ef5cc00c87c2abf9252c1
name: python-alpha-trader-python
arch: src
version: 0.6.3
epoch: 0
release: 1
summary: Python SDK for https://alpha-trader.com
url: https://pypi.org/project/alpha-trader-python/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alpha-trader-python-0.6.3-1.src.rpm
checksum_type: sha256
description:
  Welcome to the Python SDK for Alpha-Trader.
  The functionality will be extended and Pull Requests are welcome.

  For documentation, mkdocs is used, please see:


pkgId: 433e7d31f01251651fbb6627dee4e1be750f9733553eee18d4e55e4e5072d4f4
name: python-alpha-vantage
arch: src
version: 3.0.0
epoch: 0
release: 1
summary: Python module to get stock data from the Alpha Vantage Api
url: https://github.com/RomelTorres/alpha_vantage
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alpha-vantage-3.0.0-1.src.rpm
checksum_type: sha256
description:
  [![Build Status](https://travis-ci.org/RomelTorres/alpha_vantage.png?branch=master)](https://travis-ci.org/RomelTorres/alpha_vantage)
  [![PyPI version](https://badge.fury.io/py/alpha-vantage.svg)](https://badge.fury.io/py/alpha-vantage)
  [![Documentation Status](https://readthedocs.org/projects/alpha-vantage/badge/?version=latest)](http://alpha-vantage.readthedocs.io/en/latest/?badge=latest)
  [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/RomelTorres/alpha_vantage.svg)](http://isitmaintained.com/project/RomelTorres/alpha_vantage "Average time to resolve an issue")
  [![Percentage of issues still open](http://isitmaintained.com/badge/open/RomelTorres/alpha_vantage.svg)](http://isitmaintained.com/project/RomelTorres/alpha_vantage "Percentage of issues still open")

  *Python module to get stock data/cryptocurrencies from the Alpha Vantage API*

  Alpha Vantage delivers a free API for real time financial data and most used finance indicators in a simple json or pandas format. This module implements a python interface to the free API provided by [Alpha Vantage](https://www.alphavantage.co/). It requires a free API key, that can be requested from http://www.alphavantage.co/support/#api-key. You can have a look at all the API calls available in their [API documentation](https://www.alphavantage.co/documentation/).

  For code-less access to financial market data, you may also consider [Wisesheets](https://www.wisesheets.io/) or the official [Google Sheet Add-on](https://gsuite.google.com/marketplace/app/alpha_vantage_market_data/434809773372) or the [Microsoft Excel Add-on](https://appsource.microsoft.com/en-us/product/office/WA200001365) by Alpha Vantage. Check out [this](https://medium.com/@patrick.collins_58673/stock-api-landscape-5c6e054ee631) guide for some common tips on working with financial market data.



  * From version 3.0.0 onwards, all options, commodities, and economic indicators are supported, as well as various additional features in alpha intelligence and fundamental data. All sector performance, extended intraday, and the FCAS crypto rating have been depreciated. Support for the month parameter for technical indicators and entitlement, as necessary, have also been added.
  * From version 2.3.0 onwards, fundamentals data and extended intraday is supported.
  * From version 2.2.0 onwards, asyncio support now provided. See below for more information.
  * From version 2.1.3 onwards, [rapidAPI](https://rapidapi.com/alphavantage/api/alpha-vantage/) key integration is now available.
  * From version 2.1.0 onwards, error logging of bad API calls has been made more apparent.
  * From version 1.9.0 onwards, the urllib was substituted by pythons request library that is thread safe. If you have any error, post an issue.
  * From version 1.8.0 onwards, the column names of the data frames have changed, they are now exactly what alphavantage gives back in their json response. You can see the examples in better detail in the following git repo:  https://github.com/RomelTorres/av_example
  * From version 1.6.0, pandas was taken out as a hard dependency.


  To install the package use:
  ```shell
  pip install alpha_vantage
  ```
  Or install with pandas support, simply install pandas too:
  ```shell
  pip install alpha_vantage pandas
  ```

  If you want to install from source, then use:
  ```shell
  git clone https://github.com/RomelTorres/alpha_vantage.git
  pip install -e alpha_vantage
  ```


  To get data from the API, simply import the library and call the object with your API key. Next, get ready for some awesome, free, realtime finance data. Your API key may also be stored in the environment variable ``ALPHAVANTAGE_API_KEY``.
  ```python
  from alpha_vantage.timeseries import TimeSeries
  ts = TimeSeries(key='YOUR_API_KEY')

  data, meta_data = ts.get_intraday('GOOGL')
  ```
  To query data from a specific month in history, you may use the 'month' parameter for various features.
  ```python
  from alpha_vantage.timeseries import TimeSeries
  from alpha_vantage.techindicators import TechIndicators
  ts = TimeSeries(key='YOUR_API_KEY')
  ti = TechIndicators(key='YOUR_API_KEY')

  data, meta_data = ts.get_intraday('GOOGL', month='2014-01')

  data, meta_data = ti.get_sma('GOOGL', month='2014-01')
  ```
  You may also get a key from [rapidAPI](https://rapidapi.com/alphavantage/api/alpha-vantage-alpha-vantage-default). Use your rapidAPI key for the key variable, and set ```rapidapi=True```

  ```python
  ts = TimeSeries(key='YOUR_API_KEY',rapidapi=True)
  ```

  Internally there is a retries counter, that can be used to minimize connection errors (in case that the API is not able to respond in time), the default is set to
  5 but can be increased or decreased whenever needed.
  ```python
  ts = TimeSeries(key='YOUR_API_KEY',retries='YOUR_RETRIES')
  ```
  The library supports giving its results as json dictionaries (default), pandas dataframe (if installed) or csv, simply pass the parameter output_format='pandas' to change the format of the output for all the API calls in the given class. Please note that some API calls do not support the csv format (namely ```ForeignExchange and TechIndicators```) because the API endpoint does not support the format on their calls either.

  ```python
  ts = TimeSeries(key='YOUR_API_KEY',output_format='pandas')
  ```

  The pandas data frame given by the call, can have either a date string indexing or an integer indexing (by default the indexing is 'date'),
  depending on your needs, you can use both.

  ```python
   
  ts = TimeSeries(key='YOUR_API_KEY',output_format='pandas', indexing_type='date')

  ts = TimeSeries(key='YOUR_API_KEY',output_format='pandas', indexing_type='integer')
  ```


  The data frame structure is given by the call on alpha vantage rest API. The column names of the data frames
  are the ones given by their data structure. For example, the following call:
  ```python
  from alpha_vantage.timeseries import TimeSeries
  from pprint import pprint
  ts = TimeSeries(key='YOUR_API_KEY', output_format='pandas')
  data, meta_data = ts.get_intraday(symbol='MSFT',interval='1min', outputsize='full')
  pprint(data.head(2))
  ```
  Would result on:
  ![alt text](images/docs_data_frame_header.png?raw=True "Data Header format.")

  The headers from the data are specified from Alpha Vantage (in previous versions, the numbers in the headers were removed, but long term is better to have the data exactly as Alpha Vantage produces it.)


  Using pandas support we can plot the intra-minute value for 'MSFT' stock quite easily:

  ```python
  from alpha_vantage.timeseries import TimeSeries
  import matplotlib.pyplot as plt

  ts = TimeSeries(key='YOUR_API_KEY', output_format='pandas')
  data, meta_data = ts.get_intraday(symbol='MSFT',interval='1min', outputsize='full')
  data['4. close'].plot()
  plt.title('Intraday Times Series for the MSFT stock (1 min)')
  plt.show()
  ```
  Giving us as output:
  ![alt text](images/docs_ts_msft_example.png?raw=True "MSFT minute value plot example")


  The same way we can get pandas to plot technical indicators like Bollinger Bands®

  ```python
  from alpha_vantage.techindicators import TechIndicators
  import matplotlib.pyplot as plt

  ti = TechIndicators(key='YOUR_API_KEY', output_format='pandas')
  data, meta_data = ti.get_bbands(symbol='MSFT', interval='60min', time_period=60)
  data.plot()
  plt.title('BBbands indicator for  MSFT stock (60 min)')
  plt.show()
  ```
  Giving us as output:
  ![alt text](images/docs_ti_msft_example.png?raw=True "MSFT minute value plot example")



  We can also plot crypto currencies prices like BTC:

  ```python
  from alpha_vantage.cryptocurrencies import CryptoCurrencies
  import matplotlib.pyplot as plt

  cc = CryptoCurrencies(key='YOUR_API_KEY', output_format='pandas')
  data, meta_data = cc.get_digital_currency_daily(symbol='BTC', market='CNY')
  data['4b. close (USD)'].plot()
  plt.tight_layout()
  plt.title('Daily close value for bitcoin (BTC)')
  plt.grid()
  plt.show()
  ```

  Giving us as output:
  ![alt text](images/docs_cripto_btc.png?raw=True "Crypto Currenci daily (BTC)")



  The foreign exchange endpoint has no metadata, thus only available as json format and pandas (using the 'csv' format will raise an Error)

  ```python
  from alpha_vantage.foreignexchange import ForeignExchange
  from pprint import pprint
  cc = ForeignExchange(key='YOUR_API_KEY')

  data, _ = cc.get_currency_exchange_rate(from_currency='BTC',to_currency='USD')
  pprint(data)
  ```
  Giving us as output:
  ```
  {
      '1. From_Currency Code': 'BTC',
      '2. From_Currency Name': 'Bitcoin',
      '3. To_Currency Code': 'USD',
      '4. To_Currency Name': 'United States Dollar',
      '5. Exchange Rate': '5566.80500105',
      '6. Last Refreshed': '2017-10-15 15:13:08',
      '7. Time Zone': 'UTC'
  }
  ```



  From version 2.2.0 on, asyncio support will now be available. This is only for python versions 3.5+. If you do not have 3.5+, the code will break.

  The syntax is simple, just mark your methods with the `async` keyword, and use the `await` keyword.

  Here is an example of a for loop for getting multiple symbols asyncronously. This greatly improving the performance of a program with multiple API calls.

  ```python
  import asyncio
  from alpha_vantage.async_support.timeseries import TimeSeries

  symbols = ['AAPL', 'GOOG', 'TSLA', 'MSFT']


  async def get_data(symbol):
      ts = TimeSeries(key='YOUR_KEY_HERE')
      data, _ = await ts.get_quote_endpoint(symbol)
      await ts.close()
      return data

  loop = asyncio.get_event_loop()
  tasks = [get_data(symbol) for symbol in symbols]
  group1 = asyncio.gather(*tasks)
  results = loop.run_until_complete(group1)
  loop.close()
  print(results)
  ```

  We have written a much more in depth article to explain asyncio for those who have never used it but want to learn about asyncio, concurrency, and multi-threading. Check it out here: [Which Should You Use: Asynchronous Programming or Multi-Threading?](https://medium.com/better-programming/which-should-you-use-asynchronous-programming-or-multi-threading-7435ec9adc8e?source=friends_link&sk=8c6c05c2bbc3666e9066547cb564c352)



  I have added a repository with examples in a python notebook to better see the
  usage of the library: https://github.com/RomelTorres/av_example




  In order to run the tests you have to first export your API key so that the test can use it to run, also the tests require pandas, mock and nose.
  ```shell
  export API_KEY=YOUR_API_KEY
  cd alpha_vantage
  nosetests
  ```


  The code documentation can be found at https://alpha-vantage.readthedocs.io/en/latest/


  Contributing is always welcome. Just contact us on how best you can contribute, add an issue, or make a PR.


  * The integration tests are not being run at the moment within travis, gotta fix them to run.
  * Add test for csv calls as well.
  * Add tests for incompatible parameter raise errors.
  * Github actions & other items in the issues page.




  You can reach/follow the Alpha Vantage team on any of the following platforms:
  * [Slack](https://alphavantage.herokuapp.com/)
  * [Twitter: @alpha_vantage](https://twitter.com/alpha_vantage)
  * [Medium-Patrick](https://medium.com/@patrick.collins_58673)
  * [Medium-AlphaVantage](https://medium.com/alpha-vantage)
  * Email: support@alphavantage.co
  * Community events: https://alphavhack.devpost.com/



  If you like or use this project, consider showing your support by starring it.

  :venezuela:-:de:


pkgId: 1812c0f979aa2f3287258465b63b2acddff90816d76129105b00fc7e11157c70
name: python-alpha2fasta
arch: src
version: 1.448
epoch: 0
release: 1
summary: Encode text written in natural language in a FASTA-based format
url: https://pypi.org/project/alpha2fasta/
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alpha2fasta-1.448-1.src.rpm
checksum_type: sha256
description:
  The alpha2fasta library can be used to encode texts written in natural language to a FASTA-based format. The purpose of coding is to enable the application of various bioinformatics tools in text mining.


pkgId: 35afe674e7366b6a82b2db8c272146e67f3a5f4d3f55c11edfa1f869909a9619
name: python-alphabet2kana
arch: src
version: 0.1.6
epoch: 0
release: 1
summary: Convert English alphabet to Katakana
url: https://github.com/shihono/alphabet2kana
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphabet2kana-0.1.6-1.src.rpm
checksum_type: sha256
description:
  ![PyPI - Version](https://img.shields.io/pypi/v/alphabet2kana)
  ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/alphabet2kana)


  Convert English alphabet to Katakana

  アルファベットの日本語表記は [Unidic](https://unidic.ninjal.ac.jp/)
  と [英語アルファベット - Wikipedia](https://ja.wikipedia.org/wiki/%E8%8B%B1%E8%AA%9E%E3%82%A2%E3%83%AB%E3%83%95%E3%82%A1%E3%83%99%E3%83%83%E3%83%88) を参考にしています。

  特に、`Z` は `ゼット` 表記です。



  ```bash
  pip install alphabet2kana
  ```



  ```python
  from alphabet2kana import a2k

  a2k("ABC")


  a2k("Alphabetと日本語")


  a2k("Alphabetと日本語", delimiter="・")


  a2k('k8s', delimiter='・', numeral=True)

  ```

  半角にのみ対応しています。
  全角アルファベットは [mojimoji](https://github.com/studio-ousia/mojimoji) や [jaconv](https://github.com/ikegami-yukino/jaconv)
  などで半角に変換してください。

  Only supported with half-width characters.


pkgId: 564055b55bd7099eae32c8d54411b3c57c87392dd6e57013d2cd1f8b9f1c00cb
name: python-alphacodings
arch: src
version: 0.1.0
epoch: 0
release: 1
summary: base26 ([A-Z]) and base52 ([A-Za-z]) encodings
url: https://pypi.org/project/alphacodings/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphacodings-0.1.0-1.src.rpm
checksum_type: sha256
description:
  <div align="center">



  <img src="resources/alphacodings.png" width="256" height="256">

  base26 ([A-Z]) and base52 ([A-Za-z]) encodings
  </div>



  transform any string to alphabetic-only with base26 ([A-Z]) and base52 ([A-Za-z]) lossless encodings; useful for transmitting textual data over restrictive channels or for training AI models and tokenizers on simpler vocabularies.

  **alphacodings** is a fast and lightweight library using [GMP arithmetic](https://gmplib.org).



  ```python
  python -m pip install alphacodings
  ```



  ```python
  from alphacodings import base26_encode, base26_decode, base52_encode, base52_decode


  string = """\
  <!DOCTYPE html>
  <html>
  <head>
      <title>sample page</title>
  </head>
  <body>
      <h1>welcome!</h1>
      <p>you are reading a sample HTML string.</p>
  </body>
  </html>
  """


  if __name__ == "__main__":
      encoding_base26 = base26_encode(string)
      print(encoding_base26)
      

      encoding_base52 = base52_encode(string)
      print(encoding_base52)
      

      assert base26_decode(encoding_base26) == string
      assert base52_decode(encoding_base52) == string
  ```



  The library is inspired by [R. Heaton](https://github.com/robert)'s base26 implementation and his story of manipulating data transmission in restrictive network channels on long-distance flights using alphabetic-only encodings and tokenization.

  have a look at the original [repository](https://github.com/robert/pyskywifi) and [blog post](https://robertheaton.com/pyskywifi) and show him some love!



  TBC <!-- HTML string of almost 2.5M characters -->



  contributions to **alphacodings** are welcome!

  feel free to submit pull requests or open issues on our repository.



  see the [LICENSE](LICENSE) file for more details.

rpm_license:
  MIT License  Copyright (c) 2024 Federico Minutoli  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


pkgId: 873cc374047e682e2ef6299d6446fab12bfa22ee91b818e96e00e0e3b8a5f424
name: python-alphaconf
arch: src
version: 0.5.0
epoch: 0
release: 1
summary: Write simple scripts leveraging omegaconf
url: https://github.com/kmagusiak/alphaconf
rpm_license: BSD License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphaconf-0.5.0-1.src.rpm
checksum_type: sha256
description:
  [![PyPI version](https://badge.fury.io/py/alphaconf.svg)](https://pypi.org/project/alphaconf/)

  A small library to ease writing parameterized scripts.
  The goal is to execute a single script and be able to overwrite the parameters
  easily.
  The configuration is based on [OmegaConf].
  Optionally, loading from toml or using [pydantic] is possible.

  To run multiple related tasks, there is an integration with
  [invoke](https://www.pyinvoke.org).
  If you need something more complex, like running multiple instances of the
  script, take a look at [hydra-core](https://hydra.cc) or use another script
  to launch multiple instances.



  To run an application, you need...

  ```python

  import alphaconf
  import logging

  alphaconf.setup_configuration({
      "server.url": "http://default",
  }, {
      "server.url": "The URL to show here",
  })

  def main():
      log = logging.getLogger()
      log.info('server.url:', alphaconf.get('server.url'))
      log.info('has server.user:', alphaconf.get('server.user', bool, default=False))

  if __name__ == '__main__':
      alphaconf.cli.run(main)
  ```

  Invoking:
  ```bash
  python myapp.py server.url=http://github.com
  ```

  During an *interactive session*, you can set the application in the current
  context.
  ```python

  import alphaconf.interactive
  alphaconf.interactive.mount()
  alphaconf.interactive.load_configuration_file('path')
  ```

  Check the [DEMO](./demo.ipynb) for more examples.



  When running a program, first dotenv is used to load environment variables
  from a `.env` file - this is optional.

  Then configuration is built from:

  - default configurations defined using (`alphaconf.setup_configuration`)
  - `application` key is generated
  - `PYTHON_ALPHACONF` environment variable may contain a path to load
  - configuration files from configuration directories (using application name)
  - environment variables based on key prefixes,
    except "BASE" and "PYTHON"; \
    if you have a configuration key "abc", all environment variables starting
    with "ABC_" will be loaded, for example "ABC_HELLO=a" would set "abc.hello=a"
  - key-values from the program arguments

  Finally, the configuration is fully resolved and logging is configured.



  Configuration values are resolved by [OmegaConf].
  Some of the resolvers (standard and custom):
  - `${oc.env:USER,me}`: resolve the environment variable USER
    with a default value "me"
  - `${oc.select:config_path}`: resolve to another configuration value
  - `${read_text:file_path}`: read text contents of a file as `str`
  - `${read_bytes:file_path}`: read contents of a file as `bytes`
  - `${read_strip:file_path}`: read text contents of a file as strip spaces

  The *oc.select* is used to build multiple templates for configurations
  by providing base configurations.
  An argument `--select key=template` is a shortcut for
  `key=${oc.select:base.key.template}`.
  So, `logging: ${oc.select:base.logging.default}` resolves to the configuration
  dict defined in base.logging.default and you can select it using
  `--select logging=default`.





  You can use [OmegaConf] with [pydantic] to *get* typed values.
  ```python
  class MyConf(pydantic.BaseModel):
      value: int = 0

      def build(self):
          
          
          return self.value * 2


  alphaconf.setup_configuration(MyConf, prefix='a')

  alphaconf.get('a', MyConf)
  v = alphaconf.get(MyConf)  # because it's registered as a type
  ```



  When showing the configuration, by default configuration keys which are
  secrets, keys or passwords will be masked.
  You can read values or passwords from files, by using the template
  `${read_strip:/path_to_file}`
  or, more securely, read the file in the code
  `alphaconf.get('secret_file', Path).read_text().strip()`.



  We can inject default values to functions from the configuration.
  Either one by one, where we can map a factory function or a configuration key.
  Or inject all automatically base on the parameter name.

  ```python
  from alphaconf.inject import inject, inject_auto

  @inject('name', 'application.name')
  @inject_auto(ignore={'name'})
  def main(name: str, example=None):
      pass


  def main(name: str=None, example=None):
      if name is None:
          name = alphaconf.get('application.name', str)
      if example is None:
          example = alphaconf.get('example', default=example)
      ...
  ```



  Just add the lines below to parameterize invoke.
  Note that the argument parsing to overwrite configuration will work only
  when the script is directly called.

  ```python
  import alphaconf.invoke
  ns = alphaconf.invoke.collection(globals())
  alphaconf.setup_configuration({'backup': 'all'})
  alphaconf.invoke.run(__name__, ns)
  ```


  - Run a specific function `alphaconf my.module.main`:
    find functions and inject args
  - Install completions for bash `alphaconf --install-autocompletion`

  [OmegaConf]: https://omegaconf.readthedocs.io/
  [pydantic]: https://docs.pydantic.dev/latest/


pkgId: d075662e83ad471998b28a255e0fdedd9db4083842a2c89d6182c4c5dcfc304a
name: python-alphadb
arch: src
version: 1.0.0b19
epoch: 0
release: 1
summary: MySQL Database versioning toolset
url: https://github.com/w-kuipers/alphadb
rpm_license: UNKNOWN
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphadb-1.0.0b19-1.src.rpm
checksum_type: sha256
description:
  ![AlphaDB](https://github.com/w-kuipers/alphadb/blob/main/assets/ALPHADB_Github-Social-Preview.png?raw=true)

  [![GitHub releases](https://img.shields.io/github/v/release/w-kuipers/alphadb)](https://github.com/w-kuipers/alphadb/releases)
  [![PyPI release](https://img.shields.io/pypi/v/alphadb.svg)](https://pypi.org/project/alphadb/)
  [![NPM release](https://img.shields.io/npm/v/%40w-kuipers%2Falphadb)](https://www.npmjs.com/package/@w-kuipers/alphadb)
  [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
  [![](https://img.shields.io/github/last-commit/w-kuipers/alphadb?label=last%20modified)](https://github.com/w-kuipers/alphadb)
  [![Tests](https://github.com/w-kuipers/alphadb/actions/workflows/run-tests.yml/badge.svg)](https://github.com/w-kuipers/alphadb/actions/workflows/run-tests.yml)



  A toolset for MySQL database versioning.



  AlphaDB is currently in `beta` stage. Breaking changes should be expected.

  <details>
    <summary>Table of Contents</summary>
    <ol>
      <li><a href="#documentation">Documentation</a></li>
      <li>
        <a href="#installation">Installation</a>
        <ul>
          <li><a href="#install-using-pip">Install using PIP</a></li>
        </ul>
      </li>
      <li><a href="#usage">Usage</a></li>
      <li><a href="#exceptions">Exceptions</a></li>
      <li><a href="#license">License</a></li>
    </ol>
  </details>



  Visit the [official documentation](https://alphadb.w-kuipers.com/)





      pip install alphadb

  Note that `pip` refers to the Python 3 package manager. In an environment where Python 2 is also present the correct command may be `pip3`.



  Import AlphaDB
  ``` python
  from alphadb import AlphaDB
  ```
  Connect to a database.
  ``` python
  db = AlphaDB()
  db.connect(
      host="localhost",
      user="user",
      password="password",
      database="database"
  )
  ```
  Make sure the database is empty, back it up if necessary. If the database is not empty, you can use the `vacate` method.
  Note that this function will erase ALL data in the database and there is no way to get it back. For extra safety the argument `confirm=True` is required for the function to run.
  ``` python
  db.vacate(confirm=True)
  ```
  The database is now ready to be initialized. The `init` method will create the `adb_conf` table. This holds configuration data for the database.
  ``` python
  db.init()
  ```
  Now we update the database. For this we need to give it a structure. The database version information is a JSON structure formatted as such:
  ``` python
  database_version_source = {
      "name": "mydb", ## Database name, does not have to, but is advised to match the actual database name
      "version": [ ## List containing database versions
          {
              "_id": "0.1.0", ## Database version
              "createtable": { ## Object containing tables to be created,
                  "customers": { ## Object key will be used as table name
                      "primary_key": "id",
                      "name": { ## Object key will be used as column name
                          "type": "VARCHAR", ## Data type
                          "length": 100, ## Date max length,
                      },
                      "id": {
                          "type": "INT",
                          "a_i": True
                      }
                  },
              }
          },
          {
              "_id": "1.0.0",
              "createtable": {
                  "orders": {
                      "primary_key": "id",
                      "id": {
                          "type": "INT",
                          "a_i": True
                      },
                      "date": {
                          "type": "DATETIME",
                      },
                      "note": {
                          "type": "TEXT",
                          "null": True
                      }
                  }
              }
          }
      ]
  }
  ```

  Then call the `update` method.
  ``` python
  db.update(version_source=database_version_source)
  ```




  The `NoConnection` exception is thrown when a method is called while no database connection is active.



  The `DBNotInitialized` exception is thrown when the database is not yet initialized.
  ``` python
  Database.init() ## Will initialize the database and thus resolve the error
  ```


  The `DBTemplateNoMatch` exception is thrown when de database was previously updated using another version source.
  On initialization, a table `adb_conf` is created. In this table the column `template` is used to save the version source template name. Make sure it matches.



  [GPL-3.0 LICENSE](https://github.com/w-kuipers/alphadb/blob/main/LICENSE)


pkgId: 6b2e16a8d688878b77bf07b789372a0dc0204b02c0886bd6cb57c942e8ffecf4
name: python-alphadia
arch: src
version: 1.8.2
epoch: 0
release: 1
summary: A novel proteomics search engine for DIA data based on end-to-end transfer learning.
url: https://pypi.org/project/alphadia/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphadia-1.8.2-1.src.rpm
checksum_type: sha256
description:
  This guide will show you how to perform your first search using the One-click GUI.

  Make sure you have installed the GUI using the one-click installer. To verify your installation, open alphaDIA and make sure that the `BundledExecutionEngine` is selected.
  <img src="assets/select_engine.gif" alt="Logo" width="400" height="auto">

  For the first search we will be using a spectral library to search 60SPD bulk HeLa samples on the Orbitrap Astral. Download the test samples and save them: [HeLa library](https://datashare.biochem.mpg.de/s/Uw2yfNSbApfPpTk), [RAW files].(https://datashare.biochem.mpg.de/s/339jg5HtGrwLwDN)


  Import the library `.hdf` file and select the thre `.raw` files. You can select a human `.fasta` file for reannotation but it's generally not recommended for empirical spectral libraries.

  Although alphaDIA is highly customizable, we will only specify a limited number of settings here. Go to the *Search* settings and make the following changes:
  * Number of candidates: 5
  * MS1 Tolerance 4ppm
  * MS2 Tolerance 7ppm

  Select an output folder where the search progress and the final results should be saved.

rpm_license:
  Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.  "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."  "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.  Copyright 2020 MannLabs  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


pkgId: 4912cf8798da17d48a976177a73250823fb35a55a26cf3a68e0ef66170ce4267
name: python-alphaess
arch: src
version: 0.0.18
epoch: 0
release: 1
url: https://github.com/CharlesGillanders/alphaess
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphaess-0.0.18-1.src.rpm
checksum_type: sha256
summary:
  A python library to retrieve energy statistics from your Alpha ESS inverter by polling the Alpha ESS web API.

description:
  This Python library logs in to cloud.alphaess.com and retrieves data on your Alpha ESS inverter, photovoltaic panels, and battery if you have one.



  Create a new Alpha ESS instance, log in, retrieve a list of Alpha ESS systems and request energy statistics of one of those Alpha ESS systems.



  Currently this package uses an API that I reverse engineered the API from the Alpha ESS web app. This is an internal API subject to change at any time by Alpha ESS.



  As of AlphaCloud V5.0.0.2 (2022-10-16) Alpha ESS introduced anti-crawl efforts to make retrieving data more difficult for packages like this one.

  To be good internet citizens, it is advised that your polling frequency for any AlphaCloud endpoints are 10 seconds at a minimum.



  There are four public methods in this module

  `authenticate(username, password)` - attempts to authenticate to the ALpha ESS API with a username and password combination, returns True or False depending on successful authentication or not

  `getdata()` - having successfully authenticated attempts to get statistical energy data on all registered Alpha ESS systems - will return None if there are issues retrieving data from the Alpha ESS API.

  `setbatterycharge(serial, enabled, cp1start, cp1end, cp2start, cp2end, chargestopsoc)` - having successfully authenticated set battery grid charging settings for the SN.

  `setbatterydischarge(serial, enabled, dp1start, dp1end, dp2start, dp2end, dischargecutoffsoc)` - having successfully authenticated set battery discharge settings for the SN.


pkgId: 54e1f46c1a803108826d1757230197e60c6b033a2265f4f71cf7fd638a6b42cb
name: python-alphaess-aio
arch: src
version: 0.0.0
epoch: 0
release: 1
summary: Sends get and post requests to available AlphaCloud API endpoints.
url: https://pypi.org/project/alphaess-aio/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphaess-aio-0.0.0-1.src.rpm
checksum_type: sha256
description:
  Sends get and post requests to available AlphaCloud API endpoints and retrieves data about you AlphaESS system.
  Code generated out of API description.



  Register account at https://open.alphaess.com/. You will recieve an AppID and AppSecret needed for authentification.



  ```python
  import asyncio
  from alphaessaio import AlphaEssAPI, AlphaEssAuth


  auth = AlphaEssAuth(appid="your_app_id", appsecret="your_app_secret")


  alphaess_api = AlphaEssAPI(auth)

  ess_list = asyncio.run(alphaess_api.get_ess_list())
  ```

rpm_license:
  MIT License  Copyright (c) 2024 zeguramente  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


pkgId: a50ef109c4ce9dfd5155a8395adb4d18475e7fce0a41520d965e32a0dae525c3
name: python-alphaessopenapi
arch: src
version: 0.0.11
epoch: 0
release: 1
url: https://github.com/CharlesGillanders/alphaess-openAPI
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphaessopenapi-0.0.11-1.src.rpm
checksum_type: sha256
summary:
  A python library to retrieve energy statistics from your Alpha ESS inverter by polling the Official Alpha ESS Open API.

description:
  This Python library uses the Alpha ESS Open API to retrieve data on your Alpha ESS inverter, photovoltaic panels, and battery if you have one.  This library is principally intended for use by my Home Assistant integration [https://github.com/CharlesGillanders/homeassistant-alphaESS]




  Register at https://open.alphaess.com/ for a (free) account to get your Developer ID (AppID) and Developer Secret (AppSecret).

  Once registered, add your battery/inverter to the developer account via the web UI.



  To be good internet citizens, it is advised that your polling frequency for any AlphaCloud endpoints are 10 seconds at a minimum.



  There are public methods in this module that duplicate the AlphaESS OpenAPI and provide wrappers for

  + https://openapi.alphaess.com/api/getEssList
  + https://openapi.alphaess.com/api/getLastPowerData
  + https://openapi.alphaess.com/api/getOneDayPowerBySn
  + https://openapi.alphaess.com/api/getOneDateEnergyBySn
  + https://openapi.alphaess.com/api/getChargeConfigInfo
  + https://openapi.alphaess.com/api/updateChargeConfigInfo
  + https://openapi.alphaess.com/api/getDisChargeConfigInfo
  + https://openapi.alphaess.com/api/updateDisChargeConfigInfo

  All of the above are documented at https://open.alphaess.com/developmentManagement/apiList (Registration required)

  + getdata() - Attempts to get statistical energy data for use in Home Assistant for all registered Alpha ESS systems - will return None if there are issues retrieving data from the Alpha ESS API.
  + authenticate - Attempts to use https://openapi.alphaess.com/api/getEssList to validate authentication to the ALpha ESS API - will return True or False.
  + setbatterycharge (serial, enabled, dp1start, dp1end, dp2start, dp2end, chargecutoffsoc)
  **Parameters:**
  - `chargecutoffsoc` (float) % to stop charging from the grid at
  - `enabled` (bool) True to charge from the grid, False do not
  - `dp1start` (`datetime.time`) The start time of charging period 1 (the minutes must be one of :00, :15, :30, :45)
  - `dp1end` (`datetime.time`) The end time of charging period 1 (the minutes must be one of :00, :15, :30, :45)
  - `dp2start` (`datetime.time`) The start time of charging period 2 (the minutes must be one of :00, :15, :30, :45)
  - `dp2end` (`datetime.time`) The end time of charging period 2 (the minutes must be one of :00, :15, :30, :45)
  - `serial` (str) The serial number of the battery/inverter.

  + setbatterydischarge (serial, enabled, dp1start, dp1end, dp2start, dp2end, dischargecutoffsoc)
  **Parameters:**
  - `dischargecutoffsoc` (float) % to stop discharging from the battery at
  - `enabled` (bool) True to discharge from the battery, False do not
  - `dp1start` (`datetime.time`) The start time of charging period 1 (the minutes must be one of :00, :15, :30, :45)
  - `dp1end` (`datetime.time`) The end time of charging period 1 (the minutes must be one of :00, :15, :30, :45)
  - `dp2start` (`datetime.time`) The start time of charging period 2 (the minutes must be one of :00, :15, :30, :45)
  - `dp2end` (`datetime.time`) The end time of charging period 2 (the minutes must be one of :00, :15, :30, :45)
  - `serial` (str) The serial number of the battery/inverter.


pkgId: 6a5d2789830978431e4a0c71c9feebd8c59821c785095ccc63390961aa4870f9
name: python-alphafold-colabfold
arch: src
version: 2.3.6
epoch: 0
release: 1
url: https://github.com/sokrypton/alphafold
rpm_license: Apache License, Version 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphafold-colabfold-2.3.6-1.src.rpm
checksum_type: sha256
summary:
  An implementation of the inference pipeline of AlphaFold v2.3.1. This is a completely new model that was entered as AlphaFold2 in CASP14 and published in Nature. This package contains patches for colabfold.


pkgId: 23819b0e22c1edfa43d117c048f34b91cb9848737d81eb5213be165472d76f50
name: python-alphafold3-pytorch
arch: src
version: 0.6.10
epoch: 0
release: 1
summary: Alphafold 3 - Pytorch
url: https://pypi.org/project/alphafold3-pytorch/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphafold3-pytorch-0.6.10-1.src.rpm
checksum_type: sha256
description:
  <img src="./alphafold3.png" width="500px"></img>



  Implementation of <a href="https://www.nature.com/articles/s41586-024-07487-w">Alphafold 3</a> in Pytorch

  You can chat with other researchers about this work [here](https://discord.gg/Xsq4WaBR9S)

  <a href="https://www.youtube.com/watch?v=qjFgthkKxcA">Review of the paper</a> by <a href="https://x.com/sokrypton">Sergey</a>

  <a href="https://elanapearl.github.io/blog/2024/the-illustrated-alphafold/">Illustrated guide</a> by <a href="https://elanapearl.github.io/">Elana P. Simon</a>

  <a href="https://www.youtube.com/watch?v=AE35XCN5NuU">Talk by Max Jaderberg</a>

  A fork with full Lightning + Hydra support is being maintained by <a href="https://github.com/amorehead">Alex</a> at <a href="https://github.com/amorehead/alphafold3-pytorch-lightning-hydra">this repository</a>

  A visualization of the molecules of life used in the repository can be seen and interacted with <a href="https://colab.research.google.com/drive/1S9TD8WmS1Gjgwjo9xyEYTbdxgMVVZcQe?usp=sharing">here</a>



  - <a href="https://github.com/joseph-c-kim">Joseph</a> for contributing the Relative Positional Encoding and the Smooth LDDT Loss!

  - <a href="https://github.com/engelberger">Felipe</a> for contributing Weighted Rigid Align, Express Coordinates In Frame, Compute Alignment Error, and Centre Random Augmentation modules!

  - <a href="https://github.com/amorehead">Alex</a> for fixing various issues in the transcribed algorithms

  - <a href="https://github.com/gitabtion">Heng</a> for pointing out inconsistencies with the paper and pull requesting the solutions

  - <a href="https://github.com/gitabtion">Heng</a> for finding an issue with the molecular atom indices for the distogram loss

  - <a href="https://github.com/luwei0917">Wei Lu</a> for catching a few erroneous hyperparameters

  - <a href="https://github.com/amorehead">Alex</a> for the PDB dataset preparation script!

  - <a href="https://github.com/milot-mirdita">Milot</a> for optimizing the PDB dataset clustering script!

  - <a href="https://github.com/amorehead">Alex</a> for basically writing the entire gargantuan flow from parsing the PDB all the way to the molecule and atomic inputs for training

  - <a href="https://github.com/vandrw">Andrei</a> for working on the weighted PDB dataset sampling!

  - <a href="https://github.com/tanjimin">Jimin</a> for submitting a small fix to an issue with the coordinates being passed into `WeightedRigidAlign`

  - <a href="https://github.com/xluo233">@xluo233</a> for contributing the confidence measures, clash penalty ranking, and sample ranking logic!

  - <a href="https://github.com/sj900">sj900</a> for integrating and testing the `WeightedPDBSampler` within the `PDBDataset` and for adding initial support for MSA and template parsing!

  - <a href="https://github.com/xluo233">@xluo233</a> again for contributing the logic for computing the model selection score as well as the unresolved rasa!

  - <a href="https://github.com/wufandi">Fandi</a> for discovering a few inconsistencies in the elucidated atom diffusion module with the supplementary

  - <a href="https://github.com/ptosco">Paolo</a> for proposing the `PDB neutral stable molecule` hypothesis!

  - <a href="https://github.com/dhuvik">Dhuvi</a> for fixing a bug related to metal ion molecule ID assignment for `Alphafold3Inputs`!

  - <a href="https://github.com/dhuvik">Dhuvi</a> for taking on the logic for translating `Alphafold3Input` to `BioMolecule` for saving to mmCIF!

  - Tom (from the Discord channel) for identifying a discrepancy between this codebase's distogram and template unit vector computations and those of OpenFold (and <a href="https://github.com/vandrw">Andrei</a> for helping address the distogram issue)!

  - <a href="https://github.com/Kaihui-Cheng">Kaihui</a> for identifying a bug in how non-standard atoms were handled in polymer residues!

  - <a href="https://github.com/vandrw">Andrei</a> for taking on the gradio frontend interface!

  - <a href="https://github.com/patrick-kidger">Patrick</a> for <a href="https://docs.kidger.site/jaxtyping/">jaxtyping</a>, <a href="https://github.com/fferflo">Florian</a> for <a href="https://github.com/fferflo/einx">einx</a>, and of course, <a href="https://github.com/arogozhnikov">Alex</a> for <a href="https://einops.rocks/">einops</a>

  - Soumith and the Pytorch organization for giving me the opportunity to open source this work



  ```bash
  $ pip install alphafold3-pytorch
  ```



  ```python
  import torch
  from alphafold3_pytorch import Alphafold3
  from alphafold3_pytorch.utils.model_utils import exclusive_cumsum

  alphafold3 = Alphafold3(
      dim_atom_inputs = 77,
      dim_template_feats = 108
  )



  seq_len = 16

  molecule_atom_indices = torch.randint(0, 2, (2, seq_len)).long()
  molecule_atom_lens = torch.full((2, seq_len), 2).long()

  atom_seq_len = molecule_atom_lens.sum(dim=-1).amax()
  atom_offsets = exclusive_cumsum(molecule_atom_lens)

  atom_inputs = torch.randn(2, atom_seq_len, 77)
  atompair_inputs = torch.randn(2, atom_seq_len, atom_seq_len, 5)

  additional_molecule_feats = torch.randint(0, 2, (2, seq_len, 5))
  additional_token_feats = torch.randn(2, seq_len, 33)
  is_molecule_types = torch.randint(0, 2, (2, seq_len, 5)).bool()
  is_molecule_mod = torch.randint(0, 2, (2, seq_len, 4)).bool()
  molecule_ids = torch.randint(0, 32, (2, seq_len))

  template_feats = torch.randn(2, 2, seq_len, seq_len, 108)
  template_mask = torch.ones((2, 2)).bool()

  msa = torch.randn(2, 7, seq_len, 32)
  msa_mask = torch.ones((2, 7)).bool()

  additional_msa_feats = torch.randn(2, 7, seq_len, 2)



  atom_pos = torch.randn(2, atom_seq_len, 3)

  distogram_atom_indices = molecule_atom_lens - 1

  distance_labels = torch.randint(0, 37, (2, seq_len, seq_len))
  resolved_labels = torch.randint(0, 2, (2, atom_seq_len))



  distogram_atom_indices += atom_offsets
  molecule_atom_indices += atom_offsets



  loss = alphafold3(
      num_recycling_steps = 2,
      atom_inputs = atom_inputs,
      atompair_inputs = atompair_inputs,
      molecule_ids = molecule_ids,
      molecule_atom_lens = molecule_atom_lens,
      additional_molecule_feats = additional_molecule_feats,
      additional_msa_feats = additional_msa_feats,
      additional_token_feats = additional_token_feats,
      is_molecule_types = is_molecule_types,
      is_molecule_mod = is_molecule_mod,
      msa = msa,
      msa_mask = msa_mask,
      templates = template_feats,
      template_mask = template_mask,
      atom_pos = atom_pos,
      distogram_atom_indices = distogram_atom_indices,
      molecule_atom_indices = molecule_atom_indices,
      distance_labels = distance_labels,
      resolved_labels = resolved_labels
  )

  loss.backward()



  sampled_atom_pos = alphafold3(
      num_recycling_steps = 4,
      num_sample_steps = 16,
      atom_inputs = atom_inputs,
      atompair_inputs = atompair_inputs,
      molecule_ids = molecule_ids,
      molecule_atom_lens = molecule_atom_lens,
      additional_molecule_feats = additional_molecule_feats,
      additional_msa_feats = additional_msa_feats,
      additional_token_feats = additional_token_feats,
      is_molecule_types = is_molecule_types,
      is_molecule_mod = is_molecule_mod,
      msa = msa,
      msa_mask = msa_mask,
      templates = template_feats,
      template_mask = template_mask
  )

  sampled_atom_pos.shape # (2, <atom_seqlen>, 3)
  ```

  An example with molecule level input handling

  ```python
  import torch
  from alphafold3_pytorch import Alphafold3, Alphafold3Input

  contrived_protein = 'AG'

  mock_atompos = [
      torch.randn(5, 3),   # alanine has 5 non-hydrogen atoms
      torch.randn(4, 3)    # glycine has 4 non-hydrogen atoms
  ]

  train_alphafold3_input = Alphafold3Input(
      proteins = [contrived_protein],
      atom_pos = mock_atompos
  )

  eval_alphafold3_input = Alphafold3Input(
      proteins = [contrived_protein]
  )



  alphafold3 = Alphafold3(
      dim_atom_inputs = 3,
      dim_atompair_inputs = 5,
      atoms_per_window = 27,
      dim_template_feats = 108,
      num_molecule_mods = 0,
      confidence_head_kwargs = dict(
          pairformer_depth = 1
      ),
      template_embedder_kwargs = dict(
          pairformer_stack_depth = 1
      ),
      msa_module_kwargs = dict(
          depth = 1
      ),
      pairformer_stack = dict(
          depth = 2
      ),
      diffusion_module_kwargs = dict(
          atom_encoder_depth = 1,
          token_transformer_depth = 1,
          atom_decoder_depth = 1,
      )
  )

  loss = alphafold3.forward_with_alphafold3_inputs([train_alphafold3_input])
  loss.backward()



  alphafold3.eval()
  sampled_atom_pos = alphafold3.forward_with_alphafold3_inputs(eval_alphafold3_input)

  assert sampled_atom_pos.shape == (1, (5 + 4), 3)
  ```





  To acquire the AlphaFold 3 PDB dataset, first download all first-assembly (and asymmetric unit) complexes in the Protein Data Bank (PDB), and then preprocess them with the script referenced below. The PDB can be downloaded from the RCSB: https://www.wwpdb.org/ftp/pdb-ftp-sites#rcsbpdb. The two Python scripts below (i.e., `filter_pdb_{train,val,test}_mmcifs.py` and `cluster_pdb_{train,val,test}_mmcifs.py`) assume you have downloaded the PDB in the **mmCIF file format**, placing its first-assembly and asymmetric unit mmCIF files at `data/pdb_data/unfiltered_assembly_mmcifs/` and `data/pdb_data/unfiltered_asym_mmcifs/`, respectively.

  For reproducibility, we recommend downloading the PDB using AWS snapshots (e.g., `20240101`). To do so, refer to [AWS's documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to set up the AWS CLI locally. Alternatively, on the RCSB website, navigate down to "Download Protocols", and follow the download instructions depending on your location.

  For example, one can use the following commands to download the PDB as two collections of mmCIF files:

  ```bash

  aws s3 sync s3://pdbsnapshots/20240101/pub/pdb/data/assemblies/mmCIF/divided/ ./data/pdb_data/unfiltered_assembly_mmcifs

  rsync -rlpt -v -z --delete --port=33444 \
  rsync.rcsb.org::ftp_data/assemblies/mmCIF/divided/ ./data/pdb_data/unfiltered_assembly_mmcifs/


  aws s3 sync s3://pdbsnapshots/20240101/pub/pdb/data/structures/divided/mmCIF/ ./data/pdb_data/unfiltered_asym_mmcifs

  rsync -rlpt -v -z --delete --port=33444 \
  rsync.rcsb.org::ftp_data/structures/divided/mmCIF/ ./data/pdb_data/unfiltered_asym_mmcifs/
  ```

  > WARNING: Downloading the PDB can take up to 700GB of space.

  > NOTE: The PDB hosts all available AWS snapshots here: https://pdbsnapshots.s3.us-west-2.amazonaws.com/index.html.

  After downloading, you should have two directories formatted like this:
  https://files.rcsb.org/pub/pdb/data/assemblies/mmCIF/divided/ & https://files.rcsb.org/pub/pdb/data/structures/divided/mmCIF/

  ```bash
  00/
  01/
  02/
  ..
  zz/
  ```

  For these directories, unzip all the files:

  ```bash
  find ./data/pdb_data/unfiltered_assembly_mmcifs/ -type f -name "*.gz" -exec gzip -d {} \;
  find ./data/pdb_data/unfiltered_asym_mmcifs/ -type f -name "*.gz" -exec gzip -d {} \;
  ```

  Next run the commands

  ```bash
  wget -P ./data/ccd_data/ https://files.wwpdb.org/pub/pdb/data/monomers/components.cif.gz
  wget -P ./data/ccd_data/ https://files.wwpdb.org/pub/pdb/data/component-models/complete/chem_comp_model.cif.gz
  ```

  from the project's root directory to download the latest version of the PDB's Chemical Component Dictionary (CCD) and its structural models. Extract each of these files using the following command:

  ```bash
  find data/ccd_data/ -type f -name "*.gz" -exec gzip -d {} \;
  ```



  Then run the following with `pdb_assembly_dir`, `pdb_asym_dir`, `ccd_dir`, and `mmcif_output_dir` replaced with the locations of your local copies of the first-assembly PDB, asymmetric unit PDB, CCD, and your desired dataset output directory (i.e., `./data/pdb_data/unfiltered_assembly_mmcifs/`, `./data/pdb_data/unfiltered_asym_mmcifs/`, `./data/ccd_data/`, and `./data/pdb_data/{train,val,test}_mmcifs/`).

  ```bash
  python scripts/filter_pdb_train_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --ccd_dir <ccd_dir> --output_dir <mmcif_output_dir>
  python scripts/filter_pdb_val_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --output_dir <mmcif_output_dir>
  python scripts/filter_pdb_test_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --output_dir <mmcif_output_dir>
  ```

  See the scripts for more options. Each first-assembly mmCIF that successfully passes
  all processing steps will be written to `mmcif_output_dir` within a subdirectory
  named according to the mmCIF's second and third PDB ID characters (e.g. `5c`).



  Next, run the following with `mmcif_dir` and `{train,val,test}_clustering_output_dir` replaced, respectively, with your local output directory created using the dataset filtering script above and with your desired clustering output directories (i.e., `./data/pdb_data/{train,val,test}_mmcifs/` and `./data/pdb_data/data_caches/{train,val,test}_clusterings/`):

  ```bash
  python scripts/cluster_pdb_train_mmcifs.py --mmcif_dir <mmcif_dir> --output_dir <train_clustering_output_dir> --clustering_filtered_pdb_dataset
  python scripts/cluster_pdb_val_mmcifs.py --mmcif_dir <mmcif_dir> --reference_clustering_dir <train_clustering_output_dir> --output_dir <val_clustering_output_dir> --clustering_filtered_pdb_dataset
  python scripts/cluster_pdb_test_mmcifs.py --mmcif_dir <mmcif_dir> --reference_1_clustering_dir <train_clustering_output_dir> --reference_2_clustering_dir <val_clustering_output_dir> --output_dir <test_clustering_output_dir> --clustering_filtered_pdb_dataset
  ```

  **Note**: The `--clustering_filtered_pdb_dataset` flag is recommended when clustering the filtered PDB dataset as curated using the scripts above, as this flag will enable faster runtimes in this context (since filtering leaves each chain's residue IDs 1-based). However, this flag must **not** be provided when clustering other (i.e., non-PDB) datasets of mmCIF files. Otherwise, interface clustering may be performed incorrectly, as these datasets' mmCIF files may not use strict 1-based residue indexing for each chain.

  **Note**: One can instead download preprocessed (i.e., filtered) mmCIF (`train`/`val`/`test`) files (~25GB, comprising 148k complexes) and chain/interface clustering (`train`/`val`/`test`) files (~3GB) for the PDB's `20240101` AWS snapshot via a [shared OneDrive folder](https://mailmissouri-my.sharepoint.com/:f:/g/personal/acmwhb_umsystem_edu/EqU8tjUmmKxJr-FAlq4tzaIBi2TIBtmw5Vl3k_kmgNlepA?e=mzlyv6). Each of these `tar.gz` archives should be decompressed within the `data/pdb_data/` directory e.g., via `tar -xzf data_caches.tar.gz -C data/pdb_data/`. One can also download and prepare PDB distillation data using as a reference the script `scripts/distillation_data_download.sh`. Once downloaded, one can run `scripts/reduce_uniprot_predictions_to_pdb.py` to filter this dataset to only examples associated with at least one PDB entry. Moreover, for convenience, a [mapping](https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/idmapping.dat.gz) of UniProt accession IDs to PDB IDs for training on PDB distillation data has already been downloaded and extracted as `data/afdb_data/data_caches/uniprot_to_pdb_id_mapping.dat`.



  At the project root, run

  ```bash
  $ sh ./contribute.sh
  ```

  Then, add your module to `alphafold3_pytorch/alphafold3.py`, add your tests to `tests/test_af3.py`, and submit a pull request. You can run the tests locally with

  ```bash
  $ pytest tests/
  ```


  The included `Dockerfile` contains the required dependencies to run the package and to train/inference using PyTorch with GPUs.

  The default base image is `pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime` and installs the latest version of this package from the `main` GitHub branch.

  ```bash

  docker build -t af3 .
  ```

  Alternatively, use build arguments to rebuild the image with different software versions:
  - `PYTORCH_TAG`: Changes the base image and thus builds with different PyTorch, CUDA, and/or cuDNN versions.
  - `GIT_TAG`: Changes the tag of this repo to clone and install the package.

  For example:
  ```bash

  docker build --build-arg "PYTORCH_TAG=2.2.1-cuda12.1-cudnn8-devel" --build-arg "GIT_TAG=0.1.15" -t af3 .
  ```

  Then, run the container with GPUs and mount a local volume (for training) using the following command:

  ```bash

  docker run -v .:/data --gpus all -it af3
  ```



  ```bibtex
  @article{Abramson2024-fj,
    title    = "Accurate structure prediction of biomolecular interactions with
                {AlphaFold} 3",
    author   = "Abramson, Josh and Adler, Jonas and Dunger, Jack and Evans,
                Richard and Green, Tim and Pritzel, Alexander and Ronneberger,
                Olaf and Willmore, Lindsay and Ballard, Andrew J and Bambrick,
                Joshua and Bodenstein, Sebastian W and Evans, David A and Hung,
                Chia-Chun and O'Neill, Michael and Reiman, David and
                Tunyasuvunakool, Kathryn and Wu, Zachary and {\v Z}emgulyt{\.e},
                Akvil{\.e} and Arvaniti, Eirini and Beattie, Charles and
                Bertolli, Ottavia and Bridgland, Alex and Cherepanov, Alexey and
                Congreve, Miles and Cowen-Rivers, Alexander I and Cowie, Andrew
                and Figurnov, Michael and Fuchs, Fabian B and Gladman, Hannah and
                Jain, Rishub and Khan, Yousuf A and Low, Caroline M R and Perlin,
                Kuba and Potapenko, Anna and Savy, Pascal and Singh, Sukhdeep and
                Stecula, Adrian and Thillaisundaram, Ashok and Tong, Catherine
                and Yakneen, Sergei and Zhong, Ellen D and Zielinski, Michal and
                {\v Z}{\'\i}dek, Augustin and Bapst, Victor and Kohli, Pushmeet
                and Jaderberg, Max and Hassabis, Demis and Jumper, John M",
    journal  = "Nature",
    month    = "May",
    year     =  2024
  }
  ```

  ```bibtex
  @inproceedings{Darcet2023VisionTN,
      title   = {Vision Transformers Need Registers},
      author  = {Timoth'ee Darcet and Maxime Oquab and Julien Mairal and Piotr Bojanowski},
      year    = {2023},
      url     = {https://api.semanticscholar.org/CorpusID:263134283}
  }
  ```

  ```bibtex
  @article{Arora2024SimpleLA,
      title   = {Simple linear attention language models balance the recall-throughput tradeoff},
      author  = {Simran Arora and Sabri Eyuboglu and Michael Zhang and Aman Timalsina and Silas Alberti and Dylan Zinsley and James Zou and Atri Rudra and Christopher R'e},
      journal = {ArXiv},
      year    = {2024},
      volume  = {abs/2402.18668},
      url     = {https://api.semanticscholar.org/CorpusID:268063190}
  }
  ```

  ```bibtex
  @article{Puny2021FrameAF,
      title   = {Frame Averaging for Invariant and Equivariant Network Design},
      author  = {Omri Puny and Matan Atzmon and Heli Ben-Hamu and Edward James Smith and Ishan Misra and Aditya Grover and Yaron Lipman},
      journal = {ArXiv},
      year    = {2021},
      volume  = {abs/2110.03336},
      url     = {https://api.semanticscholar.org/CorpusID:238419638}
  }
  ```

  ```bibtex
  @article{Duval2023FAENetFA,
      title   = {FAENet: Frame Averaging Equivariant GNN for Materials Modeling},
      author  = {Alexandre Duval and Victor Schmidt and Alex Hernandez Garcia and Santiago Miret and Fragkiskos D. Malliaros and Yoshua Bengio and David Rolnick},
      journal = {ArXiv},
      year    = {2023},
      volume  = {abs/2305.05577},
      url     = {https://api.semanticscholar.org/CorpusID:258564608}
  }
  ```

  ```bibtex
  @article{Wang2022DeepNetST,
      title   = {DeepNet: Scaling Transformers to 1, 000 Layers},
      author  = {Hongyu Wang and Shuming Ma and Li Dong and Shaohan Huang and Dongdong Zhang and Furu Wei},
      journal = {ArXiv},
      year    = {2022},
      volume  = {abs/2203.00555},
      url     = {https://api.semanticscholar.org/CorpusID:247187905}
  }
  ```

  ```bibtex
  @inproceedings{Ainslie2023CoLT5FL,
      title   = {CoLT5: Faster Long-Range Transformers with Conditional Computation},
      author  = {Joshua Ainslie and Tao Lei and Michiel de Jong and Santiago Ontan'on and Siddhartha Brahma and Yury Zemlyanskiy and David Uthus and Mandy Guo and James Lee-Thorp and Yi Tay and Yun-Hsuan Sung and Sumit Sanghai},
      year    = {2023}
  }
  ```

  ```bibtex
  @article{Ash2019OnTD,
      title   = {On the Difficulty of Warm-Starting Neural Network Training},
      author  = {Jordan T. Ash and Ryan P. Adams},
      journal = {ArXiv},
      year    = {2019},
      volume  = {abs/1910.08475},
      url     = {https://api.semanticscholar.org/CorpusID:204788802}
  }
  ```

  ```bibtex
  @ARTICLE{Heinzinger2023.07.23.550085,
      author  = {Michael Heinzinger and Konstantin Weissenow and Joaquin Gomez Sanchez and Adrian Henkel and Martin Steinegger and Burkhard Rost},
      title   = {ProstT5: Bilingual Language Model for Protein Sequence and Structure},
      year    = {2023},
      doi     = {10.1101/2023.07.23.550085},
      journal = {bioRxiv}
  }
  ```

  ```bibtex
  @article {Lin2022.07.20.500902,
      author  = {Lin, Zeming and Akin, Halil and Rao, Roshan and Hie, Brian and Zhu, Zhongkai and Lu, Wenting and Santos Costa, Allan dos and Fazel-Zarandi, Maryam and Sercu, Tom and Candido, Sal and Rives, Alexander},
      title   = {Language models of protein sequences at the scale of evolution enable accurate structure prediction},
      elocation-id = {2022.07.20.500902},
      year    = {2022},
      doi     = {10.1101/2022.07.20.500902},
      publisher = {Cold Spring Harbor Laboratory},
      URL     = {https://www.biorxiv.org/content/early/2022/07/21/2022.07.20.500902},
      eprint  = {https://www.biorxiv.org/content/early/2022/07/21/2022.07.20.500902.full.pdf},
      journal = {bioRxiv}
  }
  ```

  ```bibtex
  @article{Li2024SwitchEA,
      title   = {Switch EMA: A Free Lunch for Better Flatness and Sharpness},
      author  = {Siyuan Li and Zicheng Liu and Juanxi Tian and Ge Wang and Zedong Wang and Weiyang Jin and Di Wu and Cheng Tan and Tao Lin and Yang Liu and Baigui Sun and Stan Z. Li},
      journal = {ArXiv},
      year    = {2024},
      volume  = {abs/2402.09240},
      url     = {https://api.semanticscholar.org/CorpusID:267657558}
  }
  ```

  ```bibtex
  @article{Nguyen2023MitigatingOI,
      title   = {Mitigating Over-smoothing in Transformers via Regularized Nonlocal Functionals},
      author  = {Tam Nguyen and Tan M. Nguyen and Richard G. Baraniuk},
      journal = {ArXiv},
      year    = {2023},
      volume  = {abs/2312.00751},
      url     = {https://api.semanticscholar.org/CorpusID:264300597}
  }
  ```

  ```bibtex
  @inproceedings{Zhou2024ValueRL,
      title   = {Value Residual Learning For Alleviating Attention Concentration In Transformers},
      author  = {Zhanchao Zhou and Tianyi Wu and Zhiyun Jiang and Zhenzhong Lan},
      year    = {2024},
      url     = {https://api.semanticscholar.org/CorpusID:273532030}
  }
  ```

  ```bibtex
  @inproceedings{Duvvuri2024LASERAW,
      title   = {LASER: Attention with Exponential Transformation},
      author  = {Sai Surya Duvvuri and Inderjit S. Dhillon},
      year    = {2024},
      url     = {https://api.semanticscholar.org/CorpusID:273849947}
  }
  ```

rpm_license:
[cell repeats an earlier one in this file: 1065 characters]


pkgId: d4012f5bcb6a692eec62ab4b3557234f42755ebc2a23d35ff9206bad82dda527
name: python-alphafold3-pytorch
arch: src
version: 0.6.2
epoch: 0
release: 1
summary: Alphafold 3 - Pytorch
url: https://pypi.org/project/alphafold3-pytorch/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphafold3-pytorch-0.6.2-1.src.rpm
checksum_type: sha256
description:
  <img src="./alphafold3.png" width="500px"></img>



  Implementation of <a href="https://www.nature.com/articles/s41586-024-07487-w">Alphafold 3</a> in Pytorch

  You can chat with other researchers about this work [here](https://discord.gg/Xsq4WaBR9S)

  <a href="https://www.youtube.com/watch?v=qjFgthkKxcA">Review of the paper</a> by <a href="https://x.com/sokrypton">Sergey</a>

  <a href="https://elanapearl.github.io/blog/2024/the-illustrated-alphafold/">Illustrated guide</a> by <a href="https://elanapearl.github.io/">Elana P. Simon</a>

  <a href="https://www.youtube.com/watch?v=AE35XCN5NuU">Talk by Max Jaderberg</a>

  A fork with full Lightning + Hydra support is being maintained by <a href="https://github.com/amorehead">Alex</a> at <a href="https://github.com/amorehead/alphafold3-pytorch-lightning-hydra">this repository</a>

  A visualization of the molecules of life used in the repository can be seen and interacted with <a href="https://colab.research.google.com/drive/1S9TD8WmS1Gjgwjo9xyEYTbdxgMVVZcQe?usp=sharing">here</a>



  - <a href="https://github.com/joseph-c-kim">Joseph</a> for contributing the Relative Positional Encoding and the Smooth LDDT Loss!

  - <a href="https://github.com/engelberger">Felipe</a> for contributing Weighted Rigid Align, Express Coordinates In Frame, Compute Alignment Error, and Centre Random Augmentation modules!

  - <a href="https://github.com/amorehead">Alex</a> for fixing various issues in the transcribed algorithms

  - <a href="https://github.com/gitabtion">Heng</a> for pointing out inconsistencies with the paper and pull requesting the solutions

  - <a href="https://github.com/gitabtion">Heng</a> for finding an issue with the molecular atom indices for the distogram loss

  - <a href="https://github.com/luwei0917">Wei Lu</a> for catching a few erroneous hyperparameters

  - <a href="https://github.com/amorehead">Alex</a> for the PDB dataset preparation script!

  - <a href="https://github.com/milot-mirdita">Milot</a> for optimizing the PDB dataset clustering script!

  - <a href="https://github.com/amorehead">Alex</a> for basically writing the entire gargantuan flow from parsing the PDB all the way to the molecule and atomic inputs for training

  - <a href="https://github.com/vandrw">Andrei</a> for working on the weighted PDB dataset sampling!

  - <a href="https://github.com/tanjimin">Jimin</a> for submitting a small fix to an issue with the coordinates being passed into `WeightedRigidAlign`

  - <a href="https://github.com/xluo233">@xluo233</a> for contributing the confidence measures, clash penalty ranking, and sample ranking logic!

  - <a href="https://github.com/sj900">sj900</a> for integrating and testing the `WeightedPDBSampler` within the `PDBDataset` and for adding initial support for MSA and template parsing!

  - <a href="https://github.com/xluo233">@xluo233</a> again for contributing the logic for computing the model selection score as well as the unresolved rasa!

  - <a href="https://github.com/wufandi">Fandi</a> for discovering a few inconsistencies in the elucidated atom diffusion module with the supplementary

  - <a href="https://github.com/ptosco">Paolo</a> for proposing the `PDB neutral stable molecule` hypothesis!

  - <a href="https://github.com/dhuvik">Dhuvi</a> for fixing a bug related to metal ion molecule ID assignment for `Alphafold3Inputs`!

  - <a href="https://github.com/dhuvik">Dhuvi</a> for taking on the logic for translating `Alphafold3Input` to `BioMolecule` for saving to mmCIF!

  - Tom (from the Discord channel) for identifying a discrepancy between this codebase's distogram and template unit vector computations and those of OpenFold (and <a href="https://github.com/vandrw">Andrei</a> for helping address the distogram issue)!

  - <a href="https://github.com/Kaihui-Cheng">Kaihui</a> for identifying a bug in how non-standard atoms were handled in polymer residues!

  - <a href="https://github.com/vandrw">Andrei</a> for taking on the gradio frontend interface!

  - <a href="https://github.com/patrick-kidger">Patrick</a> for <a href="https://docs.kidger.site/jaxtyping/">jaxtyping</a>, <a href="https://github.com/fferflo">Florian</a> for <a href="https://github.com/fferflo/einx">einx</a>, and of course, <a href="https://github.com/arogozhnikov">Alex</a> for <a href="https://einops.rocks/">einops</a>

  - Soumith and the Pytorch organization for giving me the opportunity to open source this work



  ```bash
  $ pip install alphafold3-pytorch
  ```



  ```python
  import torch
  from alphafold3_pytorch import Alphafold3
  from alphafold3_pytorch.utils.model_utils import exclusive_cumsum

  alphafold3 = Alphafold3(
      dim_atom_inputs = 77,
      dim_template_feats = 108
  )



  seq_len = 16

  molecule_atom_indices = torch.randint(0, 2, (2, seq_len)).long()
  molecule_atom_lens = torch.full((2, seq_len), 2).long()

  atom_seq_len = molecule_atom_lens.sum(dim=-1).amax()
  atom_offsets = exclusive_cumsum(molecule_atom_lens)

  atom_inputs = torch.randn(2, atom_seq_len, 77)
  atompair_inputs = torch.randn(2, atom_seq_len, atom_seq_len, 5)

  additional_molecule_feats = torch.randint(0, 2, (2, seq_len, 5))
  additional_token_feats = torch.randn(2, seq_len, 33)
  is_molecule_types = torch.randint(0, 2, (2, seq_len, 5)).bool()
  is_molecule_mod = torch.randint(0, 2, (2, seq_len, 4)).bool()
  molecule_ids = torch.randint(0, 32, (2, seq_len))

  template_feats = torch.randn(2, 2, seq_len, seq_len, 108)
  template_mask = torch.ones((2, 2)).bool()

  msa = torch.randn(2, 7, seq_len, 32)
  msa_mask = torch.ones((2, 7)).bool()

  additional_msa_feats = torch.randn(2, 7, seq_len, 2)



  atom_pos = torch.randn(2, atom_seq_len, 3)

  distogram_atom_indices = molecule_atom_lens - 1

  distance_labels = torch.randint(0, 37, (2, seq_len, seq_len))
  resolved_labels = torch.randint(0, 2, (2, atom_seq_len))



  distogram_atom_indices += atom_offsets
  molecule_atom_indices += atom_offsets



  loss = alphafold3(
      num_recycling_steps = 2,
      atom_inputs = atom_inputs,
      atompair_inputs = atompair_inputs,
      molecule_ids = molecule_ids,
      molecule_atom_lens = molecule_atom_lens,
      additional_molecule_feats = additional_molecule_feats,
      additional_msa_feats = additional_msa_feats,
      additional_token_feats = additional_token_feats,
      is_molecule_types = is_molecule_types,
      is_molecule_mod = is_molecule_mod,
      msa = msa,
      msa_mask = msa_mask,
      templates = template_feats,
      template_mask = template_mask,
      atom_pos = atom_pos,
      distogram_atom_indices = distogram_atom_indices,
      molecule_atom_indices = molecule_atom_indices,
      distance_labels = distance_labels,
      resolved_labels = resolved_labels
  )

  loss.backward()



  sampled_atom_pos = alphafold3(
      num_recycling_steps = 4,
      num_sample_steps = 16,
      atom_inputs = atom_inputs,
      atompair_inputs = atompair_inputs,
      molecule_ids = molecule_ids,
      molecule_atom_lens = molecule_atom_lens,
      additional_molecule_feats = additional_molecule_feats,
      additional_msa_feats = additional_msa_feats,
      additional_token_feats = additional_token_feats,
      is_molecule_types = is_molecule_types,
      is_molecule_mod = is_molecule_mod,
      msa = msa,
      msa_mask = msa_mask,
      templates = template_feats,
      template_mask = template_mask
  )

  sampled_atom_pos.shape # (2, <atom_seqlen>, 3)
  ```

  An example with molecule level input handling

  ```python
  import torch
  from alphafold3_pytorch import Alphafold3, Alphafold3Input

  contrived_protein = 'AG'

  mock_atompos = [
      torch.randn(5, 3),   # alanine has 5 non-hydrogen atoms
      torch.randn(4, 3)    # glycine has 4 non-hydrogen atoms
  ]

  train_alphafold3_input = Alphafold3Input(
      proteins = [contrived_protein],
      atom_pos = mock_atompos
  )

  eval_alphafold3_input = Alphafold3Input(
      proteins = [contrived_protein]
  )



  alphafold3 = Alphafold3(
      dim_atom_inputs = 3,
      dim_atompair_inputs = 5,
      atoms_per_window = 27,
      dim_template_feats = 108,
      num_molecule_mods = 0,
      confidence_head_kwargs = dict(
          pairformer_depth = 1
      ),
      template_embedder_kwargs = dict(
          pairformer_stack_depth = 1
      ),
      msa_module_kwargs = dict(
          depth = 1
      ),
      pairformer_stack = dict(
          depth = 2
      ),
      diffusion_module_kwargs = dict(
          atom_encoder_depth = 1,
          token_transformer_depth = 1,
          atom_decoder_depth = 1,
      )
  )

  loss = alphafold3.forward_with_alphafold3_inputs([train_alphafold3_input])
  loss.backward()



  alphafold3.eval()
  sampled_atom_pos = alphafold3.forward_with_alphafold3_inputs(eval_alphafold3_input)

  assert sampled_atom_pos.shape == (1, (5 + 4), 3)
  ```





  To acquire the AlphaFold 3 PDB dataset, first download all first-assembly (and asymmetric unit) complexes in the Protein Data Bank (PDB), and then preprocess them with the script referenced below. The PDB can be downloaded from the RCSB: https://www.wwpdb.org/ftp/pdb-ftp-sites#rcsbpdb. The two Python scripts below (i.e., `filter_pdb_{train,val,test}_mmcifs.py` and `cluster_pdb_{train,val,test}_mmcifs.py`) assume you have downloaded the PDB in the **mmCIF file format**, placing its first-assembly and asymmetric unit mmCIF files at `data/pdb_data/unfiltered_assembly_mmcifs/` and `data/pdb_data/unfiltered_asym_mmcifs/`, respectively.

  For reproducibility, we recommend downloading the PDB using AWS snapshots (e.g., `20240101`). To do so, refer to [AWS's documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to set up the AWS CLI locally. Alternatively, on the RCSB website, navigate down to "Download Protocols", and follow the download instructions depending on your location.

  For example, one can use the following commands to download the PDB as two collections of mmCIF files:

  ```bash

  aws s3 sync s3://pdbsnapshots/20240101/pub/pdb/data/assemblies/mmCIF/divided/ ./data/pdb_data/unfiltered_assembly_mmcifs

  rsync -rlpt -v -z --delete --port=33444 \
  rsync.rcsb.org::ftp_data/assemblies/mmCIF/divided/ ./data/pdb_data/unfiltered_assembly_mmcifs/


  aws s3 sync s3://pdbsnapshots/20240101/pub/pdb/data/structures/divided/mmCIF/ ./data/pdb_data/unfiltered_asym_mmcifs

  rsync -rlpt -v -z --delete --port=33444 \
  rsync.rcsb.org::ftp_data/structures/divided/mmCIF/ ./data/pdb_data/unfiltered_asym_mmcifs/
  ```

  > WARNING: Downloading the PDB can take up to 700GB of space.

  > NOTE: The PDB hosts all available AWS snapshots here: https://pdbsnapshots.s3.us-west-2.amazonaws.com/index.html.

  After downloading, you should have two directories formatted like this:
  https://files.rcsb.org/pub/pdb/data/assemblies/mmCIF/divided/ & https://files.rcsb.org/pub/pdb/data/structures/divided/mmCIF/

  ```bash
  00/
  01/
  02/
  ..
  zz/
  ```

  For these directories, unzip all the files:

  ```bash
  find ./data/pdb_data/unfiltered_assembly_mmcifs/ -type f -name "*.gz" -exec gzip -d {} \;
  find ./data/pdb_data/unfiltered_asym_mmcifs/ -type f -name "*.gz" -exec gzip -d {} \;
  ```

  Next run the commands

  ```bash
  wget -P ./data/ccd_data/ https://files.wwpdb.org/pub/pdb/data/monomers/components.cif.gz
  wget -P ./data/ccd_data/ https://files.wwpdb.org/pub/pdb/data/component-models/complete/chem_comp_model.cif.gz
  ```

  from the project's root directory to download the latest version of the PDB's Chemical Component Dictionary (CCD) and its structural models. Extract each of these files using the following command:

  ```bash
  find data/ccd_data/ -type f -name "*.gz" -exec gzip -d {} \;
  ```



  Then run the following with `pdb_assembly_dir`, `pdb_asym_dir`, `ccd_dir`, and `mmcif_output_dir` replaced with the locations of your local copies of the first-assembly PDB, asymmetric unit PDB, CCD, and your desired dataset output directory (i.e., `./data/pdb_data/unfiltered_assembly_mmcifs/`, `./data/pdb_data/unfiltered_asym_mmcifs/`, `./data/ccd_data/`, and `./data/pdb_data/{train,val,test}_mmcifs/`).

  ```bash
  python scripts/filter_pdb_train_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --ccd_dir <ccd_dir> --output_dir <mmcif_output_dir>
  python scripts/filter_pdb_val_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --output_dir <mmcif_output_dir>
  python scripts/filter_pdb_test_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --output_dir <mmcif_output_dir>
  ```

  See the scripts for more options. Each first-assembly mmCIF that successfully passes
  all processing steps will be written to `mmcif_output_dir` within a subdirectory
  named according to the mmCIF's second and third PDB ID characters (e.g. `5c`).



  Next, run the following with `mmcif_dir` and `{train,val,test}_clustering_output_dir` replaced, respectively, with your local output directory created using the dataset filtering script above and with your desired clustering output directories (i.e., `./data/pdb_data/{train,val,test}_mmcifs/` and `./data/pdb_data/data_caches/{train,val,test}_clusterings/`):

  ```bash
  python scripts/cluster_pdb_train_mmcifs.py --mmcif_dir <mmcif_dir> --output_dir <train_clustering_output_dir> --clustering_filtered_pdb_dataset
  python scripts/cluster_pdb_val_mmcifs.py --mmcif_dir <mmcif_dir> --reference_clustering_dir <train_clustering_output_dir> --output_dir <val_clustering_output_dir> --clustering_filtered_pdb_dataset
  python scripts/cluster_pdb_test_mmcifs.py --mmcif_dir <mmcif_dir> --reference_1_clustering_dir <train_clustering_output_dir> --reference_2_clustering_dir <val_clustering_output_dir> --output_dir <test_clustering_output_dir> --clustering_filtered_pdb_dataset
  ```

  **Note**: The `--clustering_filtered_pdb_dataset` flag is recommended when clustering the filtered PDB dataset as curated using the scripts above, as this flag will enable faster runtimes in this context (since filtering leaves each chain's residue IDs 1-based). However, this flag must **not** be provided when clustering other (i.e., non-PDB) datasets of mmCIF files. Otherwise, interface clustering may be performed incorrectly, as these datasets' mmCIF files may not use strict 1-based residue indexing for each chain.

  **Note**: One can instead download preprocessed (i.e., filtered) mmCIF (`train`/`val`/`test`) files (~25GB, comprising 148k complexes) and chain/interface clustering (`train`/`val`/`test`) files (~3GB) for the PDB's `20240101` AWS snapshot via a [shared OneDrive folder](https://mailmissouri-my.sharepoint.com/:f:/g/personal/acmwhb_umsystem_edu/EqU8tjUmmKxJr-FAlq4tzaIBi2TIBtmw5Vl3k_kmgNlepA?e=mzlyv6). Each of these `tar.gz` archives should be decompressed within the `data/pdb_data/` directory e.g., via `tar -xzf data_caches.tar.gz -C data/pdb_data/`. One can also download and prepare PDB distillation data using as a reference the script `scripts/distillation_data_download.sh`. Once downloaded, one can run `scripts/reduce_uniprot_predictions_to_pdb.py` to filter this dataset to only examples associated with at least one PDB entry. Moreover, for convenience, a [mapping](https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/idmapping.dat.gz) of UniProt accession IDs to PDB IDs for training on PDB distillation data has already been downloaded and extracted as `data/afdb_data/data_caches/uniprot_to_pdb_id_mapping.dat`.



  At the project root, run

  ```bash
  $ sh ./contribute.sh
  ```

  Then, add your module to `alphafold3_pytorch/alphafold3.py`, add your tests to `tests/test_af3.py`, and submit a pull request. You can run the tests locally with

  ```bash
  $ pytest tests/
  ```


  The included `Dockerfile` contains the required dependencies to run the package and to train/inference using PyTorch with GPUs.

  The default base image is `pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime` and installs the latest version of this package from the `main` GitHub branch.

  ```bash

  docker build -t af3 .
  ```

  Alternatively, use build arguments to rebuild the image with different software versions:
  - `PYTORCH_TAG`: Changes the base image and thus builds with different PyTorch, CUDA, and/or cuDNN versions.
  - `GIT_TAG`: Changes the tag of this repo to clone and install the package.

  For example:
  ```bash

  docker build --build-arg "PYTORCH_TAG=2.2.1-cuda12.1-cudnn8-devel" --build-arg "GIT_TAG=0.1.15" -t af3 .
  ```

  Then, run the container with GPUs and mount a local volume (for training) using the following command:

  ```bash

  docker run -v .:/data --gpus all -it af3
  ```



  ```bibtex
  @article{Abramson2024-fj,
    title    = "Accurate structure prediction of biomolecular interactions with
                {AlphaFold} 3",
    author   = "Abramson, Josh and Adler, Jonas and Dunger, Jack and Evans,
                Richard and Green, Tim and Pritzel, Alexander and Ronneberger,
                Olaf and Willmore, Lindsay and Ballard, Andrew J and Bambrick,
                Joshua and Bodenstein, Sebastian W and Evans, David A and Hung,
                Chia-Chun and O'Neill, Michael and Reiman, David and
                Tunyasuvunakool, Kathryn and Wu, Zachary and {\v Z}emgulyt{\.e},
                Akvil{\.e} and Arvaniti, Eirini and Beattie, Charles and
                Bertolli, Ottavia and Bridgland, Alex and Cherepanov, Alexey and
                Congreve, Miles and Cowen-Rivers, Alexander I and Cowie, Andrew
                and Figurnov, Michael and Fuchs, Fabian B and Gladman, Hannah and
                Jain, Rishub and Khan, Yousuf A and Low, Caroline M R and Perlin,
                Kuba and Potapenko, Anna and Savy, Pascal and Singh, Sukhdeep and
                Stecula, Adrian and Thillaisundaram, Ashok and Tong, Catherine
                and Yakneen, Sergei and Zhong, Ellen D and Zielinski, Michal and
                {\v Z}{\'\i}dek, Augustin and Bapst, Victor and Kohli, Pushmeet
                and Jaderberg, Max and Hassabis, Demis and Jumper, John M",
    journal  = "Nature",
    month    = "May",
    year     =  2024
  }
  ```

  ```bibtex
  @inproceedings{Darcet2023VisionTN,
      title   = {Vision Transformers Need Registers},
      author  = {Timoth'ee Darcet and Maxime Oquab and Julien Mairal and Piotr Bojanowski},
      year    = {2023},
      url     = {https://api.semanticscholar.org/CorpusID:263134283}
  }
  ```

  ```bibtex
  @article{Arora2024SimpleLA,
      title   = {Simple linear attention language models balance the recall-throughput tradeoff},
      author  = {Simran Arora and Sabri Eyuboglu and Michael Zhang and Aman Timalsina and Silas Alberti and Dylan Zinsley and James Zou and Atri Rudra and Christopher R'e},
      journal = {ArXiv},
      year    = {2024},
      volume  = {abs/2402.18668},
      url     = {https://api.semanticscholar.org/CorpusID:268063190}
  }
  ```

  ```bibtex
  @article{Puny2021FrameAF,
      title   = {Frame Averaging for Invariant and Equivariant Network Design},
      author  = {Omri Puny and Matan Atzmon and Heli Ben-Hamu and Edward James Smith and Ishan Misra and Aditya Grover and Yaron Lipman},
      journal = {ArXiv},
      year    = {2021},
      volume  = {abs/2110.03336},
      url     = {https://api.semanticscholar.org/CorpusID:238419638}
  }
  ```

  ```bibtex
  @article{Duval2023FAENetFA,
      title   = {FAENet: Frame Averaging Equivariant GNN for Materials Modeling},
      author  = {Alexandre Duval and Victor Schmidt and Alex Hernandez Garcia and Santiago Miret and Fragkiskos D. Malliaros and Yoshua Bengio and David Rolnick},
      journal = {ArXiv},
      year    = {2023},
      volume  = {abs/2305.05577},
      url     = {https://api.semanticscholar.org/CorpusID:258564608}
  }
  ```

  ```bibtex
  @article{Wang2022DeepNetST,
      title   = {DeepNet: Scaling Transformers to 1, 000 Layers},
      author  = {Hongyu Wang and Shuming Ma and Li Dong and Shaohan Huang and Dongdong Zhang and Furu Wei},
      journal = {ArXiv},
      year    = {2022},
      volume  = {abs/2203.00555},
      url     = {https://api.semanticscholar.org/CorpusID:247187905}
  }
  ```

  ```bibtex
  @inproceedings{Ainslie2023CoLT5FL,
      title   = {CoLT5: Faster Long-Range Transformers with Conditional Computation},
      author  = {Joshua Ainslie and Tao Lei and Michiel de Jong and Santiago Ontan'on and Siddhartha Brahma and Yury Zemlyanskiy and David Uthus and Mandy Guo and James Lee-Thorp and Yi Tay and Yun-Hsuan Sung and Sumit Sanghai},
      year    = {2023}
  }
  ```

  ```bibtex
  @article{Ash2019OnTD,
      title   = {On the Difficulty of Warm-Starting Neural Network Training},
      author  = {Jordan T. Ash and Ryan P. Adams},
      journal = {ArXiv},
      year    = {2019},
      volume  = {abs/1910.08475},
      url     = {https://api.semanticscholar.org/CorpusID:204788802}
  }
  ```

  ```bibtex
  @ARTICLE{Heinzinger2023.07.23.550085,
      author  = {Michael Heinzinger and Konstantin Weissenow and Joaquin Gomez Sanchez and Adrian Henkel and Martin Steinegger and Burkhard Rost},
      title   = {ProstT5: Bilingual Language Model for Protein Sequence and Structure},
      year    = {2023},
      doi     = {10.1101/2023.07.23.550085},
      journal = {bioRxiv}
  }
  ```

  ```bibtex
  @article {Lin2022.07.20.500902,
      author  = {Lin, Zeming and Akin, Halil and Rao, Roshan and Hie, Brian and Zhu, Zhongkai and Lu, Wenting and Santos Costa, Allan dos and Fazel-Zarandi, Maryam and Sercu, Tom and Candido, Sal and Rives, Alexander},
      title   = {Language models of protein sequences at the scale of evolution enable accurate structure prediction},
      elocation-id = {2022.07.20.500902},
      year    = {2022},
      doi     = {10.1101/2022.07.20.500902},
      publisher = {Cold Spring Harbor Laboratory},
      URL     = {https://www.biorxiv.org/content/early/2022/07/21/2022.07.20.500902},
      eprint  = {https://www.biorxiv.org/content/early/2022/07/21/2022.07.20.500902.full.pdf},
      journal = {bioRxiv}
  }
  ```

rpm_license:
[cell repeats an earlier one in this file: 1065 characters]


pkgId: 485e5e9cc8de4c004ba5110779d3e2753336d591291377411868039d57650b47
name: python-alphafold3-pytorch
arch: src
version: 0.6.6
epoch: 0
release: 1
summary: Alphafold 3 - Pytorch
url: https://pypi.org/project/alphafold3-pytorch/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphafold3-pytorch-0.6.6-1.src.rpm
checksum_type: sha256
description:
  <img src="./alphafold3.png" width="500px"></img>



  Implementation of <a href="https://www.nature.com/articles/s41586-024-07487-w">Alphafold 3</a> in Pytorch

  You can chat with other researchers about this work [here](https://discord.gg/Xsq4WaBR9S)

  <a href="https://www.youtube.com/watch?v=qjFgthkKxcA">Review of the paper</a> by <a href="https://x.com/sokrypton">Sergey</a>

  <a href="https://elanapearl.github.io/blog/2024/the-illustrated-alphafold/">Illustrated guide</a> by <a href="https://elanapearl.github.io/">Elana P. Simon</a>

  <a href="https://www.youtube.com/watch?v=AE35XCN5NuU">Talk by Max Jaderberg</a>

  A fork with full Lightning + Hydra support is being maintained by <a href="https://github.com/amorehead">Alex</a> at <a href="https://github.com/amorehead/alphafold3-pytorch-lightning-hydra">this repository</a>

  A visualization of the molecules of life used in the repository can be seen and interacted with <a href="https://colab.research.google.com/drive/1S9TD8WmS1Gjgwjo9xyEYTbdxgMVVZcQe?usp=sharing">here</a>



  - <a href="https://github.com/joseph-c-kim">Joseph</a> for contributing the Relative Positional Encoding and the Smooth LDDT Loss!

  - <a href="https://github.com/engelberger">Felipe</a> for contributing Weighted Rigid Align, Express Coordinates In Frame, Compute Alignment Error, and Centre Random Augmentation modules!

  - <a href="https://github.com/amorehead">Alex</a> for fixing various issues in the transcribed algorithms

  - <a href="https://github.com/gitabtion">Heng</a> for pointing out inconsistencies with the paper and pull requesting the solutions

  - <a href="https://github.com/gitabtion">Heng</a> for finding an issue with the molecular atom indices for the distogram loss

  - <a href="https://github.com/luwei0917">Wei Lu</a> for catching a few erroneous hyperparameters

  - <a href="https://github.com/amorehead">Alex</a> for the PDB dataset preparation script!

  - <a href="https://github.com/milot-mirdita">Milot</a> for optimizing the PDB dataset clustering script!

  - <a href="https://github.com/amorehead">Alex</a> for basically writing the entire gargantuan flow from parsing the PDB all the way to the molecule and atomic inputs for training

  - <a href="https://github.com/vandrw">Andrei</a> for working on the weighted PDB dataset sampling!

  - <a href="https://github.com/tanjimin">Jimin</a> for submitting a small fix to an issue with the coordinates being passed into `WeightedRigidAlign`

  - <a href="https://github.com/xluo233">@xluo233</a> for contributing the confidence measures, clash penalty ranking, and sample ranking logic!

  - <a href="https://github.com/sj900">sj900</a> for integrating and testing the `WeightedPDBSampler` within the `PDBDataset` and for adding initial support for MSA and template parsing!

  - <a href="https://github.com/xluo233">@xluo233</a> again for contributing the logic for computing the model selection score as well as the unresolved rasa!

  - <a href="https://github.com/wufandi">Fandi</a> for discovering a few inconsistencies in the elucidated atom diffusion module with the supplementary

  - <a href="https://github.com/ptosco">Paolo</a> for proposing the `PDB neutral stable molecule` hypothesis!

  - <a href="https://github.com/dhuvik">Dhuvi</a> for fixing a bug related to metal ion molecule ID assignment for `Alphafold3Inputs`!

  - <a href="https://github.com/dhuvik">Dhuvi</a> for taking on the logic for translating `Alphafold3Input` to `BioMolecule` for saving to mmCIF!

  - Tom (from the Discord channel) for identifying a discrepancy between this codebase's distogram and template unit vector computations and those of OpenFold (and <a href="https://github.com/vandrw">Andrei</a> for helping address the distogram issue)!

  - <a href="https://github.com/Kaihui-Cheng">Kaihui</a> for identifying a bug in how non-standard atoms were handled in polymer residues!

  - <a href="https://github.com/vandrw">Andrei</a> for taking on the gradio frontend interface!

  - <a href="https://github.com/patrick-kidger">Patrick</a> for <a href="https://docs.kidger.site/jaxtyping/">jaxtyping</a>, <a href="https://github.com/fferflo">Florian</a> for <a href="https://github.com/fferflo/einx">einx</a>, and of course, <a href="https://github.com/arogozhnikov">Alex</a> for <a href="https://einops.rocks/">einops</a>

  - Soumith and the Pytorch organization for giving me the opportunity to open source this work



  ```bash
  $ pip install alphafold3-pytorch
  ```



  ```python
  import torch
  from alphafold3_pytorch import Alphafold3
  from alphafold3_pytorch.utils.model_utils import exclusive_cumsum

  alphafold3 = Alphafold3(
      dim_atom_inputs = 77,
      dim_template_feats = 108
  )



  seq_len = 16

  molecule_atom_indices = torch.randint(0, 2, (2, seq_len)).long()
  molecule_atom_lens = torch.full((2, seq_len), 2).long()

  atom_seq_len = molecule_atom_lens.sum(dim=-1).amax()
  atom_offsets = exclusive_cumsum(molecule_atom_lens)

  atom_inputs = torch.randn(2, atom_seq_len, 77)
  atompair_inputs = torch.randn(2, atom_seq_len, atom_seq_len, 5)

  additional_molecule_feats = torch.randint(0, 2, (2, seq_len, 5))
  additional_token_feats = torch.randn(2, seq_len, 33)
  is_molecule_types = torch.randint(0, 2, (2, seq_len, 5)).bool()
  is_molecule_mod = torch.randint(0, 2, (2, seq_len, 4)).bool()
  molecule_ids = torch.randint(0, 32, (2, seq_len))

  template_feats = torch.randn(2, 2, seq_len, seq_len, 108)
  template_mask = torch.ones((2, 2)).bool()

  msa = torch.randn(2, 7, seq_len, 32)
  msa_mask = torch.ones((2, 7)).bool()

  additional_msa_feats = torch.randn(2, 7, seq_len, 2)



  atom_pos = torch.randn(2, atom_seq_len, 3)

  distogram_atom_indices = molecule_atom_lens - 1

  distance_labels = torch.randint(0, 37, (2, seq_len, seq_len))
  resolved_labels = torch.randint(0, 2, (2, atom_seq_len))



  distogram_atom_indices += atom_offsets
  molecule_atom_indices += atom_offsets



  loss = alphafold3(
      num_recycling_steps = 2,
      atom_inputs = atom_inputs,
      atompair_inputs = atompair_inputs,
      molecule_ids = molecule_ids,
      molecule_atom_lens = molecule_atom_lens,
      additional_molecule_feats = additional_molecule_feats,
      additional_msa_feats = additional_msa_feats,
      additional_token_feats = additional_token_feats,
      is_molecule_types = is_molecule_types,
      is_molecule_mod = is_molecule_mod,
      msa = msa,
      msa_mask = msa_mask,
      templates = template_feats,
      template_mask = template_mask,
      atom_pos = atom_pos,
      distogram_atom_indices = distogram_atom_indices,
      molecule_atom_indices = molecule_atom_indices,
      distance_labels = distance_labels,
      resolved_labels = resolved_labels
  )

  loss.backward()



  sampled_atom_pos = alphafold3(
      num_recycling_steps = 4,
      num_sample_steps = 16,
      atom_inputs = atom_inputs,
      atompair_inputs = atompair_inputs,
      molecule_ids = molecule_ids,
      molecule_atom_lens = molecule_atom_lens,
      additional_molecule_feats = additional_molecule_feats,
      additional_msa_feats = additional_msa_feats,
      additional_token_feats = additional_token_feats,
      is_molecule_types = is_molecule_types,
      is_molecule_mod = is_molecule_mod,
      msa = msa,
      msa_mask = msa_mask,
      templates = template_feats,
      template_mask = template_mask
  )

  sampled_atom_pos.shape # (2, <atom_seqlen>, 3)
  ```

  An example with molecule level input handling

  ```python
  import torch
  from alphafold3_pytorch import Alphafold3, Alphafold3Input

  contrived_protein = 'AG'

  mock_atompos = [
      torch.randn(5, 3),   # alanine has 5 non-hydrogen atoms
      torch.randn(4, 3)    # glycine has 4 non-hydrogen atoms
  ]

  train_alphafold3_input = Alphafold3Input(
      proteins = [contrived_protein],
      atom_pos = mock_atompos
  )

  eval_alphafold3_input = Alphafold3Input(
      proteins = [contrived_protein]
  )



  alphafold3 = Alphafold3(
      dim_atom_inputs = 3,
      dim_atompair_inputs = 5,
      atoms_per_window = 27,
      dim_template_feats = 108,
      num_molecule_mods = 0,
      confidence_head_kwargs = dict(
          pairformer_depth = 1
      ),
      template_embedder_kwargs = dict(
          pairformer_stack_depth = 1
      ),
      msa_module_kwargs = dict(
          depth = 1
      ),
      pairformer_stack = dict(
          depth = 2
      ),
      diffusion_module_kwargs = dict(
          atom_encoder_depth = 1,
          token_transformer_depth = 1,
          atom_decoder_depth = 1,
      )
  )

  loss = alphafold3.forward_with_alphafold3_inputs([train_alphafold3_input])
  loss.backward()



  alphafold3.eval()
  sampled_atom_pos = alphafold3.forward_with_alphafold3_inputs(eval_alphafold3_input)

  assert sampled_atom_pos.shape == (1, (5 + 4), 3)
  ```





  To acquire the AlphaFold 3 PDB dataset, first download all first-assembly (and asymmetric unit) complexes in the Protein Data Bank (PDB), and then preprocess them with the script referenced below. The PDB can be downloaded from the RCSB: https://www.wwpdb.org/ftp/pdb-ftp-sites#rcsbpdb. The two Python scripts below (i.e., `filter_pdb_{train,val,test}_mmcifs.py` and `cluster_pdb_{train,val,test}_mmcifs.py`) assume you have downloaded the PDB in the **mmCIF file format**, placing its first-assembly and asymmetric unit mmCIF files at `data/pdb_data/unfiltered_assembly_mmcifs/` and `data/pdb_data/unfiltered_asym_mmcifs/`, respectively.

  For reproducibility, we recommend downloading the PDB using AWS snapshots (e.g., `20240101`). To do so, refer to [AWS's documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to set up the AWS CLI locally. Alternatively, on the RCSB website, navigate down to "Download Protocols", and follow the download instructions depending on your location.

  For example, one can use the following commands to download the PDB as two collections of mmCIF files:

  ```bash

  aws s3 sync s3://pdbsnapshots/20240101/pub/pdb/data/assemblies/mmCIF/divided/ ./data/pdb_data/unfiltered_assembly_mmcifs

  rsync -rlpt -v -z --delete --port=33444 \
  rsync.rcsb.org::ftp_data/assemblies/mmCIF/divided/ ./data/pdb_data/unfiltered_assembly_mmcifs/


  aws s3 sync s3://pdbsnapshots/20240101/pub/pdb/data/structures/divided/mmCIF/ ./data/pdb_data/unfiltered_asym_mmcifs

  rsync -rlpt -v -z --delete --port=33444 \
  rsync.rcsb.org::ftp_data/structures/divided/mmCIF/ ./data/pdb_data/unfiltered_asym_mmcifs/
  ```

  > WARNING: Downloading the PDB can take up to 700GB of space.

  > NOTE: The PDB hosts all available AWS snapshots here: https://pdbsnapshots.s3.us-west-2.amazonaws.com/index.html.

  After downloading, you should have two directories formatted like this:
  https://files.rcsb.org/pub/pdb/data/assemblies/mmCIF/divided/ & https://files.rcsb.org/pub/pdb/data/structures/divided/mmCIF/

  ```bash
  00/
  01/
  02/
  ..
  zz/
  ```

  For these directories, unzip all the files:

  ```bash
  find ./data/pdb_data/unfiltered_assembly_mmcifs/ -type f -name "*.gz" -exec gzip -d {} \;
  find ./data/pdb_data/unfiltered_asym_mmcifs/ -type f -name "*.gz" -exec gzip -d {} \;
  ```

  Next run the commands

  ```bash
  wget -P ./data/ccd_data/ https://files.wwpdb.org/pub/pdb/data/monomers/components.cif.gz
  wget -P ./data/ccd_data/ https://files.wwpdb.org/pub/pdb/data/component-models/complete/chem_comp_model.cif.gz
  ```

  from the project's root directory to download the latest version of the PDB's Chemical Component Dictionary (CCD) and its structural models. Extract each of these files using the following command:

  ```bash
  find data/ccd_data/ -type f -name "*.gz" -exec gzip -d {} \;
  ```



  Then run the following with `pdb_assembly_dir`, `pdb_asym_dir`, `ccd_dir`, and `mmcif_output_dir` replaced with the locations of your local copies of the first-assembly PDB, asymmetric unit PDB, CCD, and your desired dataset output directory (i.e., `./data/pdb_data/unfiltered_assembly_mmcifs/`, `./data/pdb_data/unfiltered_asym_mmcifs/`, `./data/ccd_data/`, and `./data/pdb_data/{train,val,test}_mmcifs/`).

  ```bash
  python scripts/filter_pdb_train_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --ccd_dir <ccd_dir> --output_dir <mmcif_output_dir>
  python scripts/filter_pdb_val_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --output_dir <mmcif_output_dir>
  python scripts/filter_pdb_test_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --output_dir <mmcif_output_dir>
  ```

  See the scripts for more options. Each first-assembly mmCIF that successfully passes
  all processing steps will be written to `mmcif_output_dir` within a subdirectory
  named according to the mmCIF's second and third PDB ID characters (e.g. `5c`).



  Next, run the following with `mmcif_dir` and `{train,val,test}_clustering_output_dir` replaced, respectively, with your local output directory created using the dataset filtering script above and with your desired clustering output directories (i.e., `./data/pdb_data/{train,val,test}_mmcifs/` and `./data/pdb_data/data_caches/{train,val,test}_clusterings/`):

  ```bash
  python scripts/cluster_pdb_train_mmcifs.py --mmcif_dir <mmcif_dir> --output_dir <train_clustering_output_dir> --clustering_filtered_pdb_dataset
  python scripts/cluster_pdb_val_mmcifs.py --mmcif_dir <mmcif_dir> --reference_clustering_dir <train_clustering_output_dir> --output_dir <val_clustering_output_dir> --clustering_filtered_pdb_dataset
  python scripts/cluster_pdb_test_mmcifs.py --mmcif_dir <mmcif_dir> --reference_1_clustering_dir <train_clustering_output_dir> --reference_2_clustering_dir <val_clustering_output_dir> --output_dir <test_clustering_output_dir> --clustering_filtered_pdb_dataset
  ```

  **Note**: The `--clustering_filtered_pdb_dataset` flag is recommended when clustering the filtered PDB dataset as curated using the scripts above, as this flag will enable faster runtimes in this context (since filtering leaves each chain's residue IDs 1-based). However, this flag must **not** be provided when clustering other (i.e., non-PDB) datasets of mmCIF files. Otherwise, interface clustering may be performed incorrectly, as these datasets' mmCIF files may not use strict 1-based residue indexing for each chain.

  **Note**: One can instead download preprocessed (i.e., filtered) mmCIF (`train`/`val`/`test`) files (~25GB, comprising 148k complexes) and chain/interface clustering (`train`/`val`/`test`) files (~3GB) for the PDB's `20240101` AWS snapshot via a [shared OneDrive folder](https://mailmissouri-my.sharepoint.com/:f:/g/personal/acmwhb_umsystem_edu/EqU8tjUmmKxJr-FAlq4tzaIBi2TIBtmw5Vl3k_kmgNlepA?e=mzlyv6). Each of these `tar.gz` archives should be decompressed within the `data/pdb_data/` directory e.g., via `tar -xzf data_caches.tar.gz -C data/pdb_data/`. One can also download and prepare PDB distillation data using as a reference the script `scripts/distillation_data_download.sh`. Once downloaded, one can run `scripts/reduce_uniprot_predictions_to_pdb.py` to filter this dataset to only examples associated with at least one PDB entry. Moreover, for convenience, a [mapping](https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/idmapping.dat.gz) of UniProt accession IDs to PDB IDs for training on PDB distillation data has already been downloaded and extracted as `data/afdb_data/data_caches/uniprot_to_pdb_id_mapping.dat`.



  At the project root, run

  ```bash
  $ sh ./contribute.sh
  ```

  Then, add your module to `alphafold3_pytorch/alphafold3.py`, add your tests to `tests/test_af3.py`, and submit a pull request. You can run the tests locally with

  ```bash
  $ pytest tests/
  ```


  The included `Dockerfile` contains the required dependencies to run the package and to train/inference using PyTorch with GPUs.

  The default base image is `pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime` and installs the latest version of this package from the `main` GitHub branch.

  ```bash

  docker build -t af3 .
  ```

  Alternatively, use build arguments to rebuild the image with different software versions:
  - `PYTORCH_TAG`: Changes the base image and thus builds with different PyTorch, CUDA, and/or cuDNN versions.
  - `GIT_TAG`: Changes the tag of this repo to clone and install the package.

  For example:
  ```bash

  docker build --build-arg "PYTORCH_TAG=2.2.1-cuda12.1-cudnn8-devel" --build-arg "GIT_TAG=0.1.15" -t af3 .
  ```

  Then, run the container with GPUs and mount a local volume (for training) using the following command:

  ```bash

  docker run -v .:/data --gpus all -it af3
  ```



  ```bibtex
  @article{Abramson2024-fj,
    title    = "Accurate structure prediction of biomolecular interactions with
                {AlphaFold} 3",
    author   = "Abramson, Josh and Adler, Jonas and Dunger, Jack and Evans,
                Richard and Green, Tim and Pritzel, Alexander and Ronneberger,
                Olaf and Willmore, Lindsay and Ballard, Andrew J and Bambrick,
                Joshua and Bodenstein, Sebastian W and Evans, David A and Hung,
                Chia-Chun and O'Neill, Michael and Reiman, David and
                Tunyasuvunakool, Kathryn and Wu, Zachary and {\v Z}emgulyt{\.e},
                Akvil{\.e} and Arvaniti, Eirini and Beattie, Charles and
                Bertolli, Ottavia and Bridgland, Alex and Cherepanov, Alexey and
                Congreve, Miles and Cowen-Rivers, Alexander I and Cowie, Andrew
                and Figurnov, Michael and Fuchs, Fabian B and Gladman, Hannah and
                Jain, Rishub and Khan, Yousuf A and Low, Caroline M R and Perlin,
                Kuba and Potapenko, Anna and Savy, Pascal and Singh, Sukhdeep and
                Stecula, Adrian and Thillaisundaram, Ashok and Tong, Catherine
                and Yakneen, Sergei and Zhong, Ellen D and Zielinski, Michal and
                {\v Z}{\'\i}dek, Augustin and Bapst, Victor and Kohli, Pushmeet
                and Jaderberg, Max and Hassabis, Demis and Jumper, John M",
    journal  = "Nature",
    month    = "May",
    year     =  2024
  }
  ```

  ```bibtex
  @inproceedings{Darcet2023VisionTN,
      title   = {Vision Transformers Need Registers},
      author  = {Timoth'ee Darcet and Maxime Oquab and Julien Mairal and Piotr Bojanowski},
      year    = {2023},
      url     = {https://api.semanticscholar.org/CorpusID:263134283}
  }
  ```

  ```bibtex
  @article{Arora2024SimpleLA,
      title   = {Simple linear attention language models balance the recall-throughput tradeoff},
      author  = {Simran Arora and Sabri Eyuboglu and Michael Zhang and Aman Timalsina and Silas Alberti and Dylan Zinsley and James Zou and Atri Rudra and Christopher R'e},
      journal = {ArXiv},
      year    = {2024},
      volume  = {abs/2402.18668},
      url     = {https://api.semanticscholar.org/CorpusID:268063190}
  }
  ```

  ```bibtex
  @article{Puny2021FrameAF,
      title   = {Frame Averaging for Invariant and Equivariant Network Design},
      author  = {Omri Puny and Matan Atzmon and Heli Ben-Hamu and Edward James Smith and Ishan Misra and Aditya Grover and Yaron Lipman},
      journal = {ArXiv},
      year    = {2021},
      volume  = {abs/2110.03336},
      url     = {https://api.semanticscholar.org/CorpusID:238419638}
  }
  ```

  ```bibtex
  @article{Duval2023FAENetFA,
      title   = {FAENet: Frame Averaging Equivariant GNN for Materials Modeling},
      author  = {Alexandre Duval and Victor Schmidt and Alex Hernandez Garcia and Santiago Miret and Fragkiskos D. Malliaros and Yoshua Bengio and David Rolnick},
      journal = {ArXiv},
      year    = {2023},
      volume  = {abs/2305.05577},
      url     = {https://api.semanticscholar.org/CorpusID:258564608}
  }
  ```

  ```bibtex
  @article{Wang2022DeepNetST,
      title   = {DeepNet: Scaling Transformers to 1, 000 Layers},
      author  = {Hongyu Wang and Shuming Ma and Li Dong and Shaohan Huang and Dongdong Zhang and Furu Wei},
      journal = {ArXiv},
      year    = {2022},
      volume  = {abs/2203.00555},
      url     = {https://api.semanticscholar.org/CorpusID:247187905}
  }
  ```

  ```bibtex
  @inproceedings{Ainslie2023CoLT5FL,
      title   = {CoLT5: Faster Long-Range Transformers with Conditional Computation},
      author  = {Joshua Ainslie and Tao Lei and Michiel de Jong and Santiago Ontan'on and Siddhartha Brahma and Yury Zemlyanskiy and David Uthus and Mandy Guo and James Lee-Thorp and Yi Tay and Yun-Hsuan Sung and Sumit Sanghai},
      year    = {2023}
  }
  ```

  ```bibtex
  @article{Ash2019OnTD,
      title   = {On the Difficulty of Warm-Starting Neural Network Training},
      author  = {Jordan T. Ash and Ryan P. Adams},
      journal = {ArXiv},
      year    = {2019},
      volume  = {abs/1910.08475},
      url     = {https://api.semanticscholar.org/CorpusID:204788802}
  }
  ```

  ```bibtex
  @ARTICLE{Heinzinger2023.07.23.550085,
      author  = {Michael Heinzinger and Konstantin Weissenow and Joaquin Gomez Sanchez and Adrian Henkel and Martin Steinegger and Burkhard Rost},
      title   = {ProstT5: Bilingual Language Model for Protein Sequence and Structure},
      year    = {2023},
      doi     = {10.1101/2023.07.23.550085},
      journal = {bioRxiv}
  }
  ```

  ```bibtex
  @article {Lin2022.07.20.500902,
      author  = {Lin, Zeming and Akin, Halil and Rao, Roshan and Hie, Brian and Zhu, Zhongkai and Lu, Wenting and Santos Costa, Allan dos and Fazel-Zarandi, Maryam and Sercu, Tom and Candido, Sal and Rives, Alexander},
      title   = {Language models of protein sequences at the scale of evolution enable accurate structure prediction},
      elocation-id = {2022.07.20.500902},
      year    = {2022},
      doi     = {10.1101/2022.07.20.500902},
      publisher = {Cold Spring Harbor Laboratory},
      URL     = {https://www.biorxiv.org/content/early/2022/07/21/2022.07.20.500902},
      eprint  = {https://www.biorxiv.org/content/early/2022/07/21/2022.07.20.500902.full.pdf},
      journal = {bioRxiv}
  }
  ```

  ```bibtex
  @article{Li2024SwitchEA,
      title   = {Switch EMA: A Free Lunch for Better Flatness and Sharpness},
      author  = {Siyuan Li and Zicheng Liu and Juanxi Tian and Ge Wang and Zedong Wang and Weiyang Jin and Di Wu and Cheng Tan and Tao Lin and Yang Liu and Baigui Sun and Stan Z. Li},
      journal = {ArXiv},
      year    = {2024},
      volume  = {abs/2402.09240},
      url     = {https://api.semanticscholar.org/CorpusID:267657558}
  }
  ```

  ```bibtex
  @article{Nguyen2023MitigatingOI,
      title   = {Mitigating Over-smoothing in Transformers via Regularized Nonlocal Functionals},
      author  = {Tam Nguyen and Tan M. Nguyen and Richard G. Baraniuk},
      journal = {ArXiv},
      year    = {2023},
      volume  = {abs/2312.00751},
      url     = {https://api.semanticscholar.org/CorpusID:264300597}
  }
  ```

  ```bibtex
  @inproceedings{Zhou2024ValueRL,
      title   = {Value Residual Learning For Alleviating Attention Concentration In Transformers},
      author  = {Zhanchao Zhou and Tianyi Wu and Zhiyun Jiang and Zhenzhong Lan},
      year    = {2024},
      url     = {https://api.semanticscholar.org/CorpusID:273532030}
  }
  ```

rpm_license:
[cell repeats an earlier one in this file: 1065 characters]


pkgId: c7303450fe29afeb9a21d0bdba8b068fdcc3b69b970f60af740e8d808943380e
name: python-alphafold3-pytorch-lightning-hydra
arch: src
version: 0.5.31
epoch: 0
release: 1
summary: AlphaFold 3 - Pytorch
url: https://pypi.org/project/alphafold3-pytorch-lightning-hydra/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphafold3-pytorch-lightning-hydra-0.5.31-1.src.rpm
checksum_type: sha256
description:
  <div align="center">



  <a href="https://pytorch.org/get-started/locally/"><img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-ee4c2c?logo=pytorch&logoColor=white"></a>
  <a href="https://pytorchlightning.ai/"><img alt="Lightning" src="https://img.shields.io/badge/-Lightning-792ee5?logo=pytorchlightning&logoColor=white"></a>
  <a href="https://hydra.cc/"><img alt="Config: Hydra" src="https://img.shields.io/badge/Config-Hydra-89b8cd"></a>
  <a href="https://github.com/ashleve/lightning-hydra-template"><img alt="Template" src="https://img.shields.io/badge/-Lightning--Hydra--Template-017F2F?style=flat&logo=github&labelColor=gray"></a><br>

  <!-- [![Paper](http://img.shields.io/badge/paper-arxiv.1001.2234-B31B1B.svg)](https://www.nature.com/articles/s41586-024-07487-w) -->

  <!-- [![Conference](http://img.shields.io/badge/AnyConference-year-4b44ce.svg)](https://papers.nips.cc/paper/2020) -->

  <img src="./img/alphafold3.png" width="600">

  </div>



  Implementation of <a href="https://www.nature.com/articles/s41586-024-07487-w">AlphaFold 3</a> in PyTorch Lightning + Hydra

  You can chat with other researchers about this work [here](https://discord.gg/Xsq4WaBR9S)

  <a href="https://www.youtube.com/watch?v=qjFgthkKxcA">Review of the paper</a> by <a href="https://x.com/sokrypton">Sergey</a>

  <a href="https://elanapearl.github.io/blog/2024/the-illustrated-alphafold/">Illustrated guide</a> by <a href="https://elanapearl.github.io/">Elana P. Simon</a>

  <a href="https://www.youtube.com/watch?v=AE35XCN5NuU">Talk by Max Jaderberg</a>

  The original version of this repository with <a href="https://lightning.ai/docs/fabric/stable/">Fabric</a> support is being maintained by <a href="https://github.com/lucidrains">Phil</a> at <a href="https://github.com/lucidrains/alphafold3-pytorch">this repository</a>

  A visualization of the molecules of life used in the repository can be seen and interacted with <a href="https://colab.research.google.com/drive/1S9TD8WmS1Gjgwjo9xyEYTbdxgMVVZcQe?usp=sharing">here</a>



  - <a href="https://github.com/lucidrains">Phil</a> for spearheading the development of the `Alphafold3` module and losses as well as the `Input` classes!

  - <a href="https://github.com/joseph-c-kim">Joseph</a> for contributing the Relative Positional Encoding and the Smooth LDDT Loss!

  - <a href="https://github.com/engelberger">Felipe</a> for contributing Weighted Rigid Align, Express Coordinates In Frame, Compute Alignment Error, and Centre Random Augmentation modules!

  - <a href="https://github.com/gitabtion">Heng</a> for pointing out inconsistencies with the paper and pull requesting the solutions (e.g., finding an issue with the molecular atom indices for the distogram loss)

  - <a href="https://github.com/luwei0917">Wei Lu</a> for catching a few erroneous hyperparameters

  - <a href="https://github.com/milot-mirdita">Milot</a> for generating MSA and template inputs as well as optimizing the PDB dataset clustering script!

  - <a href="https://github.com/vandrw">Andrei</a> for working on the weighted PDB dataset sampling and for taking on the gradio frontend interface!

  - <a href="https://github.com/tanjimin">Jimin</a> for submitting a small fix to an issue with the coordinates being passed into `WeightedRigidAlign`

  - <a href="https://github.com/xluo233">@xluo233</a> for contributing the confidence measures, clash penalty ranking, sample ranking logic, as well as the logic for computing the model selection score and unresolved RASA!

  - <a href="https://github.com/sj900">sj900</a> for integrating and testing the `WeightedPDBSampler` within the `PDBDataset` and for adding initial support for MSA and template parsing!

  - <a href="https://github.com/wufandi">Fandi</a> for discovering a few inconsistencies in the elucidated atom diffusion module with the supplementary

  - <a href="https://github.com/ptosco">Paolo</a> for proposing the `PDB neutral stable molecule` hypothesis!

  - <a href="https://github.com/dhuvik">Dhuvi</a> for fixing a bug related to metal ion molecule ID assignment for `Alphafold3Inputs` and for taking on the logic for translating `Alphafold3Inputs` to `Biomolecules` for saving inference samples to mmCIF files!

  - Tom (from the Discord channel) for identifying a discrepancy between this codebase's distogram and template unit vector computations and those of OpenFold (and <a href="https://github.com/vandrw">Andrei</a> for helping address the distogram issue)!

  - <a href="https://github.com/Kaihui-Cheng">Kaihui</a> for identifying a bug in how non-standard atoms were handled in polymer residues!

  - <a href="https://github.com/patrick-kidger">Patrick</a> for <a href="https://docs.kidger.site/jaxtyping/">jaxtyping</a>, <a href="https://github.com/fferflo">Florian</a> for <a href="https://github.com/fferflo/einx">einx</a>, and of course, <a href="https://github.com/arogozhnikov">Alex</a> for <a href="https://einops.rocks/">einops</a>

  - Soumith and the PyTorch organization for giving <a href="https://github.com/lucidrains">Phil</a> the opportunity to open source this work



  - [Installation](#installation)
  - [Usage](#usage)
  - [Data preparation](#data-preparation)
  - [Training](#training)
  - [Evaluation](#evaluation)
  - [For developers](#for-developers)
  - [Citations](#citations)



  <details>



  ```bash
  pip install alphafold3-pytorch-lightning-hydra
  ```



  Install `mamba` for dependency management (as a fast alternative to Anaconda):

  ```bash
  wget "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
  bash Mambaforge-$(uname)-$(uname -m).sh  # accept all terms and install to the default location
  rm Mambaforge-$(uname)-$(uname -m).sh  # (optionally) remove installer after using it
  source ~/.bashrc  # alternatively, one can restart their shell session to achieve the same result
  ```

  Install dependencies:

  ```bash

  git clone https://github.com/amorehead/alphafold3-pytorch-lightning-hydra
  cd alphafold3-pytorch-lightning-hydra


  mamba env create -f environment.yaml
  conda activate alphafold3-pytorch  # note: one still needs to use `conda` to (de)activate environments


  pip3 install -e .
  ```



  The included `Dockerfile` contains the required dependencies to run the package and to train/inference using PyTorch with GPUs.

  The default base image is `pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime` and installs the latest version of this package from the `main` GitHub branch.

  ```bash

  git clone https://github.com/amorehead/alphafold3-pytorch-lightning-hydra
  cd alphafold3-pytorch-lightning-hydra


  docker build -t alphafold3-pytorch-lightning-hydra .
  ```

  Alternatively, use build arguments to rebuild the image with different software versions:

  - `PYTORCH_TAG`: Changes the base image and thus builds with different PyTorch, CUDA, and/or cuDNN versions.
  - `GIT_TAG`: Changes the tag of this repo to clone and install the package.

  For example:

  ```bash

  docker build --build-arg "PYTORCH_TAG=2.2.1-cuda12.1-cudnn8-devel" --build-arg "GIT_TAG=0.1.15" -t alphafold3-pytorch-lightning-hydra .
  ```

  Then, run the container with GPUs and mount a local volume (for training) using the following command:

  ```bash

  docker run -v .:/data --gpus all -it alphafold3-pytorch-lightning-hydra
  ```

  **NOTE:** An AMD ROCm version of the Docker image can alternatively be built using `ROCm_Dockerfile`.

  </details>



  <details>

  ```python
  import torch
  from alphafold3_pytorch import Alphafold3
  from alphafold3_pytorch.utils.model_utils import exclusive_cumsum

  alphafold3 = Alphafold3(
      dim_atom_inputs = 77,
      dim_template_feats = 108
  )



  seq_len = 16

  molecule_atom_indices = torch.randint(0, 2, (2, seq_len)).long()
  molecule_atom_lens = torch.full((2, seq_len), 2).long()

  atom_seq_len = molecule_atom_lens.sum(dim=-1).amax()
  atom_offsets = exclusive_cumsum(molecule_atom_lens)

  atom_inputs = torch.randn(2, atom_seq_len, 77)
  atompair_inputs = torch.randn(2, atom_seq_len, atom_seq_len, 5)

  additional_molecule_feats = torch.randint(0, 2, (2, seq_len, 5))
  additional_token_feats = torch.randn(2, seq_len, 33)
  is_molecule_types = torch.randint(0, 2, (2, seq_len, 5)).bool()
  is_molecule_mod = torch.randint(0, 2, (2, seq_len, 4)).bool()
  molecule_ids = torch.randint(0, 32, (2, seq_len))

  template_feats = torch.randn(2, 2, seq_len, seq_len, 108)
  template_mask = torch.ones((2, 2)).bool()

  msa = torch.randn(2, 7, seq_len, 32)
  msa_mask = torch.ones((2, 7)).bool()

  additional_msa_feats = torch.randn(2, 7, seq_len, 2)



  atom_pos = torch.randn(2, atom_seq_len, 3)

  distogram_atom_indices = molecule_atom_lens - 1

  distance_labels = torch.randint(0, 37, (2, seq_len, seq_len))
  resolved_labels = torch.randint(0, 2, (2, atom_seq_len))



  distogram_atom_indices += atom_offsets
  molecule_atom_indices += atom_offsets



  loss = alphafold3(
      num_recycling_steps = 2,
      atom_inputs = atom_inputs,
      atompair_inputs = atompair_inputs,
      molecule_ids = molecule_ids,
      molecule_atom_lens = molecule_atom_lens,
      additional_molecule_feats = additional_molecule_feats,
      additional_msa_feats = additional_msa_feats,
      additional_token_feats = additional_token_feats,
      is_molecule_types = is_molecule_types,
      is_molecule_mod = is_molecule_mod,
      msa = msa,
      msa_mask = msa_mask,
      templates = template_feats,
      template_mask = template_mask,
      atom_pos = atom_pos,
      distogram_atom_indices = distogram_atom_indices,
      molecule_atom_indices = molecule_atom_indices,
      distance_labels = distance_labels,
      resolved_labels = resolved_labels
  )

  loss.backward()



  sampled_atom_pos = alphafold3(
      num_recycling_steps = 4,
      num_sample_steps = 16,
      atom_inputs = atom_inputs,
      atompair_inputs = atompair_inputs,
      molecule_ids = molecule_ids,
      molecule_atom_lens = molecule_atom_lens,
      additional_molecule_feats = additional_molecule_feats,
      additional_msa_feats = additional_msa_feats,
      additional_token_feats = additional_token_feats,
      is_molecule_types = is_molecule_types,
      is_molecule_mod = is_molecule_mod,
      msa = msa,
      msa_mask = msa_mask,
      templates = template_feats,
      template_mask = template_mask
  )

  sampled_atom_pos.shape # (2, <atom_seqlen>, 3)
  ```

  </details>

  <details>

  An example with molecule level input handling

  ```python
  import torch
  from alphafold3_pytorch import Alphafold3, Alphafold3Input

  contrived_protein = 'AG'

  mock_atompos = [
      torch.randn(5, 3),   # alanine has 5 non-hydrogen atoms
      torch.randn(4, 3)    # glycine has 4 non-hydrogen atoms
  ]

  train_alphafold3_input = Alphafold3Input(
      proteins = [contrived_protein],
      missing_atom_indices = [[1, 2], None],
      atom_pos = mock_atompos
  )

  eval_alphafold3_input = Alphafold3Input(
      proteins = [contrived_protein]
  )



  alphafold3 = Alphafold3(
      dim_atom_inputs = 3,
      dim_atompair_inputs = 5,
      atoms_per_window = 27,
      dim_template_feats = 108,
      num_molecule_mods = 0,
      confidence_head_kwargs = dict(
          pairformer_depth = 1
      ),
      template_embedder_kwargs = dict(
          pairformer_stack_depth = 1
      ),
      msa_module_kwargs = dict(
          depth = 1
      ),
      pairformer_stack = dict(
          depth = 2
      ),
      diffusion_module_kwargs = dict(
          atom_encoder_depth = 1,
          token_transformer_depth = 1,
          atom_decoder_depth = 1,
      )
  )

  loss = alphafold3.forward_with_alphafold3_inputs([train_alphafold3_input])
  loss.backward()



  alphafold3.eval()
  sampled_atom_pos = alphafold3.forward_with_alphafold3_inputs(eval_alphafold3_input)

  assert sampled_atom_pos.shape == (1, (5 + 4), 3)
  ```

  </details>



  <details>



  To acquire the AlphaFold 3 PDB dataset, first download all first-assembly (and asymmetric unit) complexes in the Protein Data Bank (PDB), and then preprocess them with the script referenced below. The PDB can be downloaded from the RCSB: https://www.wwpdb.org/ftp/pdb-ftp-sites#rcsbpdb. The two Python scripts below (i.e., `filter_pdb_{train,val,test}_mmcifs.py` and `cluster_pdb_{train,val,test}_mmcifs.py`) assume you have downloaded the PDB in the **mmCIF file format**, placing its first-assembly and asymmetric unit mmCIF files at `data/pdb_data/unfiltered_assembly_mmcifs/` and `data/pdb_data/unfiltered_asym_mmcifs/`, respectively.

  For reproducibility, we recommend downloading the PDB using AWS snapshots (e.g., `20240101`). To do so, refer to [AWS's documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to set up the AWS CLI locally. Alternatively, on the RCSB website, navigate down to "Download Protocols", and follow the download instructions depending on your location.

  For example, one can use the following commands to download the PDB as two collections of mmCIF files:

  ```bash

  aws s3 sync s3://pdbsnapshots/20240101/pub/pdb/data/assemblies/mmCIF/divided/ ./data/pdb_data/unfiltered_assembly_mmcifs

  rsync -rlpt -v -z --delete --port=33444 \
  rsync.rcsb.org::ftp_data/assemblies/mmCIF/divided/ ./data/pdb_data/unfiltered_assembly_mmcifs/


  aws s3 sync s3://pdbsnapshots/20240101/pub/pdb/data/structures/divided/mmCIF/ ./data/pdb_data/unfiltered_asym_mmcifs

  rsync -rlpt -v -z --delete --port=33444 \
  rsync.rcsb.org::ftp_data/structures/divided/mmCIF/ ./data/pdb_data/unfiltered_asym_mmcifs/
  ```

  > WARNING: Downloading the PDB can take up to 700GB of space.

  > NOTE: The PDB hosts all available AWS snapshots here: https://pdbsnapshots.s3.us-west-2.amazonaws.com/index.html.

  After downloading, you should have two directories formatted like this:
  https://files.rcsb.org/pub/pdb/data/assemblies/mmCIF/divided/ & https://files.rcsb.org/pub/pdb/data/structures/divided/mmCIF/

  ```bash
  00/
  01/
  02/
  ..
  zz/
  ```

  For these directories, unzip all the files:

  ```bash
  find ./data/pdb_data/unfiltered_assembly_mmcifs/ -type f -name "*.gz" -exec gzip -d {} \;
  find ./data/pdb_data/unfiltered_asym_mmcifs/ -type f -name "*.gz" -exec gzip -d {} \;
  ```

  Next run the commands

  ```bash
  wget -P ./data/ccd_data/ https://files.wwpdb.org/pub/pdb/data/monomers/components.cif.gz
  wget -P ./data/ccd_data/ https://files.wwpdb.org/pub/pdb/data/component-models/complete/chem_comp_model.cif.gz
  ```

  from the project's root directory to download the latest version of the PDB's Chemical Component Dictionary (CCD) and its structural models. Extract each of these files using the following command:

  ```bash
  find data/ccd_data/ -type f -name "*.gz" -exec gzip -d {} \;
  ```



  Then run the following with `pdb_assembly_dir`, `pdb_asym_dir`, `ccd_dir`, and `mmcif_output_dir` replaced with the locations of your local copies of the first-assembly PDB, asymmetric unit PDB, CCD, and your desired dataset output directory (i.e., `./data/pdb_data/unfiltered_assembly_mmcifs/`, `./data/pdb_data/unfiltered_asym_mmcifs/`, `./data/ccd_data/`, and `./data/pdb_data/{train,val,test}_mmcifs/`).

  ```bash
  python scripts/filter_pdb_train_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --ccd_dir <ccd_dir> --output_dir <mmcif_output_dir>
  python scripts/filter_pdb_val_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --output_dir <mmcif_output_dir>
  python scripts/filter_pdb_test_mmcifs.py --mmcif_assembly_dir <pdb_assembly_dir> --mmcif_asym_dir <pdb_asym_dir> --output_dir <mmcif_output_dir>
  ```

  See the scripts for more options. Each first-assembly mmCIF that successfully passes
  all processing steps will be written to `mmcif_output_dir` within a subdirectory
  named according to the mmCIF's second and third PDB ID characters (e.g. `5c`).



  Next, run the following with `mmcif_dir` and `{train,val,test}_clustering_output_dir` replaced, respectively, with your local output directory created using the dataset filtering script above and with your desired clustering output directories (i.e., `./data/pdb_data/{train,val,test}_mmcifs/` and `./data/pdb_data/data_caches/{train,val,test}_clusterings/`):

  ```bash
  python scripts/cluster_pdb_train_mmcifs.py --mmcif_dir <mmcif_dir> --output_dir <train_clustering_output_dir> --clustering_filtered_pdb_dataset
  python scripts/cluster_pdb_val_mmcifs.py --mmcif_dir <mmcif_dir> --reference_clustering_dir <train_clustering_output_dir> --output_dir <val_clustering_output_dir> --clustering_filtered_pdb_dataset
  python scripts/cluster_pdb_test_mmcifs.py --mmcif_dir <mmcif_dir> --reference_1_clustering_dir <train_clustering_output_dir> --reference_2_clustering_dir <val_clustering_output_dir> --output_dir <test_clustering_output_dir> --clustering_filtered_pdb_dataset
  ```

  **Note**: The `--clustering_filtered_pdb_dataset` flag is recommended when clustering the filtered PDB dataset as curated using the scripts above, as this flag will enable faster runtimes in this context (since filtering leaves each chain's residue IDs 1-based). However, this flag must **not** be provided when clustering other (i.e., non-PDB) datasets of mmCIF files. Otherwise, interface clustering may be performed incorrectly, as these datasets' mmCIF files may not use strict 1-based residue indexing for each chain.

  **Note**: One can instead download preprocessed (i.e., filtered) mmCIF (`train`/`val`/`test`) files (~25GB, comprising 148k complexes) and chain/interface clustering (`train`/`val`/`test`) files (~3GB) for the PDB's `20240101` AWS snapshot via a [shared OneDrive folder](https://mailmissouri-my.sharepoint.com/:f:/g/personal/acmwhb_umsystem_edu/EqU8tjUmmKxJr-FAlq4tzaIBi2TIBtmw5Vl3k_kmgNlepA?e=mzlyv6). Each of these `tar.gz` archives should be decompressed within the `data/pdb_data/` directory e.g., via `tar -xzf data_caches.tar.gz -C data/pdb_data/`. One can also download and prepare PDB distillation data using as a reference the script `scripts/distillation_data_download.sh`. Once downloaded, one can run `scripts/reduce_uniprot_predictions_to_pdb.py` to filter this dataset to only examples associated with at least one PDB entry. Moreover, for convenience, a [mapping](https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/idmapping/idmapping.dat.gz) of UniProt accession IDs to PDB IDs for training on PDB distillation data has already been downloaded and extracted as `data/afdb_data/data_caches/uniprot_to_pdb_id_mapping.dat`.

  </details>



  <details>

  Train model with default configuration

  ```bash

  python alphafold3_pytorch/train.py trainer=cpu


  python alphafold3_pytorch/train.py trainer=gpu
  ```

  Train model with chosen experiment configuration from [configs/experiment/](configs/experiment/)

  ```bash

  python alphafold3_pytorch/train.py experiment=alphafold3_initial_training.yaml
  ```

  You can override any parameter from command line like this

  ```bash
  python alphafold3_pytorch/train.py trainer.max_steps=1e6 data.batch_size=128
  ```

  </details>



  <details>

  Evaluate a trained set of weights on held-out test data

  ```bash

  python alphafold3_pytorch/eval.py trainer=gpu
  ```

  </details>



  <details>



  At the project root, run

  ```bash
  bash contributing.sh
  ```

  Then, add your module to `alphafold3_pytorch/models/components/alphafold3.py`, add your tests to `tests/test_alphafold3.py`, and submit a pull request. You can run the tests locally with

  ```bash
  pytest tests/
  ```



  We use `pip` and `docker` to manage the project's underlying dependencies. Notably, to update the dependencies built by the project's `Dockerfile`, first edit the contents of the `dependencies` list in `pyproject.toml`, and then rebuild the project's `docker` image:

  ```bash
  docker stop <container_id> # First stop any running `af3` container(s)
  docker rm <container_id> # Then remove the container(s) - Caution: Make sure to push your local changes to GitHub before running this!
  docker build -t af3 . # Rebuild the Docker image
  docker run -v .:/data --gpus all -it af3 # Lastly, (re)start the Docker container from the updated image
  ```

  If you want to update the project's `pip` dependencies only, you can simply push to GitHub your changes to the `pyproject.toml` file.



  We use `pre-commit` to automatically format the project's code. To set up `pre-commit` (one time only) for automatic code linting and formatting upon each execution of `git commit`:

  ```bash
  pre-commit install
  ```

  To manually reformat all files in the project as desired:

  ```bash
  pre-commit run -a
  ```

  Refer to [pre-commit's documentation](https://pre-commit.com/) for more details.

  </details>



  ```bibtex
  @article{Abramson2024-fj,
    title    = "Accurate structure prediction of biomolecular interactions with
                {AlphaFold} 3",
    author   = "Abramson, Josh and Adler, Jonas and Dunger, Jack and Evans,
                Richard and Green, Tim and Pritzel, Alexander and Ronneberger,
                Olaf and Willmore, Lindsay and Ballard, Andrew J and Bambrick,
                Joshua and Bodenstein, Sebastian W and Evans, David A and Hung,
                Chia-Chun and O'Neill, Michael and Reiman, David and
                Tunyasuvunakool, Kathryn and Wu, Zachary and {\v Z}emgulyt{\.e},
                Akvil{\.e} and Arvaniti, Eirini and Beattie, Charles and
                Bertolli, Ottavia and Bridgland, Alex and Cherepanov, Alexey and
                Congreve, Miles and Cowen-Rivers, Alexander I and Cowie, Andrew
                and Figurnov, Michael and Fuchs, Fabian B and Gladman, Hannah and
                Jain, Rishub and Khan, Yousuf A and Low, Caroline M R and Perlin,
                Kuba and Potapenko, Anna and Savy, Pascal and Singh, Sukhdeep and
                Stecula, Adrian and Thillaisundaram, Ashok and Tong, Catherine
                and Yakneen, Sergei and Zhong, Ellen D and Zielinski, Michal and
                {\v Z}{\'\i}dek, Augustin and Bapst, Victor and Kohli, Pushmeet
                and Jaderberg, Max and Hassabis, Demis and Jumper, John M",
    journal  = "Nature",
    month    = "May",
    year     =  2024
  }
  ```

  ```bibtex
  @inproceedings{Darcet2023VisionTN,
      title   = {Vision Transformers Need Registers},
      author  = {Timoth'ee Darcet and Maxime Oquab and Julien Mairal and Piotr Bojanowski},
      year    = {2023},
      url     = {https://api.semanticscholar.org/CorpusID:263134283}
  }
  ```

  ```bibtex
  @article{Arora2024SimpleLA,
      title   = {Simple linear attention language models balance the recall-throughput tradeoff},
      author  = {Simran Arora and Sabri Eyuboglu and Michael Zhang and Aman Timalsina and Silas Alberti and Dylan Zinsley and James Zou and Atri Rudra and Christopher R'e},
      journal = {ArXiv},
      year    = {2024},
      volume  = {abs/2402.18668},
      url     = {https://api.semanticscholar.org/CorpusID:268063190}
  }
  ```

  ```bibtex
  @article{Puny2021FrameAF,
      title   = {Frame Averaging for Invariant and Equivariant Network Design},
      author  = {Omri Puny and Matan Atzmon and Heli Ben-Hamu and Edward James Smith and Ishan Misra and Aditya Grover and Yaron Lipman},
      journal = {ArXiv},
      year    = {2021},
      volume  = {abs/2110.03336},
      url     = {https://api.semanticscholar.org/CorpusID:238419638}
  }
  ```

  ```bibtex
  @article{Duval2023FAENetFA,
      title   = {FAENet: Frame Averaging Equivariant GNN for Materials Modeling},
      author  = {Alexandre Duval and Victor Schmidt and Alex Hernandez Garcia and Santiago Miret and Fragkiskos D. Malliaros and Yoshua Bengio and David Rolnick},
      journal = {ArXiv},
      year    = {2023},
      volume  = {abs/2305.05577},
      url     = {https://api.semanticscholar.org/CorpusID:258564608}
  }
  ```

  ```bibtex
  @article{Wang2022DeepNetST,
      title   = {DeepNet: Scaling Transformers to 1, 000 Layers},
      author  = {Hongyu Wang and Shuming Ma and Li Dong and Shaohan Huang and Dongdong Zhang and Furu Wei},
      journal = {ArXiv},
      year    = {2022},
      volume  = {abs/2203.00555},
      url     = {https://api.semanticscholar.org/CorpusID:247187905}
  }
  ```

  ```bibtex
  @inproceedings{Ainslie2023CoLT5FL,
      title   = {CoLT5: Faster Long-Range Transformers with Conditional Computation},
      author  = {Joshua Ainslie and Tao Lei and Michiel de Jong and Santiago Ontan'on and Siddhartha Brahma and Yury Zemlyanskiy and David Uthus and Mandy Guo and James Lee-Thorp and Yi Tay and Yun-Hsuan Sung and Sumit Sanghai},
      year    = {2023}
  }
  ```

  ```bibtex
  @article{Ash2019OnTD,
      title   = {On the Difficulty of Warm-Starting Neural Network Training},
      author  = {Jordan T. Ash and Ryan P. Adams},
      journal = {ArXiv},
      year    = {2019},
      volume  = {abs/1910.08475},
      url     = {https://api.semanticscholar.org/CorpusID:204788802}
  }
  ```

  ```bibtex
  @ARTICLE{Heinzinger2023.07.23.550085,
      author  = {Michael Heinzinger and Konstantin Weissenow and Joaquin Gomez Sanchez and Adrian Henkel and Martin Steinegger and Burkhard Rost},
      title   = {ProstT5: Bilingual Language Model for Protein Sequence and Structure},
      year    = {2023},
      doi     = {10.1101/2023.07.23.550085},
      journal = {bioRxiv}
  }
  ```

  ```bibtex
  @article {Lin2022.07.20.500902,
      author  = {Lin, Zeming and Akin, Halil and Rao, Roshan and Hie, Brian and Zhu, Zhongkai and Lu, Wenting and Santos Costa, Allan dos and Fazel-Zarandi, Maryam and Sercu, Tom and Candido, Sal and Rives, Alexander},
      title   = {Language models of protein sequences at the scale of evolution enable accurate structure prediction},
      elocation-id = {2022.07.20.500902},
      year    = {2022},
      doi     = {10.1101/2022.07.20.500902},
      publisher = {Cold Spring Harbor Laboratory},
      URL     = {https://www.biorxiv.org/content/early/2022/07/21/2022.07.20.500902},
      eprint  = {https://www.biorxiv.org/content/early/2022/07/21/2022.07.20.500902.full.pdf},
      journal = {bioRxiv}
  }
  ```

rpm_license:
[cell repeats an earlier one in this file: 1065 characters]


pkgId: 9990bfc816cc605bcda9a02649e72593e4aa379e8f3130be8b0868a50cdd58dc
name: python-alphainspect
arch: src
version: 0.4.4
epoch: 0
release: 1
summary: factor performance visualization
url: https://pypi.org/project/alphainspect/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphainspect-0.4.4-1.src.rpm
checksum_type: sha256
description:
  仿`alphalens`的单因子分析工具



  ```commandline
  pip install -i https://pypi.org/simple --upgrade alphainspect  # 官方源
  pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade alphainspect  # 国内镜像源
  ```



  1. 准备数据。运行`data/prepare_data.py`
      1. date, asset。必需的两个字段
      2. factor因子值。放在因子发生时刻
      3. forward return远期收益率。计算收益率后需要回移到开始位置。为何是`shift(-n)收益率`，而不是`shift(n)因子`呢？
          1. 多期收期率。如果移动因子，会导致一个因子就要移动多次
          2. 因子一般成百上千，全移动要的工作量非常大，而收益率则少很多
      4. 推荐大家使用`expr_codegen`和`polars_ta`等项目
  2. 运行`examples/demo1.py`示例弹出简易图表
  3. 运行`examples/demo2.py`示例弹出完整图表
  4. 运行`examples/demo3.py`示例多进程并行输出HTML网页报表
  5. 运行`examples/demo4.py`示例事件图表



  ![2x2](docs/img/2x2.png)
  ![3x2](docs/img/3x2.png)
  ![ic](docs/img/ic.png)
  ![returns](docs/img/returns.png)
  ![cum_returns](docs/img/cum_returns.png)
  ![spread](docs/img/spread.png)
  ![turnover](docs/img/turnover.png)
  ![events](docs/img/events.png)



  参考 [cum_returns.md](cum_returns.md)



  1. 不自动计算`forward_returns`。
      1. `alphalens`设`periods=(1, 5, 10)`，然后内部计算持有1、5、10期数的收益率
      2. `alphainspect`由用户外部生成，用户可以比较同因子，不同交易方式产生的差异。例如：
          - `RETURN_OC_1`: T+1开盘入场，T+1收盘出场
          - `RETURN_CC_1`: T+0收盘入场，T+1收盘出场
          - `RETURN_OO_1`: T+1开盘入场，T+2开盘出场
          - `RETURN_OO_5`: T+1开盘入场，T+6开盘出场
  2. 不做去极值、标准化、行业中性化等操作
      1. `alphalens`的各参数要弄懂还是很麻烦的，初学者如绩效达不到要求就得深入研究源代码找原因
      2. `alphainspect`用户在外可以一次性全计算好，如`F1_ORG, F1_ZS, F1_NEUT`，然后在分别传不同因子进行比较即可
  3. 资金分配只用等权
      1. `alphalens`有因子加权、多空等设置
      2. `alphainspect`只提供等权一种计算方法，实现简单
  4. 收益率计算方法不同
      1. `alphalens`多期简单收益率几何平均成1期，然后+1累乘
      2. ~~`alphainspect`由用户提供1期简单收益率，然后根据要求持有或调仓，得到新的权益，循环迭代下去。更精确~~
      3. `alphainspect`由用户提供每期收益率(也可以使用多期收益率的几何平均),然后累加。（分层计算速度提高1~1.5倍）



  1. 数据组织方式相同。都是长表，都是因子不移动，收益率计算，然后后移到与因子产生时间对齐
  2. 不考虑滑点和手续费。单因子是用来合成多因子的，因手续费和滑点而错过部分单因子就可惜了，应当在因子合成后的回测阶段才考虑手续费
  3. 收益计算不求精确，只为能正确评价因子绩效



  ```commandline
  git --clone https://github.com/wukan1986/alphainspect.git
  cd alphainspect
  pip install -e .
  ```

rpm_license:
  MIT License  Copyright (c) 2024 wukan  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


pkgId: b5840ea29206416c5a357b52b36a3c00a01a7e9bdeb9b3b004de6bd9d1bcc169
name: python-alphaiq-sdk
arch: src
version: 0.2.9
epoch: 0
release: 1
url: https://pypi.org/project/alphaiq-sdk/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphaiq-sdk-0.2.9-1.src.rpm
checksum_type: sha256
summary:
  Access AlphaIQ's generative insights, explainable investment signals, and the Corporate Transparency Score model

description:
  [**get_signal_explanations**](docs/InvestmentResearchersApi.md#get_signal_explanations) | **GET** /generative/company/signal_explanation/{ticker} | GetSignalExplanations
  [**get_trending_content**](docs/InvestmentResearchersApi.md#get_trending_content) | **GET** /generative/company/compass/reportContent/{ticker} | GetTrendingGenerative
  [**get_question_answer**](docs/InvestmentResearchersApi.md#get_question_answer) | **GET** /generative/company/compass/questionContent/{ticker} | GetQuestionAnswer
  [**get_compass_report_pdf**](docs/InvestmentResearchersApi.md#get_compass_report_pdf) | **GET** /pdf/compass/{ticker} | CompassReportPDF
  [**get_quant_linguistics_signals**](docs/InvestmentResearchersApi.md#get_quant_linguistics_signals) | **GET** /signals/quantLinguistics | SignalsQuantLinguistics
  [**get_bulk_signals_all**](docs/InvestmentResearchersApi.md#get_bulk_signals_all) | **GET** /bulk/signals/all | BulkFileSignalsAll
  [**get_bulk_signals_top_level**](docs/InvestmentResearchersApi.md#get_bulk_signals_top_level) | **GET** /bulk/signals/topLevel | BulkFileSignalsTopLevel
  [**get_models_corporate_transparency**](docs/InvestmentResearchersApi.md#get_models_corporate_transparency) | **GET** /models/corporateTransparency | ModelsCorporateTransparency
  [**get_bulk_model**](docs/InvestmentResearchersApi.md#get_bulk_model) | **GET** /bulk/models | BulkFileModels
  [**get_company_identifiers_map**](docs/InvestmentResearchersApi.md#get_company_identifiers_map) | **GET** /mapping/companyIdentifierMapping | MappingCompanyIdentifiers
  [**get_bulk_mapping**](docs/InvestmentResearchersApi.md#get_bulk_mapping) | **GET** /bulk/mapping | BulkFileMapping

   - [CompanyInfoModel](docs/CompanyInfoModel.md)
   - [CompanyInfoModel1](docs/CompanyInfoModel1.md)
   - [FileDownloadModel](docs/FileDownloadModel.md)
   - [FileDownloadModel1](docs/FileDownloadModel1.md)
   - [FileDownloadModelData](docs/FileDownloadModelData.md)
   - [FileDownloadModelData1](docs/FileDownloadModelData1.md)
   - [GenerativeSignalExplanationModel](docs/GenerativeSignalExplanationModel.md)
   - [GenerativeCompanyCompassReportContentModel](docs/GenerativeCompanyCompassReportContentModel.md)
   - [GenerativeCompanyCompassReportContentModelData](docs/GenerativeCompanyCompassReportContentModelData.md)
   - [GenerativeCompanyCompassReportContentModelDataCompassContent](docs/GenerativeCompanyCompassReportContentModelDataCompassContent.md)
   - [GenerativeCompanyQuestionAnswerModel](docs/GenerativeCompanyQuestionAnswerModel.md)
   - [GenerativeCompanyQuestionAnswerModelData](docs/GenerativeCompanyQuestionAnswerModelData.md)
   - [GenerativeCompanyQuestionAnswerModelDataQuestionAnswerItems](docs/GenerativeCompanyQuestionAnswerModelDataQuestionAnswerItems.md)
   - [MappingCompanyIdentifierMappingModel](docs/MappingCompanyIdentifierMappingModel.md)
   - [MappingCompanyIdentifierMappingModelDataItems](docs/MappingCompanyIdentifierMappingModelDataItems.md)
   - [ModelsSpindexModel](docs/ModelsSpindexModel.md)
   - [ModelsSpindexModelData](docs/ModelsSpindexModelData.md)
   - [ModelsSpindexModelItems](docs/ModelsSpindexModelItems.md)
   - [SignalsQuantLinguisticsModelData](docs/SignalsQuantLinguisticsModelData.md)
   - [SignalsQuantLinguisticsModelRoot](docs/SignalsQuantLinguisticsModelRoot.md)
   - [SignalsQuantLinguisticsSignalsModel2](docs/SignalsQuantLinguisticsSignalsModel2.md)

  Authorization is a bearer token. That bearer token is your API key.


pkgId: 94456d7f45a5d61d92ea40c8641071309d2b5bfef1ef10515ccdb86df3791106
name: python-alphalens-cn
arch: src
version: 0.4.6
epoch: 0
release: 1
summary: Performance analysis of predictive (alpha) stock factors
url: https://pypi.org/project/alphalens-cn/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphalens-cn-0.4.6-1.src.rpm
checksum_type: sha256
description:
  <p align="center">
  <a href="https://alphalens.ml4trading.io">
  <img src="https://i.imgur.com/uf8PmQO.png" width="35%">
  </a>
  </p>




  ```
  pip install alphalens-cn
  ```


  ![PyPI](https://img.shields.io/pypi/v/alphalens-reloaded)
  [![Anaconda](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/conda_package.yml/badge.svg)](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/conda_package.yml)
  [![Tests](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/unit_tests.yml)
  [![PyPI](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/build_wheels.yml/badge.svg)](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/build_wheels.yml)
  [![Coverage Status](https://coveralls.io/repos/github/stefan-jansen/alphalens-reloaded/badge.svg?branch=main)](https://coveralls.io/github/stefan-jansen/alphalens-reloaded?branch=main)
  ![GitHub issues](https://img.shields.io/github/issues/stefan-jansen/alphalens-reloaded)
  ![PyPI - License](https://img.shields.io/pypi/l/alphalens-reloaded)
  ![Discourse users](https://img.shields.io/discourse/users?server=https%3A%2F%2Fexchange.ml4trading.io%2F)
  ![Twitter Follow](https://img.shields.io/twitter/follow/ml4trading?style=social)

  Alphalens is a Python library for performance analysis of predictive
  (alpha) stock factors. Alphalens works great with the
  [Zipline](https://www.zipline.ml4trading.io/) open source backtesting library, and [Pyfolio](https://github.com/quantopian/pyfolio) which provides performance and risk analysis of financial portfolios.

  The main function of Alphalens is to surface the most relevant statistics and plots about an alpha factor, including:

  - Returns Analysis
  - Information Coefficient Analysis
  - Turnover Analysis
  - Grouped Analysis



  With a signal and pricing data creating a factor \"tear sheet\" is a two step process:

  ```python
  import alphalens


  factor_data = alphalens.utils.get_clean_factor_and_forward_returns(my_factor,
                                                                     pricing,
                                                                     quantiles=5,
                                                                     groupby=ticker_sector,
                                                                     groupby_labels=sector_names)


  alphalens.tears.create_full_tear_sheet(factor_data)
  ```



  Check out the [example notebooks](https://github.com/stefan-jansen/alphalens-reloaded/tree/master/alphalens/examples)
  for more on how to read and use the factor tear sheet.



  Install with pip:

      pip install alphalens-reloaded

  Install with conda:

      conda install -c ml4t alphalens-reloaded

  Install from the master branch of Alphalens repository (development code):

      pip install git+https://github.com/stefan-jansen/alphalens-reloaded

  Alphalens depends on:

  - [matplotlib](https://github.com/matplotlib/matplotlib)
  - [numpy](https://github.com/numpy/numpy)
  - [pandas](https://github.com/pandas-dev/pandas)
  - [scipy](https://github.com/scipy/scipy)
  - [seaborn](https://github.com/mwaskom/seaborn)
  - [statsmodels](https://github.com/statsmodels/statsmodels)

  > Note that Numpy>=2.0 requires pandas>=2.2.2. If you are using an older version of pandas, you may need to upgrade
  > accordingly, otherwise you may encounter compatibility issues.



  A good way to get started is to run the examples in a [Jupyter notebook](https://jupyter.org/).

  To get set up with an example, you can:

  Run a Jupyter notebook server via:

  ```bash
  jupyter notebook
  ```

  From the notebook list page(usually found at `http://localhost:8888/`), navigate over to the examples directory, and open any file with a .ipynb extension.

  Execute the code in a notebook cell by clicking on it and hitting Shift+Enter.



  If you find a bug, feel free to open an issue on our [github tracker](https://github.com/stefan-jansen/alphalens-reloaded/issues).



  If you want to contribute, a great place to start would be the
  [help-wanted issues](https://github.com/stefan-jansen/alphalens-reloaded/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).



  - [Andrew Campbell](https://github.com/a-campbell)
  - [James Christopher](https://github.com/jameschristopher)
  - [Thomas Wiecki](https://github.com/twiecki)
  - [Jonathan Larkin](https://github.com/marketneutral)
  - Jessica Stauth (<jstauth@quantopian.com>)
  - [Taso Petridis](https://github.com/tasopetridis)

  For a full list of contributors see the [contributors page.](https://github.com/stefan-jansen/alphalens-reloaded/graphs/contributors)



  Example factor courtesy of [ExtractAlpha](https://extractalpha.com/)



  ![image](https://i.imgur.com/4T8cziG.png)



  ![image](https://i.imgur.com/aVs3KiM.png)



  ![image](https://i.imgur.com/vAm8okb.png)



  ![image](https://i.imgur.com/pnBs0ta.png)




  ```

  create_full_tear_sheet_html(
      ret,
      long_short=False,
      group_neutral=False,
      by_group=False,
      output_file='factor_analysis.html'
  )
  ```

rpm_license:
  Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.  "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."  "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.  Copyright 2018 Quantopian, Inc.  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


pkgId: 7506701de6c4ad1751e864fe19c1f61585fec58b83f2e205538c43680ad2d3c5
name: python-alphalens-reloaded
arch: src
version: 0.4.5
epoch: 0
release: 1
summary: Performance analysis of predictive (alpha) stock factors
url: https://pypi.org/project/alphalens-reloaded/
rpm_group: Unspecified
rpm_buildhost: localhost
location_href: Packages/python-alphalens-reloaded-0.4.5-1.src.rpm
checksum_type: sha256
description:
  <p align="center">
  <a href="https://alphalens.ml4trading.io">
  <img src="https://i.imgur.com/uf8PmQO.png" width="35%">
  </a>
  </p>

  ![PyPI](https://img.shields.io/pypi/v/alphalens-reloaded)
  [![Anaconda](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/conda_package.yml/badge.svg)](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/conda_package.yml)
  [![Tests](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/unit_tests.yml)
  [![PyPI](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/build_wheels.yml/badge.svg)](https://github.com/stefan-jansen/alphalens-reloaded/actions/workflows/build_wheels.yml)
  [![Coverage Status](https://coveralls.io/repos/github/stefan-jansen/alphalens-reloaded/badge.svg?branch=main)](https://coveralls.io/github/stefan-jansen/alphalens-reloaded?branch=main)
  ![GitHub issues](https://img.shields.io/github/issues/stefan-jansen/alphalens-reloaded)
  ![PyPI - License](https://img.shields.io/pypi/l/alphalens-reloaded)
  ![Discourse users](https://img.shields.io/discourse/users?server=https%3A%2F%2Fexchange.ml4trading.io%2F)
  ![Twitter Follow](https://img.shields.io/twitter/follow/ml4trading?style=social)

  Alphalens is a Python library for performance analysis of predictive
  (alpha) stock factors. Alphalens works great with the
  [Zipline](https://www.zipline.ml4trading.io/) open source backtesting library, and [Pyfolio](https://github.com/quantopian/pyfolio) which provides performance and risk analysis of financial portfolios.

  The main function of Alphalens is to surface the most relevant statistics and plots about an alpha factor, including:

  - Returns Analysis
  - Information Coefficient Analysis
  - Turnover Analysis
  - Grouped Analysis



  With a signal and pricing data creating a factor \"tear sheet\" is a two step process:

  ```python
  import alphalens


  factor_data = alphalens.utils.get_clean_factor_and_forward_returns(my_factor,
                                                                     pricing,
                                                                     quantiles=5,
                                                                     groupby=ticker_sector,
                                                                     groupby_labels=sector_names)


  alphalens.tears.create_full_tear_sheet(factor_data)
  ```



  Check out the [example notebooks](https://github.com/stefan-jansen/alphalens-reloaded/tree/master/alphalens/examples)
  for more on how to read and use the factor tear sheet.



  Install with pip:

      pip install alphalens-reloaded

  Install with conda:

      conda install -c ml4t alphalens-reloaded

  Install from the master branch of Alphalens repository (development code):

      pip install git+https://github.com/stefan-jansen/alphalens-reloaded

  Alphalens depends on:

  - [matplotlib](https://github.com/matplotlib/matplotlib)
  - [numpy](https://github.com/numpy/numpy)
  - [pandas](https://github.com/pandas-dev/pandas)
  - [scipy](https://github.com/scipy/scipy)
  - [seaborn](https://github.com/mwaskom/seaborn)
  - [statsmodels](https://github.com/statsmodels/statsmodels)

  > Note that Numpy>=2.0 requires pandas>=2.2.2. If you are using an older version of pandas, you may need to upgrade
  > accordingly, otherwise you may encounter compatibility issues.



  A good way to get started is to run the examples in a [Jupyter notebook](https://jupyter.org/).

  To get set up with an example, you can:

  Run a Jupyter notebook server via:

  ```bash
  jupyter notebook
  ```

  From the notebook list page(usually found at `http://localhost:8888/`), navigate over to the examples directory, and open any file with a .ipynb extension.

  Execute the code in a notebook cell by clicking on it and hitting Shift+Enter.



  If you find a bug, feel free to open an issue on our [github tracker](https://github.com/stefan-jansen/alphalens-reloaded/issues).



  If you want to contribute, a great place to start would be the
  [help-wanted issues](https://github.com/stefan-jansen/alphalens-reloaded/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).



  - [Andrew Campbell](https://github.com/a-campbell)
  - [James Christopher](https://github.com/jameschristopher)
  - [Thomas Wiecki](https://github.com/twiecki)
  - [Jonathan Larkin](https://github.com/marketneutral)
  - Jessica Stauth (<jstauth@quantopian.com>)
  - [Taso Petridis](https://github.com/tasopetridis)

  For a full list of contributors see the [contributors page.](https://github.com/stefan-jansen/alphalens-reloaded/graphs/contributors)



  Example factor courtesy of [ExtractAlpha](https://extractalpha.com/)



  ![image](https://i.imgur.com/4T8cziG.png)



  ![image](https://i.imgur.com/aVs3KiM.png)



  ![image](https://i.imgur.com/vAm8okb.png)



  ![image](https://i.imgur.com/pnBs0ta.png)

rpm_license:
  Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.  "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."  "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.  Copyright 2018 Quantopian, Inc.  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


