code: def python_op_builder():
      PythonOpStats.lock.acquire()
      PythonOpStats.num_instances += 1
      PythonOpStats.lock.release()
  
      def my_op(inputs, outputs):
          PythonOpStats.lock.acquire()
          PythonOpStats.num_calls += 1
          PythonOpStats.lock.release()
  
      return my_op
  
imports: from caffe2.python import workspace
  from caffe2.python.core import Plan, to_execution_step, Net
  from caffe2.python.task import Task, TaskGroup, final_output
  from caffe2.python.net_builder import ops, NetBuilder
  from caffe2.python.session import LocalSession
  import unittest
  import threading
label_desc: Use image node_id 1 for calling a global function with example usage: python_op_builder() and returns: my_op