<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def groupby_count(i, key=None, force_keys=None):
 """ Aggregate iterator values into buckets based on how frequently the values appear. Example:: [(1, 3), (2, 1), (3, 1)] """

    counter = defaultdict(lambda: 0)
    if not key:
        key = lambda o: o

    for k in i:
        counter[key(k)] += 1

    if force_keys:
        for k in force_keys:
            counter[k] += 0

    return counter.items()