coding.fix_from_imports
Replace `from X import Y` imports with `import X` and update usages in a file
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- model
- haiku
- description
- Replace `from X import Y` imports with `import X` and update usages in a file
03 SKILL.md 正文
-
Replace any Python statement like
from X import Ywith the formimport Xand then replace the uses ofYwithX.Y -
For aliased imports
from X import Y as Z, convert toimport Xand replace all uses ofZwithX.Y -
For nested module imports
from X.Y import Z, convert toimport X.Yand replace all uses ofZwithX.Y.Z -
The only ones that can stay as
from X import Yare:from __future__ import annotations from typing import Any, Dict, List, Optional, Tuple, Union, ... (any typing name) from IPython.display import display from pathlib import Path -
Do not use
# Re-export get_chat_model for backward compatibility. get_chat_model = langchain_API_utils.get_chat_modelbut replace all the callers
Verification
- [ ] Confirm no remaining
from X import Ystatements outside the allowed exceptions - [ ] Confirm every use of the imported name is updated to
X.Y(orX.Y.Zfor nested modules) - [ ] Confirm no backward-compatibility re-export aliases remain
04 同仓库更多 Skills
tutorial_in_60_mins.propagate_docker_changes
Sync tutorial and class-project Docker files to match project_template
tutorial_in_60_mins.merge_markdown
Merge the content of a markdown file into a Jupyter notebook
tutorial_in_60_mins.format
Format a directory to follow the "Learn X in 60 Minutes" tutorial conventions
tutorial_in_60_mins.create
Create a tutorial directory for the Learn X in 60 Minutes conventions
todo.reorg_in_progress
Reorganize ai_task_queue.md so in-progress tasks, not-started tasks, and mislabeled topic headers sit under the right H1 stage
todo.reorg_headers
Reorganize ai_task_queue.md .md so every H2 topic matches ALL TOPICS and every H3 task sits under the right topic, keeping its H1 stage