docs: def _wrapinit(init):
      """Wrap an existing initialize function by thawing self for the duration
      of the init.
  
      Parameters
      ----------
      init : callable
          The user-provided init.
  
      Returns
      -------
      wrapped : callable
          The wrapped init method.
      """
      try:
          spec = getfullargspec(init)
      except TypeError:
          # we cannot preserve the type signature.
          def __init__(*args, **kwargs):
              self = args[0]
              __setattr__._initializing.add(self)
              init(*args, **kwargs)
              __setattr__._initializing.remove(self)
              _check_missing_slots(self)
  
          return __init__
  
      args = spec.args
      varargs = spec.varargs
      if not (args or varargs):
          raise TypeError(
              "%r must accept at least one positional argument for 'self'" %
              getattr(init, '__qualname__', getattr(init, '__name__', init)),
          )
  
      if not args:
          self = '%s[0]' % varargs
          forward = argspec = '*' + varargs
      else:
          self = args[0]
          forward = argspec = ', '.join(args)
  
      if args and varargs:
          forward = '%s, *%s' % (forward, spec.varargs)
          argspec = '%s, *%s' % (argspec, spec.varargs)
      if spec.kwonlyargs:
          forward = '%s, %s' % (
              forward,
              ', '.join(map('{0}={0}'.format, spec.kwonlyargs))
          )
          argspec = '%s,%s%s' % (
              argspec,
              '*, ' if not spec.varargs else '',
              ', '.join(spec.kwonlyargs),
          )
      if spec.varkw:
          forward = '%s, **%s' % (forward, spec.varkw)
          argspec = '%s, **%s' % (argspec, spec.varkw)
  
      ns = {
          '__init': init,
          '__initializing': __setattr__._initializing,
          '__check_missing_slots': _check_missing_slots,
      }
      exec(
          dedent(
              """\
              def __init__({argspec}):
                  __initializing.add({self})
                  __init({forward})
                  __initializing.remove({self})
                  __check_missing_slots({self})
              """.format(
                  argspec=argspec,
                  self=self,
                  forward=forward,
              ),
          ),
          ns,
      )
      __init__ = ns['__init__']
      __init__.__defaults__ = spec.defaults
      __init__.__kwdefaults__ = spec.kwonlydefaults
      __init__.__annotations__ = spec.annotations
      return __init__