def METHOD_NAME(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)