code: def test_extract_features():
      fake_features = np.zeros(shape)
      fake_features_as_features = Features(
          features=fake_features,
          attribute=INTENT,
          feature_type=SENTENCE,
          origin=[],
      )
      # create zero features
      fake_features_list = [fake_features_as_features]
  
      # create tracker state features by setting a random index in the array to 1
      random_inds = np.random.randint(shape, size=6)
      list_of_features = []
      for idx in random_inds:
          current_features = copy.deepcopy(fake_features_as_features)
          current_features.features[idx] = 1
          list_of_features.append([current_features])
  
      # organize the created features into lists ~ dialog history
      tracker_features = [
          [list_of_features[0], None, list_of_features[1]],
          [None, None, list_of_features[2]],
          [
              list_of_features[3],
              list_of_features[4],
              list_of_features[5],
          ],
      ]
  
      (
          attribute_masks,
          dense_features,
          sparse_features,
      ) = model_data_utils._extract_features(
          tracker_features, fake_features_list, INTENT
      )
      expected_mask = np.array([[1, 0, 1], [0, 0, 1], [1, 1, 1]])
  
      assert np.all(
          np.squeeze(np.array(attribute_masks), 2) == expected_mask
      )
      assert (
          np.array(dense_features[SENTENCE]).shape[-1]
          == fake_features.shape[-1]
      )
      assert sparse_features == {}
  
imports: from typing import Any, Text, Optional, Dict, List
  import pytest
  import scipy.sparse
  import numpy
  import copy
  from spacy import Language
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.extractors.extractor import EntityTagSpec
  from rasa.nlu.constants import SPACY_DOCS
  from rasa.nlu.featurizers.dense_featurizer.spacy_featurizer import SpacyFeaturizer
  from rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer import CountVectorsFeaturizer
  from rasa.nlu.tokenizers.spacy_tokenizer import SpacyTokenizer
  from rasa.utils.tensorflow import model_data_utils
  from rasa.shared.nlu.training_data.features import Features
  from rasa.shared.nlu.constants import ACTION_NAME, TEXT, INTENT, ENTITIES, FEATURE_TYPE_SENTENCE, FEATURE_TYPE_SEQUENCE
  from rasa.utils.tensorflow.constants import SENTENCE
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.utils.tensorflow.model_data_utils import TAG_ID_ORIGIN
label_desc: Use image node_id 3 for calling a global function with example usage: test_extract_features() without return types