code: def testBuildAnalysisTable(self):
      model_location = self._exportEvalSavedModel(
          linear_classifier.simple_linear_classifier
      )
      eval_shared_model = model_eval_lib.default_eval_shared_model(
          eval_saved_model_path=model_location
      )
  
      example1 = self._makeExample(
          age=3.0,
          language="english",
          label=1.0,
          slice_key="first_slice",
      )
  
      with beam.Pipeline() as pipeline:
          result = (
              pipeline
              | "CreateInput"
              >> beam.Create([example1.SerializeToString()])
              | "BuildTable"
              >> contrib.BuildAnalysisTable(
                  eval_shared_model=eval_shared_model
              )
          )
  
          def check_result(got):
              self.assertEqual(1, len(got), "got: %s" % got)
              extracts = got[0]
  
              # Values of type MaterializedColumn are emitted to signal to
              # downstream sink components to output the data to file.
              materialized_dict = dict(
                  (k, v)
                  for k, v in extracts.items()
                  if isinstance(v, types.MaterializedColumn)
              )
              self._assertMaterializedColumns(
                  materialized_dict,
                  {
                      # Slice key
                      "features__slice_key": types.MaterializedColumn(
                          name="features__slice_key",
                          value=[b"first_slice"],
                      ),
                      # Features
                      "features__language": types.MaterializedColumn(
                          name="features__language", value=[b"english"]
                      ),
                      "features__age": types.MaterializedColumn(
                          name="features__age",
                          value=np.array([3.0], dtype=np.float32),
                      ),
                      # Label
                      "features__label": types.MaterializedColumn(
                          name="features__label",
                          value=np.array([1.0], dtype=np.float32),
                      ),
                      "labels": types.MaterializedColumn(
                          name="labels",
                          value=np.array([1.0], dtype=np.float32),
                      ),
                  },
              )
              self._assertMaterializedColumnsExist(
                  materialized_dict,
                  [
                      "predictions__logits",
                      "predictions__probabilities",
                      "predictions__classes",
                      "predictions__logistic",
                      "predictions__class_ids",
                      constants.SLICE_KEYS_KEY,
                  ],
              )
  
          util.assert_that(result[constants.ANALYSIS_KEY], check_result)
  
imports: import os
  import tempfile
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import model_eval_lib
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.contrib import model_eval_lib
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.eval_saved_model.example_trainers import linear_classifier
  from tensorflow_model_analysis.slicer import slicer_lib
label_desc: Use image node_id 5 for calling the BuildAnalysisTableTest obj's underlying member method code with example usage: obj.testBuildAnalysisTable() without return types