title: how to know python semaphore value
body: <p>i use threading.semaphore in my code and i wonder if there is way i can use code like This</p>
  
  <pre><code>if(sema.acquire()!=True):
     #do Somthing
  </code></pre>
  
  <p>i want to use this piece of code in loop so i need to get if semaphore is taken or it's released 
   or use code like this in my code</p>
  
  <pre><code>if(sema.get_value!=1):
    #do something
  </code></pre>
  
  <p>i read this doc but i can't find my answer
  <a href="https://docs.python.org/3/library/threading.html" rel="noreferrer">https://docs.python.org/3/library/threading.html</a></p>