def METHOD_NAME(self, timeout: float = LOCK_TTL_SECONDS + 1) -> t.Iterator[None]:
    """A context manager that acquires and releases a lock on a path.
    This is a convenience method for acquiring a lock and reading the contents of
    the file. It will release the lock when the context manager exits. This is
    useful for reading a file and then writing it back out as a transaction. If
    the lock cannot be acquired, this will raise a RuntimeError. If the lock is
    acquired, the contents of the file will be returned. If the file does not
    exist, None will be returned. If an exception is raised within the context
    manager, the transaction will be rolled back.
    Args:
        timeout: The timeout for acquiring the lock.
    Raises:
        RuntimeError: If the lock cannot be acquired.
    """
    if not self.acquire_lock(timeout=timeout):
        raise RuntimeError("Could not acquire lock.")
    try:
        yield
    except Exception:
        self.rollback()
        raise
    finally:
        self.release_lock()