semvec/pypi-packages huggingface dataset:
vidbcontrol 0.1.0
Add your description here
Requires Python: >=3.10



# vidbcontrol

一个可以进行数据验证的服务器配置信息库

## 安装

```powershell
pip install vidbcontrol
```

## 使用

### 生成sql语句

```python
    # 示例使用
    table = Query("name", "public")

    try:
        sql, params = table.select(**{
            "columns": ["name AS username", "age AS userage"],
            "where": {
                "and": {
                    "name=": ["zhoubin", "zhangsan"],  # 支持列表
                    "or": {
                        "age>": 20,
                        "age<": 10
                    },
                    "age BETWEEN": [18, 30]
                }
            },
            "orderby": "name",
            "limit": 1
        })
        print("SQL 语句:", sql)
        print("参数列表:", params)

        sql, params = table.insert({"name":  "test", "age": 20})
        print("SQL 语句:", sql)
        print("参数列表:", params)

        sql, params = table.insert_mul(**{
            "columns": ["name", "age"],
            "data": [
                ["zhoubin", 28],
                ["zhangsan", 30]
            ]
        })
        print("SQL 语句:", sql)
        print("参数列表:", params)

        sql, params = table.update({"name":  "test", "age": 20}, {"name=":  "test", "age=": 20})
        print("SQL 语句:", sql)
        print("参数列表:", params)

        sql, params = table.delete({"name=":  "test", "age=": 20})
        print("SQL 语句:", sql)
        print("参数列表:", params)
    except DBException as e:
        print(f"数据库异常: {e}")
```

## 依赖库

- `psycopg2`

## 版权说明

该项目签署了MIT 授权许可。详细请查看LICENSE
nsdget 0.0.4
Python API to easily download stimuli and fMRI betas from Natural Scenes Dataset.
Requires Python: >=3.10

# 🧠🏞️ nsdget

