original_string: public function spin($lambda)
      {
          $e = null;
          $timeLimit = time() + self::SPIN_TIMEOUT;
          do {
              try {
                  $return = $lambda($this);
                  if ($return) {
                      return $return;
                  }
              } catch (\Exception $e) {
              }
  
              $this->sleep();
          } while ($timeLimit > time());
  
          throw new \Exception(
              'Timeout while retreaving DOM element' .
              ($e !== null ? '. Last exception: ' . $e->getMessage() : '')
          );
      }
code: public function spin($lambda)
      {
          $e = null;
          $timeLimit = time() + self::SPIN_TIMEOUT;
          do {
              try {
                  $return = $lambda($this);
                  if ($return) {
                      return $return;
                  }
              } catch (\Exception $e) {
              }
  
              $this->sleep();
          } while ($timeLimit > time());
  
          throw new \Exception(
              'Timeout while retreaving DOM element' .
              ($e !== null ? '. Last exception: ' . $e->getMessage() : '')
          );
      }
code_tokens: public function spin ( $ lambda ) { $ e = null ; $ timeLimit = time ( ) + self :: SPIN_TIMEOUT ; do { try { $ return = $ lambda ( $ this ) ; if ( $ return ) { return $ return ; } } catch ( \ Exception $ e ) { } $ this -> sleep ( ) ; } while ( $ timeLimit > time ( ) ) ; throw new \ Exception ( 'Timeout while retreaving DOM element' . ( $ e !== null ? '. Last exception: ' . $ e -> getMessage ( ) : '' ) ) ; }
docstring: Behat spin function
  Execute a provided function and return it's result if valid,
  if an exception is thrown or the result is false wait and retry
  until a max timeout is reached.
docstring_tokens: Behat spin function Execute a provided function and return it s result if valid if an exception is thrown or the result is false wait and retry until a max timeout is reached .