Create a dict whose keys are the members of the iterable and values
        are the number of times the key appears in the iterable.

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