class_docstr: Ancestor to all operators in this subfolder.
  
  Args:
      onnx_node: `onnx` node
      run_params: additional parameters such as `verbose`, `opsets`
          (it can be more than one if the operator has a subgraph),
          `log` for a logging function
      schema: operator schema
class_docstr_tok: ["Ancestor","to","all","operators","in","this","subfolder",".","Args",":","onnx_node",":","`","onnx","`","node","run_params",":","additional","parameters","such","as","`","verbose","`",",","`","opsets","`","(","it","can","be","more","than","one","if","the","operator","has","a","subgraph",")",",","`","log","`","for","a","logging","function","schema",":","operator","schema"]
docstr: Converts an attribute value into a python value.
docstr_tok: ["Converts","an","attribute","value","into","a","python","value","."]
code: def _extract_attribute_value(
      self, att: AttributeProto, ref_att: AttributeProto | None = None
  ) -> Any:
      """Converts an attribute value into a python value."""
      if att.type == AttributeProto.GRAPH:
          from onnx.reference.reference_evaluator import (
              ReferenceEvaluator,  # type: ignore
          )
  
          new_ops = self.run_params.get("new_ops", None)
          if "existing_functions" in self.run_params:
              functions = list(
                  self.run_params["existing_functions"].values()
              )
          else:
              functions = None
          return ReferenceEvaluator(
              att.g,
              opsets=self.run_params["opsets"],
              verbose=max(0, self.run_params.get("verbose", 0) - 2),
              new_ops=None
              if new_ops is None
              else list(new_ops.values()),
              functions=functions,
          )
      if att.type in OpRun._attribute_conversion_functions:
          return OpRun._attribute_conversion_functions[att.type](att)  # type: ignore
      if ref_att is None:
          raise AttributeError(
              f"Unable to convert attribute {att.name!r} type {att.type!r} "
              f"from node type {self.onnx_node.op_type!r}, "
              f"domain {self.onnx_node.domain!r}\n{att}."
          )
      raise AttributeError(
          f"Unable to convert default value for {ref_att.name!r} type {att.type!r} "
          f"from node type {self.onnx_node.op_type!r}, "
          f"domain {self.onnx_node.domain!r}\n{att}\n{ref_att}."
      )
  
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 3 for calling the OpRun obj's underlying member method code with example usage: obj._extract_attribute_value(att, ref_att) and returns: ReferenceEvaluator, OpRun