code: def test_from_json(fig1):
      fig1_json = json.dumps(fig1, **opts)
      fig1_loaded = pio.from_json(fig1_json)
  
      # Check return type
      assert isinstance(fig1_loaded, go.Figure)
  
      # Check return json
      assert pio.to_json(fig1_loaded) == pio.to_json(fig1.to_dict())
  
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 7 for calling a global function with example usage: test_from_json(fig1) without return types