code: def test_to_json_file():
      with tempfile.NamedTemporaryFile() as f:
          shutil.copyfile(SAMPLEJSON, f.name)
          xtr = SupportMatrixExtractor("x", "22.02", f.name)
          xtr.from_json()
          xtr.get_from_pip("pip")
          xtr.to_json_file()
          a, b = "", ""
          with open(SAMPLEAFTERJSON, encoding="utf-8") as fa, open(
              f.name, encoding="utf-8"
          ) as fb:
              a = json.load(fa)
              b = json.load(fb)
              assert a == b
  
      with tempfile.NamedTemporaryFile() as f:
          shutil.copyfile(SAMPLEJSON, f.name)
          xtr = SupportMatrixExtractor("x", "22.02", f.name, force=True)
          xtr.from_json()
          xtr.get_from_pip("pip")
          xtr.to_json_file()
          a, b = "", ""
          with open(SAMPLEAFTERJSON, encoding="utf-8") as fa, open(
              f.name, encoding="utf-8"
          ) as fb:
              a = json.load(fa)
              b = json.load(fb)
              assert a == b
  
file_path: Merlin/docs/test_extractor.py
imports: import json
  import os
  import shutil
  import tempfile
  from pathlib import Path
  from extractor import SupportMatrixExtractor
label_desc: Use image node_id 10 for calling a global function with example usage: test_to_json_file() without return types