MCPcopy Create free account
hub / github.com/cocoindex-io/cocoindex-code / normalize_input_path

Function normalize_input_path

src/cocoindex_code/settings.py:268–274  ·  view source on GitHub ↗

Translate a host path back to its container form before using it internally. Inverse of :func:`format_path_for_display`. No-op when the env var is unset or when ``p`` is relative / unmatched.

(p: str | Path)

Source from the content-addressed store, hash-verified

266
267
268def normalize_input_path(p: str | Path) -> str:
269 """Translate a host path back to its container form before using it internally.
270
271 Inverse of :func:`format_path_for_display`. No-op when the env var is unset
272 or when ``p`` is relative / unmatched.
273 """
274 return _apply_mapping(get_host_path_mappings(), p, reverse=True)
275
276
277def _reset_db_path_mapping_cache() -> None:

Callers 10

test_translates_inputMethod · 0.90
indexFunction · 0.85
searchFunction · 0.85
project_statusFunction · 0.85
remove_projectFunction · 0.85
doctorFunction · 0.85
_apply_host_cwdFunction · 0.85

Calls 2

_apply_mappingFunction · 0.85
get_host_path_mappingsFunction · 0.85