code: def link(
      *figs, include_events=None, exclude_events=None, verbose=None
  ):
      """Link the event channels of two figures together.
  
      When event channels are linked, any events that are published on one
      channel are simultaneously published on the other channel. Links are
      bi-directional.
  
      Parameters
      ----------
      *figs : tuple of matplotlib.figure.Figure | tuple of Figure3D
          The figures whose event channel will be linked.
      include_events : list of str | None
          Select which events to publish across figures. By default (``None``),
          both figures will receive all of each other's events. Passing a list of
          event names will restrict the events being shared across the figures to
          only the given ones.
      exclude_events : list of str | None
          Select which events not to publish across figures. By default (``None``),
          no events are excluded.
      %(verbose)s
      """
      if include_events is not None:
          include_events = set(include_events)
      if exclude_events is not None:
          exclude_events = set(exclude_events)
  
      # Make sure the event channels of the figures are setup properly.
      for fig in figs:
          _get_event_channel(fig)
          if fig not in _event_channel_links:
              _event_channel_links[fig] = weakref.WeakKeyDictionary()
  
      # Link the event channels
      for fig1 in figs:
          for fig2 in figs:
              if fig1 is not fig2:
                  _event_channel_links[fig1][fig2] = (
                      include_events,
                      exclude_events,
                  )
  
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 5 for calling a global function with example usage: link() without return types