from pathlib import Path return os.getenv("GIT_REPO_DIR", str(Path(__file__).resolve().parents[2])) return os.getenv("GIT_REPO_DIR", str(Path(__file__).resolve().parent.parent.parent)) def fuzzy_list_to_dict(it
Tensors and Dynamic neural networks in Python with strong GPU acceleration - Revert "[BE][Easy] use `pathlib.Path` instead of `dirname` / `".."` /… · yangw-dev/pytorch@475656f
import sys, os from pathlib import Path def get_config_dir() -> str: config_dir = os.getenv('XDG_CONFIG_HOME', '') // If the value of the environment variable is unset, empty, or not an absolute path, use the default if config_dir == '' or config_dir[0] != '/': return...
+ scripts/lib/zulip_tools.py:657:26: PTH208 Use `pathlib.Path.iterdir()` instead. + tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py:34:29: PTH208 Use `pathlib.Path.iterdir()` instead. + tools/lib/test_script.py:102:34: PTH208 Use `pathlib.Path.iter...
If not specified, currently active Conda environment will be used if found. 60 61 """ 61 62 ), llama_stack/cli/stack/run.py +59-21 Original file line numberDiff line numberDiff line change @@ -8,6 +8,7 @@ 8 8 import os 9 9 from pathlib import Path 10 10 11 +...
Since we use os.path.join as a string glue method, I silenced those cases. Summary by Sourcery Refactor file operations to use pathlib. Enhancements: Replace open() with Path.read_text() and Path.write_text() for file I/O. Use Path.mkdir() instead of os
6 6 from pathlib import Path 7 - from tempfile import NamedTemporaryFile 8 7 from time import time 9 8 from typing import TYPE_CHECKING, Any, Literal 10 9 @@ -13,7 +12,7 @@ 13 12 from clan_cli.facts import public_modules as facts_public_modules 14 13 from clan_cli.facts impor...
33 33 from pathlib import Path 34 34 35 - return os.getenv("GIT_REPO_DIR", str(Path(__file__).absolute().parents[2])) 35 + return os.getenv("GIT_REPO_DIR", str(Path(__file__).resolve().parents[2])) 36 36 37 37 38 38 def fuzzy_list_to_dict(items: List[Tuple...
Original file line numberDiff line numberDiff line change @@ -1,8 +1,12 @@ 1 1 import json 2 + import os 2 3 from pathlib import Path 3 4 5 + import requests 4 6 from jsonschema import Draft202012Validator, validators 5 7 from jsonschema.exceptions import ValidationError 8 ...
"from pathlib import Path\n", "\n", "finetuned_model_path = Path(\"review_classifier.pth\")\n", "if not finetuned_model_path.exists():\n", " print(\n", " f\"Could not find '{finetuned_model_path}'.\\n\"\n", " \"Run the `ch06.ipynb` notebook to finetune and sa...