def outfile_name(infile):
    """Given infile (i.e. template file), generate outfile name."""
    outfile = '%s.%s' % (infile, 'generated')
    if 'template' in infile:
        outfile = infile.replace('template', 'generated')
    return outfile