code: def _compute_forwards_meeg(
      rr, *, sensors, fwd_data, n_jobs, silent=False
  ):
      """Compute MEG and EEG forward solutions for all sensor types."""
      Bs = dict()
      # The dipole location and orientation must be transformed to mri coords
      mri_rr = None
      if fwd_data["head_mri_t"] is not None:
          mri_rr = np.ascontiguousarray(
              apply_trans(fwd_data["head_mri_t"]["trans"], rr)
          )
      mri_Q, bem_rr, fun = (
          fwd_data["mri_Q"],
          fwd_data["bem_rr"],
          fwd_data["fun"],
      )
      solutions = fwd_data["solutions"]
      del fwd_data
      for coil_type, sens in sensors.items():
          coils = sens["defs"]
          compensator = sens.get("compensator", None)
          post_picks = sens.get("post_picks", None)
          solution = solutions.get(coil_type, None)
  
          # Do the actual forward calculation for a list MEG/EEG sensors
          if not silent:
              logger.info(
                  "Computing %s at %d source location%s "
                  "(free orientations)..."
                  % (coil_type.upper(), len(rr), _pl(rr))
              )
          # Calculate forward solution using spherical or BEM model
          B = fun(
              rr,
              mri_rr,
              mri_Q,
              coils=coils,
              solution=solution,
              bem_rr=bem_rr,
              n_jobs=n_jobs,
              coil_type=coil_type,
          )
  
          # Compensate if needed (only done for MEG systems w/compensation)
          if compensator is not None:
              B = B @ compensator.T
          if post_picks is not None:
              B = B[:, post_picks]
          Bs[coil_type] = B
      return Bs
  
imports: from copy import deepcopy
  import numpy
  from .._fiff.constants import FIFF
  from ..bem import _import_openmeeg, _make_openmeeg_geometry
  from ..fixes import bincount, jit
  from ..parallel import parallel_func
  from ..surface import _jit_cross, _project_onto_surface
  from ..transforms import apply_trans, invert_transform
  from ..utils import _check_option, _pl, fill_doc, logger, verbose, warn
label_desc: Use image node_id 22 for calling a global function with example usage: _compute_forwards_meeg(rr) and returns: Bs