class_docstr: A lock for coroutines.
  
  A Lock begins unlocked, and `acquire` locks it immediately. While it is
  locked, a coroutine that yields `acquire` waits until another coroutine
  calls `release`.
  
  Releasing an unlocked lock raises `RuntimeError`.
  
  A Lock can be used as an async context manager with the ``async
  with`` statement:
  
  >>> from tornado import locks
  >>> lock = locks.Lock()
  >>>
  >>> async def f():
  ...    async with lock:
  ...        # Do something holding the lock.
  ...        pass
  ...
  ...    # Now the lock is released.
  
  For compatibility with older versions of Python, the `.acquire`
  method asynchronously returns a regular context manager:
  
  >>> async def f2():
  ...    with (yield lock.acquire()):
  ...        # Do something holding the lock.
  ...        pass
  ...
  ...    # Now the lock is released.
  
  .. versionchanged:: 4.3
     Added ``async with`` support in Python 3.5.
class_docstr_tok: ["A","lock","for","coroutines",".","A","Lock","begins","unlocked",",","and","`","acquire","`","locks","it","immediately",".","While","it","is","locked",",","a","coroutine","that","yields","`","acquire","`","waits","until","another","coroutine","calls","`","release","`",".","Releasing","an","unlocked","lock","raises","`","RuntimeError","`",".","A","Lock","can","be","used","as","an","async","context","manager","with","the","``","async","with","``","statement",":",">",">",">","from","tornado","import","locks",">",">",">","lock","=","locks.Lock","(",")",">",">",">",">",">",">","async","def","f","(",")",":","...","async","with","lock",":","...","#","Do","something","holding","the","lock",".","...","pass","...","...","#","Now","the","lock","is","released",".","For","compatibility","with","older","versions","of","Python",",","the","`",".acquire","`","method","asynchronously","returns","a","regular","context","manager",":",">",">",">","async","def","f2","(",")",":","...","with","(","yield","lock.acquire","(",")",")",":","...","#","Do","something","holding","the","lock",".","...","pass","...","...","#","Now","the","lock","is","released",".","..","versionchanged",":",":","4.3","Added","``","async","with","``","support","in","Python","3.5","."]
code: def __enter__(self) -> None:
      raise RuntimeError("Use `async with` instead of `with` for Lock")
  
imports: import collections
  import datetime
  import types
  from tornado import gen, ioloop
  from tornado.concurrent import Future, future_set_result_unless_cancelled
  from typing import Union, Optional, Type, Any, Awaitable
  import typing
label_desc: Use image node_id 5 for calling the Lock obj's underlying member method code with example usage: obj.__enter__() without return types