code: def test_active_graph(mocker):
      n = mocker.sentinel
      n1, n2, n3, n4, n5, n6, n7, n8, n9 = (
          getattr(n, f"n{i}") for i in range(1, 10)
      )
      edges = {n1: [n2, n3], n2: [n4, n5], n3: [n6, n7], n8: [n9]}
      for node in chain.from_iterable(
          [n, *v] for n, v in edges.items()
      ):
          node.frozen = False
  
      g = DiGraph(edges)
  
      active = get_active_graph(g)
      assert graphs_equal(g, active)
  
      n2.frozen = True
      active = get_active_graph(g)
      assert g.edges() - active.edges() == {(n2, n5), (n2, n4)}
      assert n2 in active
      assert not active.edges() - g.edges()
      assert not graphs_equal(g, active)
  
imports: from itertools import chain
  from networkx import DiGraph
  from networkx.utils import graphs_equal
  from dvc.repo.reproduce import get_active_graph, plan_repro
label_desc: Use image node_id 1 for calling a global function with example usage: test_active_graph(mocker) without return types