code: def wait_for_zap(self, timeout):
          
          timeout_time = time.time() + timeout
          while not self.is_running():
              if time.time() > timeout_time:
                  raise ZAPError('Timed out waiting for ZAP to start.')
              time.sleep(2)
docs: Wait for ZAP to be ready to receive API calls.