code: def _normalize_feature_item(
      feature: features_lib.FeatureConnector,
      expected_feature: FeatureSpecs,
  ) -> FeatureSpecs:
      """Extracts the features matching the expected_feature structure."""
      # If user provide a FeatureConnector, use this
      if (
          isinstance(expected_feature, features_lib.FeatureConnector)
      ) or (dtype_utils.is_np_or_tf_dtype(expected_feature)):
          return expected_feature
      # If the user provide a bool, use the matching feature connector
      # Example: {'cameras': True} -> `{'camera': FeatureDict({'image': Image()})}`
      elif isinstance(expected_feature, bool):
          assert expected_feature  # `False` values should have been filtered already
          return feature
      # If the user provide a sequence, merge it with the associated feature.
      elif isinstance(expected_feature, (list, set, dict)):
          if isinstance(expected_feature, (list, set)):
              expected_feature = {k: True for k in expected_feature}
          return _normalize_feature_dict(
              feature=feature,
              expected_feature=expected_feature,
          )
      else:
          raise TypeError(
              f"Unexpected partial feature spec: {expected_feature!r}"
          )
  
file_path: datasets/tensorflow_datasets/core/decode/partial_decode.py
imports: import typing
  from typing import Any, Callable, Optional, Union
  from tensorflow_datasets.core import features
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.decode import base
  from tensorflow_datasets.core.features import features_dict
  from tensorflow_datasets.core.utils import dtype_utils
label_desc: Use image node_id 1 for calling a global function with example usage: _normalize_feature_item(feature, expected_feature) and returns: expected_feature, feature, _normalize_feature_dict