def METHOD_NAME(argv=None):
    if argv is None:
        argv = sys.argv
    try:
        opts, args = getopt.getopt(argv[1:], "h", ['help'])
    except getopt.error as msg:
        print('Error: %s\n' % msg, file=sys.stderr)
        print(__usage__.strip(), file=sys.stderr)
        return 1
    # process options
    for o, a in opts:
        if o in ('-h', '--help'):
            print(__usage__.strip(), file=sys.stderr)
            return 0
    # check arguments
    if len(args) != 2:
        print('Error: 2 arguments required\n', file=sys.stderr)
        print(__usage__.strip(), file=sys.stderr)
        return 2
    # process arguments
    in_name = args[0]
    out_name = args[1]
    # open input
    in_file = open(in_name, 'r')
    # open data store via PywwsContext
    ds = pywws.storage.PywwsContext(out_name,False).raw_data
    # get time to go forward to
    first_stored = ds.after(datetime.min)
    if first_stored == None:
        first_stored = datetime.max
    # copy any missing data
    last_date = None
    count = 0
    for line in in_file:
        items = line.split(',')
        local_date = datetime.strptime(items[2].strip(), '%Y-%m-%d %H:%M:%S')
        date = time_zone.local_to_utc(local_date)
        if last_date and date < last_date:
            date = date + timedelta(hours=1)
            print("Corrected DST ambiguity %s -> %s" % (local_date, date))
        last_date = date
        # get data
        data = {}
        data['delay'] = int(items[3])
        data['hum_in'] = int(items[4])
        data['temp_in'] = float(items[5])
        try:
            data['hum_out'] = int(items[6])
        except Exception:
            data['hum_out'] = None
        try:
            data['temp_out'] = float(items[7])
        except Exception:
            data['temp_out'] = None
        data['abs_pressure'] = float(items[10])
        try:
            data['wind_ave'] = float(items[12])
        except Exception:
            data['wind_ave'] = None
        try:
            data['wind_gust'] = float(items[14])
        except Exception:
            data['wind_gust'] = None
        try:
            data['wind_dir'] = int(items[16])
        except Exception:
            data['wind_dir'] = None
        data['rain'] = int(items[18]) * 0.3
        data['status'] = int(items[35].split()[15], 16)
        # check against first_stored
        if first_stored - date < timedelta(minutes=data['delay'] // 2):
            break
        ds[date] = data
        count += 1
    print("%d records written" % count)
    in_file.close()
    return 0