code: def run(
      job_mode: c.JobMode,
      run_args: Optional[List[str]] = None,
      script_args: Optional[List[str]] = None,
      image_id: Optional[str] = None,
      **build_image_kwargs,
  ) -> None:
      """Builds an image using the supplied **build_image_kwargs and calls `docker
      run` on the resulting image using sensible defaults.
      Keyword args:
      - job_mode: c.JobMode.
      - run_args: extra arguments to supply to `docker run` after our defaults.
      - script_args: extra arguments to supply to the entrypoint. (You can
      - override the default container entrypoint by supplying a new one inside
        run_args.)
      - image_id: ID of the image to run. Supplying this will skip an image build.
      any extra kwargs supplied are passed through to build_image.
      """
      if run_args is None:
          run_args = []
  
      if script_args is None:
          script_args = []
  
      if image_id is None:
          image_id = b.build_image(job_mode, **build_image_kwargs)
  
      base_cmd = _run_cmd(job_mode, run_args)
  
      command = base_cmd + [image_id] + script_args
  
      logging.info("Running command: {}".format(" ".join(command)))
      subprocess.call(command)
      return None
  
imports: from __future__ import absolute_import, division, print_function
  from datetime import datetime
  import json
  import os
  import subprocess
  import sys
  import traceback
  from typing import Any, Dict, Iterable, List, Optional
  import tqdm
  from absl import logging
  from blessings import Terminal
  from tqdm.utils import _screen_shape_wrapper
  import caliban.config
  import caliban.config.experiment
  import caliban.docker.build
  import caliban.util
  import caliban.util.fs
  import caliban.util.metrics
  import caliban.util.tqdm
  from caliban.history.types import Experiment, Job, JobSpec, JobStatus, Platform
  from caliban.history.util import create_experiments, generate_container_spec, get_mem_engine, get_sql_engine, session_scope
label_desc: Use image node_id 10 for calling a global function with example usage: run(job_mode, run_args, script_args, image_id) and returns: None