human
I wrote the below code

    if (expected_defaults is None):
        expected_defaults = {}
    unknown_defaults = (set(expected_defaults.keys()) - set(kwargs.keys()))
    if unknown_defaults:
        raise TypeError('expected_defaults    contained    the    following    unrecognized    keys:    {}'.format(tuple(unknown_defaults)))
    required_kwargs = kwargs.copy()
    for k in expected_defaults.keys():
        required_kwargs.pop(k)
    class WithInitTests(TestCase, ):
        '\n                                Tests    for    classes    decorated    with    ``with_init``.\n                                '
        def test_init(self):
            '\n                                                The    record    type    accepts    keyword    arguments    which    are    exposed    as\n                                                public    attributes.\n                                                '
            record = record_type(**kwargs)
            self.assertEqual(kwargs.values(), [getattr(record, key) for key in kwargs.keys()])
        def test_optional_arguments(self):
            '\n                                                The    record    type    initialiser    has    arguments    which    may    be    omitted.\n                                                '
            try:
                record = record_type(**required_kwargs)
            except ValueError as e:
                self.fail(('One    of    the    following    arguments    was    expected    to    be    optional    but    appears    to    be    required:    %r.    Error    was:    %r' % (expected_defaults.keys(), e)))
            self.assertEqual(required_kwargs.values(), [getattr(record, key) for key in required_kwargs.keys()])
        def test_optional_defaults(self):
            '\n                                                The    optional    arguments    have    the    expected    defaults.\n                                                '
            try:
                record = record_type(**required_kwargs)
            except...

What's a good function header?

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

def make_with_init_tests(record_type, kwargs, expected_defaults=None):