Original file line numberDiff line numberDiff line change @@ -23,6 +23,7 @@ from collections.abc import Generator from pathlib import Path from airflow_breeze.utils.cache import check_if_cache_exists from airflow_breeze.utils.console import get_console from airflow_breeze.utils.run_utils imp...
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(items: List[Tuple[str, str]]) -> Dict[str, List[str]]: Expand ...
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...
Tensors and Dynamic neural networks in Python with strong GPU acceleration - Revert "[BE][Easy] use `pathlib.Path` instead of `dirname` / `".."` /… · yangw-dev/pytorch@475656f
exists() Checking if a directory is empty with os.listdir is also wasteful: not os.listdir(api_dir) Users should probably write something like: next(os.scandir(api_dir), None) is None Pathlib equivalent: next(api_dir.iterdir(), None) is None...
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 +...
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 ...
if not mod_dir.exists(): @@ -316,3 +325,34 @@ def get_syslinux_version() -> int: ) output = completed_process.stdout.split() return int(float(output[1]))def find_file( glob_path: pathlib.Path, file_regex: typing.Pattern[str] ...
"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...
from pathlib import Path from numpy.testing import assert_array_equal @@ -559,7 +559,7 @@ def test_dtensor_save_load_import(self): import_string = ( "import torch.distributed.tensor;" if should_import else "" ) filename = pathlib.Path(f.name) filename = Path(f.name) err_msg =...