def iterate_date_values(d, start_date=None, stop_date=None, default=0):
    dataiter = iter(d)
    cur_day, cur_val = next(dataiter)

    start_date = start_date or cur_day

    while cur_day < start_date:
        cur_day, cur_val = next(dataiter)

    for d in iterate_date(start_date, stop_date):
        if d != cur_day:
            yield default
            continue

        yield cur_val
        try:
            cur_day, cur_val = next(dataiter)
        except StopIteration:
            if not stop_date:
                raise
Convert (date, value) sorted lists into contiguous value-per-day data sets. Great for sparklines.
dataset/ETHPy150Open shazow/unstdlib.py/unstdlib/standard/datetime_.py/iterate_date_values