code: def _load(
      path_or_url: Union[IO, _PATH],
      map_location: _MAP_LOCATION_TYPE = None,
  ) -> Any:
      """Loads a checkpoint.
  
      Args:
          path_or_url: Path or URL of the checkpoint.
          map_location: a function, ``torch.device``, string or a dict specifying how to remap storage locations.
      """
      if not isinstance(path_or_url, (str, Path)):
          # any sort of BytesIO or similar
          return torch.load(path_or_url, map_location=map_location)
      if str(path_or_url).startswith("http"):
          return torch.hub.load_state_dict_from_url(
              str(path_or_url),
              map_location=map_location,  # type: ignore[arg-type] # upstream annotation is not correct
          )
      fs = get_filesystem(path_or_url)
      with fs.open(path_or_url, "rb") as f:
          return torch.load(f, map_location=map_location)
  
file_path: autogluon/multimodal/src/autogluon/multimodal/utils/cloud_io.py
imports: import io
  from pathlib import Path
  from typing import IO, Any, Callable, Dict, Optional, Union
  import fsspec
  import torch
  from fsspec.core import url_to_fs
  from fsspec.implementations.local import AbstractFileSystem
label_desc: Use image node_id 1 for calling a global function with example usage: _load(path_or_url, map_location) and returns: torch, torch, torch