title: How to decorate a Python function with a context manager?
body: <p>Given an existing context manager, I'd like a function decorator that causes execution to occur inside a <code>with</code>-block.</p>
  <p>This should make the following two code blocks equivalent:</p>
  <pre><code>@decorate(contextmanager)
  async def f():
     ...
  
  await f()
  </code></pre>
  <pre><code>async def f():
      ...
  
  async with contextmanager:
      await f()
  </code></pre>
  <p>This would be handy for wrapping functions in e.g. <code>asyncio.Semaphore(n)</code> contexts.</p>
  <p>Does a convenience utility like <code>decorate</code> already exist somewhere in the standard library?</p>