code: def wait(self, timeout=None):
          
          if not self._is_owned():
              raise RuntimeError("cannot wait on un-acquired lock")
  
          current = compat.getcurrent()
  
          waketime = None if timeout is None else time.time() + timeout
          if timeout is not None:
              scheduler.schedule_at(waketime, current)
          self._waiters.append((current, waketime))
  
          self._lock.release()
          scheduler.state.mainloop.switch()
          self._lock.acquire()
  
          if timeout is not None:
              timedout = not scheduler._remove_timer(waketime, current)
              if timedout:
                  self._waiters.remove((current, waketime))
              return timedout
  
          return False
docs: wait to be woken up by the condition
  
          .. note::
  
              this method will block the current coroutine until a :meth:`notify`
              wakes it back up.
  
          :raises:
              `RuntimeError` if the underlying lock hasn't been
              :meth:`acquired <Lock.acquire>`