code: def test_batch_encode_plus_padding(self):
      # Test that padded sequences are equivalent between batch_encode_plus and encode_plus
  
      # Right padding tests
      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()
  
              max_length = 100
  
              # check correct behaviour if no pad_token_id exists and add it eventually
              self._check_no_pad_token_padding(tokenizer, nodes)
  
              encoded_sequences = [
                  tokenizer.encode_plus(
                      nodes_example,
                      xpaths=xpaths_example,
                      max_length=max_length,
                      padding="max_length",
                  )
                  for nodes_example, xpaths_example in zip(
                      nodes, xpaths
                  )
              ]
              encoded_sequences_batch = tokenizer.batch_encode_plus(
                  nodes,
                  is_pair=False,
                  xpaths=xpaths,
                  max_length=max_length,
                  padding="max_length",
              )
              self.assertListEqual(
                  encoded_sequences,
                  self.convert_batch_encode_plus_format_to_encode_plus(
                      encoded_sequences_batch
                  ),
              )
  
      # Left padding tests
      tokenizers = self.get_tokenizers(do_lower_case=False)
      for tokenizer in tokenizers:
          with self.subTest(f"{tokenizer.__class__.__name__}"):
              tokenizer.padding_side = "left"
              nodes, xpaths = self.get_nodes_and_xpaths_batch()
  
              max_length = 100
  
              # check correct behaviour if no pad_token_id exists and add it eventually
              self._check_no_pad_token_padding(tokenizer, nodes)
  
              encoded_sequences = [
                  tokenizer.encode_plus(
                      nodes_example,
                      xpaths=xpaths_example,
                      max_length=max_length,
                      padding="max_length",
                  )
                  for nodes_example, xpaths_example in zip(
                      nodes, xpaths
                  )
              ]
              encoded_sequences_batch = tokenizer.batch_encode_plus(
                  nodes,
                  is_pair=False,
                  xpaths=xpaths,
                  max_length=max_length,
                  padding="max_length",
              )
              self.assertListEqual(
                  encoded_sequences,
                  self.convert_batch_encode_plus_format_to_encode_plus(
                      encoded_sequences_batch
                  ),
              )
  
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 20 for calling the MarkupLMTokenizationTest obj's underlying member method code with example usage: obj.test_batch_encode_plus_padding() without return types