class_docstr: Stores the features produced by any featurizer.
class_docstr_tok: ["Stores","the","features","produced","by","any","featurizer","."]
docstr: Groups the given features according to their attribute.
  
  Args:
    features_list: list of features to be grouped
    attributes: If specified, the result will be a grouping with respect to
      the given attributes. If some specified attribute has no features attached
      to it, then the resulting dictionary will map it to an empty list.
      If this is None, the result will be a grouping according to all attributes
      for which features can be found.
  
  Returns:
     a mapping from the requested attributes to the list of correspoding
     features
docstr_tok: ["Groups","the","given","features","according","to","their","attribute",".","Args",":","features_list",":","list","of","features","to","be","grouped","attributes",":","If","specified",",","the","result","will","be","a","grouping","with","respect","to","the","given","attributes",".","If","some","specified","attribute","has","no","features","attached","to","it",",","then","the","resulting","dictionary","will","map","it","to","an","empty","list",".","If","this","is","None",",","the","result","will","be","a","grouping","according","to","all","attributes","for","which","features","can","be","found",".","Returns",":","a","mapping","from","the","requested","attributes","to","the","list","of","correspoding","features"]
code: def groupby_attribute(
      features_list: List[Features],
      attributes: Optional[Iterable[Text]] = None,
  ) -> Dict[Text, List[Features]]:
      """Groups the given features according to their attribute.
  
      Args:
        features_list: list of features to be grouped
        attributes: If specified, the result will be a grouping with respect to
          the given attributes. If some specified attribute has no features attached
          to it, then the resulting dictionary will map it to an empty list.
          If this is None, the result will be a grouping according to all attributes
          for which features can be found.
  
      Returns:
         a mapping from the requested attributes to the list of correspoding
         features
      """
      # ensure all requested attributes are present in the output - regardless
      # of whether we find features later
      extracted: Dict[Text, List[Features]] = (
          dict()
          if attributes is None
          else {attribute: [] for attribute in attributes}
      )
      # extract features for all (requested) attributes
      for feat in features_list:
          if attributes is None or feat.attribute in attributes:
              extracted.setdefault(feat.attribute, []).append(feat)
      return extracted
  
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 13 for calling the Features obj's underlying member method code with example usage: obj.groupby_attribute(features_list, attributes) and returns: extracted