code: def gen_sub_model_conf(output_config, flags, conf):
      model_conf = copy.deepcopy(get_model_conf_by_name(flags, conf))
      if isinstance(model_conf[ModelKeys.subgraphs], list):
          model_conf[ModelKeys.subgraphs][0][
              ModelKeys.output_tensors
          ] = output_config[ModelKeys.output_tensors]
          model_conf[ModelKeys.subgraphs][0][
              ModelKeys.output_shapes
          ] = output_config[ModelKeys.output_shapes]
      else:
          model_conf[ModelKeys.subgraphs][ModelKeys.default_graph][
              ModelKeys.output_tensors
          ] = output_config[ModelKeys.output_tensors]
          model_conf[ModelKeys.subgraphs][ModelKeys.default_graph][
              ModelKeys.output_shapes
          ] = output_config[ModelKeys.output_shapes]
      return model_conf
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import copy
  import numpy
  import shutil
  import tempfile
  from micro_converter import MicroConverter
  from py_proto import mace_pb2
  import run_target
  from utils import util
  from utils import device
  from utils import config_parser
  from utils.target import Target
  from utils.config_parser import ModelKeys
  from utils.util import MaceLogger
  from utils.util import mace_check
  import validate
  import layers_validate
label_desc: Use image node_id 5 for calling a global function with example usage: gen_sub_model_conf(output_config, flags, conf) and returns: model_conf