code: def load_from_csc(filename, reference):
      data = np.loadtxt(str(filename), dtype=np.float64)
      csc = sparse.csc_matrix(data[:, 1:])
      label = data[:, 0].astype(np.float32)
      handle = ctypes.c_void_p()
      ref = None
      if reference is not None:
          ref = reference
  
      LIB.LGBM_DatasetCreateFromCSC(
          csc.indptr.ctypes.data_as(ctypes.POINTER(ctypes.c_int32)),
          ctypes.c_int(dtype_int32),
          csc.indices.ctypes.data_as(ctypes.POINTER(ctypes.c_int32)),
          csc.data.ctypes.data_as(ctypes.POINTER(ctypes.c_double)),
          ctypes.c_int(dtype_float64),
          ctypes.c_int64(len(csc.indptr)),
          ctypes.c_int64(len(csc.data)),
          ctypes.c_int64(csc.shape[0]),
          c_str("max_bin=15"),
          ref,
          ctypes.byref(handle),
      )
      num_data = ctypes.c_int(0)
      LIB.LGBM_DatasetGetNumData(handle, ctypes.byref(num_data))
      num_feature = ctypes.c_int(0)
      LIB.LGBM_DatasetGetNumFeature(handle, ctypes.byref(num_feature))
      LIB.LGBM_DatasetSetField(
          handle,
          c_str("label"),
          label.ctypes.data_as(ctypes.POINTER(ctypes.c_float)),
          ctypes.c_int(len(label)),
          ctypes.c_int(dtype_float32),
      )
      print(f"#data: {num_data.value} #feature: {num_feature.value}")
      return handle
  
file_path: LightGBM/tests/c_api_test/test_.py
imports: import ctypes
  from pathlib import Path
  from platform import system
  import numpy
  from scipy import sparse
label_desc: Use image node_id 5 for calling a global function with example usage: load_from_csc(filename, reference) and returns: handle