code: def delete(id_or_alias):
      db = read_checkpoint_db()
      checkpoint = get_checkpoint(db, id_or_alias)
      if not checkpoint:
          click.echo(
              "Checkpoint '{}' not found in index.".format(id_or_alias)
          )
          return
  
      # If checkpoint is local, remove entry from index. If it's remote, only
      # mark as ``NOT_DOWNLOADED``.
      if checkpoint["source"] == "local":
          db["checkpoints"] = [
              cp
              for cp in db["checkpoints"]
              if not cp["id"] == checkpoint["id"]
          ]
      else:  # Remote.
          if checkpoint["status"] == "NOT_DOWNLOADED":
              click.echo(
                  "Checkpoint isn't downloaded. Nothing to delete."
              )
              return
          checkpoint["status"] = "NOT_DOWNLOADED"
      save_checkpoint_db(db)
  
      # Delete tar file associated to checkpoint.
      path = get_checkpoint_path(checkpoint["id"])
      try:
          shutil.rmtree(path)
      except OSError:
          # The tar is not present, warn the user just in case.
          click.echo(
              "Skipping files deletion; not present in {}.".format(path)
          )
  
      click.echo(
          "Checkpoint {} deleted successfully.".format(checkpoint["id"])
      )
  
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 19 for calling a global function with example usage: delete(id_or_alias) without return types