class_docstr: Tests FeatureExpectations with full encode-decode.
docstr: Test that the HTML repr works.
docstr_tok: ["Test","that","the","HTML","repr","works","."]
code: def _test_repr(
      self,
      feature: features.FeatureConnector,
      out_numpy: np.ndarray,
  ) -> None:
      """Test that the HTML repr works."""
      # pylint: disable=protected-access
      flat_example = feature._flatten(out_numpy)
      flat_features = feature._flatten(feature)
      flat_serialized_info = feature._flatten(
          feature.get_serialized_info()
      )
      # pylint: enable=protected-access
      for ex, f, spec in zip(
          flat_example, flat_features, flat_serialized_info
      ):
          # Features with multi-data not supported
          if isinstance(spec, dict):
              continue
          # TODO(tfds): Should use `as_dataframe._get_feature` instead, to
          # correctly compute for `sequence_rank` for subclasses like `Video`.
          elif spec.sequence_rank == 0:
              text = f.repr_html(ex)
          elif spec.sequence_rank == 1:
              text = f.repr_html_batch(ex)
          elif spec.sequence_rank > 1:
              text = f.repr_html_ragged(ex)
          self.assertIsInstance(text, str)
  
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 6 for calling the FeatureExpectationsTestCase obj's underlying member method code with example usage: obj._test_repr(feature, out_numpy) without return types