class_docstr: Stores the features produced by any featurizer.
class_docstr_tok: ["Stores","the","features","produced","by","any","featurizer","."]
docstr: Combines features of same type and level into one Feature.
  
  Args:
     features_list: list of Features which must all describe the same attribute
     expected_origins: if specified, this list will be used to validate that
       the features from the right featurizers are combined in the right order
       (cf. `Features.combine`)
  
  Returns:
      a list of the combined Features, i.e. at most 4 Features, where
      - all the sparse features are listed before the dense features
      - sequence feature is always listed before the sentence feature with the
        same sparseness property
docstr_tok: ["Combines","features","of","same","type","and","level","into","one","Feature",".","Args",":","features_list",":","list","of","Features","which","must","all","describe","the","same","attribute","expected_origins",":","if","specified",",","this","list","will","be","used","to","validate","that","the","features","from","the","right","featurizers","are","combined","in","the","right","order","(","cf",".","`","Features.combine","`",")","Returns",":","a","list","of","the","combined","Features",",","i.e",".","at","most","4","Features",",","where","-","all","the","sparse","features","are","listed","before","the","dense","features","-","sequence","feature","is","always","listed","before","the","sentence","feature","with","the","same","sparseness","property"]
code: def reduce(
      features_list: List[Features],
      expected_origins: Optional[List[Text]] = None,
  ) -> List[Features]:
      """Combines features of same type and level into one Feature.
  
      Args:
         features_list: list of Features which must all describe the same attribute
         expected_origins: if specified, this list will be used to validate that
           the features from the right featurizers are combined in the right order
           (cf. `Features.combine`)
  
      Returns:
          a list of the combined Features, i.e. at most 4 Features, where
          - all the sparse features are listed before the dense features
          - sequence feature is always listed before the sentence feature with the
            same sparseness property
      """
      if len(features_list) == 1:
          return features_list
      # sanity check
      different_settings = set(f.attribute for f in features_list)
      if len(different_settings) > 1:
          raise ValueError(
              f"Expected all Features to describe the same attribute but found "
              f" {different_settings}."
          )
      output = []
      for is_sparse in [True, False]:
          # all sparse features before all dense features
          for type in [FEATURE_TYPE_SEQUENCE, FEATURE_TYPE_SENTENCE]:
              # sequence feature that is (not) sparse before sentence feature that is
              # (not) sparse
              sublist = Features.filter(
                  features_list=features_list,
                  type=type,
                  is_sparse=is_sparse,
              )
              if sublist:
                  combined_feature = Features.combine(
                      sublist, expected_origins=expected_origins
                  )
                  output.append(combined_feature)
      return output
  
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 15 for calling the Features obj's underlying member method code with example usage: obj.reduce(features_list, expected_origins) and returns: output, features_list