code: def _get_onnx_opset(model: ModelProto):
      """
      Returns the ONNX opset version used to generate `model`.
      """
      opset_import = model.opset_import[0]
      return getattr(opset_import, "version")
  
imports: import hashlib
  from collections import defaultdict
  from typing import TYPE_CHECKING, Any, DefaultDict, Dict, List, Set, Tuple
  import numpy
  import onnx
  from onnx import ModelProto, ValueInfoProto, numpy_helper
  from ..utils import logging, recurse_getattr
label_desc: Use image node_id 8 for calling a global function with example usage: _get_onnx_opset(model) and returns: getattr