code: def _check_call(ret):
      """Check the return value of C API call
  
      This function will raise exception when error occurs.
      Wrap every API call with this function
  
      Parameters
      ----------
      ret : int
          return value from API calls
      """
      if ret != 0:
          msg = ""
          # raise XLearnError()
          _LIB.XLearnGetLastError.restype = ctypes.POINTER(
              ctypes.c_ubyte
          )
          ptr = _LIB.XLearnGetLastError()
          idx = 0
          while ptr[idx] != 0:
              msg += chr(ptr[idx])
              idx += 1
          raise XLearnError(msg)
  
imports: import sys
  import os
  import ctypes
  from .libpath import find_lib_path
label_desc: Use image node_id 2 for calling a global function with example usage: _check_call(ret) without return types