code: def _create_checker(
      proto_type: Type[Message],
  ) -> Callable[[FuncType], FuncType]:
      def decorator(py_func: FuncType) -> FuncType:
          @functools.wraps(py_func)
          def checker(
              proto: Message, ctx: C.CheckerContext = DEFAULT_CONTEXT
          ) -> Any:
              if not isinstance(proto, proto_type):
                  raise RuntimeError(
                      f"You cannot pass an object that is not of type {proto_type.__name__}"
                  )
              return getattr(C, py_func.__name__)(
                  proto.SerializeToString(), ctx
              )
  
          return cast(FuncType, checker)
  
      return decorator
  
file_path: catboost/contrib/libs/onnx/onnx/checker.py
imports: import functools
  import sys
  from typing import Any, Callable, Optional, Type, TypeVar, Union, cast
  from google.protobuf.message import Message
  import onnx.defs
  from onnx.onnx_cpp2py_export import checker
  import onnx.shape_inference
  from onnx import IR_VERSION, AttributeProto, FunctionProto, GraphProto, ModelProto, NodeProto, SparseTensorProto, TensorProto, ValueInfoProto, helper
label_desc: Use image node_id 1 for calling a global function with example usage: _create_checker(proto_type) and returns: decorator, cast, getattr