Lines Matching refs:lst
167 average = lambda lst: float(sum(lst)) / len(lst)
168 get_sums = lambda lst: [sum(count) for count in zip(*lst)]
169 _pct = lambda lst: float(lst[0]) / lst[1] * 100
177 _missed_pct = lambda lst: (float(lst[1] - lst[0]) / lst[1] * 100
178 if lst[1] != 0 else 0)
180 # pct by numbers: lst means [(incorrect number, total number), ...]
181 # E.g., lst = [(2, 10), (0, 10), (0, 10), (0, 10)]
183 pct_by_numbers = lambda lst: _pct(get_sums(lst))
185 # pct by misssed numbers: lst means
187 # E.g., lst = [(0, 1), (1, 1), (1, 1), (1, 1)]
192 pct_by_missed_numbers = lambda lst: _missed_pct(get_sums(lst))
195 # E.g., lst = [(1, 1), (0, 1), (1, 1), (1, 1)]
198 pct_by_cases_neq = lambda lst: _pct(
199 [len([pair for pair in lst if pair[0] != pair[1]]), len(lst)])
202 # E.g., lst = [(3, 3), (4, 3)]
204 # E.g., lst = [(2, 3), (5, 3)]
207 pct_by_cases_less = lambda lst: _pct(
208 [len([pair for pair in lst if pair[0] < pair[1]]), len(lst)])