code: def _filter_features(
      features: Optional[List["Features"]], featurizers: List[Text]
  ) -> Optional[List["Features"]]:
      """Filter the given features.
  
      Return only those features that are coming from one of the given featurizers.
  
      Args:
          features: list of features
          featurizers: names of featurizers to consider
  
      Returns:
          The filtered list of features.
      """
      if features is None or not featurizers:
          return features
  
      # it might be that the list of features also contains some tag_ids
      # the origin of the tag_ids is set to TAG_ID_ORIGIN
      # add TAG_ID_ORIGIN to the list of featurizers to make sure that we keep the
      # tag_ids
      featurizers.append(TAG_ID_ORIGIN)
  
      # filter the features
      return [f for f in features if f.origin in featurizers]
  
imports: import typing
  import copy
  import numpy
  import scipy.sparse
  from collections import defaultdict, OrderedDict
  from typing import List, Optional, Text, Dict, Tuple, Union, Any, DefaultDict, cast
  from rasa.nlu.constants import TOKENS_NAMES
  from rasa.utils.tensorflow.model_data import Data, FeatureArray, ragged_array_to_ndarray
  from rasa.utils.tensorflow.constants import MASK, IDS
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.constants import TEXT, ENTITIES, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_GROUP, ENTITY_ATTRIBUTE_ROLE
label_desc: Use image node_id 5 for calling a global function with example usage: _filter_features(features, featurizers) and returns: unknown, features