code: def acquire(self,blocking=True,timeout=None,shared=False):
          
          with self._lock:
              if shared:
                  self._acquire_shared(blocking,timeout)
              else:
                  self._acquire_exclusive(blocking,timeout)
              assert not (self.is_shared and self.is_exclusive)
docs: Acquire the lock in shared or exclusive mode.