docstr: Truncates a sequence pair in place to the maximum length.
  This is a simple heuristic which will always truncate the longer
  sequence one token at a time. This makes more sense than
  truncating an equal percent of tokens from each, since if one
  sequence is very short then each token that's truncated likely
  contains more information than a longer sequence.
docstr_tok: ["Truncates","a","sequence","pair","in","place","to","the","maximum","length",".","This","is","a","simple","heuristic","which","will","always","truncate","the","longer","sequence","one","token","at","a","time",".","This","makes","more","sense","than","truncating","an","equal","percent","of","tokens","from","each",",","since","if","one","sequence","is","very","short","then","each","token","that","'s","truncated","likely","contains","more","information","than","a","longer","sequence","."]
code: def _truncate_seq_pair(self, tokens_a, tokens_b, max_length):
      """Truncates a sequence pair in place to the maximum length.
      This is a simple heuristic which will always truncate the longer
      sequence one token at a time. This makes more sense than
      truncating an equal percent of tokens from each, since if one
      sequence is very short then each token that's truncated likely
      contains more information than a longer sequence."""
  
      if not tokens_b:
          max_length += 1
  
      while True:
          total_length = len(tokens_a) + len(tokens_b)
          if total_length <= max_length:
              break
          if len(tokens_a) > len(tokens_b):
              tokens_a.pop()
          else:
              tokens_b.pop()
  
      tokens_a.append(BertTokens.SEP)
  
      if tokens_b:
          tokens_b.append(BertTokens.SEP)
  
      return [tokens_a, tokens_b]
  
imports: import logging
  import warnings
  from collections.abc import Iterable
  from enum import Enum
  import torch
  from pytorch_pretrained_bert.tokenization import BertTokenizer
  from tqdm import tqdm
  import numpy
  import torch.nn
  from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset
  from pytorch_pretrained_bert.modeling import BertForSequenceClassification
  from pytorch_pretrained_bert.optimization import BertAdam
  from interpret_text.experimental.common.utils_pytorch import get_device, move_to_device
  from interpret_text.experimental.common.constants import BertTokens
  from collections import namedtuple
  from cached_property import cached_property
label_desc: Use image node_id 3 for calling the Tokenizer obj's underlying member method code with example usage: obj._truncate_seq_pair(tokens_a, tokens_b, max_length) and returns: list