class_docstr: Abstract base class for storage managers. Storage managers need to
  support five operations:
  
     1.  Upload an existing directory to storage
     2.  Download from storage to a target directory
     3.  Provide a path to write to, in order to upload
     4.  Provide a path to read from, after a download
     5.  Delete a directory in storage
  
  Advanced methods 3. and 4.  allow shared_fs to do optimized zero-copy checkpointing.
  Cloud-based implementations can subclass the CloudStorageManager, which will define 3. and 4. in
  terms of 1. and 2.
  
  Configuration for storage managers is represented as a dictionary of key value pairs. The
  primary key in the dictionary is the `type` defining which storage backend to use. Additional
  keys may be required to instantiate some implementations of the storage manager.
docstr: Prepare a local directory to be written to the storage backend.
  
  This base implementation creates the dst directory, but subclasses whose storage
  backends are in remote places are responsible for uploading the data after the files are
  created and deleting the temporary dst directory.
docstr_tok: ["Prepare","a","local","directory","to","be","written","to","the","storage","backend",".","This","base","implementation","creates","the","dst","directory",",","but","subclasses","whose","storage","backends","are","in","remote","places","are","responsible","for","uploading","the","data","after","the","files","are","created","and","deleting","the","temporary","dst","directory","."]
code: def pre_store_path(self, dst: str) -> pathlib.Path:
      """
      Prepare a local directory to be written to the storage backend.
  
      This base implementation creates the dst directory, but subclasses whose storage
      backends are in remote places are responsible for uploading the data after the files are
      created and deleting the temporary dst directory.
      """
  
      # Set umask to 0 in order that the storage dir allows future containers of any owner to
      # create new checkpoints. Administrators wishing to control the permissions more
      # specifically should just create the storage path themselves; this will not interfere.
      old_umask = os.umask(0)
      try:
          os.makedirs(self._base_path, exist_ok=True, mode=0o777)
      finally:
          # Restore the original umask.
          os.umask(old_umask)
  
      storage_dir = os.path.join(self._base_path, dst)
      os.makedirs(storage_dir, exist_ok=True)
  
      return pathlib.Path(storage_dir)
  
imports: import abc
  import contextlib
  import copy
  import glob
  import os
  import pathlib
  import tempfile
  import urllib
  from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Union
  from determined import util
  from determined.common import storage
label_desc: Use image node_id 3 for calling the StorageManager obj's underlying member method code with example usage: obj.pre_store_path(dst) and returns: pathlib