code: def test_batch_encoding_pickle(self):
      import numpy as np
  
      tokenizer_p = BertTokenizer.from_pretrained("bert-base-cased")
      tokenizer_r = BertTokenizerFast.from_pretrained("bert-base-cased")
  
      # Python no tensor
      with self.subTest("BatchEncoding (Python, return_tensors=None)"):
          self.assert_dump_and_restore(
              tokenizer_p("Small example to encode")
          )
  
      with self.subTest("BatchEncoding (Python, return_tensors=NUMPY)"):
          self.assert_dump_and_restore(
              tokenizer_p(
                  "Small example to encode",
                  return_tensors=TensorType.NUMPY,
              ),
              np.array_equal,
          )
  
      with self.subTest("BatchEncoding (Rust, return_tensors=None)"):
          self.assert_dump_and_restore(
              tokenizer_r("Small example to encode")
          )
  
      with self.subTest("BatchEncoding (Rust, return_tensors=NUMPY)"):
          self.assert_dump_and_restore(
              tokenizer_r(
                  "Small example to encode",
                  return_tensors=TensorType.NUMPY,
              ),
              np.array_equal,
          )
  
imports: import os
  import pickle
  import tempfile
  import unittest
  from typing import Callable, Optional
  import numpy
  from transformers import PreTrainedTokenizerFast
  from transformers import BatchEncoding, BertTokenizer, BertTokenizerFast, PreTrainedTokenizer, TensorType, TokenSpan, is_tokenizers_available
  from transformers.models.gpt2.tokenization_gpt2 import GPT2Tokenizer
  from transformers.testing_utils import CaptureStderr, require_flax, require_tf, require_tokenizers, require_torch, slow
label_desc: Use image node_id 5 for calling the TokenizerUtilsTest obj's underlying member method code with example usage: obj.test_batch_encoding_pickle() without return types