code: def test_max_thread_control():
      # at initialization, should be -1
      num_threads = ctypes.c_int(0)
      ret = LIB.LGBM_GetMaxThreads(ctypes.byref(num_threads))
      assert ret == 0
      assert num_threads.value == -1
  
      # updating that value through the C API should work
      ret = LIB.LGBM_SetMaxThreads(ctypes.c_int(6))
      assert ret == 0
  
      ret = LIB.LGBM_GetMaxThreads(ctypes.byref(num_threads))
      assert ret == 0
      assert num_threads.value == 6
  
      # resetting to any negative number should set it to -1
      ret = LIB.LGBM_SetMaxThreads(ctypes.c_int(-123))
      assert ret == 0
      ret = LIB.LGBM_GetMaxThreads(ctypes.byref(num_threads))
      assert ret == 0
      assert num_threads.value == -1
  
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 10 for calling a global function with example usage: test_max_thread_control() without return types