code: def test_png_renderer_mimetype(fig1):
      pio.renderers.default = "png"
  
      # Configure renderer so that we can use the same parameters
      # to build expected image below
      pio.renderers["png"].width = 400
      pio.renderers["png"].height = 500
      pio.renderers["png"].scale = 1
  
      image_bytes = pio.to_image(fig1, width=400, height=500, scale=1)
      image_str = base64.b64encode(image_bytes).decode("utf8")
  
      expected = {"image/png": image_str}
  
      pio.renderers.render_on_display = False
  
      with mock.patch("IPython.display.display") as mock_display:
          fig1._ipython_display_()
  
      # assert fig1._repr_mimebundle_(None, None) is None
      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)
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_orca/test_image_renderers.py
imports: import base64
  import sys
  import json
  import pytest
  import numpy
  from plotly import io
  import plotly.graph_objs
  from plotly.offline.offline import _get_jconfig
label_desc: Use image node_id 2 for calling a global function with example usage: test_png_renderer_mimetype(fig1) without return types