code: def test_BatchTimeTracker():
      with mock.patch.object(
          BatchTimeTracker, "_time_now"
      ) as mock_method:
          mock_method.side_effect = [10, 40]
          iterations_to_complete = 3
          tracker = BatchTimeTracker(
              batches_to_measure=iterations_to_complete
          )
          stopped = False
          for i in range(iterations_to_complete + 1):
              try:
                  tracker.after_batch()
                  if i == iterations_to_complete:
                      raise ValueError(
                          "CancelFitException should be raised, but was not"
                      )
              except CancelFitException:
                  stopped = True
          assert stopped
          assert tracker.batch_measured_time == 10.0
  
file_path: autogluon/tabular/tests/unittests/models/test_tabular_nn_fastai.py
imports: from unittest import mock
  import numpy
  import pytest
  from fastai.callback.core import CancelFitException
  from autogluon.tabular.models.fastainn.callbacks import BatchTimeTracker
  from autogluon.tabular.models.fastainn.tabular_nn_fastai import NNFastAiTabularModel
label_desc: Use image node_id 6 for calling a global function with example usage: test_BatchTimeTracker() without return types