code: def debug_net(net):
      """
      Given a Net, produce another net that logs info about the operator call
      before each operator execution. Use for debugging purposes.
      """
      assert isinstance(net, Net)
      debug_net = Net(str(net))
      assert isinstance(net, Net)
      for op in net.Proto().op:
          text = Text()
          print_op(op, text)
          debug_net.LogInfo(str(text))
          debug_net.Proto().op.extend([op])
      return debug_net
  
imports: from caffe2.proto.caffe2_pb2 import OperatorDef, NetDef
  from caffe2.python.checkpoint import Job
  from caffe2.python.core import Net, ExecutionStep, Plan
  from caffe2.python.task import Task, TaskGroup, WorkspaceType, TaskOutput
  from collections import defaultdict
  from contextlib import contextmanager
  from copy import copy
  from itertools import chain
label_desc: Use image node_id 25 for calling a global function with example usage: debug_net(net) and returns: debug_net