human
I wrote the below code

    def processor(term_method, _, term_instance):
        term_dtype = term_instance.dtype
        if (term_dtype != dtype):
            raise TypeError(message_template.format(method_name=term_method.__name__, expected_dtype=dtype.name, received_dtype=term_dtype))
        return term_instance
    return preprocess(self=processor)

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

def restrict_to_dtype(dtype, message_template):