import statistics


def median_of_counter_obj(counter):
    """
    Calculate the weighted median of a counter obj
    :param counter: A counter obj
    """
    items = []
    for item in counter.items():
        items += [item[0]] * int(item[1])

    return statistics.median(items)