code: def test_long_sequence_splitting(self):
      tokenizer = cached_transformers.get_tokenizer("bert-base-uncased")
      indexer = PretrainedTransformerMismatchedIndexer(
          "bert-base-uncased", max_length=4
      )
      text = ["AllenNLP", "is", "great"]
      tokens = tokenizer.tokenize(
          " ".join(["[CLS]"] + text + ["[SEP]"])
      )
      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:]
      )
  
      vocab = Vocabulary()
      indexed = indexer.tokens_to_indices(
          [Token(word) for word in text], vocab
      )
  
      assert indexed["token_ids"] == expected_ids
      # [CLS] allen ##nl [SEP] [CLS] #p is [SEP] [CLS] great [SEP]
      assert indexed["segment_concat_mask"] == [True] * len(
          expected_ids
      )
      # allennlp is great
      assert indexed["mask"] == [True] * len(text)
      # [CLS] allen #nl #p is great [SEP]
      assert indexed["wordpiece_mask"] == [True] * 7
  
file_path: allennlp/tests/data/token_indexers/pretrained_transformer_mismatched_indexer_test.py
imports: from allennlp.common import cached_transformers
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Token, Vocabulary
  from allennlp.data.token_indexers import PretrainedTransformerMismatchedIndexer
label_desc: Use image node_id 2 for calling the TestPretrainedTransformerMismatchedIndexer obj's underlying member method code with example usage: obj.test_long_sequence_splitting() without return types