code: def test_sanitize_json(engine):
      layout = {"title": {"text": "</script>\u2028\u2029"}}
      fig = go.Figure(layout=layout)
      fig_json = pio.to_json_plotly(fig, engine=engine)
      layout_2 = json.loads(fig_json)["layout"]
      del layout_2["template"]
  
      assert layout == layout_2
  
      replacements = {
          "<": "\\u003c",
          ">": "\\u003e",
          "/": "\\u002f",
          "\u2028": "\\u2028",
          "\u2029": "\\u2029",
      }
  
      for bad, good in replacements.items():
          assert bad not in fig_json
          assert good in fig_json
  
imports: import pytest
  import plotly.io.json
  import plotly.graph_objects
  import plotly.express
  import numpy
  import pandas
  import json
  import datetime
  import re
  import sys
  import warnings
  from pytz import timezone
  from _plotly_utils.optional_imports import get_module
label_desc: Use image node_id 24 for calling a global function with example usage: test_sanitize_json(engine) without return types