code: def __new__(cls, name, bases, attrs):
      for event in BLOCKS_EVENTS:
          trigger = (
              event
              if isinstance(event, EventListener)
              else EventListener(event_name=event)
          ).copy()
          trigger.set_doc(component=name)
          attrs[event] = trigger.listener
      component_class = super().__new__(cls, name, bases, attrs)
      create_or_modify_pyi(BlocksEvents, "BlocksEvents", BLOCKS_EVENTS)
      return component_class
  
imports: from __future__ import annotations
  from gradio.component_meta import create_or_modify_pyi
  from gradio.events import EventListener, Events
label_desc: Use image node_id 1 for calling the BlocksMeta obj's underlying member method code with example usage: obj.__new__(cls, name, bases, attrs) and returns: component_class