class_docstr: Test for SlowBytelevelBPE.
  
  Essentially, test whether using a stand-in GPT2 tokenizer for a dict originally
  built with HF's tokenizer produces the same results.
class_docstr_tok: ["Test","for","SlowBytelevelBPE",".","Essentially",",","test","whether","using","a","stand-in","GPT2","tokenizer","for","a","dict","originally","built","with","HF","'s","tokenizer","produces","the","same","results","."]
docstr: run the actual test.
code: def _run_test(self, slow_bytelevel_bpe, hf_bpe):
      """
      run the actual test.
      """
      self.assertEqual(
          # grinning face emoji
          slow_bytelevel_bpe.bytelevelbpe_tokenize(
              "Hello, ParlAI! \U0001f600"
          ),
          slow_bytelevel_bpe_RESULT,
      )
      self.assertEqual(
          slow_bytelevel_bpe.vec2txt(
              [
                  slow_bytelevel_bpe.tok2ind[w]
                  for w in slow_bytelevel_bpe_RESULT
              ]
          ),
          # grinning face emoji
          "Hello, ParlAI! \U0001f600",
      )
      self.assertEqual(
          slow_bytelevel_bpe.txt2vec("Hello, ParlAI! \U0001f600"),
          [
              slow_bytelevel_bpe.tok2ind[w]
              for w in slow_bytelevel_bpe_RESULT
          ],
      )
      vocab_size = len(slow_bytelevel_bpe.bpe.encoder)
      with testing_utils.tempdir() as tmpdir:
          path = os.path.join(tmpdir, "dict-checkpoint")
          slow_bytelevel_bpe.save(filename=path)
          slow_bytelevel_bpe.load(filename=path)
      # Test loading / saving
      self.assertEqual(vocab_size, len(slow_bytelevel_bpe.bpe.encoder))
  
      # next, check that hf_bpe and slow_bytelevel_bpe are equivalent
      self.assertEqual(
          slow_bytelevel_bpe.vec2txt(
              [
                  slow_bytelevel_bpe.tok2ind[w]
                  for w in slow_bytelevel_bpe_RESULT
              ]
          ),
          hf_bpe.vec2txt(
              [hf_bpe.tok2ind[w] for w in BYTELEVEL_BPE_RESULT]
          ),
      )
  
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 2 for calling the TestGpt2HFInterop obj's underlying member method code with example usage: obj._run_test(slow_bytelevel_bpe, hf_bpe) without return types