def _subdivide_interval_by_date(start, end):
    if start.date() == end.date():
        date_to_secs = {start.date(): _to_secs(end - start)}
    else:
        date_to_secs = {}

        date_to_secs[start.date()] = _to_secs(
            datetime(start.year, start.month, start.day) + timedelta(days=1) -
            start)

        date_to_secs[end.date()] = _to_secs(
            end - datetime(end.year, end.month, end.day))

        # fill in dates in the middle
        cur_date = start.date() + timedelta(days=1)
        while cur_date < end.date():
            date_to_secs[cur_date] = _to_secs(timedelta(days=1))
            cur_date += timedelta(days=1)

    # remove zeros
    date_to_secs = dict(
        (d, secs) for d, secs in date_to_secs.items() if secs)

    return date_to_secs
Ensure that on* properties are not assigned string values.
dataset/ETHPy150Open Yelp/mrjob/mrjob/tools/emr/audit_usage.py/_subdivide_interval_by_date--crossover with--dataset/ETHPy150Open mozilla/app-validator/appvalidator/testcases/javascript/instanceproperties.py/set_on_event