How would you write a function that returns the integer that occurs the most frequently in a list of integers?
Implement most_frequent_integer(nums), where nums is a non-empty list of integers and the return value is an integer. If multiple integers share the highest frequency, return the one whose first occurrence appears earliest in nums.
def most_frequent_integer(nums):