code: def from_string(shortcut: str) -> StorageManager:
      p: urllib.parse.ParseResult = urllib.parse.urlparse(shortcut)
      if any((p.params, p.query, p.fragment)):
          raise ValueError(
              f'Malformed checkpoint_storage string "{shortcut}"'
          )
      scheme = p.scheme.lower()
      if scheme in ["", "file"]:
          if p.netloc:
              raise ValueError(
                  "A netloc in the file URI of checkpoint_storage is not allowed."
              )
          base_path = p.path
          return storage.SharedFSStorageManager(base_path=base_path)
      elif scheme == "gs":
          bucket = p.netloc
          prefix = p.path.lstrip("/")
          return storage.GCSStorageManager(bucket=bucket, prefix=prefix)
      elif scheme == "s3":
          bucket = p.netloc
          prefix = p.path.lstrip("/")
          return storage.S3StorageManager(bucket=bucket, prefix=prefix)
      else:
          raise ValueError(
              f'Could not understand storage manager scheme "{p.scheme}". Use "gs", "s3", "file", '
              "or omit it."
          )
  
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 1 for calling a global function with example usage: from_string(shortcut) and returns: storage, storage, storage