code: def get_onnx_example(op_name, domain):
      """
      Retrieves examples associated to one operator
      stored in onnx packages.
      :param op_name: operator name
      :param domain: operator domain
      :param fmt: rendering format
      :return: dictionary
      """
      if domain in (None, "ai.onnx"):
          modules = [
              f"onnx.backend.test.case.node.{op_name.lower()}",
              f"onnx.backend.test.case.node.{pascal_to_snake_case(op_name)}",
          ]
      else:
          domain_ = domain.replace(".", "_")
          modules = [
              f"onnx.backend.test.case.node.{domain_}.{op_name.lower()}",
              f"onnx.backend.test.case.node.{domain_}.{pascal_to_snake_case(op_name)}",
          ]
      module = None
      for m in modules:
          try:
              mod = importlib.import_module(m)
              module = m
          except ImportError:
              continue
      if module is None:
          # Unable to find an example for 'op_name'.
          return {}
      results: dict[str, Any] = {}
      for v in mod.__dict__.values():
          if not isinstance(v, _Exporter):
              continue
          code_cls = inspect.getsource(v)
          codes = code_cls.split("@staticmethod")
          for me in v.__dict__:
              if not me.startswith("export"):
                  continue
              sub = f" {me}()"
              found = None
              for code in codes:
                  if sub in code:
                      found = code
              if found is None:
                  raise RuntimeError(
                      f"Unable to find {sub!r} in\n{code_cls}"
                  )
              found = textwrap.dedent(found)
              lines = found.split("\n")
              first = 0
              for i in range(len(lines)):
                  if lines[i].startswith("def "):
                      first = i + 1
              found = textwrap.dedent("\n".join(lines[first:]))
              key = me[len("export") :]
              if key == "":
                  key = "default"
                  if key in results:
                      key = f"example {len(results) + 1}"
              results[key] = _process_example(found)
      return results
  
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 12 for calling a global function with example usage: get_onnx_example(op_name, domain) and returns: results, dict