[docs]defis_directory(f:Any)->TypeGuard[StrOrBytesPath]:"""Checks if an object is a string, and that it points to a directory."""returnis_path(f)andos.path.isdir(f)
[docs]@staticmethoddefnew(ex:BaseException)->Any:""" Creates an object that raises the wrapped exception ``ex`` when used, and casts it to :py:obj:`~typing.Any` type. """returnDeferredError(ex)