code: def test_stop_on_not_first_learner(self):
      params = {
          "total_time_limit": 100,
          "total_time_start": time.time(),
          "expected_learners_cnt": 10,
      }
      callback = TotalTimeConstraint(params)
      callback.add_and_set_learner(learner={})
      callback.on_learner_train_start(logs=None)
      callback.on_learner_train_end(logs=None)
      with self.assertRaises(NotTrainedException) as context:
          #
          # hardcoded change just for tests!
          callback.total_time_start = time.time() - 600 - 100 - 1
          #
          callback.add_and_set_learner(learner={})
          callback.on_learner_train_start(logs=None)
          callback.on_learner_train_end(logs=None)
      self.assertTrue("Force to stop" in str(context.exception))
  
file_path: mljar-supervised/tests/tests_callbacks/test_total_time_constraint.py
imports: import unittest
  import tempfile
  import json
  import time
  import numpy
  import pandas
  from numpy.testing import assert_almost_equal
  from supervised.callbacks.total_time_constraint import TotalTimeConstraint
  from supervised.exceptions import NotTrainedException
label_desc: Use image node_id 2 for calling the TotalTimeConstraintTest obj's underlying member method code with example usage: obj.test_stop_on_not_first_learner() without return types