def count_defaultdict(dict_of_lists: Mapping[X, List[Y]]) -> Mapping[X, typing.Counter[Y]]:
return {<EOL>k: Counter(v)<EOL>for k, v in dict_of_lists.items()<EOL>}<EOL>
Count the number of elements in each value of the dictionary.