MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / _basename

Function _basename

monai/apps/utils.py:84–87  ·  view source on GitHub ↗

get the last part of the path (removing the trailing slash if it exists)

(p: PathLike)

Source from the content-addressed store, hash-verified

82
83
84def _basename(p: PathLike) -> str:
85 """get the last part of the path (removing the trailing slash if it exists)"""
86 sep = os.path.sep + (os.path.altsep or "") + "/ "
87 return Path(f"{p}".rstrip(sep)).name
88
89
90def _download_with_progress(url: str, filepath: Path, progress: bool = True) -> None:

Callers 7

downloadFunction · 0.90
_download_with_progressFunction · 0.85
check_hashFunction · 0.85
download_urlFunction · 0.85
extractallFunction · 0.85
get_filename_from_urlFunction · 0.85
download_and_extractFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…