class_docstr: A semaphore that prevents release() being called too many times.
  
  If `.release` would increment the semaphore's value past the initial
  value, it raises `ValueError`. Semaphores are mostly used to guard
  resources with limited capacity, so a semaphore released too many times
  is a sign of a bug.
class_docstr_tok: ["A","semaphore","that","prevents","release","(",")","being","called","too","many","times",".","If","`",".release","`","would","increment","the","semaphore","'s","value","past","the","initial","value",",","it","raises","`","ValueError","`",".","Semaphores","are","mostly","used","to","guard","resources","with","limited","capacity",",","so","a","semaphore","released","too","many","times","is","a","sign","of","a","bug","."]
code: def __init__(self, value=1):
      super(BoundedSemaphore, self).__init__(value=value)
      self._initial_value = value
  
imports: from __future__ import absolute_import, division, print_function
  import collections
  from tornado import gen, ioloop
  from tornado.concurrent import Future
label_desc: Use image node_id 1 to create a new BoundedSemaphore object from inherited base classes: Semaphore with example: obj = BoundedSemaphore(value)