code: def reset_metrics():
      def callback(env):
          lgb_eval_new = lgb.Dataset(
              X_test, y_test, reference=lgb_train
          )
          if env.iteration - env.begin_iteration == 5:
              print("Add a new valid dataset at iteration 5...")
              env.model.add_valid(lgb_eval_new, "new_valid")
  
      callback.before_iteration = True
      callback.order = 0
      return callback
  
file_path: LightGBM/examples/python-guide/advanced_example.py
imports: import copy
  import json
  import pickle
  from pathlib import Path
  import numpy
  import pandas
  from sklearn.metrics import roc_auc_score
  import lightgbm
label_desc: Use image node_id 4 for calling a global function with example usage: reset_metrics() and returns: callback