code: def _dist_search_fn(temp_dir, study_id, tuner_id):
      """Multi-process safe tuner instantiation and tuner.search()."""
  
      # Jitter instantiation so as to avoid contention on study
      # creation and dataset download.
      time.sleep(
          int(tuner_id[5:]) * 20
      )  # tuner_id is formatted as 'tuner%d'
  
      # Dataset must be loaded independently in sub-process.
      (x, y), (val_x, val_y) = _load_data(temp_dir)
  
      tuner = CloudTuner(
          _build_model,
          project_id=_PROJECT_ID,
          region=_REGION,
          objective="acc",
          hyperparameters=_HPS,
          max_trials=5,
          study_id=study_id,
          directory=os.path.join(temp_dir, study_id, tuner_id),
      )
      tuner.tuner_id = tuner_id
  
      tuner.search(
          x=x,
          y=y,
          epochs=2,
          steps_per_epoch=20,
          validation_steps=10,
          validation_data=(val_x, val_y),
      )
      return tuner
  
imports: import contextlib
  import io
  import multiprocessing
  import os
  import re
  import time
  import keras_tuner
  import tensorflow
  from tensorflow import keras
  from tensorflow_cloud import CloudTuner
  from tensorflow_cloud.tuner import vizier_client
label_desc: Use image node_id 3 for calling a global function with example usage: _dist_search_fn(temp_dir, study_id, tuner_id) and returns: tuner