code: def test_write_json_from_file_string(fig1, pretty, remove_uids):
      with tempfile.TemporaryDirectory() as dir_name:
          # Write json
          path = os.path.join(dir_name, "fig1.json")
          pio.write_json(
              fig1, path, pretty=pretty, remove_uids=remove_uids
          )
  
          # Open as text file
          with open(path, "r") as f:
              result = f.read()
  
          # Check contents that were written
          expected = pio.to_json(
              fig1, pretty=pretty, remove_uids=remove_uids
          )
          assert result == expected
  
imports: import plotly.graph_objs
  import plotly.io
  import pytest
  import plotly
  import json
  import os
  import tempfile
  from unittest.mock import MagicMock
  from pathlib import Path
label_desc: Use image node_id 16 for calling a global function with example usage: test_write_json_from_file_string(fig1, pretty, remove_uids) without return types