code: def get_operator_schemas(op_name, version=None, domain=None):
      """
      Returns all schemas mapped to an operator name.
      :param op_name: name of the operator
      :param version: version
      :param domain: domain
      :return: list of schemas
      """
      if version == "last" and op_name is not None:
          if domain is not None:
              return [onnx.defs.get_schema(op_name, domain=domain)]
      all_schemas = _get_all_schemas_with_history()
      if domain is None:
          domains = []
          for dom, ops in all_schemas.items():
              if op_name is None or op_name in ops:
                  domains.append(dom)
      else:
          domains = [domain]
  
      # schemas
      sch = []
      for dom in domains:
          ops = all_schemas[dom]
          if op_name is None:
              for op, v in ops.items():
                  if version is None:
                      sch.extend(v.values())
                  elif version == "last" and (
                      dom == "" or "onnx" in dom
                  ):
                      try:
                          sch.append(
                              onnx.defs.get_schema(op, domain=dom)
                          )
                      except onnx.defs.SchemaError:
                          sch.append(v[max(v)])
                  elif version == "last":
                      sch.append(v[max(v)])
                  else:
                      sch.append(v[version])
          elif op_name in ops:
              if version is None:
                  sch.extend(ops[op_name].values())
              elif version in ops[op_name]:
                  sch.append(ops[op_name][version])
  
      # sort
      vals = [(s.domain, s.name, -s.since_version, s) for s in sch]
      vals.sort()
      return [v[-1] for v in vals]
  
imports: import difflib
  import importlib
  import inspect
  import keyword
  import os
  import pathlib
  import re
  import shutil
  import sys
  import textwrap
  from typing import Any
  import jinja2
  import numpy
  from sphinx.util import logging
  import onnx
  from onnx.backend.test.case.base import _Exporter
  from onnx.defs import OpSchema
label_desc: Use image node_id 7 for calling a global function with example usage: get_operator_schemas(op_name, version, domain) and returns: unknown, list