def _normalize_interval(start, end, value):
if not isinstance(start, datetime):<EOL><INDENT>start = datetime.combine(start, START_OF_DAY)<EOL>end = datetime.combine(end, START_OF_DAY)<EOL><DEDENT>if start.tzinfo is None:<EOL><INDENT>start = pytz.UTC.localize(start)<EOL>end = pytz.UTC.localize(end)<EOL><DEDENT>else:<EOL><INDENT>start = start.astimezone(pytz.UTC)<EOL>end = end.astimezone(pytz.UTC)<EOL><DEDENT>return start, end<EOL>
Normalize datetime intervals.

    Given a pair of datetime.date or datetime.datetime objects,
    returns a 2-tuple of tz-aware UTC datetimes spanning the same interval.

    For datetime.date objects, the returned interval starts at 00:00:00.0
    on the first date and ends at 00:00:00.0 on the second.

    Naive datetimes are upgraded to UTC.

    Timezone-aware datetimes are normalized to the UTC tzdata.

    Params:
        - start: A date or datetime
        - end: A date or datetime