code: def get_checkpoint_config(id_or_alias, prompt=True):
      """Returns the checkpoint config object in order to load the model.
  
      If `prompt` is ``True`` and the checkpoint is not present in the index,
      prompt the user to refresh the index. If the checkpoint is present in the
      index but is remote and not yet downloaded, prompt to download.
      """
      db = read_checkpoint_db()
      checkpoint = get_checkpoint(db, id_or_alias)
  
      if prompt and not checkpoint:
          # Checkpoint not found in database. Prompt for refreshing the index and
          # try again.
          click.confirm(
              "Checkpoint not found. Check remote repository?",
              abort=True,
          )
          db = refresh_remote_index()
          checkpoint = get_checkpoint(db, id_or_alias)
          if not checkpoint:
              # Still not found, abort.
              click.echo(
                  "Checkpoint isn't available in remote repository either."
              )
              raise ValueError("Checkpoint not found.")
      elif not checkpoint:
          # No checkpoint but didn't prompt.
          raise ValueError("Checkpoint not found.")
  
      if prompt and checkpoint["status"] == "NOT_DOWNLOADED":
          # Checkpoint hasn't been downloaded yet. Prompt for downloading it
          # before continuing.
          click.confirm(
              "Checkpoint not present locally. Want to download it?",
              abort=True,
          )
          download_remote_checkpoint(db, checkpoint)
      elif checkpoint["status"] == "NOT_DOWNLOADED":
          # Not downloaded but didn't prompt.
          raise ValueError("Checkpoint not downloaded.")
  
      path = get_checkpoint_path(checkpoint["id"])
      config = get_config(os.path.join(path, "config.yml"))
  
      # Config paths should point to the path where the checkpoint files are
      # stored.
      config.dataset.dir = path
      config.train.job_dir = get_checkpoints_directory()
  
      return config
  
imports: import click
  import json
  import os
  import shutil
  import six
  import requests
  import tarfile
  import tempfile
  import tensorflow
  import uuid
  from datetime import datetime
  from luminoth import __version__
  from luminoth.utils.config import get_config
  from luminoth.utils.homedir import get_luminoth_home
label_desc: Use image node_id 7 for calling a global function with example usage: get_checkpoint_config(id_or_alias, prompt) and returns: config