code: def check_solution(solution, signal, ab, msrc, mrec):
      r
  
      # Ensure valid solution.
      if solution not in ['fs', 'dfs', 'dhs', 'dsplit', 'dtetm']:
          print("* ERROR   :: Solution must be one of ['fs', 'dfs', 'dhs', " +
                "'dsplit', 'dtetm']; <solution> provided: " + solution)
          raise ValueError('solution')
  
      # If diffusive solution is required, ensure EE-field.
      if solution[0] == 'd' and (msrc or mrec):
          print('* ERROR   :: Diffusive solution is only implemented for ' +
                'electric sources and electric receivers, <ab> provided: ' +
                str(ab))
          raise ValueError('ab')
  
      # If full solution is required, ensure frequency-domain.
      if solution == 'fs' and signal is not None:
          print('* ERROR   :: Full fullspace solution is only implemented for ' +
                'the frequency domain, <signal> provided: ' + str(signal))
          raise ValueError('signal')
docs: r"""Check required solution with parameters.
  
      This check-function is called from one of the modelling routines in
      :mod:`model`. Consult these modelling routines for a detailed description
      of the input parameters.
  
      Parameters
      ----------
      solution : str
          String to define analytical solution.
  
      signal : {None, 0, 1, -1}
          Source signal:
              - None: Frequency-domain response
              - -1 : Switch-off time-domain response
              - 0 : Impulse time-domain response
              - +1 : Switch-on time-domain response
  
      msrc, mrec : bool
          True if src/rec is magnetic, else False.