code: def get_chpi_info(info, on_missing="raise", verbose=None):
      """Retrieve cHPI information from the data.
  
      Parameters
      ----------
      %(info_not_none)s
      %(on_missing_chpi)s
      %(verbose)s
  
      Returns
      -------
      hpi_freqs : array, shape (n_coils,)
          The frequency used for each individual cHPI coil.
      hpi_pick : int | None
          The index of the ``STIM`` channel containing information about when
          which cHPI coils were switched on.
      hpi_on : array, shape (n_coils,)
          The values coding for the "on" state of each individual cHPI coil.
  
      Notes
      -----
      .. versionadded:: 0.24
      """
      _validate_type(item=info, item_name="info", types=Info)
      _check_option(
          parameter="on_missing",
          value=on_missing,
          allowed_values=["ignore", "raise", "warn"],
      )
  
      if len(info["hpi_meas"]) == 0 or (
          "coil_freq" not in info["hpi_meas"][0]["hpi_coils"][0]
      ):
          _on_missing(
              on_missing,
              msg="No appropriate cHPI information found in "
              'info["hpi_meas"] and info["hpi_subsystem"]',
          )
          return np.empty(0), None, np.empty(0)
  
      hpi_coils = sorted(
          info["hpi_meas"][-1]["hpi_coils"], key=lambda x: x["number"]
      )  # ascending (info) order
  
      # get frequencies
      hpi_freqs = np.array([float(x["coil_freq"]) for x in hpi_coils])
      logger.info(
          f"Using {len(hpi_freqs)} HPI coils: {' '.join(str(int(s)) for s in hpi_freqs)} "
          "Hz"
      )
  
      # how cHPI active is indicated in the FIF file
      hpi_sub = info["hpi_subsystem"]
      hpi_pick = None  # there is no pick!
      if hpi_sub is not None:
          if "event_channel" in hpi_sub:
              hpi_pick = pick_channels(
                  info["ch_names"],
                  [hpi_sub["event_channel"]],
                  ordered=False,
              )
              hpi_pick = hpi_pick[0] if len(hpi_pick) > 0 else None
          # grab codes indicating a coil is active
          hpi_on = [
              coil["event_bits"][0] for coil in hpi_sub["hpi_coils"]
          ]
          # not all HPI coils will actually be used
          hpi_on = np.array(
              [hpi_on[hc["number"] - 1] for hc in hpi_coils]
          )
          # mask for coils that may be active
          hpi_mask = np.array([event_bit != 0 for event_bit in hpi_on])
          hpi_on = hpi_on[hpi_mask]
          hpi_freqs = hpi_freqs[hpi_mask]
      else:
          hpi_on = np.zeros(len(hpi_freqs))
  
      return hpi_freqs, hpi_pick, hpi_on
  
imports: import copy
  import itertools
  from functools import partial
  import numpy
  from scipy.linalg import orth
  from scipy.optimize import fmin_cobyla
  from scipy.spatial.distance import cdist
  from ._fiff.constants import FIFF
  from ._fiff.meas_info import Info, _simplify_info
  from ._fiff.pick import _picks_to_idx, pick_channels, pick_channels_regexp, pick_info, pick_types
  from ._fiff.proj import Projection, setup_proj
  from .channels.channels import _get_meg_system
  from .cov import compute_whitener, make_ad_hoc_cov
  from .dipole import _make_guesses
  from .event import find_events
  from .fixes import jit
  from .forward import _concatenate_coils, _create_meg_coils, _magnetic_dipole_field_vec
  from .io import BaseRaw
  from .io.ctf.trans import _make_ctf_coord_trans_set
  from .io.kit.constants import KIT
  from .io.kit.kit import RawKIT
  from .preprocessing.maxwell import _get_mf_picks_fix_mags, _prep_mf_coils, _regularize_out, _sss_basis
  from .transforms import _angle_between_quats, _fit_matched_points, _quat_to_affine, als_ras_trans, apply_trans, invert_transform, quat_to_rot, rot_to_quat
  from .utils import ProgressBar, _check_fname, _check_option, _on_missing, _pl, _validate_type, _verbose_safe_false, logger, use_log_level, verbose, warn
label_desc: Use image node_id 6 for calling a global function with example usage: get_chpi_info(info, on_missing, verbose) and returns: hpi_freqs,  hpi_pick,  hpi_on, np,  None,  np