import re


def get_level(line, indent) :
    """ Return the level of indentation of a given line
    """
    
    level = 0
    while line.startswith(indent) :
        line = line[len(indent):]
        level += 1
    if re.match(r"^(\s+)", line) :
        raise Exception("Syntax Error")
    return level