code: def _prepare_inputs_for_onnx(
      model,  # type: ModelProto
      test_name="",  # type: Text
      values=None,  # type: Optional[List[np._ArrayLike[Any]]]
  ):
      # type: (...) -> Dict[Text, np._ArrayLike[Any]]
      graph = model.graph
      initializer_names = {t.name for t in graph.initializer}
      input_names = [
          i.name for i in graph.input if i.name not in initializer_names
      ]
      input_shapes = [
          tuple([d.dim_value for d in i.type.tensor_type.shape.dim])
          for i in graph.input
          if i.name not in initializer_names
      ]
  
      if values is None:
          inputs = [_random_array(shape) for shape in input_shapes]
      else:
          inputs = values
      input_dict = dict(zip(input_names, inputs))
      return input_dict
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import numpy.testing
  import numpy.random
  from onnx import helper, ModelProto, ValueInfoProto, TensorProto, NodeProto
  from typing import Any, Sequence, Text, Tuple, Optional, Dict, List, TypeVar
  from coremltools.converters.onnx import convert
  from coremltools.converters.onnx._converter import SupportedVersion
  from coremltools._deps import _IS_MACOS
  import sys
label_desc: Use image node_id 10 for calling a global function with example usage: _prepare_inputs_for_onnx(model, test_name, values) and returns: input_dict