code: def _create_ensemble_spec(self, ensembling_type, n):
      ensembling_spec = ensembling_spec_pb2.EnsemblingSpec()
      ensembling_spec.ensemble_search_type = ensembling_type
  
      if (
          ensembling_type
          == ensembling_spec_pb2.EnsemblingSpec.NONADAPTIVE_ENSEMBLE_SEARCH
      ):
          ensembling_spec.nonadaptive_search.minimal_pool_size = n
      elif (
          ensembling_type
          == ensembling_spec_pb2.EnsemblingSpec.ADAPTIVE_ENSEMBLE_SEARCH
      ):
          ensembling_spec.adaptive_search.minimal_pool_size = n
      elif (
          ensembling_type
          == ensembling_spec_pb2.EnsemblingSpec.INTERMIXED_NONADAPTIVE_ENSEMBLE_SEARCH
      ):
          ensembling_spec.intermixed_search.try_ensembling_every = n
  
      return ensembling_spec
  
imports: import functools
  import os
  from absl.testing import absltest
  from absl.testing import parameterized
  import mock
  from model_search import hparam
  from model_search.architecture import architecture_utils
  from model_search.generators import trial_utils
  from model_search.proto import distillation_spec_pb2
  from model_search.proto import ensembling_spec_pb2
  from model_search.proto import phoenix_spec_pb2
  import tensorflow.compat.v2
  from google.protobuf import text_format
label_desc: Use image node_id 1 for calling the TrialUtilsTest obj's underlying member method code with example usage: obj._create_ensemble_spec(ensembling_type, n) and returns: ensembling_spec