code: def test_stop_at_the_right_time():
      X, y, model = get_data_and_model(0.1)
  
      time_stopping = TimeStopping(2, verbose=0)
      history = model.fit(
          X, y, epochs=30, verbose=0, callbacks=[time_stopping]
      )
  
      assert len(history.epoch) <= 20
  
file_path: addons/tensorflow_addons/callbacks/tests/time_stopping_test.py
imports: import time
  import pytest
  import numpy
  import tensorflow
  from tensorflow.keras.models import Sequential
  from tensorflow.keras.layers import Dense
  from tensorflow_addons.callbacks.time_stopping import TimeStopping
label_desc: Use image node_id 2 for calling a global function with example usage: test_stop_at_the_right_time() without return types