code: def _summarize_neural_network_spec(mlmodel_spec):
      """Summarize network into the following structure.
      Args:
      mlmodel_spec : mlmodel spec
      Returns:
      inputs : list[(str, str)] - a list of two tuple (name, descriptor) for each input blob.
      outputs : list[(str, str)] - a list of two tuple (name, descriptor) for each output blob
      layers : list[(str, list[str], list[str], list[(str, str)])] - a list of layers represented by
          layer name, input blobs, output blobs, a list of (parameter name, content)
      """
      inputs = [
          (blob.name, _get_feature_description_summary(blob))
          for blob in mlmodel_spec.description.input
      ]
      outputs = [
          (blob.name, _get_feature_description_summary(blob))
          for blob in mlmodel_spec.description.output
      ]
      nn = None
  
      if mlmodel_spec.HasField("neuralNetwork"):
          nn = mlmodel_spec.neuralNetwork
      elif mlmodel_spec.HasField("neuralNetworkClassifier"):
          nn = mlmodel_spec.neuralNetworkClassifier
      elif mlmodel_spec.HasField("neuralNetworkRegressor"):
          nn = mlmodel_spec.neuralNetworkRegressor
  
      layers = (
          [_summarize_network_layer_info(layer) for layer in nn.layers]
          if nn != None
          else None
      )
      return (inputs, outputs, layers)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/spec_inspection_utils.py
imports: from __future__ import print_function
  from ...proto import NeuralNetwork_pb2
label_desc: Use image node_id 5 for calling a global function with example usage: _summarize_neural_network_spec(mlmodel_spec) and returns: inputs,  outputs,  layers