code: def test_fpreproc(self):
      param = {
          "max_depth": 2,
          "eta": 1,
          "silent": 1,
          "objective": "binary:logistic",
      }
      num_round = 2
  
      def fpreproc(dtrain, dtest, param):
          label = dtrain.get_label()
          ratio = float(np.sum(label == 0)) / np.sum(label == 1)
          param["scale_pos_weight"] = ratio
          return (dtrain, dtest, param)
  
      xgb.cv(
          param,
          dtrain,
          num_round,
          nfold=5,
          metrics={"auc"},
          seed=0,
          fpreproc=fpreproc,
      )
  
file_path: turicreate/src/external/xgboost/tests/python/test_models.py
imports: import numpy
  import xgboost
  import unittest
label_desc: Use image node_id 4 for calling the TestModels obj's underlying member method code with example usage: obj.test_fpreproc() and returns: dtrain,  dtest,  param