code: def test_truncate_sequences(caplog):
      caplog.set_level(logging.CRITICAL)
  
      lang_names = [
          "bert-base-cased",
          "roberta-base",
          "xlnet-base-cased",
      ]
      tokenizers = []
      for lang_name in lang_names:
          t = Tokenizer.load(lang_name, lower_case=False)
          tokenizers.append(t)
  
      # artificial sequences (could be tokens, offsets, or anything else)
      seq_a = list(range(10))
      seq_b = list(range(15))
      max_seq_len = 20
      for tokenizer in tokenizers:
          for strategy in [
              "longest_first",
              "only_first",
              "only_second",
          ]:
              trunc_a, trunc_b, overflow = truncate_sequences(
                  seq_a=seq_a,
                  seq_b=seq_b,
                  tokenizer=tokenizer,
                  max_seq_len=max_seq_len,
                  truncation_strategy=strategy,
              )
  
              assert (
                  len(trunc_a)
                  + len(trunc_b)
                  + tokenizer.num_special_tokens_to_add(pair=True)
                  == max_seq_len
              )
  
file_path: FARM/test/test_tokenization.py
imports: import logging
  import pytest
  import re
  from transformers import BertTokenizer, BertTokenizerFast, RobertaTokenizer, RobertaTokenizerFast, XLNetTokenizer, XLNetTokenizerFast, ElectraTokenizerFast
  from tokenizers.pre_tokenizers import WhitespaceSplit
  from farm.modeling.tokenization import Tokenizer, tokenize_with_metadata, truncate_sequences
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: test_truncate_sequences(caplog) without return types