docs: def _setup_events(plugin):
      """ Handles setup or teardown of event hook registration for the provided
          plugin.
  
          `plugin`
              ``Plugin`` class.
          """
  
      events = plugin.events
  
      if events and isinstance(events, (list, tuple)):
          for event in [e for e in events if e in _EVENT_VALS]:
              register('event', event, plugin)