Best Python code snippet using lemoncheesecake
my_strategy_copy.py
Source:my_strategy_copy.py
1# å°500çä¸æéå转为transfermktçè±æå2def is_between(value, low, up=float('inf')):3 if value >= low and value < up:4 return True5 else:6 return False7class My_strategy:8 def __init__(self):9 self.strategy_league = ['å¾·ç²', 'è±è¶
', 'æ³ç²', 'æ³ä¹', 'è±å ', 'ä¿è¶
', 'æ¯ç²', 'å¾·ä¹', 'ä¹è¶
', '丹è¶
', 'è±ç²', 'è±ä¹', '西ç²', '丹ç²', 'æ·ç²', 'æä¹', '西ä¹', 'æ³¢ç²', 'è¬è¶
', '奥ä¹', '奥ç²',10 'åè¶
', 'ç±ç²', 'ç±è¶
', 'K1èèµ', 'æªè¶
', 'è·ç²', 'æªç²', 'K2èèµ', 'J1èèµ', 'æ¾³è¶
', 'ä¸è¶
', 'J2èèµ', 'çå
¸è¶
', 'çå
¸ç²', 'ä¿ç²', 'èè¶
', 'ç士è¶
', 'ç士ç²', 'è·ä¹', 'å°å²è¶
',11 'è¡è¶
', '巴西ç²', '墨è¶
', '巴西ä¹', 'è¡ç²', 'é¿ç²']12 def get(self, league_name, value_ratio):13 if not league_name in self.strategy_league:14 return ''15 if league_name == 'å¾·ç²':16 if is_between(value_ratio, 0.1, 0.3) or is_between(value_ratio, 0.6, 0.7):17 return 318 elif is_between(value_ratio, 5, 10):19 return 120 elif is_between(value_ratio, 0, 0.1):21 return 022 if league_name == 'è±è¶
':23 if is_between(value_ratio, 0.5, 0.6) or is_between(value_ratio, 0.9, 1):24 return 325 elif is_between(value_ratio, 0.8, 0.9):26 return 127 elif is_between(value_ratio, 0, 0.1) or is_between(value_ratio, 1, 1.1) or is_between(value_ratio, 1.67, 2):28 return 029 if league_name == 'æ³ç²':30 if is_between(value_ratio, 0, 0.1):31 return 332 elif is_between(value_ratio, 0.7, 0.8) or is_between(value_ratio, 2.5, 3.33):33 return 034 if league_name == 'æ³ä¹':35 if is_between(value_ratio, 1.43, 1.67):36 return 337 elif is_between(value_ratio, 0.2, 0.3):38 return 039 elif is_between(value_ratio, 0.1, 0.2):40 return 141 if league_name == 'è±å ':42 if is_between(value_ratio, 0.1, 0.3) or is_between(value_ratio, 10):43 return 344 if league_name == 'ä¿è¶
':45 if is_between(value_ratio, 0, 0.1) or is_between(value_ratio, 0.5, 0.6):46 return 047 elif is_between(value_ratio, 1, 1.1):48 return 349 elif is_between(value_ratio, 2, 2.5):50 return 151 if league_name == 'æ¯ç²':52 if is_between(value_ratio, 2, 2.5):53 return 054 elif is_between(value_ratio, 0.2, 0.3):55 return 156 elif is_between(value_ratio, 0.8, 0.9):57 return 358 if league_name == 'å¾·ä¹':59 if is_between(value_ratio, 0.6, 0.7) or is_between(value_ratio, 1.67, 2.5):60 return 361 elif is_between(value_ratio, 0.7, 0.8):62 return 163 if league_name == 'ä¹è¶
':64 if is_between(value_ratio, 1.25, 1.43) or is_between(value_ratio, 3.33, 5):65 return 366 elif is_between(value_ratio, 0.6, 0.7) or is_between(value_ratio, 1.43, 1.67):67 return 168 elif is_between(value_ratio, 0.5, 0.6):69 return 070 if league_name == '丹è¶
':71 if is_between(value_ratio, 5, 10):72 return 373 elif is_between(value_ratio, 0.9, 1):74 return 175 elif is_between(value_ratio, 0.1, 0.2) or is_between(value_ratio, 1.1, 1.25):76 return 077 if league_name == 'è±ç²':78 if is_between(value_ratio, 0.2, 0.3):79 return 080 if league_name == 'è±ä¹':81 if is_between(value_ratio, 0, 0.1):82 return 083 if league_name == '西ç²':84 if is_between(value_ratio, 0.1, 0.2):85 return 386 elif is_between(value_ratio, 0.2, 0.3):87 return 188 elif is_between(value_ratio, 1.67, 2):89 return 090 if league_name == '丹ç²':91 if is_between(value_ratio, 0.3, 0.4):92 return 093 if league_name == 'æ·ç²':94 if is_between(value_ratio, 0.4, 0.5):95 return 196 elif is_between(value_ratio, 5, 10):97 return 398 if league_name == 'æä¹':99 if is_between(value_ratio, 3.33, 10):100 return 3101 if league_name == '西ä¹':102 if is_between(value_ratio, 0.3, 0.4) or is_between(value_ratio, 5, 10):103 return 1104 elif is_between(value_ratio, 0.1, 0.2):105 return 0106 if league_name == 'æ³¢ç²':107 if is_between(value_ratio, 2.5, 3.33):108 return 0109 if league_name == 'è¬è¶
':110 if is_between(value_ratio, 5, 10):111 return 3112 elif is_between(value_ratio, 1.43, 1.67):113 return 0114 if league_name == '奥ä¹':115 if is_between(value_ratio, 2.5, 3.33):116 return 3117 elif is_between(value_ratio, 0.6, 0.7):118 return 0119 if league_name == '奥ç²':120 if is_between(value_ratio, 0.4, 0.5):121 return 3122 if league_name == 'åè¶
':123 if is_between(value_ratio, 2.5, 3.33):124 return 3125 if league_name == 'ç±ç²':126 if is_between(value_ratio, 2.5, 3.33):127 return 3128 elif is_between(value_ratio, 0.9, 1):129 return 0130 if league_name == 'ç±è¶
':131 if is_between(value_ratio, 10):132 return 3133 elif is_between(value_ratio, 0, 0.1):134 return 0135 if league_name == 'K1èèµ':136 if is_between(value_ratio, 0, 0.1) or is_between(value_ratio, 0.4, 0.5) or is_between(value_ratio, 10):137 return 1138 elif is_between(value_ratio, 0.5, 0.6):139 return 0140 if league_name == 'æªè¶
':141 if is_between(value_ratio, 0.2, 0.3):142 return 0143 if league_name == 'è·ç²':144 if is_between(value_ratio, 0, 0.1):145 return 0146 if league_name == 'æªç²':147 if is_between(value_ratio, 0, 0.1) or is_between(value_ratio, 1.1, 1.25):148 return 0149 if league_name == 'K2èèµ':150 if is_between(value_ratio, 0.1, 0.3):151 return 3152 elif is_between(value_ratio, 1, 1.1):153 return 1154 if league_name == 'J1èèµ':155 if is_between(value_ratio, 0.2, 0.4) or is_between(value_ratio, 1.1, 1.25):156 return 0157 if league_name == 'æ¾³è¶
':158 if is_between(value_ratio, 1.67, 2):159 return 3160 elif is_between(value_ratio, 0.4, 0.5):161 return 0162 if league_name == 'ä¸è¶
':163 if is_between(value_ratio, 1.1, 1.25):164 return 1165 if league_name == 'J2èèµ':166 if is_between(value_ratio, 0.2, 0.3):167 return 0168 if league_name == 'çå
¸è¶
':169 if is_between(value_ratio, 5, 10):170 return 3171 elif is_between(value_ratio, 1.67, 2):172 return 1173 elif is_between(value_ratio, 0.4, 0.5):174 return 0175 if league_name == 'çå
¸ç²':176 if is_between(value_ratio, 10):177 return 3178 if league_name == 'ä¿ç²':179 if is_between(value_ratio, 0.2, 0.3) or is_between(value_ratio, 0.7, 0.8):180 return 0181 if league_name == 'èè¶
':182 if is_between(value_ratio, 0.8, 1):183 return 0184 if league_name == 'ç士è¶
':185 if is_between(value_ratio, 0.2, 0.3):186 return 1187 elif is_between(value_ratio, 2.5, 3.33):188 return 0189 if league_name == 'ç士ç²':190 if is_between(value_ratio, 3.33, 5):191 return 3192 elif is_between(value_ratio, 0.2, 0.3):193 return 0194 if league_name == 'è·ä¹':195 if is_between(value_ratio, 1.25, 1.43) or is_between(value_ratio, 2, 2.5):196 return 3197 elif is_between(value_ratio, 0.2, 0.3):198 return 0199 if league_name == 'å°å²è¶
':200 if is_between(value_ratio, 1, 1.1):201 return 1202 elif is_between(value_ratio, 10):203 return 3204 if league_name == 'è¡è¶
':205 if is_between(value_ratio, 0.7, 0.8) or is_between(value_ratio, 1.1, 1.25):206 return 1207 elif is_between(value_ratio, 0.5, 0.6):208 return 0209 if league_name == '巴西ç²':210 if is_between(value_ratio, 0, 0.1):211 return 0212 if league_name == '墨è¶
':213 if is_between(value_ratio, 1.67, 2):214 return 1215 if league_name == '巴西ä¹':216 if is_between(value_ratio, 1.25, 1.43):217 return 1218 if league_name == 'è¡ç²':219 if is_between(value_ratio, 0.2, 0.3) or is_between(value_ratio, 1.25, 1.43):220 return 0221 if league_name == 'é¿ç²':222 if is_between(value_ratio, 1.1, 1.25):223 return 1224 elif is_between(value_ratio, 0.5, 0.6):225 return 0...
my_strategy.py
Source:my_strategy.py
1# å°500çä¸æéå转为transfermktçè±æå2def is_between(value, low, up=float('inf')):3 if value >= low and value <= up:4 return True5 else:6 return False7class My_strategy:8 def __init__(self):9 self.all_league = ['å¾·ç²', 'è±è¶
', 'æ³ç²', 'æ³ä¹', 'è±å ', 'ä¿è¶
', 'æ¯ç²', 'å¾·ä¹', 'ä¹è¶
', '丹è¶
', 'è±ç²', 'è±ä¹', '西ç²', '丹ç²', 'æ·ç²', 'æä¹', '西ä¹', 'æ³¢ç²', 'è¬è¶
', '奥ä¹', '奥ç²',10 'åè¶
', 'ç±ç²', 'ç±è¶
', 'K1èèµ', 'æªè¶
', 'è·ç²', 'æªç²', 'K2èèµ', 'J1èèµ', 'æ¾³è¶
', 'ä¸è¶
', 'J2èèµ', 'çå
¸è¶
', 'çå
¸ç²', 'ä¿ç²', 'èè¶
', 'ç士è¶
', 'ç士ç²', 'è·ä¹', 'å°å²è¶
',11 'è¡è¶
', '巴西ç²', '墨è¶
', '巴西ä¹', 'è¡ç²', 'é¿ç²', 'ç½ç²', 'å
ç½ç²', 'å¡ç²è', '以è¶
', 'ä¿è¶
', 'å¥ç²']12 self.elimilated_league = ['ç±ç²']13 self.no_draw_league = []14 self.strategy2_league_arr = ['å¾·ç²', 'è±è¶
', 'æ³ç²', 'ä¿è¶
', '丹è¶
', '西ç²', 'æ·ç²', 'åè¶
', 'ä¿ç²', 'ç士è¶
', 'è·ä¹',15 'å·´ä¹', 'é¿ç²', 'ä¿è¶
', 'å¥ç²']16 def get(self, league_name, value_ratio, home_odd, draw_odd, away_odd, home_value, away_value, home_lisan, draw_lisan, away_lisan):17 if league_name in self.elimilated_league:18 return ''19 # 15 10 0.72(2016) 26 0.49 34 0.4120 if is_between(value_ratio, 3.9, 4.6) and is_between(home_odd, 1.8, 1.9):21 return 33322 # 45 33.93 0.75(2016) 60 0.63 78 0.4923 if is_between(value_ratio, 0.22, 0.29) and is_between(away_odd, 2.85, 3.25):24 return 11125 # 24 19.76 0.82(2016) 33 0.54 34 0.626 if is_between(value_ratio, 0.25, 0.3) and is_between(away_odd, 3.3, 4):27 return 00028 # 178 35.66 0.2(2016) 264 0.1 294 0.0529 if is_between(value_ratio, 0.65, 0.7) and is_between(home_odd, 1.85, 2.1):30 return 331 # 110 26.25 0.24(2016) 155 0.21 189 0.1532 if is_between(value_ratio, 1.01, 1.13):33 if away_odd >= 2.45 and away_odd <= 2.6 and away_odd < home_odd:34 return 035 # 30 å½ä¸çã0.7 1 å½ä¸çã0.3336 # 1561 0.0 // do not suggest37 # if is_between(value_ratio, 3.33, 5) and home_odd <= 1.9:38 # return 33339 # 93 33.95 0.37(2016) 151 0.22 163 0.240 if is_between(value_ratio, 1.65, 1.8) and draw_odd >= 2.9 and draw_odd <= 3.1:41 return 142 # 44 13.14 0.3(2016) 56 0.13 71 0.0943 if is_between(value_ratio, 0.02, 0.1) and is_between(away_odd, 2.2, 3.8):44 return 045 # åçç¥46 # if is_between(value_ratio, 0.6, 0.7) and home_odd <= 1.5:47 # return 348 #49 # if is_between(value_ratio, 0.1, 0.2) and draw_odd <= 3.05:50 # return 151 # if is_between(value_ratio, 0.2, 0.3) and draw_odd <= 3:52 # return 153 # if is_between(value_ratio, 0.4, 0.5) and draw_odd <= 2.9:54 # return 155 # if is_between(value_ratio, 0.5, 0.6) and draw_odd <= 2.85:56 # return 157 # if is_between(value_ratio, 1, 1.25) and draw_odd <= 2.9:58 # return 159 # if is_between(value_ratio, 1.67, 2) and draw_odd <= 3.1:60 # return 161 # if is_between(value_ratio, 2.5, 3.33) and draw_odd <= 3.15:62 # return 163 # if is_between(value_ratio, 10, 99) and draw_odd <= 5:64 # return 165 #66 # if is_between(value_ratio, 0.8, 0.9) and away_odd <= 1.7:67 # return 068 # if is_between(value_ratio, 1.1, 1.25) and away_odd <= 2.55:69 # return 070 # if is_between(value_ratio, 1.25, 1.43) and away_odd <= 2.2:71 # return 072 # if is_between(value_ratio, 1.43, 1.67) and away_odd <= 2.3:73 # return 074 # if is_between(value_ratio, 3.33, 5) and away_odd <= 3.85:75 # return 076 # ååçç¥77 # if league_name in self.strategy2_league_arr:78 # if is_between(value_ratio, 0.01, 0.18) and home_odd >= 2.8 and home_odd <= 9:79 # return 080 #81 # if is_between(value_ratio, 3.8, 4.5):82 # cur_max_odd = 2.183 # if home_odd >= 1.4 and home_odd <= cur_max_odd:84 # return 385 # elif is_between(value_ratio, 1.8, 1.9) and league_name not in self.no_draw_league:86 # if draw_odd >= 2.5 and draw_odd <= 3.8:87 # return 188 # elif is_between(value_ratio, 0, 0.1) or is_between(value_ratio, 1.1, 1.3):89 # if away_odd >= 1.4 and away_odd <= 2.3:90 # return 0...
VolumeEstimator.py
Source:VolumeEstimator.py
2 min_time = 03 min_time_index = 04 max_time = 05 max_time_index = 06 if is_between(int(current_time), 900, 905):7 return int(current_volume) * 158 if is_between(int(current_time), 905, 910):9 min_time = 90510 min_time_index = 1511 max_time = 91012 max_time_index = 1013 if is_between(int(current_time), 910, 915):14 min_time = 91015 min_time_index = 1016 max_time = 91517 max_time_index = 818 if is_between(int(current_time), 915, 930):19 min_time = 91520 min_time_index = 821 max_time = 93022 max_time_index = 4.523 if is_between(int(current_time), 930, 945):24 min_time = 93025 min_time_index = 4.526 max_time = 94527 max_time_index = 3.528 if is_between(int(current_time), 945, 1000):29 min_time = 94530 min_time_index = 3.531 max_time = 100032 max_time_index = 2.933 if is_between(int(current_time), 1000, 1015):34 min_time = 100035 min_time_index = 2.936 max_time = 101537 max_time_index = 2.538 if is_between(int(current_time), 1015, 1030):39 min_time = 101540 min_time_index = 2.541 max_time = 103042 max_time_index = 2.2243 if is_between(int(current_time), 1030, 1045):44 min_time = 103045 min_time_index = 2.2246 max_time = 104547 max_time_index = 2.0148 if is_between(int(current_time), 1045, 1100):49 min_time = 104550 min_time_index = 2.0151 max_time = 110052 max_time_index = 1.8553 if is_between(int(current_time), 1100, 1115):54 min_time = 110055 min_time_index = 1.8556 max_time = 111557 max_time_index = 1.7458 if is_between(int(current_time), 1115, 1130):59 min_time = 111560 min_time_index = 1.7461 max_time = 113062 max_time_index = 1.6363 if is_between(int(current_time), 1130, 1145):64 min_time = 113065 min_time_index = 1.6366 max_time = 114567 max_time_index = 1.5468 if is_between(int(current_time), 1145, 1200):69 min_time = 114570 min_time_index = 1.5471 max_time = 120072 max_time_index = 1.4573 if is_between(int(current_time), 1200, 1215):74 min_time = 120075 min_time_index = 1.4576 max_time = 121577 max_time_index = 1.3878 if is_between(int(current_time), 1215, 1230):79 min_time = 121580 min_time_index = 1.3881 max_time = 123082 max_time_index = 1.3283 if is_between(int(current_time), 1230, 1245):84 min_time = 123085 min_time_index = 1.3286 max_time = 124587 max_time_index = 1.2688 if is_between(int(current_time), 1245, 1300):89 min_time = 124590 min_time_index = 1.2691 max_time = 130092 max_time_index = 1.293 if is_between(int(current_time), 1300, 1315):94 min_time = 130095 min_time_index = 1.296 max_time = 131597 max_time_index = 1.1198 if is_between(int(current_time), 1315, 1330):99 min_time = 1315100 min_time_index = 1.11101 max_time = 1330102 max_time_index = 1103 time_diff_ratio = (max_time - int(current_time))/(max_time - min_time)104 ratio = max_time_index + ((min_time_index - max_time_index) * time_diff_ratio)105 return round(int(current_volume) * ratio)106def is_between(compare_int: int, min_int: int, max_int: int) -> bool:107 if min_int < compare_int <= max_int:108 return True109 else:...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!