code: def testExtractUnbatchedInputsRaisesChainedException(self):
      batched_extracts = {
          "features": [
              {
                  "label": np.array([1.0]),
                  "fixed_int": np.array([1]),
              },
              {
                  "label": np.array([2.0]),
                  "fixed_int": np.array([2]),
              },
          ],
          "labels": [
              np.array([1.0]),
          ],
      }
      with self.assertRaisesRegex(
          RuntimeError,
          "Exception encountered while adding key .* with batched length .",
      ) as ctx:
          unbatch_extractor._extract_unbatched_inputs(batched_extracts)
      self.assertIsInstance(ctx.exception.__cause__, ValueError)
      self.assertRegex(
          str(ctx.exception.__cause__),
          r"Length of values \(.\) does not match length of index \(.\)",
      )
  
imports: 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.eval_saved_model import testutil
  from tensorflow_model_analysis.extractors import example_weights_extractor
  from tensorflow_model_analysis.extractors import features_extractor
  from tensorflow_model_analysis.extractors import labels_extractor
  from tensorflow_model_analysis.extractors import materialized_predictions_extractor
  from tensorflow_model_analysis.extractors import unbatch_extractor
  from tensorflow_model_analysis.proto import config_pb2
  from tfx_bsl.tfxio import test_util
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 1 for calling the UnbatchExtractorTest obj's underlying member method code with example usage: obj.testExtractUnbatchedInputsRaisesChainedException() without return types