code: def make_processor(processor, reader=None):
      if processor is None:
          return lambda rec: rec
      elif isinstance(processor, core.Net):
          return NetProcessor(processor)
      else:
          if reader is not None and hasattr(processor, "schema_func"):
  
              def processor_schema():
                  return processor.schema_func(reader)
  
              processor.schema = processor_schema
          return processor
  
imports: from caffe2.python import core, queue_util
  from caffe2.python.dataio import Reader, Writer
  from caffe2.python.net_builder import NetBuilder, ops
  from caffe2.python.schema import as_record, Field
  from caffe2.python.task import Node, Task, TaskGroup
label_desc: Use image node_id 2 for calling a global function with example usage: make_processor(processor, reader) and returns: function, NetProcessor, processor, processor