code: def _build_schemas() -> dict[str, type]:
      res: dict[str, type] = {}
      for schema in get_all_schemas_with_history():
          # Multiple version can coexist. The last one is kept.
          if schema.name in res:
              if schema.domain != res[schema.name].domain:  # type: ignore
                  raise NotImplementedError(
                      f"This function assumes every operator has a unique name {schema.name!r} "  # type: ignore
                      f"even accross multiple domains {schema.domain!r} and {res[schema.name].domain!r}."  # type: ignore
                  )
              if schema.since_version > res[schema.name].since_version:  # type: ignore
                  # We keep the most recent one.
                  res[schema.name] = schema  # type: ignore
          else:
              res[schema.name] = schema  # type: ignore
          res[schema.name + "_" + str(schema.since_version)] = schema  # type: ignore
      return res
  
imports: from __future__ import annotations
  import abc
  from typing import Any, ClassVar, Iterable
  import numpy
  from onnx import TensorProto
  from onnx.defs import get_all_schemas_with_history, get_schema, onnx_opset_version
  from onnx.helper import make_node, make_tensor_type_proto, np_dtype_to_tensor_dtype
  from onnx.numpy_helper import to_array, unpack_int4
  from onnx.onnx_pb import AttributeProto, GraphProto, NodeProto, TypeProto
  from onnx.reference.custom_element_types import bfloat16, float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz, int4, uint4
label_desc: Use image node_id 2 for calling a global function with example usage: _build_schemas() and returns: res