MCPcopy Index your code
hub / github.com/reactive-python/reactpy / get_example_files_by_name

Function get_example_files_by_name

docs/docs_app/examples.py:56–64  ·  view source on GitHub ↗
(
    name: str, relative_to: str | Path | None = SOURCE_DIR
)

Source from the content-addressed store, hash-verified

54
55
56def 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
67def _iter_example_files(root: Path) -> Iterator[Path]:

Callers 1

runMethod · 0.90

Calls 1

Tested by

no test coverage detected