code: def test_filter_features(self):
      store = tf_testdata_utils.get_tfx_pipeline_metadata_store(
          self.tmp_db_path
      )
      stats = store.get_artifacts_by_id(
          [tf_testdata_utils.TFX_0_21_STATS_ARTIFACT_ID]
      )
      dataset_stats = tf_utils.read_stats_protos(stats[-1].uri)[
          0
      ].datasets[0]
  
      one_half_of_the_features = _DATASET_FEATURES[:27]
      the_other_half_of_the_features = _DATASET_FEATURES[27:]
  
      with self.subTest(name="features_include"):
          filtered_features = [
              feature.path.step[0]
              for feature in tf_utils.filter_features(
                  dataset_stats,
                  features_include=one_half_of_the_features,
              ).features
          ]
          self.assertSameElements(
              one_half_of_the_features, filtered_features
          )
      with self.subTest(name="features_exclude"):
          filtered_features = [
              feature.path.step[0]
              for feature in tf_utils.filter_features(
                  dataset_stats,
                  features_exclude=one_half_of_the_features,
              ).features
          ]
          self.assertSameElements(
              the_other_half_of_the_features, filtered_features
          )
      with self.subTest(
          name="both features_include and features_exclude (invalid)"
      ):
          with self.assertRaises(ValueError):
              tf_utils.filter_features(
                  dataset_stats,
                  features_include=one_half_of_the_features,
                  features_exclude=the_other_half_of_the_features,
              )
      with self.subTest(
          name="neither features_include nor features_exclude (invalid)"
      ):
          with self.assertRaises(ValueError):
              tf_utils.filter_features(dataset_stats)
  
imports: import os
  import uuid
  import ml_metadata
  import tensorflow_model_analysis
  from absl.testing import absltest
  from ml_metadata.proto import metadata_store_pb2
  from model_card_toolkit.model_card import ModelCard, PerformanceMetric
  from model_card_toolkit.utils import tf_utils
  from model_card_toolkit.utils.testdata import tf_testdata_utils
label_desc: Use image node_id 19 for calling the TfUtilsTest obj's underlying member method code with example usage: obj.test_filter_features() without return types