class_docstr: Truncates the tracker history into `max_history` long sequences.
  
  Creates training data from trackers where intents are the output prediction
  labels. Tracker state sequences which represent policy input are truncated
  to not excede `max_history` states.
class_docstr_tok: ["Truncates","the","tracker","history","into","`","max_history","`","long","sequences",".","Creates","training","data","from","trackers","where","intents","are","the","output","prediction","labels",".","Tracker","state","sequences","which","represent","policy","input","are","truncated","to","not","excede","`","max_history","`","states","."]
docstr: Pads label ids so that all are of the same length.
  
  Args:
      label_ids: Label ids of varying lengths
  
  Returns:
      Label ids padded to be of uniform length.
docstr_tok: ["Pads","label","ids","so","that","all","are","of","the","same","length",".","Args",":","label_ids",":","Label","ids","of","varying","lengths","Returns",":","Label","ids","padded","to","be","of","uniform","length","."]
code: def _pad_label_ids(label_ids: List[List[int]]) -> List[List[int]]:
      """Pads label ids so that all are of the same length.
  
      Args:
          label_ids: Label ids of varying lengths
  
      Returns:
          Label ids padded to be of uniform length.
      """
      # If `label_ids` is an empty list, no padding needs to be added.
      if not label_ids:
          return label_ids
  
      # Add `LABEL_PAD_ID` padding to labels array so that
      # each example has equal number of labels
      multiple_labels_count = [len(a) for a in label_ids]
      max_labels_count = max(multiple_labels_count)
      num_padding_needed = [
          max_labels_count - len(a) for a in label_ids
      ]
  
      padded_label_ids = []
      for ids, num_pads in zip(label_ids, num_padding_needed):
          padded_row = list(ids) + [LABEL_PAD_ID] * num_pads
          padded_label_ids.append(padded_row)
      return padded_label_ids
  
imports: from __future__ import annotations
  from pathlib import Path
  from collections import defaultdict
  from abc import abstractmethod
  import jsonpickle
  import logging
  from tqdm import tqdm
  from typing import Tuple, List, Optional, Dict, Text, Union, Any, Iterator, Set, DefaultDict, cast
  import numpy
  from rasa.core.featurizers.single_state_featurizer import SingleStateFeaturizer
  from rasa.core.featurizers.precomputation import MessageContainerForCoreFeaturization
  from rasa.core.exceptions import InvalidTrackerFeaturizerUsageError
  import rasa.shared.core.trackers
  import rasa.shared.utils.io
  from rasa.shared.nlu.constants import TEXT, INTENT, ENTITIES, ACTION_NAME
  from rasa.shared.nlu.training_data.features import Features
  from rasa.shared.core.trackers import DialogueStateTracker
  from rasa.shared.core.domain import State, Domain
  from rasa.shared.core.events import Event, ActionExecuted, UserUttered
  from rasa.shared.core.constants import USER, ACTION_UNLIKELY_INTENT_NAME, PREVIOUS_ACTION
  from rasa.shared.exceptions import RasaException
  from rasa.utils.tensorflow.constants import LABEL_PAD_ID
  from rasa.utils.tensorflow.model_data import ragged_array_to_ndarray
label_desc: Use image node_id 2 for calling the IntentMaxHistoryTrackerFeaturizer obj's underlying member method code with example usage: obj._pad_label_ids(label_ids) and returns: padded_label_ids, label_ids