def fillout(template, adict):
    """returns copy of template filled out per adict

    applies str.replace for every entry in adict
    """

    rval = template[:]
    for key in adict:
        rval = rval.replace(key, adict[key])
    return rval