code: def test_key_error_exception_if_example_specs_is_malformed():
      features = features_lib.FeaturesDict(
          {"doesnotexist": features_lib.Text()}
      )
      serialized_example = tf_example_pb2.Example(
          features=tf_feature_pb2.Features(
              feature={
                  "array_of_ints": tf_feature_pb2.Feature(
                      int64_list=tf_feature_pb2.Int64List(
                          value=[2, 3, 4]
                      )
                  ),
              }
          )
      ).SerializeToString()
      example_specs = features.get_tensor_info()
      example_parser_np = example_parser.ExampleParserNp(example_specs)
      with pytest.raises(
          KeyError,
          match="(.|\n)*array_of_ints is found in the feature, but not in*",
      ):
          example_parser_np.parse_example(serialized_example)
  
file_path: datasets/tensorflow_datasets/core/example_parser_test.py
imports: import numpy
  import pytest
  from tensorflow_datasets.core import example_parser
  from tensorflow_datasets.core import features
  from tensorflow_datasets.proto import tf_example_pb2
  from tensorflow_datasets.proto import tf_feature_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: test_key_error_exception_if_example_specs_is_malformed() without return types