From 5dc9414d9fe790142545b233dcd02d1c355d0ca0 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Tue, 19 Oct 2021 21:06:52 +0800 Subject: Flask web server prototype --- jimbrella/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 jimbrella/utils.py (limited to 'jimbrella/utils.py') diff --git a/jimbrella/utils.py b/jimbrella/utils.py new file mode 100644 index 0000000..a9f4623 --- /dev/null +++ b/jimbrella/utils.py @@ -0,0 +1,6 @@ +def group_by_status(umbrellas: list) -> dict: + keys = set([umb["status"] for umb in umbrellas]) + statuses = {} + for key in keys: + statuses[key] = [umb for umb in umbrellas if umb["status"] == key] + return statuses -- cgit v1.2.3