code: def test_fit_callback():
      num_called = 0
  
      def callback(epoch, elapsed, correct, skipped):
          nonlocal num_called
          num_called += 1
  
      raw = [
          [1, 1, 0, 1, 0, 0],
          [0, 1, 1, 1, 0, 0],
          [1, 0, 1, 0, 0, 0],
          [1, 1, 0, 0, 0, 0],
          [0, 0, 1, 1, 0, 1],
          [0, 1, 0, 0, 0, 1],
          [0, 0, 0, 0, 1, 1],
      ]
      model = BayesianPersonalizedRanking(iterations=5, use_gpu=False)
  
      model.fit(csr_matrix(raw), show_progress=False, callback=callback)
      assert num_called == model.iterations
  
file_path: implicit/tests/bpr_test.py
imports: import unittest
  from recommender_base_test import RecommenderBaseTestMixin
  from scipy.sparse import csr_matrix
  from implicit.bpr import BayesianPersonalizedRanking
  from implicit.gpu import HAS_CUDA
label_desc: Use image node_id 3 for calling a global function with example usage: test_fit_callback() without return types