code: def test_set_jupyter_format(
      monkeypatch,
      *,
      jupyter_format="jpg",
      expected_old_format="svg",
      expected_normalized_format="jpeg",
      expected_mimetype="image/jpeg",
  ):
      assert len({DEFAULT_JUPYTER_MIMETYPE, jupyter_format}) == 2
  
      from graphviz import jupyter_integration
  
      assert (
          jupyter_integration.JupyterIntegration._jupyter_mimetype
          == DEFAULT_JUPYTER_MIMETYPE
      )
  
      # isolate the test
      monkeypatch.setattr(
          "graphviz.jupyter_integration.JupyterIntegration._jupyter_mimetype",
          DEFAULT_JUPYTER_MIMETYPE,
      )
      assert (
          jupyter_integration.JupyterIntegration._jupyter_mimetype
          == DEFAULT_JUPYTER_MIMETYPE
      )
  
      g1 = graphviz.Graph()
      assert g1._jupyter_mimetype == DEFAULT_JUPYTER_MIMETYPE
  
      old = graphviz.set_jupyter_format(jupyter_format)
      assert old == jupyter_integration.DEFAULT_JUPYTER_FORMAT
  
      assert g1._jupyter_mimetype == expected_mimetype
  
      g2 = graphviz.Graph()
      assert g2._jupyter_mimetype == expected_mimetype
  
      old = graphviz.set_jupyter_format(DEFAULT_JUPYTER_FORMAT)
      assert old == expected_normalized_format
  
      assert g1._jupyter_mimetype == DEFAULT_JUPYTER_MIMETYPE
      assert g2._jupyter_mimetype == DEFAULT_JUPYTER_MIMETYPE
  
imports: import pytest
  import graphviz
label_desc: Use image node_id 5 for calling a global function with example usage: test_set_jupyter_format(monkeypatch) without return types