code: def test_plotly_mimetype_renderer_mimetype(fig1, renderer):
      pio.renderers.default = renderer
      expected = {
          plotly_mimetype: json.loads(
              pio.to_json(fig1, remove_uids=False)
          )
      }
  
      expected[plotly_mimetype]["config"] = {
          "plotlyServerURL": "https://plot.ly"
      }
  
      pio.renderers.render_on_display = False
  
      with mock.patch("IPython.display.display") as mock_display:
          fig1._ipython_display_()
  
      mock_display.assert_not_called()
  
      pio.renderers.render_on_display = True
      with mock.patch("IPython.display.display") as mock_display:
          fig1._ipython_display_()
  
      mock_display.assert_called_once_with(expected, raw=True)
  
imports: import json
  import sys
  import base64
  import threading
  import time
  import pytest
  import requests
  import numpy
  import webbrowser
  import plotly.graph_objs
  import plotly.io
  from plotly.offline import get_plotlyjs
  from plotly.io._utils import plotly_cdn_url
label_desc: Use image node_id 5 for calling a global function with example usage: test_plotly_mimetype_renderer_mimetype(fig1, renderer) without return types