code: def test_batch_encode_plus_batch_sequence_length(self):
      # Tests that all encoded values have the correct size
      tokenizers = self.get_tokenizers(do_lower_case=False)
      for tokenizer in tokenizers:
          with self.subTest(f"{tokenizer.__class__.__name__}"):
              nodes, xpaths = self.get_nodes_and_xpaths_batch()
  
              encoded_sequences = [
                  tokenizer.encode_plus(
                      nodes_example, xpaths=xpaths_example
                  )
                  for nodes_example, xpaths_example in zip(
                      nodes, xpaths
                  )
              ]
              encoded_sequences_batch = tokenizer.batch_encode_plus(
                  nodes, is_pair=False, xpaths=xpaths, padding=False
              )
              self.assertListEqual(
                  encoded_sequences,
                  self.convert_batch_encode_plus_format_to_encode_plus(
                      encoded_sequences_batch
                  ),
              )
  
              maximum_length = len(
                  max(
                      [
                          encoded_sequence["input_ids"]
                          for encoded_sequence in encoded_sequences
                      ],
                      key=len,
                  )
              )
  
              # check correct behaviour if no pad_token_id exists and add it eventually
              self._check_no_pad_token_padding(tokenizer, nodes)
  
              encoded_sequences_padded = [
                  tokenizer.encode_plus(
                      nodes_example,
                      xpaths=xpaths_example,
                      max_length=maximum_length,
                      padding="max_length",
                  )
                  for nodes_example, xpaths_example in zip(
                      nodes, xpaths
                  )
              ]
  
              encoded_sequences_batch_padded = (
                  tokenizer.batch_encode_plus(
                      nodes, is_pair=False, xpaths=xpaths, padding=True
                  )
              )
              self.assertListEqual(
                  encoded_sequences_padded,
                  self.convert_batch_encode_plus_format_to_encode_plus(
                      encoded_sequences_batch_padded
                  ),
              )
  
              # check 'longest' is unsensitive to a max length
              encoded_sequences_batch_padded_1 = (
                  tokenizer.batch_encode_plus(
                      nodes, is_pair=False, xpaths=xpaths, padding=True
                  )
              )
              encoded_sequences_batch_padded_2 = (
                  tokenizer.batch_encode_plus(
                      nodes,
                      is_pair=False,
                      xpaths=xpaths,
                      max_length=maximum_length + 10,
                      padding="longest",
                  )
              )
              for key in encoded_sequences_batch_padded_1.keys():
                  self.assertListEqual(
                      encoded_sequences_batch_padded_1[key],
                      encoded_sequences_batch_padded_2[key],
                  )
  
              # check 'no_padding' is unsensitive to a max length
              encoded_sequences_batch_padded_1 = (
                  tokenizer.batch_encode_plus(
                      nodes, is_pair=False, xpaths=xpaths, padding=False
                  )
              )
              encoded_sequences_batch_padded_2 = (
                  tokenizer.batch_encode_plus(
                      nodes,
                      is_pair=False,
                      xpaths=xpaths,
                      max_length=maximum_length + 10,
                      padding=False,
                  )
              )
              for key in encoded_sequences_batch_padded_1.keys():
                  self.assertListEqual(
                      encoded_sequences_batch_padded_1[key],
                      encoded_sequences_batch_padded_2[key],
                  )
  
imports: import inspect
  import json
  import os
  import re
  import shutil
  import tempfile
  import unittest
  from typing import List
  from transformers import AddedToken, MarkupLMTokenizerFast, SpecialTokensMixin, is_tf_available, is_torch_available, logging
  from transformers.models.markuplm.tokenization_markuplm import VOCAB_FILES_NAMES, MarkupLMTokenizer
  from transformers.testing_utils import is_pt_tf_cross_test, require_tokenizers, require_torch, slow
  from ...test_tokenization_common import SMALL_TRAINING_CORPUS, TokenizerTesterMixin, merge_model_tokenizer_mappings
label_desc: Use image node_id 18 for calling the MarkupLMTokenizationTest obj's underlying member method code with example usage: obj.test_batch_encode_plus_batch_sequence_length() without return types