code: def _wait_for(self, callback, timeout=None):
          '''
          Spins until callback() returns truthy.
          '''
          start = time.time()
          while True:
              if callback():
                  return
              elapsed = time.time() - start
              if timeout and elapsed > timeout:
                  raise BrowsingTimeout(
                          'timed out after %.1fs waiting for: %s' % (
                              elapsed, callback))
              brozzler.sleep(self._wait_intervalf _wait_for(self, callback, timeout=None):
          '''
          Spins until callback() returns truthy.
          '''
          start = time.time()
          while True:
              if callback():
                  return
              elapsed = time.time() - start
              if timeout and elapsed > timeout:
                  raise BrowsingTimeout(
                          'timed out after %.1fs waiting for: %s' % (
                              elapsed, callback))
              brozzler.sleep(self._wait_interval)
docs: Spins until callback() returns truthy.