-
Notifications
You must be signed in to change notification settings - Fork 1
/
example_generation.py
81 lines (75 loc) · 3.49 KB
/
example_generation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import json
import random
by_project_number_of_votes = {
"Programar, que es eso?": 15,
"Vis de redes neuronales": 3,
"Mirror Pypi": 12,
"Linkode": 5,
"Recordium": 6,
"Radio to podcast": 3,
"Choppycamp": 12,
"LabJM": 2,
"Pilas": 10,
"Cuentos a epub": 3,
"Web PyAr": 8,
"Moravec": 4,
"Raspi": 2,
"Fades": 5,
"PyCamp voting manager": 9,
"Easy Camp": 7,
"Metaprogramacion": 4,
"Encajonar apps": 6
}
input_example = {
"available_slots": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"responsable_available_slots": {
"Matias": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"David": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"Ariel": ["A3", "A4", "A5", "B2", "B3", "B4", "B5"],
"Fisa": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"Gilgamezh": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"Facu": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"Diego": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"Agustin": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"Manuq": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"Litox": ["B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"Mario": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"Zoe": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"],
"Luri": ["A3", "A4", "A5", "B2", "B3", "B4", "B5", "C1", "C2", "C3", "C4"]
},
"projects": {
"Programar, que es eso?": {"responsables": ["Matias", "David"], "priority_slots": ['A3']},
"Vis de redes neuronales": {"responsables": ["Ariel"]},
"Mirror Pypi": {"responsables": ["Fisa", "Gilgamezh"]},
"Linkode": {"responsables": ["Facu", "Matias"]},
"Recordium": {"responsables": ["Facu"]},
"Radio to podcast": {"responsables": ["Diego"]},
"Choppycamp": {"responsables": ["Fisa"]},
"LabJM": {"responsables": ["Agustin"]},
"Pilas": {"responsables": ["Manuq"]},
"Cuentos a epub": {"responsables": ["Diego"]},
"Web PyAr": {"responsables": ["Litox"]},
"Moravec": {"responsables": ["Mario"]},
"Raspi": {"responsables": ["David"]},
"Fades": {"responsables": ["Facu", "Gilgamezh"]},
"PyCamp voting manager": {"responsables": ["Zoe"]},
"Easy Camp": {"responsables": ["Matias", "Luri"]},
"Metaprogramacion": {"responsables": ["David"]},
"Encajonar apps": {"responsables": ["Manuq"]},
},
}
attendes = (list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") +
list(set(input_example["responsable_available_slots"].keys())))
themes = ['web', 'desktop', 'mobile', 'ia', 'hardware', 'comunity', '']
difficult_levels = [1, 2, 3]
output_example = {}
slots = input_example['available_slots']
for i, (project_name, project) in enumerate(input_example["projects"].items()):
project['votes'] = random.sample(attendes, by_project_number_of_votes[project_name])
project['difficult_level'] = random.choice(difficult_levels)
project['theme'] = random.choice(themes)
if "priority_slots" not in project:
project["priority_slots"] = []
output_example[project_name] = slots[i % len(slots)]
json.dump(input_example, open('input_example.json', 'wt'), indent=2)
json.dump(output_example, open('output_example.json', 'wt'), indent=2)