code: def sigterm(self) -> None:
          '''Handle SIGTERM from the system by stopping tasks gracefully.
          Repeated signals will be ignored while waiting for tasks to finish.'''
  
          if self.stop_attempts < 1:
              Log.info('received SIGTERM, gracefully stopping tasks')
              self.stop_attempts += 1
              self.terminate()
  
          else:
              Log.info('received SIGTERM, bravely waiting for tasks'f sigterm(self) -> None:
          '''Handle SIGTERM from the system by stopping tasks gracefully.
          Repeated signals will be ignored while waiting for tasks to finish.'''
  
          if self.stop_attempts < 1:
              Log.info('received SIGTERM, gracefully stopping tasks')
              self.stop_attempts += 1
              self.terminate()
  
          else:
              Log.info('received SIGTERM, bravely waiting for tasks')
docs: Handle SIGTERM from the system by stopping tasks gracefully.
          Repeated signals will be ignored while waiting for tasks to finish.