code: def get_attribute_value(attr: AttributeProto) -> Any:
      if attr.ref_attr_name:
          raise ValueError(
              f"Cannot get value of reference attribute: {attr}"
          )
      if attr.type == AttributeProto.FLOAT:
          return attr.f
      if attr.type == AttributeProto.INT:
          return attr.i
      if attr.type == AttributeProto.STRING:
          return attr.s
      if attr.type == AttributeProto.TENSOR:
          return attr.t
      if attr.type == AttributeProto.SPARSE_TENSOR:
          return attr.sparse_tensor
      if attr.type == AttributeProto.GRAPH:
          return attr.g
      if attr.type == AttributeProto.TYPE_PROTO:
          return attr.tp
      if attr.type == AttributeProto.FLOATS:
          return list(attr.floats)
      if attr.type == AttributeProto.INTS:
          return list(attr.ints)
      if attr.type == AttributeProto.STRINGS:
          return list(attr.strings)
      if attr.type == AttributeProto.TENSORS:
          return list(attr.tensors)
      if attr.type == AttributeProto.SPARSE_TENSORS:
          return list(attr.sparse_tensors)
      if attr.type == AttributeProto.GRAPHS:
          return list(attr.graphs)
      if attr.type == AttributeProto.TYPE_PROTOS:
          return list(attr.type_protos)
      raise ValueError(f"Unsupported ONNX attribute: {attr}")
  
imports: import collections.abc
  import numbers
  import struct
  from cmath import isnan
  from typing import Any, Callable, Dict, KeysView, List, Optional, Sequence, Tuple, TypeVar, Union, cast
  import google.protobuf.message
  import numpy
  from onnx import IR_VERSION, AttributeProto, FunctionProto, GraphProto, MapProto, ModelProto, NodeProto, OperatorSetIdProto, OptionalProto, SequenceProto, SparseTensorProto, TensorProto, TensorShapeProto, TrainingInfoProto, TypeProto, ValueInfoProto, defs, mapping
label_desc: Use image node_id 23 for calling a global function with example usage: get_attribute_value(attr) and returns: attr, attr, attr, attr, attr, attr, attr, list, list, list, list, list, list, list