code: def test_save_sentencepiece_tokenizer(self) -> None:
      if not self.test_sentencepiece or not self.test_slow_tokenizer:
          return
      # We want to verify that we will be able to save the tokenizer even if the original files that were used to
      # build the tokenizer have been deleted in the meantime.
      words, boxes = self.get_words_and_boxes()
  
      tokenizer_slow_1 = self.get_tokenizer()
      encoding_tokenizer_slow_1 = tokenizer_slow_1(
          words,
          boxes=boxes,
      )
  
      tmpdirname_1 = tempfile.mkdtemp()
      tmpdirname_2 = tempfile.mkdtemp()
  
      tokenizer_slow_1.save_pretrained(tmpdirname_1)
      tokenizer_slow_2 = self.tokenizer_class.from_pretrained(
          tmpdirname_1
      )
      encoding_tokenizer_slow_2 = tokenizer_slow_2(
          words,
          boxes=boxes,
      )
  
      shutil.rmtree(tmpdirname_1)
      tokenizer_slow_2.save_pretrained(tmpdirname_2)
  
      tokenizer_slow_3 = self.tokenizer_class.from_pretrained(
          tmpdirname_2
      )
      encoding_tokenizer_slow_3 = tokenizer_slow_3(
          words,
          boxes=boxes,
      )
      shutil.rmtree(tmpdirname_2)
  
      self.assertEqual(
          encoding_tokenizer_slow_1, encoding_tokenizer_slow_2
      )
      self.assertEqual(
          encoding_tokenizer_slow_1, encoding_tokenizer_slow_3
      )
  
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 7 for calling the LayoutXLMTokenizationTest obj's underlying member method code with example usage: obj.test_save_sentencepiece_tokenizer() without return types