code: def _test(self, kwargs, expected_values=None, expected_err=None):
      with self.cached_session() as sess:
          if expected_err:
              with self.assertRaisesWithPredicateMatch(
                  expected_err[0], expected_err[1]
              ):
                  out = parsing_ops.parse_single_example(**kwargs)
                  sess.run(
                      flatten_values_tensors_or_sparse(out.values())
                  )
              return
          else:
              # Returns dict w/ Tensors and SparseTensors.
              out = parsing_ops.parse_single_example(**kwargs)
              # Also include a test with the example names specified to retain
              # code coverage of the unfused version, and ensure that the two
              # versions produce the same results.
              out_with_example_name = parsing_ops.parse_single_example(
                  example_names="name", **kwargs
              )
              for result_dict in [out, out_with_example_name]:
                  result = flatten_values_tensors_or_sparse(
                      result_dict.values()
                  )
                  # Check values.
                  tf_result = self.evaluate(result)
                  _compare_output_to_expected(
                      self, result_dict, expected_values, tf_result
                  )
  
          for k, f in kwargs["features"].items():
              if (
                  isinstance(f, parsing_ops.FixedLenFeature)
                  and f.shape is not None
              ):
                  self.assertEqual(
                      tuple(out[k].get_shape().as_list()), f.shape
                  )
              elif isinstance(f, parsing_ops.VarLenFeature):
                  self.assertEqual(
                      tuple(out[k].indices.get_shape().as_list()),
                      (None, 1),
                  )
                  self.assertEqual(
                      tuple(out[k].values.get_shape().as_list()),
                      (None,),
                  )
                  self.assertEqual(
                      tuple(out[k].dense_shape.get_shape().as_list()),
                      (1,),
                  )
  
imports: import itertools
  import numpy
  from tensorflow.core.example import example_pb2
  from tensorflow.core.example import feature_pb2
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import parsing_ops
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 1 for calling the ParseExampleTest obj's underlying member method code with example usage: obj._test(kwargs, expected_values, expected_err) without return types