[![PyPI - Version](https://img.shields.io/pypi/v/nsdget.svg)](https://pypi.org/project/nsdget) 

**nsdget: easily download and use the single trial betas 1.8mm and coco images from the Natural Scenes Dataset**

Note: I'm not affiliated with [Natural Scenes Dataset](https://naturalscenesdataset.org/). I just wanted an easier and quicker way to download the data I needed from them (hence this package).

Shoutout to https://github.com/clane9/NSD-Flat/ since I reused some of the functions from there. Thank you!

## Usage

To use the data, please fill out the [NSD Data Access Agreement](https://docs.google.com/forms/d/e/1FAIpQLSduTPeZo54uEMKD-ihXmRhx0hBDdLHNsVyeo_kCb8qbyAkXuQ/viewform?usp=send_form) first. Then download the `nsdget` python package:

**Install**

```bash
uv add nsdget
```

or

```bash
pip install nsdget
```

Then, to download the betas for all 8 subjects and 73k coco images do


```python
from nsdget import nsd_betas_images_trials, nsd_coco_image, nsd_single_trial_betas

df = nsd_betas_images_trials(save_to="./nsdata/") # 213k trials in a Pandas DataFrame
betas = nsd_single_trial_betas(df.iloc[0]) # first betas trial as Nifty Image 
image = nsd_coco_image(df.iloc[0])  # first trial stimulus as COCO PIL Image
```

Example above ran in [`example.ipynb`](./notebooks/example.ipynb).

Note that download happens only once. After the first slow run, subsequent runs will be very fast.

If you want the betas in numpy, just convert from nibabel image to numpy like

```python
nd_betas = betas.get_fdata() 
```

If you want the COCO image in numpy just convert the PIL Image to numpy like

```python
nd_image = np.asarray(image)
```

## Development

**Dev run**

```bash
uv sync
make run
```

**Deployment PyPi**

```bash
uv sync
TOKEN=... make publish # insert your PyPi token where ...
```

## References

- https://naturalscenesdataset.org/ (Allen, St-Yves, Wu, Breedlove, Prince, Dowdle, Nau, Caron, Pestilli, Charest, Hutchinson, Naselaris*, & Kay*. A massive 7T fMRI dataset to bridge cognitive neuroscience and artificial intelligence. Nature Neuroscience (2021).)
- https://cocodataset.org/#home
- https://github.com/clane9/NSD-Flat/blob/b6851300ea3778eae7e4dbb88a85d71ce18cb9a5/generate_dataset.py#L157
tinymodel 0.1.2.2.post9
A small TinyStories LM with SAEs and transcoders
Requires Python: <4.0,>=3.11

# [TinyModel](https://github.com/noanabeshima/tiny_model)

# There's currently an issue where Python 3.13 doesn't work with TinyModel, please use Python 3.11 or 3.12 instead. Python 3.11.11 definitely works.


TinyModel is a 4 layer, 44M parameter model trained on [TinyStories V2](https://arxiv.org/abs/2305.07759) for mechanistic interpretability. It uses ReLU activations and no layernorms. It comes with trained SAEs and transcoders.

It can be installed with `pip install tinymodel` for Python 3.11 and higher.

This library is in an alpha state, it probably has some bugs. Please let me know if you find any or you're having any trouble with the library, I can be emailed at my full name @ gmail.com or messaged on twitter. You can also add GitHub issues.


```
from tinymodel import TinyModel, tokenizer

lm = TinyModel()

# for inference
tok_ids, padding_mask = tokenizer(['Once upon a time', 'In the forest'])
logprobs = lm(tok_ids)

# Get SAE/transcoder acts
# See 'SAEs/Transcoders' section for more information.
feature_acts = lm['M1N123'](tok_ids)
all_feat_acts = lm['M2'](tok_ids)

# Generation
lm.generate('Once upon a time, Ada was happily walking through a magical forest with')

# To decode tok_ids you can use
tokenizer.decode(tok_ids)
```

It was trained for 3 epochs on a [preprocessed version of TinyStoriesV2](https://huggingface.co/datasets/noanabeshima/TinyStoriesV2). Pre-tokenized dataset [here](https://huggingface.co/datasets/noanabeshima/TinyModelTokIds). I recommend using this dataset for getting SAE/transcoder activations.



# SAEs/transcoders
Some sparse SAEs/transcoders are provided along with the model.

For example, `acts = lm['M2N100'](tok_ids)`

To get sparse acts, choose which part of the transformer block you want to look at (currently [sparse MLP](https://www.lesswrong.com/posts/MXabwqMwo3rkGqEW8/sparse-mlp-distillation)/[transcoder](https://www.alignmentforum.org/posts/YmkjnWtZGLbHRbzrP/transcoders-enable-fine-grained-interpretable-circuit) and SAEs on attention out are available, under the tags `'M'` and `'A'` respectively). Residual stream and MLP out SAEs exist, they just haven't been added yet, bug me on e.g. Twitter if you want this to happen fast.

Then, add the layer. A sparse MLP at layer 2 would be `'M2'`.
Finally, optionally add a particular neuron. For example `'M0N10000'`.

# Tokenization
Tokenization is done as follows:
- the top-10K most frequent tokens using the GPT-NeoX tokenizer are selected and sorted by frequency.
- To tokenize a document, first tokenize with the GPT-NeoX tokenizer. Then replace tokens not in the top 10K tokens with a special \[UNK\] token id. All token ids are then mapped to be between 1 and 10K, roughly sorted from most frequent to least.
- Finally, prepend the document with a [BEGIN] token id.
timecapsule 0.1.2
Human-friendly datetime handling for Python
Requires Python: >=3.12

# TimeCapsule

[![PyPI version](https://img.shields.io/pypi/v/timecapsule.svg)](https://pypi.org/project/timecapsule/)
[![Python versions](https://img.shields.io/pypi/pyversions/timecapsule.svg)](https://pypi.org/project/timecapsule/)
[![PyPI downloads](https://img.shields.io/pypi/dm/timecapsule.svg)](https://pypi.org/project/timecapsule/)

Parse, format, and transform datetimes with human-friendly precision. Make Python's datetime as friendly as it should have been.
memos-cmp 0.1.0
Memos MCP服务器
Requires Python: >=3.13

# Memos MCP 服务器

[![smithery badge](https://smithery.ai/badge/codehatcher/memos-mcp)](https://smithery.ai/server/codehatcher/memos-mcp)

一个连接到 [Memos](https://usememos.com/) 的 MCP (Model Context Protocol) 服务器，让你可以通过 AI 助手（如 Claude）与你的 Memos 实例进行交互。

## 功能特点

- 🔄 **连接到用户的 Memos 实例**：通过 API 密钥安全连接
- 📚 **将 API 暴露为资源**：提供对备忘录的结构化访问
- 🔍 **提供强大的工具**：搜索、创建、更新、删除备忘录等功能
- 🏷️ **标签管理**：自动添加标签到新备忘录
- 🔎 **高级搜索**：支持 CEL 表达式进行复杂过滤
- 📝 **提示模板**：包含用于日常操作改进的提示

## 安装与配置

### 安装 via Smithery

To install memos-cmp for Claude Desktop automatically via [Smithery](https://smithery.ai/server/codehatcher/memos-mcp):

```bash
npx -y @smithery/cli install codehatcher/memos-mcp --client claude
```

### 前提条件

- Python 3.8 或更高版本
- 一个可访问的 Memos 实例
- Memos API 密钥

### 安装步骤

1. 克隆此仓库：
   ```bash
   git clone https://github.com/yourusername/memos-mcp.git
   cd memos-mcp
   ```

2. 安装依赖：
   ```bash
   pip install -r requirements.txt
   ```

3. 配置环境变量：
   - 复制 `.env.example` 为 `.env`
   - 编辑 `.env` 文件，填写以下信息：
     ```
     MEMOS_URL=https://your-memos-instance-url
     MEMOS_API_KEY=your-memos-api-key
     DEFAULT_TAG=mcp  # 可选，默认标签
     ```

## 使用方法

### 启动服务器

```bash
python memos_mcp_server.py
```

### 连接到 Claude Desktop

1. 安装 [Claude Desktop](https://claude.ai/download)
2. 在 Claude Desktop 中，添加 MCP 服务器
3. 使用 Claude 与你的 Memos 进行交互

### 使用 MCP 开发工具测试

```bash
mcp dev memos_mcp_server.py
```

## 可用资源

- `memos://recent` - 获取最近的备忘录
- `memos://all` - 获取所有备忘录
- `memos://memos/{memo_id}` - 获取指定 ID 的备忘录

## 可用工具

### 搜索和过滤

- `search_memos(query, filter_expr)` - 搜索备忘录
- `filter_memos(filter_expr)` - 使用 CEL 表达式过滤备忘录

### 创建和管理

- `create_memo(content, visibility, tags)` - 创建新备忘录
- `update_memo(memo_id, content, visibility)` - 更新备忘录
- `delete_memo(memo_id)` - 删除备忘录
- `delete_memo_tag(memo_id, tag)` - 从备忘录中删除标签

## 提示模板

- `daily-review` - 每日备忘录回顾
- `weekly-summary` - 每周备忘录总结
- `knowledge-extraction` - 从备忘录中提取知识
- `content-improvement` - 改进备忘录内容

## CEL 表达式示例

CEL (Common Expression Language) 表达式可用于高级过滤：

- 按内容过滤：`content.contains('关键词')`
- 按创建时间过滤：`createTime > timestamp('2023-01-01T00:00:00Z')`
- 按可见性过滤：`visibility == 'PRIVATE'`
- 组合条件：`content.contains('关键词') && visibility == 'PRIVATE'`

## 示例用法

### 搜索备忘录

```
search_memos(query="项目")
```

### 使用 CEL 表达式过滤

```
filter_memos(filter_expr="createTime > timestamp('2023-01-01T00:00:00Z') && visibility == 'PRIVATE'")
```

### 创建带标签的备忘录

```
create_memo(content="完成 MCP 服务器项目", tags=["项目", "编程"])
```

## 贡献

欢迎提交问题和拉取请求！

## 许可证

MIT