def get_refpoint(line: str):
    """
    Get the whitespace reference point
    (length of left-leading whitespace)
    on a given line from a query.
    """

    refpoint = 0
    while " "*refpoint == line[:refpoint]:
        refpoint += 1
    return refpoint - 1