code: def plot_topo_image_epochs(
      epochs,
      layout=None,
      sigma=0.0,
      vmin=None,
      vmax=None,
      colorbar=None,
      order=None,
      cmap="RdBu_r",
      layout_scale=0.95,
      title=None,
      scalings=None,
      border="none",
      fig_facecolor="k",
      fig_background=None,
      font_color="w",
      show=True,
  ):
      """Plot Event Related Potential / Fields image on topographies.
  
      Parameters
      ----------
      epochs : instance of :class:`~mne.Epochs`
          The epochs.
      layout : instance of Layout
          System specific sensor positions.
      sigma : float
          The standard deviation of the Gaussian smoothing to apply along
          the epoch axis to apply in the image. If 0., no smoothing is applied.
      vmin : float
          The min value in the image. The unit is µV for EEG channels,
          fT for magnetometers and fT/cm for gradiometers.
      vmax : float
          The max value in the image. The unit is µV for EEG channels,
          fT for magnetometers and fT/cm for gradiometers.
      colorbar : bool | None
          Whether to display a colorbar or not. If ``None`` a colorbar will be
          shown only if all channels are of the same type. Defaults to ``None``.
      order : None | array of int | callable
          If not None, order is used to reorder the epochs on the y-axis
          of the image. If it's an array of int it should be of length
          the number of good epochs. If it's a callable the arguments
          passed are the times vector and the data as 2d array
          (data.shape[1] == len(times)).
      cmap : colormap
          Colors to be mapped to the values.
      layout_scale : float
          Scaling factor for adjusting the relative size of the layout
          on the canvas.
      title : str
          Title of the figure.
      scalings : dict | None
          The scalings of the channel types to be applied for plotting. If
          ``None``, defaults to ``dict(eeg=1e6, grad=1e13, mag=1e15)``.
      border : str
          Matplotlib borders style to be used for each sensor plot.
      fig_facecolor : color
          The figure face color. Defaults to black.
      fig_background : None | array
          A background image for the figure. This must be a valid input to
          :func:`matplotlib.pyplot.imshow`. Defaults to ``None``.
      font_color : color
          The color of tick labels in the colorbar. Defaults to white.
      show : bool
          Whether to show the figure. Defaults to ``True``.
  
      Returns
      -------
      fig : instance of :class:`matplotlib.figure.Figure`
          Figure distributing one image per channel across sensor topography.
  
      Notes
      -----
      In an interactive Python session, this plot will be interactive; clicking
      on a channel image will pop open a larger view of the image; this image
      will always have a colorbar even when the topo plot does not (because it
      shows multiple sensor types).
      """
      from ..channels.layout import find_layout
  
      scalings = _handle_default("scalings", scalings)
  
      # make a copy because we discard non-data channels and scale the data
      epochs = epochs.copy().load_data()
      # use layout to subset channels present in epochs object
      if layout is None:
          layout = find_layout(epochs.info)
      ch_names = set(layout.names) & set(epochs.ch_names)
      idxs = [epochs.ch_names.index(ch_name) for ch_name in ch_names]
      epochs = epochs.pick(idxs)
      # get lists of channel type & scale coefficient
      ch_types = epochs.get_channel_types()
      scale_coeffs = [scalings.get(ch_type, 1) for ch_type in ch_types]
      # scale the data
      epochs._data *= np.array(scale_coeffs)[:, np.newaxis]
      data = epochs.get_data(copy=False)
      # get vlims for each channel type
      vlim_dict = dict()
      for ch_type in set(ch_types):
          this_data = data[:, np.where(np.array(ch_types) == ch_type)]
          vlim_dict[ch_type] = _setup_vmin_vmax(this_data, vmin, vmax)
      vlim_array = np.array(
          [vlim_dict[ch_type] for ch_type in ch_types]
      )
      # only show colorbar if we have a single channel type
      if colorbar is None:
          colorbar = len(set(ch_types)) == 1
      # if colorbar=True, we know we have only 1 channel type so all entries
      # in vlim_array are the same, just take the first one
      if colorbar and vmin is None and vmax is None:
          vmin, vmax = vlim_array[0]
  
      show_func = partial(
          _erfimage_imshow_unified,
          scalings=scale_coeffs,
          order=order,
          data=data,
          epochs=epochs,
          sigma=sigma,
          cmap=cmap,
          vlim_array=vlim_array,
      )
  
      erf_imshow = partial(
          _erfimage_imshow,
          scalings=scale_coeffs,
          order=order,
          data=data,
          epochs=epochs,
          sigma=sigma,
          cmap=cmap,
          vlim_array=vlim_array,
          colorbar=True,
      )
  
      fig = _plot_topo(
          info=epochs.info,
          times=epochs.times,
          click_func=erf_imshow,
          show_func=show_func,
          layout=layout,
          colorbar=colorbar,
          vmin=vmin,
          vmax=vmax,
          cmap=cmap,
          layout_scale=layout_scale,
          title=title,
          fig_facecolor=fig_facecolor,
          font_color=font_color,
          border=border,
          x_label="Time (s)",
          y_label="Epoch",
          unified=True,
          img=True,
      )
      add_background_image(fig, fig_background)
      plt_show(show)
      return fig
  
imports: from copy import deepcopy
  from functools import partial
  import numpy
  from scipy import ndimage
  from .._fiff.pick import channel_type, pick_types
  from ..defaults import _handle_default
  from ..utils import Bunch, _check_option, _clean_names, _is_numeric, _to_rgb, fill_doc
  from .utils import DraggableColorbar, _check_cov, _check_delayed_ssp, _draw_proj_checkbox, _plot_masked_image, _setup_ax_spines, _setup_vmin_vmax, add_background_image, plt_show
label_desc: Use image node_id 16 for calling a global function with example usage: plot_topo_image_epochs(epochs, layout, sigma, vmin, vmax, colorbar, order, cmap, layout_scale, title, scalings, border, fig_facecolor, fig_background, font_color, show) and returns: fig