code: def test_earlystopping_with_lightgbm():
      np.random.seed(123)
  
      # prepare dataset
      N_samples = 50000
      n_features = 1000
      X = np.random.rand(N_samples, n_features)
      y = np.random.rand(N_samples)
      dataset = dc.data.NumpyDataset(X, y)
  
      # lightgbm test
      lgbm_model = lightgbm.LGBMRegressor(
          n_estimators=20, random_state=123, silent=True
      )
      model = dc.models.GBDTModel(lgbm_model, early_stopping_rounds=3)
      # fit trained model
      model.fit(dataset)
  
      # If ES rounds are more than total epochs, it will never trigger
      if model.early_stopping_rounds < model.model.n_estimators:
          # Find the number of boosting rounds in the model
          res = list(model.model.evals_result_["valid_0"].values())
          rounds_ran = len(res[0])
          # If rounds ran are less than estimators, it means ES was triggered
          if rounds_ran < model.model.n_estimators:
              assert (
                  model.model.best_iteration_ < model.model.n_estimators
              )
  
file_path: deepchem/deepchem/models/tests/test_gbdt_model.py
imports: import tempfile
  import unittest
  import numpy
  from sklearn.datasets import load_diabetes, load_digits
  from sklearn.model_selection import train_test_split
  import deepchem
label_desc: Use image node_id 10 for calling a global function with example usage: test_earlystopping_with_lightgbm() without return types