def _get_query_timestamps(args={}):
 search_offset = int(args.get('search_offset', 0))
 start_timestamp = args.get('start_timestamp')
 if start_timestamp:
  start_timestamp = timeutils.parse_isotime(start_timestamp)
  start_timestamp = start_timestamp.replace(tzinfo=None)
  query_start = (start_timestamp - datetime.timedelta(minutes=search_offset))
 else:
  query_start = None
 end_timestamp = args.get('end_timestamp')
 if end_timestamp:
  end_timestamp = timeutils.parse_isotime(end_timestamp)
  end_timestamp = end_timestamp.replace(tzinfo=None)
  query_end = (end_timestamp + datetime.timedelta(minutes=search_offset))
 else:
  query_end = None
 return {'query_start': query_start, 'query_end': query_end, 'start_timestamp': start_timestamp, 'end_timestamp': end_timestamp, 'search_offset': search_offset}

def _get_query_timestamps ( args = { } ) : search_offset = int ( args . get ( 'search_offset' , 0 ) ) start_timestamp = args . get ( 'start_timestamp' ) if start_timestamp : start_timestamp = timeutils . parse_isotime ( start_timestamp ) start_timestamp = start_timestamp . replace ( tzinfo = None ) query_start = ( start_timestamp - datetime . timedelta ( minutes = search_offset ) ) else : query_start = None end_timestamp = args . get ( 'end_timestamp' ) if end_timestamp : end_timestamp = timeutils . parse_isotime ( end_timestamp ) end_timestamp = end_timestamp . replace ( tzinfo = None ) query_end = ( end_timestamp + datetime . timedelta ( minutes = search_offset ) ) else : query_end = None return { 'query_start' : query_start , 'query_end' : query_end , 'start_timestamp' : start_timestamp , 'end_timestamp' : end_timestamp , 'search_offset' : search_offset }
return any optional timestamp information in the request .