code: def variable_outfile_iterator(outfiles, infiles, arggroups, engine):
      
      assert len(outfiles) == 1
  
      template = engine(outfiles[0], tolerant=False)
  
      for infile in infiles:
          properties = make_path_properties(infile, prefix='')
  
          for arggroup in arggroups:
              outfile = template.apply(dict(arggroup, **properties))
              yield (outfile, infile, arggroup)
docs: Iterate over variable output file name template.