def codify(codemap, filtercodes):
    """
    Filters codes list in values to renamed/ignored list of codes

    :param dict codemap: Mapping of codes to names to use in display
    :param list filtercodes: List of codes to ignore
    """
    def inner(values):
        codes = [str(codemap.get(code, code))
                 for code in values if code and code not in filtercodes]
        return filter(lambda c: len(c), codes)
    return inner