neuralib.util.utils.ensure_dir

neuralib.util.utils.ensure_dir(p, verbose=True)[source]

Ensure the path is a directory. Create if it is not exist.

Parameters:
  • p (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader) – path to be checked

  • verbose (bool) – print verbose message

Return type:

Path