def METHOD_NAME(outfile, prefix, **kwargs):
    tfile = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                         'scaffolding_templates', prefix + '_template')
    with open(tfile, 'r') as f:
        template = f.read()
    if kwargs:
        contents = template.format(**kwargs)
    else:
        contents = template
    if outfile is not None:
        if os.path.exists(outfile):
            raise RuntimeError("'{}' already exists.".format(outfile))
        with open(outfile, 'w') as f:
            f.write(contents)
    return contents