code: def load_state(trial_id, checkpoint_directory):
      checkpoint_directory = pathlib.Path(checkpoint_directory)
      with checkpoint_directory.joinpath("state").open("r") as f:
          x, steps_completed, ckpt_trial_id = [
              int(field) for field in f.read().split(",")
          ]
      if ckpt_trial_id == trial_id:
          return x, steps_completed
      else:
          return x, 0
  
file_path: determined/e2e_tests/tests/fixtures/custom_searcher/model_coreapi.py
imports: import logging
  import pathlib
  import sys
  import determined
  from determined.common import util
label_desc: Use image node_id 2 for calling a global function with example usage: load_state(trial_id, checkpoint_directory) and returns: x,  steps_completed, x,  int