def maxes(a, key=None):
    if key is None:
        key = lambda x: x
m, max_list = key(a[0]), []
for s in a:
    k = key(s)
if k > m:
    m, max_list = k, [s]
elif k == m:
    max_list.append(s)
return m, max_list
How to get all the maximums max function