code: def evaluate(
      job_id,
      train_folder,
      bucket_name,
      dataset_split,
      region,
      machine_type,
      rebuild,
  ):
      account = ServiceAccount()
      account.validate_region(region)
  
      if not train_folder.startswith("gs://"):
          train_folder = "gs://{}".format(train_folder)
  
      if not job_id:
          job_id = "eval_{}".format(
              datetime.now().strftime("%Y%m%d_%H%M%S")
          )
  
      if bucket_name is None:
          bucket_name = "luminoth-{}".format(account.client_id)
          click.echo(
              'Bucket name not specified. Using "{}".'.format(
                  bucket_name
              ),
              err=True,
          )
  
      if rebuild:
          job_folder = "lumi_{}".format(job_id)
  
          # Make new package in the bucket for eval results
          bucket = account.get_bucket(bucket_name)
          package_path = build_package(bucket, job_folder)
          full_package_path = "gs://{}/{}".format(
              bucket_name, package_path
          )
      else:
          # Get old training package from the training folder.
          # There should only be one file ending in `.tar.gz`.
          train_packages_dir = "{}/{}".format(
              train_folder, DEFAULT_PACKAGES_PATH
          )
  
          try:
              package_files = tf.gfile.ListDirectory(train_packages_dir)
              package_filename = [
                  n for n in package_files if n.endswith("tar.gz")
              ][0]
              full_package_path = "{}/{}".format(
                  train_packages_dir, package_filename
              )
          except (IndexError, tf.errors.NotFoundError):
              click.echo(
                  "Could not find a `.tar.gz` Python package of Luminoth in "
                  "{}.\n\nCheck that the --train-folder parameter is "
                  "correct.".format(train_packages_dir),
                  err=True,
              )
              sys.exit(1)
  
      train_config_path = "{}/{}".format(
          train_folder, DEFAULT_CONFIG_FILENAME
      )
      cloudml = account.cloud_service("ml")
  
      args = [
          ["--config", train_config_path],
          ["--split", dataset_split],
      ]
  
      training_inputs = {
          "scaleTier": "CUSTOM",
          "masterType": machine_type,
          "packageUris": [full_package_path],
          "pythonModule": "luminoth.eval",
          "args": args,
          "region": region,
          # Don't need to pass jobDir since it will read it from config file.
          "runtimeVersion": RUNTIME_VERSION,
      }
  
      job_spec = {"jobId": job_id, "trainingInput": training_inputs}
  
      jobrequest = (
          cloudml.projects()
          .jobs()
          .create(
              body=job_spec,
              parent="projects/{}".format(account.project_id),
          )
      )
  
      try:
          click.echo("Submitting evaluation job.")
          res = jobrequest.execute()
          click.echo("Job submitted successfully.")
          click.echo(
              "state = {}, createTime = {}\n".format(
                  res.get("state"), res.get("createTime")
              )
          )
          click.echo("Job id: {}".format(job_id))
          click.echo(
              "Job directory: {}".format("gs://{}".format(bucket_name))
          )
  
      except Exception as err:
          click.echo(
              "There was an error creating the evaluation job. "
              "Check the details: \n{}".format(err._get_reason()),
              err=True,
          )
  
imports: import click
  import json
  import luminoth
  import os
  import shutil
  import subprocess
  import sys
  import tempfile
  import tensorflow
  import time
  from datetime import datetime
  from functools import wraps
  from luminoth.utils.config import get_config, dump_config
  from luminoth.utils.experiments import save_run
label_desc: Use image node_id 7 for calling a global function with example usage: evaluate(job_id, train_folder, bucket_name, dataset_split, region, machine_type, rebuild) without return types