code: def test_container_feature_lookup():
      arbitrary_attribute = "other"
      messages = [
          Message(
              data={TEXT: "A"}, features=[_dummy_features(1, TEXT)]
          ),
          Message(
              data={INTENT: "B", arbitrary_attribute: "C"},
              features=[_dummy_features(2, arbitrary_attribute)],
          ),
          Message(
              data={TEXT: "A2"}, features=[_dummy_features(3, TEXT)]
          ),
          Message(
              data={INTENT: "B2", arbitrary_attribute: "C2"},
              features=[_dummy_features(4, arbitrary_attribute)],
          ),
      ]
  
      table = MessageContainerForCoreFeaturization()
      table.add_all(messages)
  
      # If we don't specify a list of attributes, the resulting features dictionary will
      # only contain those attributes for which there are features.
      sub_state = {TEXT: "A", INTENT: "B", arbitrary_attribute: "C"}
      features = table.collect_features(sub_state=sub_state)
      for attribute, feature_value in [
          (TEXT, 1),
          (INTENT, None),
          (arbitrary_attribute, 2),
      ]:
          if feature_value is not None:
              assert attribute in features
              assert len(features[attribute]) == 1
              assert feature_value == features[attribute][0].features[0]
          else:
              assert attribute not in features
  
      # If we query features for `INTENT`, then a key will be there, even if there are
      # no features
      features = table.collect_features(
          sub_state=sub_state, attributes=list(sub_state.keys())
      )
      assert INTENT in features
      assert len(features[INTENT]) == 0
  
      # We only get the list of features we want...
      features = table.collect_features(
          sub_state, attributes=[arbitrary_attribute]
      )
      assert TEXT not in features
      assert INTENT not in features
      assert len(features[arbitrary_attribute]) == 1
  
      # ... even if there are no features:
      YET_ANOTHER = "another"
      features = table.collect_features(
          sub_state, attributes=[YET_ANOTHER]
      )
      assert len(features[YET_ANOTHER]) == 0
  
imports: import pytest
  import numpy
  import itertools
  from typing import List, Text, Optional, Dict
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.core.featurizers.precomputation import CoreFeaturizationCollector, MessageContainerForCoreFeaturization, CoreFeaturizationInputConverter
  from rasa.shared.nlu.training_data.features import Features
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.constants import INTENT, TEXT, ENTITIES, ACTION_NAME, ACTION_TEXT, INTENT_NAME_KEY, ENTITY_ATTRIBUTE_VALUE, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_ROLE, ENTITY_ATTRIBUTE_GROUP
  from rasa.shared.core.slots import TextSlot
  from rasa.shared.core.domain import Domain
  from rasa.shared.core.events import Event, UserUttered, ActionExecuted
  from rasa.shared.core.training_data.structures import StoryGraph, StoryStep
  from rasa.shared.core.trackers import DialogueStateTracker
label_desc: Use image node_id 12 for calling a global function with example usage: test_container_feature_lookup() without return types