code: def convert_op_in_ops(ops_ref, func_or_list):
      func = func_or_list
      if isinstance(func_or_list, list):
          func = op_func_chain(func_or_list)
      ops = [op for op in ops_ref]
      converted_ops = []
      for op in ops:
          new_ops = func(op)
          if new_ops is not None and not isinstance(new_ops, list):
              new_ops = [new_ops]
          converted_ops.extend(new_ops if new_ops is not None else [op])
      del ops_ref[:]
      # ops_ref maybe of type RepeatedCompositeFieldContainer
      # which does not have append()
      ops_ref.extend(converted_ops)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from functools import wraps
  import copy
  import numpy
  from caffe2.python import core, workspace
  from caffe2.proto import caffe2_pb2
label_desc: Use image node_id 4 for calling a global function with example usage: convert_op_in_ops(ops_ref, func_or_list) without return types