def _normalize_interval(start, end, value):
 if (not isinstance(start, datetime)):
  start = datetime.combine(start, START_OF_DAY)
  end = datetime.combine(end, START_OF_DAY)
 if (start.tzinfo is None):
  start = pytz.UTC.localize(start)
  end = pytz.UTC.localize(end)
 else:
  start = start.astimezone(pytz.UTC)
  end = end.astimezone(pytz.UTC)
 return (start, end)

def _normalize_interval ( start , end , value ) : if ( not isinstance ( start , datetime ) ) : start = datetime . combine ( start , START_OF_DAY ) end = datetime . combine ( end , START_OF_DAY ) if ( start . tzinfo is None ) : start = pytz . UTC . localize ( start ) end = pytz . UTC . localize ( end ) else : start = start . astimezone ( pytz . UTC ) end = end . astimezone ( pytz . UTC ) return ( start , end )
normalize datetime intervals .