code: def _butterfly_onpick(event, params):
      """Add a channel name on click."""
      params["need_draw"] = True
      ax = event.artist.axes
      ax_idx = np.where([ax is a for a in params["axes"]])[0]
      if len(ax_idx) == 0:  # this can happen if ax param is used
          return  # let the other axes handle it
      else:
          ax_idx = ax_idx[0]
      lidx = np.where(
          [line is event.artist for line in params["lines"][ax_idx]]
      )[0][0]
      ch_name = params["ch_names"][params["idxs"][ax_idx][lidx]]
      text = params["texts"][ax_idx]
      x = event.artist.get_xdata()[event.ind[0]]
      y = event.artist.get_ydata()[event.ind[0]]
      text.set_x(x)
      text.set_y(y)
      text.set_text(ch_name)
      text.set_color(event.artist.get_color())
      text.set_alpha(1.0)
      text.set_zorder(
          len(ax.lines)
      )  # to make sure it goes on top of the lines
      text.set_path_effects(params["path_effects"])
  
imports: from copy import deepcopy
  from functools import partial
  from itertools import cycle
  from numbers import Integral
  import numpy
  from .._fiff.pick import _DATA_CH_TYPES_SPLIT, _PICK_TYPES_DATA_DICT, _VALID_CHANNEL_TYPES, _picks_to_idx, channel_indices_by_type, channel_type, pick_info
  from ..defaults import _handle_default
  from ..fixes import _is_last_row
  from ..utils import _check_ch_locs, _check_if_nan, _clean_names, _is_numeric, _pl, _to_rgb, _validate_type, fill_doc, logger, verbose, warn
  from .topo import _plot_evoked_topo
  from .topomap import _check_sphere, _draw_outlines, _get_pos_outlines, _make_head_outlines, _prepare_topomap, _prepare_topomap_plot, _set_contour_locator, plot_topomap
  from .utils import DraggableColorbar, _check_cov, _check_delayed_ssp, _check_option, _check_time_unit, _draw_proj_checkbox, _get_cmap, _get_color_list, _make_combine_callable, _plot_masked_image, _prepare_joint_axes, _process_times, _prop_kw, _set_title_multiple_electrodes, _set_window_title, _setup_ax_spines, _setup_cmap, _setup_plot_projector, _setup_vmin_vmax, _triage_rank_sss, _trim_ticks, _validate_if_list_of_axes, plt_show
label_desc: Use image node_id 1 for calling a global function with example usage: _butterfly_onpick(event, params) without return types