code: def test_convert_intent_labels_to_ids(domain: Domain):
      trackers_as_intents = [
          ["next_intent", "nlu_fallback", "out_of_scope", "restart"],
          ["greet", "hello", "affirm"],
      ]
  
      tracker_featurizer = IntentMaxHistoryTrackerFeaturizer()
  
      actual_labels = tracker_featurizer._convert_labels_to_ids(
          trackers_as_intents, domain
      )
  
      expected_labels = np.array(
          [
              [
                  domain.intents.index("next_intent"),
                  domain.intents.index("nlu_fallback"),
                  domain.intents.index("out_of_scope"),
                  domain.intents.index("restart"),
              ],
              [
                  domain.intents.index("greet"),
                  domain.intents.index("hello"),
                  domain.intents.index("affirm"),
                  LABEL_PAD_ID,
              ],
          ]
      )
      assert expected_labels.size == actual_labels.size
      assert expected_labels.shape == actual_labels.shape
      assert np.all(expected_labels == actual_labels)
  
imports: from typing import Text, Dict, List, Optional
  import numpy
  import pytest
  from rasa.core.featurizers.single_state_featurizer import SingleStateFeaturizer
  from rasa.core.featurizers.single_state_featurizer import IntentTokenizerSingleStateFeaturizer
  from rasa.core.featurizers.tracker_featurizers import TrackerFeaturizer
  from rasa.core.featurizers.tracker_featurizers import MaxHistoryTrackerFeaturizer
  from rasa.core.featurizers.tracker_featurizers import IntentMaxHistoryTrackerFeaturizer
  from rasa.core.featurizers.tracker_featurizers import FullDialogueTrackerFeaturizer
  from rasa.shared.core.domain import Domain
  from tests.core.utilities import user_uttered
  from rasa.shared.nlu.training_data.features import Features
  from rasa.shared.nlu.constants import INTENT, ACTION_NAME
  from rasa.shared.core.constants import ACTION_LISTEN_NAME, ACTION_UNLIKELY_INTENT_NAME, USER, PREVIOUS_ACTION
  from rasa.shared.core.events import ActionExecuted
  from rasa.shared.core.trackers import DialogueStateTracker
  from rasa.utils.tensorflow.constants import LABEL_PAD_ID
  from rasa.utils.tensorflow.model_data import ragged_array_to_ndarray
  from rasa.core.exceptions import InvalidTrackerFeaturizerUsageError
label_desc: Use image node_id 4 for calling a global function with example usage: test_convert_intent_labels_to_ids(domain) without return types