code: def convert_version(
      model: ModelProto, target_version: int
  ) -> ModelProto:
      """Convert opset version of the ModelProto.
  
      Arguments:
          model: Model.
          target_version: Target opset version.
  
      Returns:
          Converted model.
  
      Raises:
          RuntimeError when some necessary conversion is not supported.
      """
      if not isinstance(model, ModelProto):
          raise ValueError(
              f"VersionConverter only accepts ModelProto as model, incorrect type: {type(model)}"
          )
      if not isinstance(target_version, int):
          raise ValueError(
              f"VersionConverter only accepts int as target_version, incorrect type: {type(target_version)}"
          )
      model_str = model.SerializeToString()
      converted_model_str = C.convert_version(model_str, target_version)
      return onnx.load_from_string(converted_model_str)
  
label_desc: Use image node_id 1 for calling a global function with example usage: convert_version(model, target_version) and returns: onnx