code: def _convert_forward_match_inv(fwd, inv):
      """Ensure forward and inverse operators match.
  
      Inverse operator and forward operator must have same surface orientations,
      but can have different source orientation constraints.
      """
      _validate_type(fwd, Forward, "fwd")
      _validate_type(inv, InverseOperator, "inverse_operator")
      # did inverse operator use fixed orientation?
      is_fixed_inv = _check_fixed_ori(inv)
      # did forward operator use fixed orientation?
      is_fixed_fwd = _check_fixed_ori(fwd)
  
      # if inv or fwd fixed: do nothing
      # if inv loose: surf_ori must be True
      # if inv free: surf_ori must be False
      if not is_fixed_inv and not is_fixed_fwd:
          inv_surf_ori = inv._is_surf_ori
          if inv_surf_ori != fwd["surf_ori"]:
              fwd = convert_forward_solution(
                  fwd, surf_ori=inv_surf_ori, force_fixed=False
              )
  
      return fwd
  
imports: from copy import deepcopy
  import numpy
  from mne.minimum_norm.inverse import InverseOperator
  from .._fiff.constants import FIFF
  from .._fiff.pick import pick_channels_forward
  from ..evoked import EvokedArray
  from ..forward.forward import Forward, convert_forward_solution
  from ..label import Label
  from ..source_estimate import _get_src_type, _make_stc, _prepare_label_extraction
  from ..source_space._source_space import SourceSpaces, _get_vertno
  from ..utils import _validate_type, logger, verbose
  from .inverse import apply_inverse
label_desc: Use image node_id 9 for calling a global function with example usage: _convert_forward_match_inv(fwd, inv) and returns: fwd