code: def get_best_model_checkpoint(best_result: "ray.train.Result"):
      best_bst = xgb.Booster()
      with best_result.checkpoint.as_directory() as checkpoint_dir:
          best_bst.load_model(os.path.join(checkpoint_dir, "model.xgb"))
      accuracy = 1.0 - best_result.metrics["test-error"]
      print(f"Best model parameters: {best_result.config}")
      print(f"Best model total accuracy: {accuracy:.4f}")
      return best_bst
  
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 3 for calling a global function with example usage: get_best_model_checkpoint(best_result) and returns: best_bst