code: def infer_function_output_types(
      function: FunctionProto,
      input_types: Sequence[TypeProto],
      attributes: Sequence[AttributeProto],
  ) -> List[TypeProto]:
      """
      Apply type-and-shape-inference to given function body, with given input types
      and given input attribute values.
      """
      result = C.infer_function_output_types(
          function.SerializeToString(),
          [x.SerializeToString() for x in input_types],
          [x.SerializeToString() for x in attributes],
      )
  
      def to_type_proto(x) -> TypeProto:
          type_proto = onnx.TypeProto()
          type_proto.ParseFromString(x)
          return type_proto
  
      return [to_type_proto(x) for x in result]
  
file_path: catboost/contrib/libs/onnx/onnx/shape_inference.py
imports: from typing import Dict, List, Optional, Sequence, Union
  import onnx
  from onnx.onnx_cpp2py_export import shape_inference
  from onnx import AttributeProto, FunctionProto, ModelProto, TypeProto
label_desc: Use image node_id 4 for calling a global function with example usage: infer_function_output_types(function, input_types, attributes) and returns: unknown, type_proto