code: def wait_for(timeout, func, *args, **kwargs):
      
      result = func(*args, **kwargs)
      try:
          return result.wait(timeout)
      except crochet.TimeoutError:
          result.cancel()
          raise
docs: Waits for a eventual result.
  
      Parameters
      ----------
      timeout : int
          How much time to wait, in seconds.
      func : callable
          A function that returns ``crochet.EventualResult``.
      args : tuple, optional
          Arguments for ``func``.
      kwargs : dict, optional
          Keyword arguments for ``func``.
  
      Returns
      -------
      out
          Given ``func`` result.
  
      Raises
      ------
      corchet.TimeoutError