Question: 
Write a function to find the item with maximum frequency in a given list.


Model's Code:
def max_occurrences(lst):
    from collections import Counter
    if not lst:
        return None
    count = Counter(lst)
    item, freq = count.most_common(1)[0]
    return item, freq



Sample Correct Code:
from collections import defaultdict
def max_occurrences(nums):
    dict = defaultdict(int)
    for i in nums:
        dict[i] += 1
    result = max(dict.items(), key=lambda x: x[1]) 
    return result


Asserts:
assert max_occurrences([2,3,8,4,7,9,8,2,6,5,1,6,1,2,3,2,4,6,9,1,2])==(2, 5)
assert max_occurrences([2,3,8,4,7,9,8,7,9,15,14,10,12,13,16,16,18])==(8, 2)
assert max_occurrences([10,20,20,30,40,90,80,50,30,20,50,10])==(20, 3)


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 130 of 974: 97/130 (74.61538461538461%): success