code: def subscribe(fig, event_name, callback, *, verbose=None):
      """Subscribe to an event on a figure's event channel.
  
      Parameters
      ----------
      fig : matplotlib.figure.Figure | Figure3D
          The figure of which event channel to subscribe.
      event_name : str
          The name of the event to listen for.
      callback : callable
          The function that should be called whenever the event is published.
      %(verbose)s
      """
      channel = _get_event_channel(fig)
      logger.debug(f"Subscribing to channel {channel}")
      if event_name not in channel:
          channel[event_name] = set()
      channel[event_name].add(callback)
  
imports: import contextlib
  import re
  import weakref
  from dataclasses import dataclass
  from typing import Optional, Union
  from matplotlib.colors import Colormap
  from ..utils import _validate_type, fill_doc, logger, verbose, warn
label_desc: Use image node_id 3 for calling a global function with example usage: subscribe(fig, event_name, callback) without return types