def make_timestamp_range(start, end):
 ts_range = {}
 if start:
  ts_range['$gte'] = start
 if end:
  ts_range['$lt'] = end
 return ts_range

def make_timestamp_range ( start , end ) : ts_range = { } if start : ts_range [ '$gte' ] = start if end : ts_range [ '$lt' ] = end return ts_range
given two possible datetimes .