class_docstr: A Semaphore implementation.
  
  A semaphore manages an internal counter which is decremented by each
  acquire() call and incremented by each release() call. The counter
  can never go below zero; when acquire() finds that it is zero, it blocks,
  waiting until some other thread calls release().
  
  Semaphores also support the context management protocol.
  
  The optional argument gives the initial value for the internal
  counter; it defaults to 1. If the value given is less than 0,
  ValueError is raised.
class_docstr_tok: ["A","Semaphore","implementation",".","A","semaphore","manages","an","internal","counter","which","is","decremented","by","each","acquire","(",")","call","and","incremented","by","each","release","(",")","call",".","The","counter","can","never","go","below","zero",";","when","acquire","(",")","finds","that","it","is","zero",",","it","blocks",",","waiting","until","some","other","thread","calls","release","(",")",".","Semaphores","also","support","the","context","management","protocol",".","The","optional","argument","gives","the","initial","value","for","the","internal","counter",";","it","defaults","to","1",".","If","the","value","given","is","less","than","0",",","ValueError","is","raised","."]
docstr: Wake up the first waiter that isn't done.
docstr_tok: ["Wake","up","the","first","waiter","that","is","n't","done","."]
code: def _wake_up_next(self):
      """Wake up the first waiter that isn't done."""
      if not self._waiters:
          return False
  
      for fut in self._waiters:
          if not fut.done():
              self._value -= 1
              fut.set_result(True)
              # `fut` is now `done()` and not `cancelled()`.
              return True
      return False
  
imports: import collections
  import enum
  from .None import exceptions
  from .None import mixins
label_desc: Use image node_id 5 for calling the Semaphore obj's underlying member method code with example usage: obj._wake_up_next() and returns: False, False, True