def _indent_levels(line: str) ->int:
    """Determine how many levels the line is indented."""
    spaces = len(line) - len(line.lstrip())
    levels, remainder = divmod(spaces, 4)
    if remainder:
        raise ValueError('indent of first line must be a multiple of four')
    return levels
