From 314edf5345ef161ac32104bed3366e2785489f75 Mon Sep 17 00:00:00 2001 From: freymond <37636251+freymondz@users.noreply.github.com> Date: Thu, 18 May 2023 13:47:20 -0700 Subject: [PATCH] remove deprecated functions --- potato/flask_server.py | 61 ------------------------------------------ 1 file changed, 61 deletions(-) diff --git a/potato/flask_server.py b/potato/flask_server.py index 9bf8c14c..5e7477c9 100644 --- a/potato/flask_server.py +++ b/potato/flask_server.py @@ -880,24 +880,6 @@ def cal_amount(user): return count -def find_start_id(user): - """ - path = user_dict[user]["path"] - # if not os.path.exists(path): - # initialize_user_data(path, user_dict[user]['user_id']) - user_data = {} - user_dict[user]["start_id"] = len(all_data["annotated_data"]) - lines = user_dict[user]["user_data"] - for i in range(len(lines), 0): - line = lines[str(i)] - if not line["annotated"]: - user_dict[user]["start_id"] = line["id"] - return line["id"] - # user_dict[user]['user_data'] = user_data - """ - raise RuntimeError("This function is deprecated?") - - def move_to_prev_instance(username): user_state = lookup_user_state(username) user_state.go_back() @@ -1017,49 +999,6 @@ def get_span_annotations_for_user_on(username, instance_id): return span_annotations -# This was used to merge annotated instances in previous annotations. For -# example, you had some annotations from google sheet, and want to merge it with -# the current annotation procedure -def merge_annotation(): - """ - global user_dict - global all_data - global args - - with open("merged_annotation.json", "w") as w: - for i in range(len(all_data["annotated_data"])): - line = all_data["annotated_data"][i] - annotations = [] - for user in user_dict: - if "label" in user_dict[user]["user_data"][str(i)]: - annotations.append( - { - "label": int(user_dict[user]["user_data"][str(i)]["label"]), - "user": int(user_dict[user]["user_id"]), - } - ) - line["annotations"] = annotations - w.writelines(json.dumps(line) + "\n") - """ - raise RuntimeError("This function is deprecated?") - - -def write_data(username): - """ - global user_dict - # global closed - global all_data - global args - - path = user_dict[username]["path"] - with open(path, "w") as w: - for line in user_dict[username]["user_data"]: - line = json.dumps(user_dict[username]["user_data"][line]) - w.writelines(line + "\n") - """ - raise RuntimeError("This function is deprecated?") - - @app.route("/") def home(): global user_config