-
Notifications
You must be signed in to change notification settings - Fork 0
/
Recommender.py
69 lines (47 loc) · 1.58 KB
/
Recommender.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
import os
import pickle
def can_sing():
with open('.\\profile.dat', 'rb') as f:
profile = pickle.load(f)
try:
os.makedirs('.//additionalData')
except:
pass
song_list = os.listdir('.\\additionalData')
return_list = []
for i in song_list:
with open(f'.\\additionalData\\{i}\\adv.dat', 'rb') as f:
song_data = pickle.load(f)
if song_data.highest_note_num <= profile.can_max: return_list.append(i)
return return_list
def well_sing(): # well_max,
with open('.\\profile.dat', 'rb') as f:
profile = pickle.load(f)
try:
os.makedirs('.//additionalData')
except:
pass
song_list = os.listdir('.\\additionalData')
return_list = []
for i in song_list:
with open(f'.\\additionalData\\{i}\\adv.dat', 'rb') as f:
song_data = pickle.load(f)
if song_data.highest_note_num <= profile.well_max and\
song_data.health <= profile.verified_health: return_list.append(i)
return return_list
def barely_sing():
with open('.\\profile.dat', 'rb') as f:
profile = pickle.load(f)
try:
os.makedirs('.//additionalData')
except:
pass
song_list = os.listdir('.\\additionalData')
return_list = []
h_e = 1 / 6
for i in song_list:
with open(f'.\\additionalData\\{i}\\adv.dat', 'rb') as f:
song_data = pickle.load(f)
if song_data.highest_note_num <= profile.can_max + h_e and \
song_data.note_range <= profile.can_max - 0.5: return_list.append(i)
return return_list