def METHOD_NAME(statement, path):
    level = getattr(statement, "level", 0)
    if level is None:
        level = 0
    for _ in range(level - 1):
        path = os.path.dirname(path)
    return path