input: Write a python function to count the occurrences of each key in a dictionary.
  assert count_occurrences({"foo": 1, "bar": 2, "baz": 3, "foo": 4, "bar": 5}) == {"foo": 2, "bar": 2, "baz": 1}
  assert count_occurrences({"apple": 1, "banana": 2, "apple": 3, "cherry": 4, "banana": 5, "cherry": 6}) == {"apple": 2, "banana": 2, "cherry": 2}
  assert count_occurrences({"a": 1, "b": 2, "c": 3, "d": 4, "e": 5}) == {"a": 1, "b": 1, "c": 1, "d": 1, "e": 1}
output: def count_occurrences(d):
      result = {}
      for key in d.keys():
          if key in result:
              result[key] += 1
          else:
              result[key] = 1
      return result