code: def test_set_default_engine(
      monkeypatch, *, engine="neato", explicit_engine="sfdp"
  ):
      assert len({DEFAULT_ENGINE, engine, explicit_engine}) == 3
  
      from graphviz.parameters import Parameters
  
      assert Parameters._engine == DEFAULT_ENGINE
  
      # isolate the test
      monkeypatch.setattr(
          "graphviz.parameters.Parameters._engine", DEFAULT_ENGINE
      )
      assert Parameters._engine == DEFAULT_ENGINE
  
      g1 = graphviz.Graph()
      assert g1.engine == DEFAULT_ENGINE
  
      g2 = graphviz.Graph(engine=explicit_engine)
      assert g2.engine == explicit_engine
  
      old = graphviz.set_default_engine(engine)
      assert old == DEFAULT_ENGINE
  
      assert g1.engine == engine
      assert g2.engine == explicit_engine
  
      g3 = graphviz.Graph()
      assert g3.engine == engine
  
      g4 = graphviz.Graph(engine=explicit_engine)
      assert g4.engine == explicit_engine
  
      old = graphviz.set_default_engine(DEFAULT_ENGINE)
      assert old == engine
  
      assert g1.engine == DEFAULT_ENGINE
      assert g2.engine == explicit_engine
      assert g3.engine == DEFAULT_ENGINE
      assert g4.engine == explicit_engine
  
imports: import pytest
  import graphviz
label_desc: Use image node_id 3 for calling a global function with example usage: test_set_default_engine(monkeypatch) without return types