code: def get_datastore_object(
      path: str, force: bool = False, num_retries: int = 5
  ) -> str:
      """Download an object from a store path and return the local path.
      If the input `path` is a local path, then nothing will be done, and
      the original path will be returned.
  
      Args:
          path: path to an object
          force: force download, even if a local file exists
          num_retries: number of retries if the get command fails
  
      Returns:
          Local path of the object.
      """
      if path.startswith("ais://"):
          endpoint = ais_endpoint()
          if endpoint is None:
              raise RuntimeError(
                  f"AIS endpoint not set, cannot resolve {path}"
              )
  
          local_path = datastore_path_to_local_path(store_path=path)
  
          if not os.path.isfile(local_path) or force:
              # Either we don't have the file in cache or we force download it
              # Enhancement: if local file is present, check some tag and compare against remote
              local_dir = os.path.dirname(local_path)
              if not os.path.isdir(local_dir):
                  os.makedirs(local_dir, exist_ok=True)
  
              cmd = [ais_binary(), "get", path, local_path]
  
              # for now info, later debug
              logging.debug("Downloading from AIS")
              logging.debug("\tendpoint    %s", endpoint)
              logging.debug("\tpath:       %s", path)
              logging.debug("\tlocal path: %s", local_path)
              logging.debug(
                  "\tcmd:        %s", subprocess.list2cmdline(cmd)
              )
  
              done = False
              for n in range(num_retries):
                  if not done:
                      try:
                          # Use stdout=subprocess.DEVNULL to prevent showing AIS command on each line
                          subprocess.check_call(
                              cmd, stdout=subprocess.DEVNULL
                          )
                          done = True
                      except subprocess.CalledProcessError as err:
                          logging.warning(
                              "Attempt %d of %d failed with: %s",
                              n + 1,
                              num_retries,
                              str(err),
                          )
  
              if not done:
                  raise RuntimeError(
                      "Download failed: %s",
                      subprocess.list2cmdline(cmd),
                  )
  
          return local_path
  
      else:
          # Assume the file is local
          return path
  
imports: import os
  import pathlib
  import shutil
  import subprocess
  from typing import Tuple
  from nemo import __version__
  from nemo import constants
  from nemo.utils import logging
label_desc: Use image node_id 11 for calling a global function with example usage: get_datastore_object(path, force, num_retries) and returns: local_path, path