code: def _cal_sss_target(
      new_z,
      old_z,
      all_coils,
      cal_idx,
      data,
      cals,
      S_tot,
      origin,
      ext_order,
      match_idx,
  ):
      """Evaluate objective function for SSS-based magnetometer calibration."""
      cals[cal_idx] = 1.0 / np.linalg.norm(new_z)
      exp = dict(int_order=0, ext_order=ext_order, origin=origin)
      S_tot = S_tot.copy()
      # Rotate necessary coils properly and adjust correct element in c
      for idx in match_idx[cal_idx]:
          this_coil = _rotate_coil(new_z, old_z, all_coils, idx)
          # Replace correct row of S_tot with new value
          S_tot[idx] = _trans_sss_basis(exp, this_coil)
      # Get the GOF
      return _data_err(data, S_tot, cals, idx=cal_idx)
  
imports: from collections import defaultdict
  from functools import partial
  import numpy
  from scipy.optimize import fmin_cobyla
  from .._fiff.pick import pick_info, pick_types
  from .._fiff.tag import _coil_trans_to_loc, _loc_to_coil_trans
  from ..bem import _check_origin
  from ..io import BaseRaw
  from ..transforms import _find_vector_rotation
  from ..utils import _check_fname, _check_option, _ensure_int, _pl, _reg_pinv, _validate_type, check_fname, logger, verbose
  from .maxwell import _col_norm_pinv, _get_grad_point_coilsets, _prep_fine_cal, _prep_mf_coils, _read_cross_talk, _trans_sss_basis
label_desc: Use image node_id 8 for calling a global function with example usage: _cal_sss_target(new_z, old_z, all_coils, cal_idx, data, cals, S_tot, origin, ext_order, match_idx) and returns: _data_err