code: def test_add_tokens_tokenizer(self):
      tokenizers: List[MarkupLMTokenizer] = self.get_tokenizers(
          do_lower_case=False
      )
      for tokenizer in tokenizers:
          with self.subTest(f"{tokenizer.__class__.__name__}"):
              vocab_size = tokenizer.vocab_size
              all_size = len(tokenizer)
  
              self.assertNotEqual(vocab_size, 0)
  
              # We usually have added tokens from the start in tests because our vocab fixtures are
              # smaller than the original vocabs - let's not assert this
              # self.assertEqual(vocab_size, all_size)
  
              new_toks = ["aaaaa", "bbbbbb", "cccccccccdddddddd"]
              added_toks = tokenizer.add_tokens(new_toks)
              vocab_size_2 = tokenizer.vocab_size
              all_size_2 = len(tokenizer)
  
              self.assertNotEqual(vocab_size_2, 0)
              self.assertEqual(vocab_size, vocab_size_2)
              self.assertEqual(added_toks, len(new_toks))
              self.assertEqual(all_size_2, all_size + len(new_toks))
  
              nodes = "aaaaa bbbbbb low cccccccccdddddddd l".split()
              xpaths = [
                  "/html/body/div/li[1]/div/span"
                  for _ in range(len(nodes))
              ]
  
              tokens = tokenizer.encode(
                  nodes, xpaths=xpaths, add_special_tokens=False
              )
  
              self.assertGreaterEqual(len(tokens), 4)
              self.assertGreater(tokens[0], tokenizer.vocab_size - 1)
              self.assertGreater(tokens[-2], tokenizer.vocab_size - 1)
  
              new_toks_2 = {
                  "eos_token": ">>>>|||<||<<|<<",
                  "pad_token": "<<<<<|||>|>>>>|>",
              }
              added_toks_2 = tokenizer.add_special_tokens(new_toks_2)
              vocab_size_3 = tokenizer.vocab_size
              all_size_3 = len(tokenizer)
  
              self.assertNotEqual(vocab_size_3, 0)
              self.assertEqual(vocab_size, vocab_size_3)
              self.assertEqual(added_toks_2, len(new_toks_2))
              self.assertEqual(all_size_3, all_size_2 + len(new_toks_2))
  
              nodes = ">>>>|||<||<<|<< aaaaabbbbbb low cccccccccdddddddd <<<<<|||>|>>>>|> l".split()
              xpaths = [
                  "/html/body/div/li[1]/div/span"
                  for _ in range(len(nodes))
              ]
  
              tokens = tokenizer.encode(
                  nodes,
                  xpaths=xpaths,
                  add_special_tokens=False,
              )
  
              self.assertGreaterEqual(len(tokens), 6)
              self.assertGreater(tokens[0], tokenizer.vocab_size - 1)
              self.assertGreater(tokens[0], tokens[1])
              self.assertGreater(tokens[-2], tokenizer.vocab_size - 1)
              self.assertGreater(tokens[-2], tokens[-3])
              self.assertEqual(tokens[0], tokenizer.eos_token_id)
              self.assertEqual(tokens[-2], tokenizer.pad_token_id)
  
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 8 for calling the MarkupLMTokenizationTest obj's underlying member method code with example usage: obj.test_add_tokens_tokenizer() without return types