code: def __init__(
      self,
      callback_types: list,
      metrics: list,
      evaluation_freq: int = None,
      early_stopping_rounds: int = None,
      checkpoint_freq: int = None,
      use_first_metric: bool = False,
  ) -> None:
      if (
          not isinstance(callback_types, list)
          or len(callback_types) == 0
      ):
          raise ValueError(
              "callback_types must be a list with at least one type."
          )
  
      if not isinstance(metrics, list) or len(metrics) == 0:
          raise ValueError(
              "metrics must be a list with at least one metric."
          )
  
      for param, param_name in [
          (evaluation_freq, "evaluation_freq"),
          (early_stopping_rounds, "early_stopping_rounds"),
          (checkpoint_freq, "checkpoint_freq"),
      ]:
          if param is not None and (
              not isinstance(param, int) or param <= 0
          ):
              raise ValueError(
                  f"{param_name} must be a positive integer or None."
              )
  
      if not isinstance(use_first_metric, bool):
          raise ValueError("use_first_metric must be a boolean.")
  
      self.callback_types = callback_types
      self.metrics = metrics
      self.evaluation_freq = evaluation_freq
      self.early_stopping_rounds = early_stopping_rounds
      self.checkpoint_freq = checkpoint_freq
      self.use_first_metric = use_first_metric
  
file_path: FATE/python/fate/ml/utils/callbacks.py
imports: from fate.ml.evaluation.tool import get_metric_names, get_specified_metrics
  from fate.ml.abc.module import Module
label_desc: Use image node_id 1 to create a new CallbackParam object from inherited base classes: object with example: obj = CallbackParam(callback_types, metrics, evaluation_freq, early_stopping_rounds, checkpoint_freq, use_first_metric)