def get_line_indent(token):
    """Finds the indent of the line the token starts in."""
    start = token.start_mark.buffer.rfind('\n', 0, token.start_mark.pointer
        ) + 1
    content = start
    while token.start_mark.buffer[content] == ' ':
        content += 1
    return content - start
