code: def test_feat_extract_from_and_save_pretrained(self):
      feat_extract_first = self.feature_extraction_class(
          **self.processor_dict
      )
  
      with tempfile.TemporaryDirectory() as tmpdirname:
          feat_extract_first.save_pretrained(tmpdirname)
          check_json_file_has_correct_format(
              os.path.join(tmpdirname, "preprocessor_config.json")
          )
          feat_extract_second = (
              self.feature_extraction_class.from_pretrained(tmpdirname)
          )
  
      self.assertEqual(
          feat_extract_second.image_processor.to_dict(),
          feat_extract_first.image_processor.to_dict(),
      )
      self.assertIsInstance(
          feat_extract_first.image_processor, OneFormerImageProcessor
      )
      self.assertIsInstance(feat_extract_first.tokenizer, CLIPTokenizer)
  
imports: import json
  import os
  import tempfile
  import unittest
  import numpy
  from datasets import load_dataset
  from huggingface_hub import hf_hub_download
  from transformers.testing_utils import check_json_file_has_correct_format, require_torch, require_vision
  from transformers.utils import is_torch_available, is_vision_available
  from ...test_image_processing_common import prepare_image_inputs
label_desc: Use image node_id 10 for calling the OneFormerProcessingTest obj's underlying member method code with example usage: obj.test_feat_extract_from_and_save_pretrained() without return types