code: def convertAttributeProto(onnx_arg):
      """
      Convert an ONNX AttributeProto into an appropriate Python object
      for the type.
  
      NB: Tensor attribute gets returned as the straight proto.
      """
      if onnx_arg.HasField("f"):
          return onnx_arg.f
      elif onnx_arg.HasField("i"):
          return onnx_arg.i
      elif onnx_arg.HasField("s"):
          return onnx_arg.s
      elif onnx_arg.HasField("t"):
          return onnx_arg.t  # this is a proto!
      elif onnx_arg.HasField("g"):
          return Caffe2Backend._graph_to_net(
              onnx_arg.g, Caffe2Backend._known_opset_version
          )
      elif len(onnx_arg.floats):
          return list(onnx_arg.floats)
      elif len(onnx_arg.ints):
          return list(onnx_arg.ints)
      elif len(onnx_arg.strings):
          return list(onnx_arg.strings)
      elif len(onnx_arg.graphs):
          retval = []
          # TODO: this doesn't work with RNN ops
          for g in onnx_arg.graphs:
              retval.append(
                  Caffe2Backend._graph_to_net(
                      g, Caffe2Backend._known_opset_version
                  )
              )
          return retval
      else:
          raise ValueError(
              "Unsupported ONNX attribute: {}".format(onnx_arg)
          )
  
imports: import collections
  import sys
  import zipfile
  import itertools
  import onnx.backend
  from caffe2.python import core, workspace, rnn_cell, gru_cell
  from caffe2.python.model_helper import ModelHelper
  from caffe2.proto import caffe2_pb2
  import caffe2.python.utils
  import numpy
  import onnx
  from onnx import TensorProto
  import onnx.numpy_helper
  import onnx.defs
  import onnx.shape_inference
  import onnx.utils
  from onnx.backend.base import Backend, Device, DeviceType, namedtupledict
  from caffe2.python.onnx.workspace import Workspace
  from caffe2.python.onnx.backend_rep import Caffe2Rep
  import caffe2.python._import_c_extension
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: convertAttributeProto(onnx_arg) and returns: onnx_arg, onnx_arg, onnx_arg, onnx_arg, Caffe2Backend, list, list, list, retval