class_docstr: Test special tokens tokenization.
class_docstr_tok: ["Test","special","tokens","tokenization","."]
code: def _run_specialtok_test(self, **kwargs):
      for special_token in ["SPECIAL TOKENS", "[SPECIAL; TOKENS]"]:
          with testing_utils.tempdir() as tmpdir:
              if "dict_file" not in kwargs:
                  kwargs["dict_file"] = os.path.join(tmpdir, "dict")
              string = f"This is a test of {special_token}"
              parser = ParlaiParser(False, False)
              DictionaryAgent.add_cmdline_args(parser, partial_opt=None)
              opt = parser.parse_kwargs(**kwargs)
              da = DictionaryAgent(opt)
              before = da.tokenize(string)
              da.add_additional_special_tokens([special_token])
              after = da.tokenize(string)
              assert before != after
              assert len(before) > len(after)
              assert after[-1] == special_token
              assert before[:5] == after[:5]
              if opt["dict_tokenizer"] in (
                  "bytelevelbpe",
                  "gpt2",
                  "slow_bytelevel_bpe",
              ):
                  # we need to let the dictionary handle the tokenid mappings
                  assert da.vec2txt(da.txt2vec(string)) == string
  
imports: from parlai.core.build_data import modelzoo_path
  from parlai.core.dict import find_ngrams
  from parlai.core.params import ParlaiParser
  from parlai.core.dict import DictionaryAgent, TokenizationMode
  from parlai.core.opt import Opt
  import parlai.scripts.build_dict
  from parlai.utils.io import PathManager
  import parlai.utils.testing
  import os
  import shutil
  import unittest
  import pytest
label_desc: Use image node_id 1 for calling the SpecialTokenTests obj's underlying member method code with example usage: obj._run_specialtok_test() without return types