def normalize_data_query_bounds(lower, upper, time, tz):
 lower -= datetime.timedelta(days=1)
 if (time is not None):
  return (normalize_data_query_time(lower, time, tz), normalize_data_query_time(upper, time, tz))
 return (lower, upper)

def normalize_data_query_bounds ( lower , upper , time , tz ) : lower -= datetime . timedelta ( days = 1 ) if ( time is not None ) : return ( normalize_data_query_time ( lower , time , tz ) , normalize_data_query_time ( upper , time , tz ) ) return ( lower , upper )
adjust the first and last dates in the requested datetime index based on the provided query time and tz .