code: def fromrepetitions(cls, iterable):
          
          d = cls()
          for key in iterable:
              d[key] = d[key] + 1 if key in d else 1
          return d
docs: Create a dict whose keys are the members of the iterable and values
          are the number of times the key appears in the iterable.