class_docstr: Tests FeatureExpectations with full encode-decode.
code: def _assert_feature(
      self,
      feature,
      shape,
      dtype,
      tests,
      serialized_info=None,
      test_tensor_spec=True,
      skip_feature_tests=False,
      test_attributes=None,
  ):
      with self._subTest("shape"):
          self.assertEqual(feature.shape, shape)
      with self._subTest("dtype"):
          self.assertEqual(feature.dtype, dtype)
          tree_utils.map_structure(
              enp.lazy.is_np_dtype, feature.np_dtype
          )
          tree_utils.map_structure(
              enp.lazy.is_tf_dtype, feature.tf_dtype
          )
  
      # Check the serialized features
      if serialized_info:
          with self._subTest("serialized_info"):
              self.assertEqual(
                  serialized_info,
                  feature.get_serialized_info(),
              )
  
      if not skip_feature_tests and test_attributes:
          for key, value in test_attributes.items():
              self.assertEqual(getattr(feature, key), value)
  
imports: import contextlib
  import dataclasses
  import functools
  from typing import Any, Optional, Type
  import dill
  from etils import enp
  import numpy
  from tensorflow_datasets.core import dataset_utils
  from tensorflow_datasets.core import features
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.data_sources import python
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.utils import tree_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  from tensorflow_datasets.testing import test_case
  from tensorflow_datasets.testing import test_utils
label_desc: Use image node_id 3 for calling the FeatureExpectationsTestCase obj's underlying member method code with example usage: obj._assert_feature(feature, shape, dtype, tests, serialized_info, test_tensor_spec, skip_feature_tests, test_attributes) without return types