def METHOD_NAME(lines):
    count = 0
    lineno = 1
    for l in lines:
        if "@{" in l:
            count = count + 1
        elif "@}" in l:
            count = count -1
        if count < 0:
            sys.exit("Error in file '%s' in line %d"%(filename, lineno))
        lineno = lineno + 1
    if count != 0:
        sys.exit("Error: missing closing braces in file '%s'"%(filename))
    return