def METHOD_NAME(top_level_case_tree):
    parsed_case_expr = []
    ifs = top_level_case_tree.args["ifs"]
    for i in ifs:
        lit = i.args["true"].sql()
        sql = i.args["this"].sql(dialect="spark")
        sql = f"{sql}".format(sql=sql, lit=lit)
        parsed_case_expr.append(
            {"sql_expr": sql, "label": f"level_{lit}", "value": int(lit)}
        )
    if top_level_case_tree.args.get("default") is not None:
        lit = top_level_case_tree.args.get("default").sql("spark", pretty=True)
        sql = "ELSE"
        parsed_case_expr.append({"sql_expr": sql, "label": f"level_{lit}", "value": 0})
    return parsed_case_expr