code: def _prepare_data_ica_properties(
      inst, ica, reject_by_annotation=True, reject="auto"
  ):
      """Prepare Epochs sources to plot ICA properties.
  
      Parameters
      ----------
      ica : instance of mne.preprocessing.ICA
          The ICA solution.
      inst : instance of Epochs or Raw
          The data to use in plotting properties.
      reject_by_annotation : bool, optional
          [description], by default True
      reject : str, optional
          [description], by default 'auto'
  
      Returns
      -------
      kind : str
          "Segment" for BaseRaw and "Epochs" for BaseEpochs
      dropped_indices : list
          Dropped epochs indexes.
      epochs_src : instance of Epochs
          Segmented data of ICA sources.
      data : array of shape (n_epochs, n_ica_sources, n_times)
          A view on epochs ICA sources data.
      """
      from ..epochs import BaseEpochs
      from ..io import BaseRaw, RawArray
  
      _validate_type(
          inst, (BaseRaw, BaseEpochs), "inst", "Raw or Epochs"
      )
      if isinstance(inst, BaseRaw):
          # when auto, delegate reject to the ica
          from ..epochs import make_fixed_length_epochs
  
          if reject == "auto":
              reject = ica.reject_
          if reject is None:
              drop_inds = None
              dropped_indices = []
              # break up continuous signal into segments
              epochs_src = make_fixed_length_epochs(
                  ica.get_sources(inst),
                  duration=2,
                  preload=True,
                  reject_by_annotation=reject_by_annotation,
                  proj=False,
                  verbose=False,
              )
          else:
              data = inst.get_data()
              data, drop_inds = _reject_data_segments(
                  data,
                  reject,
                  flat=None,
                  decim=None,
                  info=inst.info,
                  tstep=2.0,
              )
              inst_rejected = RawArray(data, inst.info)
              # break up continuous signal into segments
              epochs_src = make_fixed_length_epochs(
                  ica.get_sources(inst_rejected),
                  duration=2,
                  preload=True,
                  reject_by_annotation=reject_by_annotation,
                  proj=False,
                  verbose=False,
              )
              # getting dropped epochs indexes
              dropped_indices = [
                  (d[0] // len(epochs_src.times)) + 1 for d in drop_inds
              ]
          kind = "Segment"
      else:
          drop_inds = None
          epochs_src = ica.get_sources(inst)
          dropped_indices = []
          kind = "Epochs"
      return (
          kind,
          dropped_indices,
          epochs_src,
          epochs_src.get_data(copy=False),
      )
  
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 7 for calling a global function with example usage: _prepare_data_ica_properties(inst, ica, reject_by_annotation, reject) and returns: kind,  dropped_indices,  epochs_src,  epochs_src