class_docstr: Primitive lock objects.
  
  A primitive lock is a synchronization primitive that is not owned
  by a particular coroutine when locked.  A primitive lock is in one
  of two states, 'locked' or 'unlocked'.
  
  It is created in the unlocked state.  It has two basic methods,
  acquire() and release().  When the state is unlocked, acquire()
  changes the state to locked and returns immediately.  When the
  state is locked, acquire() blocks until a call to release() in
  another coroutine changes it to unlocked, then the acquire() call
  resets it to locked and returns.  The release() method should only
  be called in the locked state; it changes the state to unlocked
  and returns immediately.  If an attempt is made to release an
  unlocked lock, a RuntimeError will be raised.
  
  When more than one coroutine is blocked in acquire() waiting for
  the state to turn to unlocked, only one coroutine proceeds when a
  release() call resets the state to unlocked; first coroutine which
  is blocked in acquire() is being processed.
  
  acquire() is a coroutine and should be called with 'await'.
  
  Locks also support the asynchronous context management protocol.
  'async with lock' statement should be used.
  
  Usage:
  
      lock = Lock()
      ...
      await lock.acquire()
      try:
          ...
      finally:
          lock.release()
  
  Context manager usage:
  
      lock = Lock()
      ...
      async with lock:
           ...
  
  Lock objects can be tested for locking state:
  
      if not lock.locked():
         await lock.acquire()
      else:
         # lock is acquired
         ...
class_docstr_tok: ["Primitive","lock","objects",".","A","primitive","lock","is","a","synchronization","primitive","that","is","not","owned","by","a","particular","coroutine","when","locked",".","A","primitive","lock","is","in","one","of","two","states",",","'locked","'","or","'unlocked","'",".","It","is","created","in","the","unlocked","state",".","It","has","two","basic","methods",",","acquire","(",")","and","release","(",")",".","When","the","state","is","unlocked",",","acquire","(",")","changes","the","state","to","locked","and","returns","immediately",".","When","the","state","is","locked",",","acquire","(",")","blocks","until","a","call","to","release","(",")","in","another","coroutine","changes","it","to","unlocked",",","then","the","acquire","(",")","call","resets","it","to","locked","and","returns",".","The","release","(",")","method","should","only","be","called","in","the","locked","state",";","it","changes","the","state","to","unlocked","and","returns","immediately",".","If","an","attempt","is","made","to","release","an","unlocked","lock",",","a","RuntimeError","will","be","raised",".","When","more","than","one","coroutine","is","blocked","in","acquire","(",")","waiting","for","the","state","to","turn","to","unlocked",",","only","one","coroutine","proceeds","when","a","release","(",")","call","resets","the","state","to","unlocked",";","first","coroutine","which","is","blocked","in","acquire","(",")","is","being","processed",".","acquire","(",")","is","a","coroutine","and","should","be","called","with","'await","'",".","Locks","also","support","the","asynchronous","context","management","protocol",".","'async","with","lock","'","statement","should","be","used",".","Usage",":","lock","=","Lock","(",")","...","await","lock.acquire","(",")","try",":","...","finally",":","lock.release","(",")","Context","manager","usage",":","lock","=","Lock","(",")","...","async","with","lock",":","...","Lock","objects","can","be","tested","for","locking","state",":","if","not","lock.locked","(",")",":","await","lock.acquire","(",")","else",":","#","lock","is","acquired","..."]
docstr: Release a lock.
  
  When the lock is locked, reset it to unlocked, and return.
  If any other coroutines are blocked waiting for the lock to become
  unlocked, allow exactly one of them to proceed.
  
  When invoked on an unlocked lock, a RuntimeError is raised.
  
  There is no return value.
docstr_tok: ["Release","a","lock",".","When","the","lock","is","locked",",","reset","it","to","unlocked",",","and","return",".","If","any","other","coroutines","are","blocked","waiting","for","the","lock","to","become","unlocked",",","allow","exactly","one","of","them","to","proceed",".","When","invoked","on","an","unlocked","lock",",","a","RuntimeError","is","raised",".","There","is","no","return","value","."]
code: def release(self):
      """Release a lock.
  
      When the lock is locked, reset it to unlocked, and return.
      If any other coroutines are blocked waiting for the lock to become
      unlocked, allow exactly one of them to proceed.
  
      When invoked on an unlocked lock, a RuntimeError is raised.
  
      There is no return value.
      """
      if self._locked:
          self._locked = False
          self._wake_up_first()
      else:
          raise RuntimeError("Lock is not acquired.")
  
imports: import collections
  import enum
  from .None import exceptions
  from .None import mixins
label_desc: Use image node_id 4 for calling the Lock obj's underlying member method code with example usage: obj.release() without return types