code: def test_number_reproduces(tmp_dir, dvc, mocker):
      mock = mocker.Mock(return_value=None)
      tmp_dir.dvc_gen({"pre-foo": "pre-foo"})
  
      dvc.stage.add(
          name="echo-foo",
          outs=["foo"],
          cmd="echo foo > foo",
          verify=False,
      )
      dvc.stage.add(
          name="echo-bar",
          deps=["foo"],
          outs=["bar"],
          cmd="echo bar > bar",
          verify=False,
      )
      dvc.stage.add(
          name="echo-baz",
          deps=["foo"],
          outs=["baz"],
          cmd="echo baz > baz",
          verify=False,
      )
      dvc.stage.add(
          name="echo-boop",
          deps=["bar"],
          outs=["boop"],
          cmd="echo boop > boop",
          verify=False,
      )
  
      dvc.reproduce(all_pipelines=True, repro_fn=mock)
      assert mock.call_count == 5
  
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 3 for calling a global function with example usage: test_number_reproduces(tmp_dir, dvc, mocker) without return types