def METHOD_NAME(conn, table_spec, files, config,
                 sample_rate=1, max_records=1000, max_files=1):
    to_return = []
    empty_samples = []
    files_so_far = 0
    sorted_files = sorted(files, key=lambda f: f['last_modified'], reverse=True)
    for f in sorted_files:
        empty_file, samples = sample_file(conn, table_spec, f,
                                          sample_rate, max_records, config)
        if empty_file:
            empty_samples += samples
        else:
            to_return += samples
        files_so_far += 1
        if files_so_far >= max_files:
            break
    if not any(to_return):
        return empty_samples
    return to_return