code: def test_filter(is_sparse: bool, type: Text, number: int):
      (
          features_list,
          modifications,
      ) = _generate_feature_list_and_modifications(
          is_sparse=is_sparse, type=type, number=number
      )
  
      # fix the filter configuration first (note: we ignore origin on purpose for now)
      filter_config = dict(
          attributes=["fixed-attribute"], type=type, is_sparse=is_sparse
      )
  
      # we get all features back if all features map...
      result = Features.filter(features_list, **filter_config)
      assert len(result) == number
  
      # ... and less matches if we change the (relevant) properties of some features
      modified_features = [
          Features(**config)
          for config in modifications
          if set(config.keys()).intersection(filter_config.keys())
      ]
      if number > 1:
          for modified_feature in modified_features:
              features_list_copy = features_list.copy()
              features_list_copy[-1] = modified_feature
              result = Features.filter(
                  features_list_copy, **filter_config
              )
              assert len(result) == number - 1
      if number > 2:
          for feat_a, feat_b in itertools.combinations(
              modified_features, 2
          ):
              features_list_copy = features_list.copy()
              features_list_copy[-1] = feat_a
              features_list_copy[-2] = feat_b
              result = Features.filter(
                  features_list_copy, **filter_config
              )
              assert len(result) == number - 2
  
      # don't forget to check the origin
      filter_config = dict(
          attributes=["fixed-attribute"],
          type=type,
          origin=["origin-0"],
          is_sparse=is_sparse,
      )
      result = Features.filter(features_list, **filter_config)
      assert len(result) == 1
  
imports: import itertools
  from typing import Optional, Text, List, Dict, Tuple, Any
  import numpy
  import pytest
  import scipy.sparse
  from rasa.shared.nlu.training_data.features import Features
  from rasa.shared.nlu.constants import FEATURE_TYPE_SENTENCE, FEATURE_TYPE_SEQUENCE, TEXT, INTENT
label_desc: Use image node_id 10 for calling a global function with example usage: test_filter(is_sparse, type, number) without return types