(
name: str, relative_to: str | Path | None = SOURCE_DIR
)
| 54 | |
| 55 | |
| 56 | def get_example_files_by_name( |
| 57 | name: str, relative_to: str | Path | None = SOURCE_DIR |
| 58 | ) -> list[Path]: |
| 59 | path = _get_root_example_path_by_name(name, relative_to) |
| 60 | if path.is_dir(): |
| 61 | return [p for p in path.glob("*") if not p.is_dir()] |
| 62 | else: |
| 63 | path = path.with_suffix(".py") |
| 64 | return [path] if path.exists() else [] |
| 65 | |
| 66 | |
| 67 | def _iter_example_files(root: Path) -> Iterator[Path]: |
no test coverage detected