def count_daily_prefixes(pfx_raw_data):
    """
    Count how many prefixes have been announced by each AS in input.

    Note: input should contain data for only one day.

    :param pfx_raw_data: generator that yields dictionaries containing BGP announces for one day
                          (from jarvis)
                            {"day": "2016/01/01", "origin_asn": 1000, "num_prefixes": 2,
                            "prefixes": ["190.210.210.0/24", "190.210.211.0/24"]}
    :return: dictionary {asn: nb_of_prefixes_announced_by_asn}
    """
    data = {}
    for line in pfx_raw_data:
        asn = line["origin_asn"]
        nb_pfx = line["num_prefixes"]
        data[asn] = data.get(asn, 0) + nb_pfx
    return data