code: def train_breast_cancer_cv(config: dict):
      # This is a simple training function to be passed into Tune
      # using xgboost's cross validation functionality
  
      # Load dataset
      data, labels = sklearn.datasets.load_breast_cancer(
          return_X_y=True
      )
  
      # For CV, we need to average over a list of results form folds
      def average_cv_folds(
          results_dict: Dict[str, List[float]]
      ) -> Dict[str, float]:
          return {k: np.mean(v) for k, v in results_dict.items()}
  
      train_set = xgb.DMatrix(data, label=labels)
  
      # Run CV, using the Tune callback
      xgb.cv(
          config,
          train_set,
          verbose_eval=False,
          stratified=True,
          # Checkpointing is not supported for CV
          callbacks=[
              TuneReportCheckpointCallback(
                  results_postprocessing_fn=average_cv_folds,
                  frequency=0,
              )
          ],
      )
  
file_path: ray/python/ray/tune/examples/xgboost_example.py
imports: from typing import Dict, List
  import sklearn.datasets
  import sklearn.metrics
  import os
  import numpy
  from sklearn.model_selection import train_test_split
  import xgboost
  import ray
  from ray import tune
  from ray.tune.schedulers import ASHAScheduler
  from ray.tune.integration.xgboost import TuneReportCheckpointCallback
label_desc: Use image node_id 2 for calling a global function with example usage: train_breast_cancer_cv(config) and returns: unknown