parameters: (self, predicate, timeout=None)
return_statement: return result
docstring: Wait until a condition evaluates to True.
  
          predicate should be a callable which result will be interpreted as a
          boolean value.  A timeout may be provided giving the maximum time to
          wait.
docstring_summary: Wait until a condition evaluates to True.
docstring_tokens: Wait until a condition evaluates to True .
function: def wait_for(self, predicate, timeout=None):
          """Wait until a condition evaluates to True.
  
          predicate should be a callable which result will be interpreted as a
          boolean value.  A timeout may be provided giving the maximum time to
          wait.
  
          """
          endtime = None
          waittime = timeout
          result = predicate()
          while not result:
              if waittime is not None:
                  if endtime is None:
                      endtime = _time() + waittime
                  else:
                      waittime = endtime - _time()
                      if waittime <= 0:
                          break
              self.wait(waittime)
              result = predicate()
          return result
function_tokens: def wait_for ( self , predicate , timeout = None ) : endtime = None waittime = timeout result = predicate ( ) while not result : if waittime is not None : if endtime is None : endtime = _time ( ) + waittime else : waittime = endtime - _time ( ) if waittime <= 0 : break self . wait ( waittime ) result = predicate ( ) return result