code: def test_save_and_load_tokenizer(self):
      # safety check on max_len default value so we are sure the test works
      tokenizers = self.get_tokenizers()
      for tokenizer in tokenizers:
          with self.subTest(f"{tokenizer.__class__.__name__}"):
              self.assertNotEqual(tokenizer.model_max_length, 42)
  
      # Now let's start the test
      tokenizers = self.get_tokenizers()
      for tokenizer in tokenizers:
          with self.subTest(f"{tokenizer.__class__.__name__}"):
              # Isolate this from the other tests because we save additional tokens/etc
              words, boxes = self.get_words_and_boxes()
              tmpdirname = tempfile.mkdtemp()
  
              before_tokens = tokenizer.encode(
                  words, boxes=boxes, add_special_tokens=False
              )
              before_vocab = tokenizer.get_vocab()
              tokenizer.save_pretrained(tmpdirname)
  
              after_tokenizer = tokenizer.__class__.from_pretrained(
                  tmpdirname
              )
              after_tokens = after_tokenizer.encode(
                  words, boxes=boxes, add_special_tokens=False
              )
              after_vocab = after_tokenizer.get_vocab()
              self.assertListEqual(before_tokens, after_tokens)
              self.assertDictEqual(before_vocab, after_vocab)
  
              shutil.rmtree(tmpdirname)
  
imports: import inspect
  import shutil
  import tempfile
  import unittest
  from typing import List
  from transformers import AddedToken, LayoutXLMTokenizerFast, SpecialTokensMixin, is_tf_available, is_torch_available, logging
  from transformers.models.layoutxlm.tokenization_layoutxlm import LayoutXLMTokenizer
  from transformers.testing_utils import get_tests_dir, is_pt_tf_cross_test, require_pandas, require_scatter, require_sentencepiece, require_tokenizers, require_torch, slow
  from ...test_tokenization_common import SMALL_TRAINING_CORPUS, TokenizerTesterMixin, filter_non_english, merge_model_tokenizer_mappings
label_desc: Use image node_id 29 for calling the LayoutXLMTokenizationTest obj's underlying member method code with example usage: obj.test_save_and_load_tokenizer() without return types