code: def _get_attribute_value(attr):
      """
      Retrieves value from an ONNX attribute.
      """
      if attr.HasField("f"):  # floating-point attribute
          return attr.f
      elif attr.HasField("i"):  # integer attribute
          return attr.i
      elif attr.HasField("s"):  # string attribute
          return attr.s  # TODO: Sanitize string.
      elif attr.HasField("t"):  # tensor attribute
          return torch.from_numpy(numpy_helper.to_array(attr.t))
      elif len(attr.ints) > 0:
          return list(attr.ints)
      elif len(attr.floats) > 0:
          return list(attr.floats)
      raise ValueError(
          "Unknown attribute type for attribute %s." % attr.name
      )
  
imports: import copy
  import io
  import onnx
  import torch
  import torch.onnx.symbolic_helper
  import torch.onnx.utils
  from onnx import numpy_helper
  from torch.onnx import OperatorExportTypes
  from .None import module
label_desc: Use image node_id 10 for calling a global function with example usage: _get_attribute_value(attr) and returns: attr, attr, attr, torch, list, list