code: def nets_to_graph_def(nets, shapes=None, **kwargs):
      if shapes is None:
          shapes = _try_get_shapes(nets)
      nets = [copy.deepcopy(net.Proto()) for net in nets]
      shapes = copy.deepcopy(shapes)
      for net in nets:
          _propagate_device_option(net)
      return _operators_to_graph_def(
          shapes, [op for net in nets for op in net.op], **kwargs
      )
  
imports: import copy
  import logging
  import os
  from caffe2.proto import caffe2_pb2
  from caffe2.python import core, workspace
label_desc: Use image node_id 17 for calling a global function with example usage: nets_to_graph_def(nets, shapes) and returns: _operators_to_graph_def