def main (self, args, app):
    params = self.get_params(args)
    min_offset = relativedelta.relativedelta(hours=params['hours'])
    min_timestamp = parse(json.load(argparse.FileType('r')(params['now']))) - min_offset if 'now' in params else None

    records = [ ]
    for rec in self.range( ):
      timestamp = self.get_record_timestamp(rec)

      if timestamp is not None and min_timestamp is None:
        min_timestamp = timestamp - min_offset

      if timestamp is None or timestamp >= min_timestamp:
        records.append(rec)
      else:
        break
    return records
dataset/ETHPy150Open openaps/openaps/openaps/vendors/medtronic.py/iter_glucose_hours.main/original