code: def _fit_dipoles(
      fun,
      min_dist_to_inner_skull,
      data,
      times,
      guess_rrs,
      guess_data,
      *,
      sensors,
      fwd_data,
      whitener,
      ori,
      n_jobs,
      rank,
      rhoend,
  ):
      """Fit a single dipole to the given whitened, projected data."""
      parallel, p_fun, n_jobs = parallel_func(fun, n_jobs)
      # parallel over time points
      res = parallel(
          p_fun(
              min_dist_to_inner_skull,
              B,
              t,
              guess_rrs,
              guess_data,
              sensors=sensors,
              fwd_data=fwd_data,
              whitener=whitener,
              fmin_cobyla=fmin_cobyla,
              ori=ori,
              rank=rank,
              rhoend=rhoend,
          )
          for B, t in zip(data.T, times)
      )
      pos = np.array([r[0] for r in res])
      amp = np.array([r[1] for r in res])
      ori = np.array([r[2] for r in res])
      gof = np.array([r[3] for r in res]) * 100  # convert to percentage
      conf = None
      if res[0][4] is not None:
          conf = np.array([r[4] for r in res])
          keys = ["vol", "depth", "long", "trans", "qlong", "qtrans"]
          conf = {key: conf[:, ki] for ki, key in enumerate(keys)}
      khi2 = np.array([r[5] for r in res])
      nfree = np.array([r[6] for r in res])
      residual_noproj = np.array([r[7] for r in res]).T
  
      return pos, amp, ori, gof, conf, khi2, nfree, residual_noproj
  
imports: import functools
  import re
  from copy import deepcopy
  from functools import partial
  import numpy
  from scipy.linalg import eigh
  from scipy.optimize import fmin_cobyla
  from ._fiff.constants import FIFF
  from ._fiff.pick import pick_types
  from ._fiff.proj import _needs_eeg_average_ref_proj, make_projector
  from ._freesurfer import _get_aseg, head_to_mni, head_to_mri, read_freesurfer_lut
  from .bem import _bem_find_surface, _bem_surf_name, _fit_sphere
  from .cov import _ensure_cov, compute_whitener
  from .evoked import _aspect_rev, _read_evoked, _write_evokeds
  from .fixes import _safe_svd, pinvh
  from .forward._compute_forward import _compute_forwards_meeg, _prep_field_computation
  from .forward._make_forward import _get_trans, _prep_eeg_channels, _prep_meg_channels, _setup_bem
  from .parallel import parallel_func
  from .source_space._source_space import SourceSpaces, _make_volume_source_space
  from .surface import _compute_nearest, _points_outside_surface, transform_surface_to
  from .transforms import _coord_frame_name, _print_coord_trans, apply_trans
  from .utils import ExtendedTimeMixin, TimeMixin, _check_fname, _check_option, _get_blas_funcs, _pl, _repeated_svd, _svd_lwork, _time_mask, _validate_type, _verbose_safe_false, check_fname, copy_function_doc_to_method_doc, fill_doc, logger, verbose, warn
  from .viz import plot_dipole_amplitudes, plot_dipole_locations
  from .viz.evoked import _plot_evoked
label_desc: Use image node_id 13 for calling a global function with example usage: _fit_dipoles(fun, min_dist_to_inner_skull, data, times, guess_rrs, guess_data) and returns: pos,  amp,  ori,  gof,  conf,  khi2,  nfree,  residual_noproj