code: def perform_templating(args):
      
      engine = engines.engines[args.engine]
  
      if args.vary:
          it = variable_outfile_iterator(args.outfiles,
                                         args.infiles,
                                         args.args,
                                         engine)
      else:
          it = constant_outfile_iterator(args.outfiles,
                                         args.infiles,
                                         args.args)
  
      process_combinations(it, engine,
                           tolerant=args.tolerant,
                           read_old=args.read_old,
                           delete_empty=args.delete_empty,
                           )
docs: Perform templating according to the given arguments.