code: def test_attribute_error(self) -> None:
      from sklearn.datasets import load_breast_cancer
  
      X, y = load_breast_cancer(return_X_y=True)
  
      clf = xgb.XGBClassifier(n_estimators=8)
      clf.fit(X, y, eval_set=[(X, y)])
  
      with pytest.raises(
          AttributeError, match="early stopping is used"
      ):
          clf.best_iteration
  
      with pytest.raises(
          AttributeError, match="early stopping is used"
      ):
          clf.best_score
  
      booster = clf.get_booster()
      with pytest.raises(
          AttributeError, match="early stopping is used"
      ):
          booster.best_iteration
  
      with pytest.raises(
          AttributeError, match="early stopping is used"
      ):
          booster.best_score
  
imports: import json
  import os
  import tempfile
  from typing import Union
  import pytest
  import xgboost
  from xgboost import testing
label_desc: Use image node_id 17 for calling the TestCallbacks obj's underlying member method code with example usage: obj.test_attribute_error() without return types