code: def end_code(self):
      return """    return n
  
  def make_net(prototxt):
      n = KitModel()
      with open(prototxt, 'w') as fpb:
          print(n.to_proto(), file=fpb)
  
  def gen_weight(weight_file, model, prototxt):
      global _weights_dict
      _weights_dict = load_weights(weight_file)
  
      net = caffe.Net(prototxt, caffe.TRAIN)
  
      for key in _weights_dict:
          if 'weights' in _weights_dict[key]:
              net.params[key][0].data.flat = _weights_dict[key]['weights']
          elif 'mean' in _weights_dict[key]:
              net.params[key][0].data.flat = _weights_dict[key]['mean']
              net.params[key][1].data.flat = _weights_dict[key]['var']
              if 'scale' in _weights_dict[key]:
                  net.params[key][2].data.flat = _weights_dict[key]['scale']
          elif 'scale' in _weights_dict[key]:
              net.params[key][0].data.flat = _weights_dict[key]['scale']
          if 'bias' in _weights_dict[key]:
              net.params[key][1].data.flat = _weights_dict[key]['bias']
          if 'gamma' in _weights_dict[key]: # used for prelu, not sure if other layers use this too
              net.params[key][0].data.flat = _weights_dict[key]['gamma']
      net.save(model)
      return net
  
  
  
  if __name__=='__main__':
      parser = argparse.ArgumentParser(description='Generate caffe model and prototxt')
      parser.add_argument('--weight_file', '-w', type=_text_type, default='IR weight file')
      parser.add_argument('--prototxt', '-p', type=_text_type, default='caffe_converted.prototxt')
      parser.add_argument('--model', '-m', type=_text_type, default='caffe_converted.caffemodel')
      args = parser.parse_args()
      # For some reason argparser gives us unicode, so we need to conver to str first
      make_net(str(args.prototxt))
      gen_weight(str(args.weight_file), str(args.model), str(args.prototxt))
  
  """
  
imports: from __future__ import division
  import os
  import sys
  import math
  import numpy
  import caffe
  from caffe import layers
  from caffe import params
  from mmdnn.conversion.common.IR.IR_graph import IRGraph, IRGraphNode
  import mmdnn.conversion.common.IR.graph_pb2
  from mmdnn.conversion.common.IR.graph_pb2 import NodeDef, GraphDef, DataType
  from mmdnn.conversion.common.DataStructure.emitter import Emitter
  from mmdnn.conversion.common.utils import *
label_desc: Use image node_id 3 for calling the CaffeEmitter obj's underlying member method code with example usage: obj.end_code() and returns: str