code: def run(self, rerun=2):
      result = unittest.TextTestRunner(
          stream=sys.stdout, verbosity=1
      ).run(self.__suite)
      if result.wasSuccessful() is True:
          return result
  
      if len(result.errors) > 0:
          return result  # no need to restart in case of errors
  
      for attempt in range(rerun):
          time.sleep(
              1
          )  # sleep 1 second to change current time for random seed.
  
          print(
              "\n======================================================================"
          )
          print("Rerun failed tests (attempt: %d)." % (attempt + 1))
          print(
              "----------------------------------------------------------------------"
          )
  
          failure_suite = unittest.TestSuite()
          for failure in result.failures:
              failure_suite.addTest(failure[0])
  
          result = unittest.TextTestRunner(
              stream=sys.stdout, verbosity=3
          ).run(failure_suite)
          if result.wasSuccessful() is True:
              return result
  
      return result
  
imports: import sys
  import time
  import unittest
label_desc: Use image node_id 3 for calling the suite_holder obj's underlying member method code with example usage: obj.run(rerun) and returns: result, result, result, result