

def main():
    'Take folder or single file and analyze each.'
    parser = argparse.ArgumentParser(description='Process some integers.')
    parser.add_argument('--debug', dest='debug', action='store_true', help='Print debug information.')
    parser.add_argument('--copy', '-c', dest='copy', help='Copy renamed PDFs to specified folder.')
    parser.add_argument('--template-folder', '-t', dest='template_folder', default=pkg_resources.resource_filename('invoice2data', 'templates'), help='Folder containing invoice templates in yml file. Required.')
    parser.add_argument('input_files', type=argparse.FileType('r'), nargs='+', help='File or directory to analyze.')
    args = parser.parse_args()
    output = []
    templates = read_templates(args.template_folder)
    for f in args.input_files:
        res = extract_data(f.name, templates=templates, debug=args.debug)
        if res:
            print(res)
            output.append(res)
            if args.copy:
                filename = FILENAME.format(date=filename['date'].strftime('%Y-%m-%d'), desc=res['desc'])
                shutil.copyfile(f.name, join(args.copy, filename))
    invoices_to_csv(output, 'invoices-output.csv')

dataset/ETHPy150Open m3nu/invoice2data/invoice2data/main.py main/VarMisuse@192/313 `res`->`filename`