code: def _plot_sources(
      ica,
      inst,
      picks,
      exclude,
      start,
      stop,
      show,
      title,
      block,
      show_scrollbars,
      show_first_samp,
      time_format,
      precompute,
      use_opengl,
      *,
      theme=None,
      overview_mode=None,
      splash=True,
  ):
      """Plot the ICA components as a RawArray or EpochsArray."""
      from ..epochs import BaseEpochs, EpochsArray
      from ..io import BaseRaw, RawArray
      from ._figure import _get_browser
  
      # handle defaults / check arg validity
      is_raw = isinstance(inst, BaseRaw)
      is_epo = isinstance(inst, BaseEpochs)
      sfreq = inst.info["sfreq"]
      color = _handle_default("color", (0.0, 0.0, 0.0))
      units = _handle_default("units", None)
      scalings = (
          _compute_scalings(None, inst)
          if is_raw
          else _handle_default("scalings_plot_raw")
      )
      scalings["misc"] = 5.0
      scalings["whitened"] = 1.0
      unit_scalings = _handle_default("scalings", None)
  
      # data
      if is_raw:
          data = ica._transform_raw(inst, 0, len(inst.times))[picks]
      else:
          data = ica._transform_epochs(inst, concatenate=True)[picks]
  
      # events
      if is_epo:
          event_id_rev = {v: k for k, v in inst.event_id.items()}
          event_nums = inst.events[:, 2]
          event_color_dict = _make_event_color_dict(
              None, inst.events, inst.event_id
          )
  
      # channel properties / trace order / picks
      ch_names = list(ica._ica_names)  # copy
      ch_types = ["misc" for _ in picks]
  
      # add EOG/ECG channels if present
      eog_chs = pick_types(
          inst.info, meg=False, eog=True, ref_meg=False
      )
      ecg_chs = pick_types(
          inst.info, meg=False, ecg=True, ref_meg=False
      )
      for eog_idx in eog_chs:
          ch_names.append(inst.ch_names[eog_idx])
          ch_types.append("eog")
      for ecg_idx in ecg_chs:
          ch_names.append(inst.ch_names[ecg_idx])
          ch_types.append("ecg")
      extra_picks = np.concatenate((eog_chs, ecg_chs)).astype(int)
      if len(extra_picks):
          if is_raw:
              eog_ecg_data, _ = inst[extra_picks, :]
          else:
              eog_ecg_data = np.concatenate(
                  inst.get_data(extra_picks), axis=1
              )
          data = np.append(data, eog_ecg_data, axis=0)
      picks = np.concatenate(
          (picks, ica.n_components_ + np.arange(len(extra_picks)))
      )
      ch_order = np.arange(len(picks))
      n_channels = min([20, len(picks)])
      ch_names_picked = [ch_names[x] for x in picks]
  
      # create info
      info = create_info(ch_names_picked, sfreq, ch_types=ch_types)
      with info._unlock():
          info["meas_date"] = inst.info["meas_date"]
      info["bads"] = [ch_names[x] for x in exclude if x in picks]
      if is_raw:
          inst_array = RawArray(data, info, inst.first_samp)
          inst_array._annotations = inst.annotations
      else:
          data = data.reshape(-1, len(inst), len(inst.times)).swapaxes(
              0, 1
          )
          inst_array = EpochsArray(data, info)
  
      # handle time dimension
      start = 0 if start is None else start
      _last = inst.times[-1] if is_raw else len(inst.events)
      stop = min(start + 20, _last) if stop is None else stop
      first_time = inst._first_time if show_first_samp else 0
      if is_raw:
          duration = stop - start
          start += first_time
      else:
          n_epochs = stop - start
          total_epochs = len(inst)
          epoch_n_times = len(inst.times)
          n_epochs = min(n_epochs, total_epochs)
          n_times = total_epochs * epoch_n_times
          duration = n_epochs * epoch_n_times / sfreq
          event_times = (
              np.arange(total_epochs) * epoch_n_times
              + inst.time_as_index(0)
          ) / sfreq
          # NB: this includes start and end of data:
          boundary_times = (
              np.arange(total_epochs + 1) * epoch_n_times / sfreq
          )
      if duration <= 0:
          raise RuntimeError("Stop must be larger than start.")
  
      # misc
      bad_color = "lightgray"
      title = "ICA components" if title is None else title
      precompute = _handle_precompute(precompute)
  
      params = dict(
          inst=inst_array,
          ica=ica,
          ica_inst=inst,
          info=info,
          # channels and channel order
          ch_names=np.array(ch_names_picked),
          ch_types=np.array(ch_types),
          ch_order=ch_order,
          picks=picks,
          n_channels=n_channels,
          picks_data=list(),
          # time
          t_start=start if is_raw else boundary_times[start],
          duration=duration,
          n_times=inst.n_times if is_raw else n_times,
          first_time=first_time,
          time_format=time_format,
          decim=1,
          # events
          event_times=None if is_raw else event_times,
          # preprocessing
          projs=list(),
          projs_on=np.array([], dtype=bool),
          apply_proj=False,
          remove_dc=True,  # for EOG/ECG
          filter_coefs=None,
          filter_bounds=None,
          noise_cov=None,
          # scalings
          scalings=scalings,
          units=units,
          unit_scalings=unit_scalings,
          # colors
          ch_color_bad=bad_color,
          ch_color_dict=color,
          # display
          butterfly=False,
          clipping=None,
          scrollbars_visible=show_scrollbars,
          scalebars_visible=False,
          window_title=title,
          precompute=precompute,
          use_opengl=use_opengl,
          theme=theme,
          overview_mode=overview_mode,
          splash=splash,
      )
      if is_epo:
          params.update(
              n_epochs=n_epochs,
              boundary_times=boundary_times,
              event_id_rev=event_id_rev,
              event_color_dict=event_color_dict,
              event_nums=event_nums,
              epoch_color_bad=(1, 0, 0),
              epoch_colors=None,
              xlabel="Epoch number",
          )
  
      fig = _get_browser(show=show, block=block, **params)
  
      return fig
  
imports: import warnings
  from functools import partial
  import numpy
  from scipy.stats import gaussian_kde
  from .._fiff.meas_info import create_info
  from .._fiff.pick import _picks_to_idx, pick_types
  from .._fiff.proj import _has_eeg_average_ref_proj
  from ..defaults import DEFAULTS, _handle_default
  from ..utils import _reject_data_segments, _validate_type, fill_doc, verbose
  from .epochs import plot_epochs_image
  from .evoked import _butterfly_on_button_press, _butterfly_onpick
  from .topomap import _plot_ica_topomap
  from .utils import _compute_scalings, _convert_psds, _get_cmap, _get_plot_ch_type, _handle_precompute, _make_event_color_dict, plt_show
label_desc: Use image node_id 13 for calling a global function with example usage: _plot_sources(ica, inst, picks, exclude, start, stop, show, title, block, show_scrollbars, show_first_samp, time_format, precompute, use_opengl) and returns: fig