code: def _create_spec(ensemble_type="none"):
      output = phoenix_spec_pb2.PhoenixSpec()
      if ensemble_type == "adaptive":
          output.ensemble_spec.ensemble_search_type = (
              ensembling_spec_pb2.EnsemblingSpec.ADAPTIVE_ENSEMBLE_SEARCH
          )
      if ensemble_type == "nonadaptive":
          output.ensemble_spec.ensemble_search_type = (
              ensembling_spec_pb2.EnsemblingSpec.NONADAPTIVE_ENSEMBLE_SEARCH
          )
      return output
  
file_path: model_search/model_search/generators/replay_generator_test.py
imports: from absl.testing import absltest
  import mock
  from model_search.generators import replay_generator
  from model_search.metadata import ml_metadata_db
  from model_search.proto import ensembling_spec_pb2
  from model_search.proto import phoenix_spec_pb2
  import tensorflow.compat.v2
label_desc: Use image node_id 2 for calling a global function with example usage: _create_spec(ensemble_type) and returns: output