human
Complete the below
def init_func_generator(cls, spec):

    ''''Generate `__init__` function based on TPayload.default_spec
    For example::
    spec = [(\'name\', \'Alice\'), (\'number\', None)]
    will generate a types.FunctionType object representing::
    def __init__(self, name=\'Alice\', number=None):
    self.name = name
    self.number = number'
    '''
assistant
#Here is the Python program you requested.
    if (not spec):
        def __init__(self):
            pass
        return __init__
    (varnames, defaults) = zip(*spec)
    args = ',    '.join(map('{0[0]}={0[1]!r}'.format, spec))
    init = 'def    __init__(self,    {0}):\n'.format(args)
    init += '\n'.join(map('                self.{0}    =    {0}'.format, varnames))
    name = '<generated    {0}.__init__>'.format(cls.__name__)
    code = compile(init, name, 'exec')
    func = next((c for c in code.co_consts if isinstance(c, types.CodeType)))
    linecache.cache[name] = (len(init), None, init.splitlines(True), name)
    return types.FunctionType(func, {}, argdefs=defaults)