code: def create_tune_experiment_checkpoint(
      trials: list, **runner_kwargs
  ) -> str:
      experiment_dir = tempfile.mkdtemp()
      runner_kwargs.setdefault("experiment_path", experiment_dir)
  
      # Update environment
      orig_env = os.environ.copy()
  
      # Set to 1 to disable ray cluster resource lookup. That way we can
      # create experiment checkpoints without initializing ray.
      os.environ["TUNE_MAX_PENDING_TRIALS_PG"] = "1"
  
      try:
          runner = TuneController(**runner_kwargs)
  
          for trial in trials:
              runner.add_trial(trial)
  
          runner.checkpoint(force=True)
      finally:
          os.environ.clear()
          os.environ.update(orig_env)
  
      return experiment_dir
  
file_path: ray/python/ray/tune/tests/tune_test_util.py
imports: import os
  import tempfile
  from ray.tune import Callback
  from ray.tune.execution.tune_controller import TuneController
label_desc: Use image node_id 1 for calling a global function with example usage: create_tune_experiment_checkpoint(trials) and returns: experiment_dir