code: def _generate_training_callback_class():
      class ClearMLCallback:
          _scalar_index_counter = 0
  
          def __init__(self, task):
              self._logger = task.get_logger()
              self._scalar_index = ClearMLCallback._scalar_index_counter
              ClearMLCallback._scalar_index_counter += 1
  
          def after_iteration(self, info):
              info = vars(info)
              iteration = info.get("iteration")
              for title, metric in (info.get("metrics") or {}).items():
                  if self._scalar_index != 0:
                      title = "{} - {}".format(
                          title, self._scalar_index
                      )
                  for series, log in metric.items():
                      value = log[-1]
                      self._logger.report_scalar(
                          title=title,
                          series=series,
                          value=value,
                          iteration=iteration,
                      )
              return True
  
      return ClearMLCallback
  
file_path: clearml/clearml/binding/frameworks/catboost_bind.py
imports: import sys
  from pathlib2 import Path
  import six
  from ..frameworks import WeightsFileHandler, _Empty, _patched_call
  from ..frameworks.base_bind import PatchBaseModelIO
  from ..import_bind import PostImportHookPatching
  from ...model import Framework
label_desc: Use image node_id 6 for calling the PatchCatBoostModelIO obj's underlying member method code with example usage: obj._generate_training_callback_class() and returns: ClearMLCallback, True