code: def test_adagrad_callback(bin_train_data):
      class Callback(object):
          def __init__(self, X, y):
              self.X = X
              self.y = y
              self.acc = []
  
          def __call__(self, clf, t):
              alpha1 = clf.l1_ratio * clf.alpha
              alpha2 = (1 - clf.l1_ratio) * clf.alpha
              _proj_elastic_all(
                  clf.eta,
                  t,
                  clf.g_sum_[0],
                  clf.g_norms_[0],
                  alpha1,
                  alpha2,
                  0,
                  clf.coef_[0],
              )
              score = clf.score(self.X, self.y)
              self.acc.append(score)
  
      X_bin, y_bin = bin_train_data
      cb = Callback(X_bin, y_bin)
      clf = AdaGradClassifier(
          alpha=0.5,
          l1_ratio=0.85,
          n_iter=10,
          callback=cb,
          random_state=0,
      )
      clf.fit(X_bin, y_bin)
      assert cb.acc[-1] == 1.0
  
file_path: lightning/lightning/impl/tests/test_adagrad.py
imports: import numpy
  import pytest
  from lightning.classification import AdaGradClassifier
  from lightning.regression import AdaGradRegressor
  from lightning.impl.adagrad_fast import _proj_elastic_all
  from lightning.impl.tests.utils import check_predict_proba
label_desc: Use image node_id 7 for calling a global function with example usage: test_adagrad_callback(bin_train_data) without return types