MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / unit_path

Function unit_path

graphify/file_slice.py:128–134  ·  view source on GitHub ↗

The on-disk path a unit belongs to (the parent file for a slice).

(unit: "Path | FileSlice | str")

Source from the content-addressed store, hash-verified

126
127
128def unit_path(unit: "Path | FileSlice | str") -> Path:
129 """The on-disk path a unit belongs to (the parent file for a slice)."""
130 if isinstance(unit, FileSlice):
131 return unit.path
132 if isinstance(unit, Path):
133 return unit
134 return Path(unit)
135
136
137def is_splittable_text(path: "Path | FileSlice | str") -> bool:

Callers 11

_read_filesFunction · 0.90
_dispatched_source_textFunction · 0.90
_pack_chunks_by_tokensFunction · 0.90
_chunk_partial_filesFunction · 0.90
extract_corpus_parallelFunction · 0.90
_checkpoint_chunkFunction · 0.90
is_splittable_textFunction · 0.85
make_full_sliceFunction · 0.85

Calls

no outgoing calls

Tested by 1