human
I wrote the below code

    def fieldfunc(item):
        value = item._values_fixed[field]
        for (pattern, replacement) in rules:
            if pattern.match(value.lower()):
                return replacement
        return value
    return fieldfunc

What's a good function header?
assistant
#Here's a good function header.

def rewriter(field, rules):