Spaces:
Sleeping
Sleeping
nastasiasnk
commited on
Commit
•
81225f7
1
Parent(s):
cded988
Update app.py
Browse files
app.py
CHANGED
@@ -18,19 +18,22 @@ def test(input_json):
|
|
18 |
|
19 |
|
20 |
# Extract the datatree part which is a list of dictionaries
|
21 |
-
datatree = inputs["datatree"]
|
22 |
|
23 |
# Rebuild a Python dictionary from the datatree
|
24 |
# Initialize an empty dictionary
|
25 |
-
python_dict = {}
|
26 |
-
|
|
|
|
|
|
|
27 |
# Iterate through each item in the datatree list
|
28 |
for branch_dict in datatree:
|
29 |
# Each branch_dict is a dictionary with one key-value pair
|
30 |
for key, value in branch_dict.items():
|
31 |
# Assign the key and value to the new dictionary
|
32 |
python_dict[key] = value
|
33 |
-
|
34 |
|
35 |
#a_list = [int(item.strip()) for item in a_list_string.split(',')]
|
36 |
|
@@ -48,7 +51,7 @@ def test(input_json):
|
|
48 |
# Prepare the output
|
49 |
output = {
|
50 |
"list": a_list,
|
51 |
-
"matrix":
|
52 |
}
|
53 |
|
54 |
return json.dumps(output)
|
|
|
18 |
|
19 |
|
20 |
# Extract the datatree part which is a list of dictionaries
|
21 |
+
datatree = inputs['input']["datatree"]
|
22 |
|
23 |
# Rebuild a Python dictionary from the datatree
|
24 |
# Initialize an empty dictionary
|
25 |
+
#python_dict = {}
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
"""
|
30 |
# Iterate through each item in the datatree list
|
31 |
for branch_dict in datatree:
|
32 |
# Each branch_dict is a dictionary with one key-value pair
|
33 |
for key, value in branch_dict.items():
|
34 |
# Assign the key and value to the new dictionary
|
35 |
python_dict[key] = value
|
36 |
+
"""
|
37 |
|
38 |
#a_list = [int(item.strip()) for item in a_list_string.split(',')]
|
39 |
|
|
|
51 |
# Prepare the output
|
52 |
output = {
|
53 |
"list": a_list,
|
54 |
+
"matrix": datatree,
|
55 |
}
|
56 |
|
57 |
return json.dumps(output)
|