code: def dump_code(
      framework,
      network_filepath,
      weight_filepath,
      dump_filepath,
      dump_tag,
  ):
      if network_filepath.endswith(".py"):
          network_filepath = network_filepath[:-3]
      sys.path.insert(
          0, os.path.dirname(os.path.abspath(network_filepath))
      )
      MainModel = imp.load_source("MainModel", network_filepath + ".py")
      if framework == "caffe":
          from mmdnn.conversion.caffe.saver import save_model
      elif framework == "cntk":
          from mmdnn.conversion.cntk.saver import save_model
      elif framework == "keras":
          from mmdnn.conversion.keras.saver import save_model
      elif framework == "mxnet":
          from mmdnn.conversion.mxnet.saver import save_model
      elif framework == "pytorch":
          from mmdnn.conversion.pytorch.saver import save_model
      elif framework == "tensorflow":
          from mmdnn.conversion.tensorflow.saver import save_model
  
          save_model(
              MainModel,
              network_filepath,
              weight_filepath,
              dump_filepath,
              dump_tag,
          )
          return 0
  
      elif framework == "onnx":
          from mmdnn.conversion.onnx.saver import save_model
      else:
          raise NotImplementedError(
              "{} saver is not finished yet.".format(framework)
          )
      save_model(
          MainModel, network_filepath, weight_filepath, dump_filepath
      )
  
      return 0
  
file_path: MMdnn/mmdnn/conversion/_script/dump_code.py
imports: import sys
  from six import text_type
  import sys
  import imp
  import os.path
label_desc: Use image node_id 1 for calling a global function with example usage: dump_code(framework, network_filepath, weight_filepath, dump_filepath, dump_tag) and returns: int, int