code: def test_auto_ensemble_estimator_lifecycle(
      self, candidate_pool, want_loss, max_train_steps=30
  ):
      features = {"input_1": [[1.0, 0.0]]}
      labels = [[1.0]]
  
      run_config = tf.estimator.RunConfig(tf_random_seed=42)
      head = tf.contrib.estimator.regression_head(
          loss_reduction=tf.losses.Reduction.SUM_OVER_BATCH_SIZE
      )
  
      optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.01)
      feature_columns = [
          tf.feature_column.numeric_column("input_1", shape=[2])
      ]
  
      def train_input_fn():
          input_features = {}
          for key, feature in features.items():
              input_features[key] = tf.constant(feature, name=key)
          input_labels = tf.constant(labels, name="labels")
          return input_features, input_labels
  
      def test_input_fn():
          input_features = (
              tf.data.Dataset.from_tensors(
                  [tf.constant(features["input_1"])]
              )
              .make_one_shot_iterator()
              .get_next()
          )
          return {"input_1": input_features}, None
  
      estimator = AutoEnsembleEstimator(
          head=head,
          candidate_pool=candidate_pool(
              head, feature_columns, optimizer
          ),
          max_iteration_steps=10,
          force_grow=True,
          model_dir=self.test_subdirectory,
          config=run_config,
      )
  
      # Train for three iterations.
      estimator.train(
          input_fn=train_input_fn, max_steps=max_train_steps
      )
  
      # Evaluate.
      eval_results = estimator.evaluate(
          input_fn=train_input_fn, steps=1
      )
  
      self.assertAllClose(max_train_steps, eval_results["global_step"])
      self.assertAllClose(want_loss, eval_results["loss"], atol=0.3)
  
      # Predict.
      predictions = estimator.predict(input_fn=test_input_fn)
      for prediction in predictions:
          self.assertIsNotNone(prediction["predictions"])
  
      # Export SavedModel.
      def serving_input_fn():
          """Input fn for serving export, starting from serialized example."""
          serialized_example = tf.placeholder(
              dtype=tf.string, shape=(None), name="serialized_example"
          )
          for key, value in features.items():
              features[key] = tf.constant(value)
          return export.SupervisedInputReceiver(
              features=features,
              labels=tf.constant(labels),
              receiver_tensors=serialized_example,
          )
  
      export_dir_base = os.path.join(self.test_subdirectory, "export")
      export_saved_model_fn = getattr(
          estimator, "export_saved_model", None
      )
      if not callable(export_saved_model_fn):
          export_saved_model_fn = estimator.export_savedmodel
      export_saved_model_fn(
          export_dir_base=export_dir_base,
          serving_input_receiver_fn=serving_input_fn,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import os
  import shutil
  import sys
  from absl import flags
  from absl import logging
  from absl.testing import parameterized
  from adanet import tf_compat
  from adanet.autoensemble.common import AutoEnsembleSubestimator
  from adanet.autoensemble.estimator import _GeneratorFromCandidatePool
  from adanet.autoensemble.estimator import AutoEnsembleEstimator
  import tensorflow.compat.v1
  from tensorflow.python.estimator.export import export
label_desc: Use image node_id 3 for calling the AutoEnsembleEstimatorTest obj's underlying member method code with example usage: obj.test_auto_ensemble_estimator_lifecycle(candidate_pool, want_loss, max_train_steps) and returns: input_features,  input_labels, dict,  None, export