input: Write a function to count the occurrences of elements in a list and return a dictionary.
  assert count_occurrences([1, 2, 3, 4, 4, 4, 4, 5, 6, 1]) == {1: 2, 2: 1, 3: 1, 4: 4, 5: 1, 6: 1}
  assert count_occurrences(['a', 'b', 'a', 'c', 'b', 'a']) == {'a': 3, 'b': 2, 'c': 1}
  assert count_occurrences([True, False, True, False, True]) == {True: 3, False: 2}
output: def count_occurrences(lst):
      occurrences = {}
      for element in lst:
          if element in occurrences:
              occurrences[element] += 1
          else:
              occurrences[element] = 1
      return occurrences