class_docstr: Stores the features produced by any featurizer.
class_docstr_tok: ["Stores","the","features","produced","by","any","featurizer","."]
docstr: Filters the given list of features.
  
  Args:
    features_list: list of features to be filtered
    attributes: List of attributes that we're interested in. Set this to `None`
      to disable this filter.
    type: The type of feature we're interested in. Set this to `None`
      to disable this filter.
    origin: If specified, this method will check that the exact order of origins
      matches the given list of origins. The reason for this is that if
      multiple origins are listed for a Feature, this means that this feature
      has been created by concatenating Features from the listed origins in
      that particular order.
    is_sparse: Defines whether all features that we're interested in should be
      sparse. Set this to `None` to disable this filter.
  
  Returns:
      sub-list of features with the desired properties
docstr_tok: ["Filters","the","given","list","of","features",".","Args",":","features_list",":","list","of","features","to","be","filtered","attributes",":","List","of","attributes","that","we","'re","interested","in",".","Set","this","to","`","None","`","to","disable","this","filter",".","type",":","The","type","of","feature","we","'re","interested","in",".","Set","this","to","`","None","`","to","disable","this","filter",".","origin",":","If","specified",",","this","method","will","check","that","the","exact","order","of","origins","matches","the","given","list","of","origins",".","The","reason","for","this","is","that","if","multiple","origins","are","listed","for","a","Feature",",","this","means","that","this","feature","has","been","created","by","concatenating","Features","from","the","listed","origins","in","that","particular","order",".","is_sparse",":","Defines","whether","all","features","that","we","'re","interested","in","should","be","sparse",".","Set","this","to","`","None","`","to","disable","this","filter",".","Returns",":","sub-list","of","features","with","the","desired","properties"]
code: def filter(
      features_list: List[Features],
      attributes: Optional[Iterable[Text]] = None,
      type: Optional[Text] = None,
      origin: Optional[List[Text]] = None,
      is_sparse: Optional[bool] = None,
  ) -> List[Features]:
      """Filters the given list of features.
  
      Args:
        features_list: list of features to be filtered
        attributes: List of attributes that we're interested in. Set this to `None`
          to disable this filter.
        type: The type of feature we're interested in. Set this to `None`
          to disable this filter.
        origin: If specified, this method will check that the exact order of origins
          matches the given list of origins. The reason for this is that if
          multiple origins are listed for a Feature, this means that this feature
          has been created by concatenating Features from the listed origins in
          that particular order.
        is_sparse: Defines whether all features that we're interested in should be
          sparse. Set this to `None` to disable this filter.
  
      Returns:
          sub-list of features with the desired properties
      """
      filtered = features_list
      if attributes is not None:
          attributes = set(attributes)
          filtered = [f for f in filtered if f.attribute in attributes]
      if origin is not None:
          filtered = [
              f
              for f in filtered
              if (
                  f.origin
                  if not isinstance(f.origin, Text)
                  else list([f.origin])
              )
              == origin
          ]
      if type is not None:
          filtered = [f for f in filtered if f.type == type]
      if is_sparse is not None:
          filtered = [f for f in filtered if f.is_sparse() == is_sparse]
      return filtered
  
imports: from __future__ import annotations
  from typing import Iterable, Union, Text, Optional, List, Any, Tuple, Dict, Set
  import itertools
  import numpy
  import scipy.sparse
  import rasa.shared.utils.io
  import rasa.shared.nlu.training_data.util
  from rasa.shared.nlu.constants import FEATURE_TYPE_SEQUENCE, FEATURE_TYPE_SENTENCE
label_desc: Use image node_id 12 for calling the Features obj's underlying member method code with example usage: obj.filter(features_list, attributes, type, origin, is_sparse) and returns: filtered