code: def _train(original_fn, *args, **kwargs):
      def trains_lightgbm_callback():
          def callback(env):
              # logging the results to scalars section
              # noinspection PyBroadException
              try:
                  logger = (
                      PatchLIGHTgbmModelIO._current_task.get_logger()
                  )
                  iteration = env.iteration
                  for (
                      data_title,
                      data_series,
                      value,
                      _,
                  ) in env.evaluation_result_list:
                      logger.report_scalar(
                          title=data_title,
                          series=data_series,
                          value="{:.6f}".format(value),
                          iteration=iteration,
                      )
              except Exception:
                  pass
  
          return callback
  
      kwargs.setdefault("callbacks", []).append(
          trains_lightgbm_callback()
      )
      ret = original_fn(*args, **kwargs)
      if not PatchLIGHTgbmModelIO._current_task:
          return ret
      params = args[0] if args else kwargs.get("params", {})
      for k, v in params.items():
          if isinstance(v, set):
              params[k] = list(v)
      if params:
          PatchLIGHTgbmModelIO._current_task.connect(params)
      return ret
  
file_path: clearml/clearml/binding/frameworks/lightgbm_bind.py
imports: import sys
  import six
  from pathlib2 import Path
  from ..frameworks.base_bind import PatchBaseModelIO
  from ..frameworks import _patched_call, WeightsFileHandler, _Empty
  from ..import_bind import PostImportHookPatching
  from ...config import running_remotely
  from ...model import Framework
label_desc: Use image node_id 5 for calling the PatchLIGHTgbmModelIO obj's underlying member method code with example usage: obj._train(original_fn) and returns: ret, callback, ret