def revision_before(latest_revision: int, revisions: list) ->dict:
    """Finds the revision before the current revision"""
    for revision in reversed(revisions):
        if revision['revision'] < latest_revision:
            return revision
    raise ValueError('No earlier revision found')
