code: def test_long_sequence_splitting(self):
      tokenizer = cached_transformers.get_tokenizer("bert-base-uncased")
      allennlp_tokenizer = PretrainedTransformerTokenizer(
          "bert-base-uncased"
      )
      indexer = PretrainedTransformerIndexer(
          model_name="bert-base-uncased", max_length=4
      )
      string_specials = "[CLS] AllenNLP is great [SEP]"
      string_no_specials = "AllenNLP is great"
      tokens = tokenizer.tokenize(string_specials)
      expected_ids = tokenizer.convert_tokens_to_ids(tokens)
      assert (
          len(expected_ids) == 7
      )  # just to make sure it's what we're expecting
      cls_id, sep_id = expected_ids[0], expected_ids[-1]
      expected_ids = (
          expected_ids[:3]
          + [sep_id, cls_id]
          + expected_ids[3:5]
          + [sep_id, cls_id]
          + expected_ids[5:]
      )
  
      allennlp_tokens = allennlp_tokenizer.tokenize(string_no_specials)
      vocab = Vocabulary()
      indexed = indexer.tokens_to_indices(allennlp_tokens, vocab)
      assert indexed["token_ids"] == expected_ids
      assert indexed["segment_concat_mask"] == [True] * len(
          expected_ids
      )
      assert indexed["mask"] == [True] * 7
  
imports: import pytest
  from allennlp.common import cached_transformers
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Vocabulary
  from allennlp.data.token_indexers import PretrainedTransformerIndexer
  from allennlp.data.tokenizers import PretrainedTransformerTokenizer
label_desc: Use image node_id 9 for calling the TestPretrainedTransformerIndexer obj's underlying member method code with example usage: obj.test_long_sequence_splitting() without return types