code: def check_pending(self):
          
          for name in self.hook.__dict__:
              if name[0] != "_":
                  hook = getattr(self.hook, name)
                  if not hook.has_spec():
                      for hookimpl in hook.get_hookimpls():
                          if not hookimpl.optionalhook:
                              raise PluginValidationError(
                                  hookimpl.plugin,
                                  "unknown hook %r in plugin %r"
                                  % (name, hookimpl.plugin),
                              )
docs: Verify that all hooks which have not been verified against
          a hook specification are optional, otherwise raise PluginValidationError