code: def create(config_files, override_params, entries):
      # Parse the entries passed as options.
      entries = parse_entries(entries)
      if entries is None:
          return
  
      click.echo("Creating checkpoint for given configuration...")
      # Get and build the configuration file for the model.
      config = get_config(config_files, override_params=override_params)
  
      # Retrieve the files for the last checkpoint available.
      run_dir = os.path.join(
          config.train.job_dir, config.train.run_name
      )
      ckpt = tf.train.get_checkpoint_state(run_dir)
      if not ckpt or not ckpt.all_model_checkpoint_paths:
          click.echo(
              "Couldn't find checkpoint in '{}'.".format(run_dir)
          )
          return
  
      last_checkpoint = sorted(
          [
              {"global_step": int(path.split("-")[-1]), "file": path}
              for path in ckpt.all_model_checkpoint_paths
          ],
          key=lambda c: c["global_step"],
      )[-1]["file"]
  
      checkpoint_prefix = os.path.basename(last_checkpoint)
      checkpoint_paths = [
          os.path.join(run_dir, file)
          for file in os.listdir(run_dir)
          if file.startswith(checkpoint_prefix)
      ]
  
      # Find the `classes.json` file.
      classes_path = os.path.join(config.dataset.dir, "classes.json")
      if not os.path.exists(classes_path):
          classes_path = None
  
      # Create an checkpoint_id to identify the checkpoint.
      checkpoint_id = str(uuid.uuid4()).replace("-", "")[:12]
  
      # Update the directory paths for the configuration file. Since it's going
      # to be packed into a single tar file, we set them to the current directoy.
      config.dataset.dir = "."
      config.train.job_dir = "."
      config.train.run_name = checkpoint_id
  
      # Create the directory that will contain the model.
      path = get_checkpoint_path(checkpoint_id)
      tf.gfile.MakeDirs(path)
  
      with open(os.path.join(path, "config.yml"), "w") as f:
          json.dump(config, f)
  
      # Add the checkpoint files.
      for checkpoint_path in checkpoint_paths:
          shutil.copy2(checkpoint_path, path)
  
      # Add `checkpoint` file to indicate where the checkpoint is located. We
      # need to create it manually instead of just copying as it may contain
      # absolute paths.
      with open(os.path.join(path, "checkpoint"), "w") as f:
          f.write(
              """
              model_checkpoint_path: "{0}"
              all_model_checkpoint_paths: "{0}"
              """.format(
                  checkpoint_prefix
              )
          )
  
      # Add the `classes.json` file. Also get the number of classes, if
      # available.
      num_classes = None
      if classes_path:
          shutil.copy2(classes_path, path)
          with open(classes_path) as f:
              num_classes = len(json.load(f))
  
      # Store the new checkpoint into the checkpoint index.
      metadata = {
          "id": checkpoint_id,
          "name": entries.get("name", ""),
          "description": entries.get("description", ""),
          "alias": entries.get("alias", ""),
          "model": config.model.type,
          "dataset": {
              "name": entries.get("dataset.name", ""),
              "num_classes": (
                  num_classes
                  or entries.get("dataset.num_classes", None)
              ),
          },
          "luminoth_version": lumi_version,
          "created_at": datetime.utcnow().isoformat(),
          "status": "LOCAL",
          "source": "local",
          "url": None,  # Only for remotes.
      }
  
      db = read_checkpoint_db()
      db["checkpoints"].append(metadata)
      save_checkpoint_db(db)
  
      click.echo(
          "Checkpoint {} created 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 17 for calling a global function with example usage: create(config_files, override_params, entries) without return types