in iopath/common/file_io.py [0:0]
def set_cwd(self, path: Union[str, None], **kwargs: Any) -> bool:
"""
Set the current working directory. PathHandler classes prepend the cwd
to all URI paths that are handled.
Args:
path (str) or None: A URI supported by this PathHandler. Must be a valid
absolute Unix path or None to set the cwd to None.
Returns:
bool: true if cwd was set without errors
"""
if path is None and self._cwd is None:
return True
handler = self.__get_path_handler(path or self._cwd)
if self.__get_path_handler(path or self._cwd)._set_cwd(path, **kwargs): # type: ignore
self._cwd = path
bret = True
else:
bret = False
kvs = {"op": "set_cwd", "path": path}
self.__log_tmetry_keys(handler, kvs)
return bret