def METHOD_NAME(inner):
    # can only differentiate with respect to a single argument, but
    # handle both list and non-list arguments
    def f(self, fields, dfields):
        if isinstance(fields, list):
            assert len(fields) == len(dfields) and fields[0] is dfields[0]
            return [inner(self, fields[0])]
        else:
            return inner(self, fields)
    return f