mind2web
This commit is contained in:
parent
2b5d923f63
commit
98d5e90894
754 changed files with 1175740 additions and 142424 deletions
16
Mind2Web/loader.py
Normal file
16
Mind2Web/loader.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import json
|
||||
from typing import List, Dict, Any
|
||||
|
||||
|
||||
def load_tasks(path: str, limit: int | None = None, offset: int = 0) -> List[Dict[str, Any]]:
|
||||
with open(path, "r", encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
|
||||
if not isinstance(data, list):
|
||||
raise ValueError("Ожидался список задач в JSON")
|
||||
|
||||
sliced = data[offset:]
|
||||
if limit is not None:
|
||||
sliced = sliced[:limit]
|
||||
|
||||
return sliced
|
||||
Loading…
Add table
Add a link
Reference in a new issue