code: def acquire(self, lock_transactions=None):
          
  
          if not self.personal_lock.acquire(timeout=self.lock_timeout):
              raise LockTimeoutError(self)
  
          self.with_count += 1
  
          if lock_transactions is None:
              lock_transactions = self.lock_transactions
  
          if lock_transactions and self.db_state.active_connection is not self:
              if not self.db_state.transaction_lock.acquire(timeout=self.lock_timeout):
                  self.personal_lock.release()
                  raise LockTimeoutError(self)
  
              self.db_state.active_connection = self
  
          if not self.db_state.lock.acquire(timeout=self.lock_timeout):
              self.personal_lock.release()
  
              if lock_transactions:
                  self.db_state.active_connection = None
                  self.db_state.transaction_lock.release()
  
              raise LockTimeoutError(self)
  
          try:
              # If the connection is closed, an exception is thrown
              in_transaction = self.in_transaction
          except sqlite3.ProgrammingError:
              in_transaction = False
  
          self.was_in_transaction = in_transaction
docs: Acquire the connection locks.
  
              :param lock_transactions: `bool`, acquire the transaction lock
                                        (`self.lock_transactions` is the default value)