MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / _safe_tail

Function _safe_tail

deeplabcut/core/debug/debug_logger.py:342–354  ·  view source on GitHub ↗

Redact user-specific absolute paths. Keeps only the last 2 path components when possible.

(pathlike: object)

Source from the content-addressed store, hash-verified

340
341
342def _safe_tail(pathlike: object) -> str:
343 """Redact user-specific absolute paths.
344
345 Keeps only the last 2 path components when possible.
346 """
347 try:
348 p = Path(str(pathlike))
349 parts = p.parts
350 if len(parts) >= 2:
351 return str(Path(*parts[-2:]).as_posix())
352 return str(p.as_posix())
353 except Exception:
354 return str(pathlike)
355
356
357def _module_version(module_name: str) -> str:

Callers 3

collect_version_summaryFunction · 0.85
collect_runtime_summaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected