semvec/pypi-packages huggingface dataset:
els-utils 0.3.9
A simple wrapper for Elasticsearch tool
Requires Python: >=3.9

# els-utils

This library provides utilities for interacting with Elasticsearch and results retrived from it.

The core features are:
- Index creation (even if already exists)
- Index deletion
- Search (can include `explain: True` in the DSL query)
- Explain

## Installation

```
uv add els-utils
```

## Example usage

### Instantiate
```python
from els_utils import ELS


# Using API key to authenticate
els = ELS(ES_ENDPOINT, api_key=ES_API_KEY)

# Using basic authen with username and password
els = ELS(ES_ENDPOINT, basic_authen=(USERNAME, PASSWORD))
```
### Create index
```python
mapping = {"mappings": {"properties": {...}}}

els.create_index(index_name="my-index", json_mapping=mapping, replace_if_exists=True)
```

### Bulk update
```python
data = [{"some-id": "1", "field1": "some-value"}, {"some-id": "2", "field1": "another-value"}]

els.bulk_update(index_name="my-index", data=data, id_key="some-id")

# Routing option is also available if needed
els.bulk_update(index_name="my-index", data=data, id_key="some-id", routing_key="1")
```

### Results

```python
dsl = {"query": {...}}
results = els.search(INDEX_NAME, dsl)

# results: <SearchResults total_hits=510>

# Get the JSON
results.json

# Get the hits
result.hits

# Get the sources
results.get_sources(as_list=False)  # as_list can be `True` if you wish to get just a list of sources

# Get results in a DataFrame format
results.to_dataframe()

# You can also pass in just the columns you want
results.to_dataframe(columns=["field1"])

# If explain: True was passed in the DSL, you can also get explanations
results.get_explanations()  # This returns a dict of {`_id`: `<ExplainResult>`}
```

### Explanation

#### Using the `explain` API
```python
dsl = {"query": {...}}
explain = els.explain(INDEX_NAME, doc_id="75720", dsl=dsl, routing=None)

# Get the JSON
explain.json

# Get score
explain.score

# Get the explanation dict
explain.explanation

# Get scores breakdown
explain.get_scores_breakdown(as_df=False)  # If you wish to return a DataFrame, can pass `as_df=True`

# Get the scores terms, e.g., tf, idf, boost for each field
explain.get_scores_term(as_df=False)

# Get the contributions summary for each field
explain.get_scores_summary()  # You can also pass in `as_df` parameter
```

#### Using the explanation from the `search` API
```python
dsl = {"explain": True, "query": {...}}
results = els.search(INDEX_NAME, dsl=dsl)

# This returns a dict of {`_id`: `<ExplainResult>`}
explanations = results.get_explanations()

# You can do the same thing as the `ExplainResult` for each item
explanations["75720"].get_scores_term()  # Given that the key "75720" exists in the results
```
gitee-openapi 0.2.11
Python SDK for Gitee API
Requires Python: >=3.8

# Gitee OpenAPI SDK
        
        [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/)
        [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
        
        一个功能完整、结构清晰、易于使用的Gitee API Python SDK包，使用uv进行依赖管理。
        
        ## 功能特点
        
        - 完整覆盖Gitee API的所有功能
        - 模块化设计，结构清晰
        - 简洁易用的接口
        - 完善的错误处理
        - 支持分页处理
        - 类型提示，提高IDE支持
        - 详细的文档和示例
        
        ## 安装
        
        ```bash
        pip install gitee-openapi
        ```
        
        使用uv安装：
        
        ```bash
        uv pip install gitee-openapi
        ```
        
        ## 快速开始
        
        ```python
        from gitee import GiteeClient
        
        # 创建客户端
        client = GiteeClient(token="your_access_token")
        
        # 获取用户仓库列表
        repos = client.repositories.list()
        for repo in repos:
            print(f"{repo['full_name']}: {repo['description']}")
        
        # 创建Issue
        issue = client.issues.create(
            owner="octocat",
            repo="hello-world",
            title="Found a bug",
            body="I'm having a problem with this."
        )
        print(f"Created issue #{issue['number']}: {issue['title']}")
        ```
        
        ## 支持的API
        
        - 仓库管理 (Repositories)
        - Issues管理
        - Pull Requests
        - 用户管理 (Users)
        - 组织管理 (Organizations)
        - 代码片段 (Gists)
        - 企业管理 (Enterprises)
        - 邮箱管理 (Emails)
        - 标签管理 (Labels)
        - 里程碑管理 (Milestones)
        - Webhooks
        - 动态通知 (Activities)
        - 门禁检查项 (Checks)
        - 仓库数据 (Git Data)
        - 搜索 (Search)
        - 杂项 (Miscellaneous)
        
        ## 详细文档
        
        查看[设计文档](DESIGN.md)了解更多关于SDK架构和设计的信息。
        
        ## 开发
        
        ### 环境设置
        
        ```bash
        # 克隆仓库
        git clone https://github.com/bojackli/gitee-sdk.git
        cd gitee-sdk
        
        # 使用uv安装依赖
        uv pip install -e ".[dev]"
        ```
        
        ### 运行测试
        
        ```bash
        pytest
        ```
        
        ## 贡献
        
        欢迎贡献代码、报告问题或提出改进建议！
        
        ## 许可证
        
        [MIT](LICENSE)
nz-allo-usage-tools 0.2.10
Functions to process and analyse NZ allocation and usage data
Requires Python: >=3.9
Keywords: allocation

Repository for NZ allocation and usage Python tools
=============================================================

This git repository contains the NZ allocation and usage Python tools and associated documentation.

.. Documentation
.. --------------
.. The primary documentation for the package can be found `here <http://hilltop-py.readthedocs.io>`_.

Installation
------------
nz-allo-usage-tools can be installed via pip or conda::

  pip install nz-allo-usage-tools

or::

  conda install -c mullenkamp nz-allo-usage-tools

The main dependencies are `Pandas <http://pandas.pydata.org/pandas-docs/stable/>`_ and boto3.
dtensor 0.0.1
Facilities built around PyTorch DTensor
Requires Python: >=3.9

# Facilities for PyTorch DTensor

## Installation

Install the project using the following command:

```bash
pip install -e .
```

## Visualize Sharding

Since transitioning from the PyTorch Distributed team at Meta to working on Apple Foundation Models at Apple, I've been utilizing [AXLearn](https://github.com/google/axlearn), which is built on top of JAX.

To understand JAX's distributed arrays and how sharding across a device mesh could implement various parallelism strategies, I've used `jax.debug.visualize_array_sharding`. In this [LinkedIn post](https://www.linkedin.com/posts/yidewang_i-coauthored-this-notebook-with-wanchao-activity-7319523841595076608-bcm3?utm_source=share&utm_medium=member_desktop&rcm=ACoAAALdDjQBRj38KfRE5-nY27SqXVIIS8171vE), co-authored with Wanchao Liang, we demonstrate the benefits of visualizing sharding.

It's encouraging to see my former team releasing PyTorch's DTensor and showcasing its value through the development of FSDP2 and TorchTitan. DTensor also includes a sharding visualization feature that utilizes `tabulate` to produce a basic visual representation.

This project introduces an enhanced visualization for DTensor's sharding, inspired by JAX's approach.  Run the following command to see how it works.

```shell
OMP_NUM_THREADS=1 torchrun --nproc_per_node=4 dtensor/visualize_example.py
```

This will display a list of sharding/mesh combinations. For each combination, visualizations generated by both the original and the new methods will be presented.

![](screenshot.png)