code: def __new__(cls, name, bases, attrs):
      if "__init__" in attrs:
          attrs["__init__"] = updateable(attrs["__init__"])
      if "EVENTS" not in attrs:
          found = False
          for base in bases:
              if hasattr(base, "EVENTS"):
                  found = True
                  break
          if not found:
              raise ComponentDefinitionError(
                  f"{name} or its base classes must define an EVENTS list. "
                  "If no events are supported, set it to an empty list."
              )
      events = attrs.get("EVENTS", [])
      if not all(isinstance(e, (str, EventListener)) for e in events):
          raise ComponentDefinitionError(
              f"All events for {name} must either be an string or an instance "
              "of EventListener."
          )
      new_events = []
      for event in events:
          trigger = (
              event
              if isinstance(event, EventListener)
              else EventListener(event_name=event)
          ).copy()
          new_events.append(trigger)
          trigger.set_doc(component=name)
          attrs[event] = trigger.listener
      if "EVENTS" in attrs:
          attrs["EVENTS"] = new_events
      component_class = super().__new__(cls, name, bases, attrs)
      create_or_modify_pyi(component_class, name, events)
      return component_class
  
file_path: gradio/gradio/component_meta.py
imports: from __future__ import annotations
  import ast
  import inspect
  from abc import ABCMeta
  from functools import wraps
  from pathlib import Path
  from jinja2 import Template
  from gradio.events import EventListener
  from gradio.exceptions import ComponentDefinitionError
  from gradio.utils import no_raise_exception
label_desc: Use image node_id 1 for calling the ComponentMeta obj's underlying member method code with example usage: obj.__new__(cls, name, bases, attrs) and returns: component_class