def release_lock(dax, key, lock_mode=LockMode.wait):
  """Manually release a pg advisory lock.

  :dax: a DataAccess instance
  :key: either a big int or a 2-tuple of integers
  :lock_mode: a member of the LockMode enum
  """
  lock_fxn = _lock_fxn("unlock", lock_mode, False)
  return dax.get_scalar(
    dax.callproc(lock_fxn, key if isinstance(key, (list, tuple)) else [key])[0])
Manually release a pg advisory lock.

  :dax: a DataAccess instance
  :key: either a big int or a 2-tuple of integers
  :lock_mode: a member of the LockMode enum