code: def test_multilabels_with_intent_max_history_tracker_featurizer(
      moodbot_domain: Domain,
      max_history: Optional[int],
      remove_duplicates: bool,
  ):
      state_featurizer = IntentTokenizerSingleStateFeaturizer()
      tracker_featurizer = IntentMaxHistoryTrackerFeaturizer(
          state_featurizer,
          max_history=max_history,
          remove_duplicates=remove_duplicates,
      )
  
      event_list1 = [
          ActionExecuted(ACTION_LISTEN_NAME),
          user_uttered("greet"),
          ActionExecuted("utter_greet"),
          ActionExecuted(ACTION_LISTEN_NAME),
          user_uttered("mood_great"),
      ]
      tracker1 = DialogueStateTracker.from_events(
          "default", event_list1, domain=moodbot_domain
      )
      event_list2 = [
          ActionExecuted(ACTION_LISTEN_NAME),
          user_uttered("greet"),
          ActionExecuted("utter_greet"),
          ActionExecuted(ACTION_LISTEN_NAME),
          user_uttered("mood_unhappy"),
      ]
      tracker2 = DialogueStateTracker.from_events(
          "default", event_list2, domain=moodbot_domain
      )
  
      _1, actual_labels, _2 = tracker_featurizer.featurize_trackers(
          [tracker1, tracker2], moodbot_domain, precomputations=None
      )
  
      greet_index = 5
      mood_great_index = 6
      mood_unhappy_index = 7
  
      if remove_duplicates:
          expected_labels = np.array(
              [
                  [greet_index, -1],
                  [mood_great_index, mood_unhappy_index],
              ]
          )
      else:
          expected_labels = np.array(
              [
                  [greet_index, -1],
                  [mood_great_index, mood_unhappy_index],
                  [greet_index, -1],
                  [mood_great_index, mood_unhappy_index],
              ]
          )
  
      assert actual_labels is not None
      assert actual_labels.shape == expected_labels.shape
  
      # Order of label indices may be different,
      # hence need to sort the indices and then check.
      for actual_label_indices, expected_label_indices in zip(
          actual_labels, expected_labels
      ):
          assert sorted(actual_label_indices) == sorted(
              expected_label_indices
          )
  
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 39 for calling a global function with example usage: test_multilabels_with_intent_max_history_tracker_featurizer(moodbot_domain, max_history, remove_duplicates) without return types