code: def test_sequence_length_overflow_train(
      input_sequence_length: int,
      model_name: Text,
      should_overflow: bool,
      create_language_model_featurizer: Callable[
          [Dict[Text, Any]], LanguageModelFeaturizer
      ],
      monkeypatch: MonkeyPatch,
  ):
      monkeypatch.setattr(
          LanguageModelFeaturizer,
          "_load_model_instance",
          lambda _: None,
      )
      component = create_language_model_featurizer(
          {"model_name": model_name}
      )
      message = Message.build(
          text=" ".join(["hi"] * input_sequence_length)
      )
      if should_overflow:
          with pytest.raises(RuntimeError):
              component._validate_sequence_lengths(
                  [input_sequence_length],
                  [message],
                  "text",
                  inference_mode=False,
              )
      else:
          component._validate_sequence_lengths(
              [input_sequence_length],
              [message],
              "text",
              inference_mode=False,
          )
  
imports: import os
  from typing import Text, List, Dict, Tuple, Any, Callable
  import numpy
  import pytest
  import logging
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.logging import LogCaptureFixture
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.storage.resource import Resource
  from rasa.nlu.constants import TOKENS_NAMES, NUMBER_OF_SUB_TOKENS
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.featurizers.dense_featurizer.lm_featurizer import LanguageModelFeaturizer
  from rasa.shared.nlu.constants import TEXT, INTENT
  from rasa.nlu.tokenizers.tokenizer import Token
label_desc: Use image node_id 7 for calling a global function with example usage: test_sequence_length_overflow_train(input_sequence_length, model_name, should_overflow, create_language_model_featurizer, monkeypatch) without return types