code: def test_save_and_load_tokenizer(self):
      tokenizer = self.get_tokenizer()
      # Isolate this from the other tests because we save additional tokens/etc
      tmpdirname = tempfile.mkdtemp()
  
      sample_ids = [0, 1, 4, 8, 9, 0, 12]
      before_tokens = tokenizer.decode(sample_ids)
      before_vocab = tokenizer.get_vocab()
      tokenizer.save_pretrained(tmpdirname)
  
      after_tokenizer = tokenizer.__class__.from_pretrained(tmpdirname)
      after_tokens = after_tokenizer.decode(sample_ids)
      after_vocab = after_tokenizer.get_vocab()
  
      self.assertEqual(before_tokens, after_tokens)
      self.assertDictEqual(before_vocab, after_vocab)
  
      shutil.rmtree(tmpdirname)
  
      tokenizer = self.get_tokenizer()
  
      # Isolate this from the other tests because we save additional tokens/etc
      tmpdirname = tempfile.mkdtemp()
  
      before_len = len(tokenizer)
      sample_ids = [
          0,
          1,
          4,
          8,
          9,
          0,
          12,
          before_len,
          before_len + 1,
          before_len + 2,
      ]
      tokenizer.add_tokens(["?", "!"])
      additional_special_tokens = tokenizer.additional_special_tokens
      additional_special_tokens.append("&")
      tokenizer.add_special_tokens(
          {"additional_special_tokens": additional_special_tokens}
      )
      before_tokens = tokenizer.decode(sample_ids)
      before_vocab = tokenizer.get_vocab()
      tokenizer.save_pretrained(tmpdirname)
  
      after_tokenizer = tokenizer.__class__.from_pretrained(tmpdirname)
      after_tokens = after_tokenizer.decode(sample_ids)
      after_vocab = after_tokenizer.get_vocab()
  
      self.assertEqual(before_tokens, after_tokens)
      self.assertDictEqual(before_vocab, after_vocab)
  
      self.assertTrue(len(tokenizer), before_len + 3)
      self.assertTrue(len(tokenizer), len(after_tokenizer))
      shutil.rmtree(tmpdirname)
  
imports: import inspect
  import json
  import os
  import random
  import shutil
  import tempfile
  import unittest
  import numpy
  from transformers import WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2Config, Wav2Vec2CTCTokenizer, Wav2Vec2Tokenizer
  from transformers.models.wav2vec2.tokenization_wav2vec2 import VOCAB_FILES_NAMES, Wav2Vec2CTCTokenizerOutput
  from transformers.testing_utils import require_torch, slow
  from ...test_tokenization_common import TokenizerTesterMixin
label_desc: Use image node_id 10 for calling the Wav2Vec2TokenizerTest obj's underlying member method code with example usage: obj.test_save_and_load_tokenizer() without return types