docs: def swap_default(mode, equation, symbol_names, default, **kwargs):
      '''
      Given a `sympy` equation or equality, along with a list of symbol names,
      substitute the specified default value for each symbol for which a value is
      not provided through a keyword argument.
  
      For example, consider the following equality:
  
      >>> sp.pprint(H)
      V₂   Z₂
      ── = ──
      V₁   Z₁
  
      Let us substitute a default value of 1 for terms Z1 and Z2:
  
      >>> sp.pprint(subs_default(H, ['Z1', 'Z2'], 1))
      V₂
      ── = 1
      V₁
  
      Now, let us specify a default value of 1 for terms Z1 and Z2, but provide
      an overriding value for Z1:
  
      >>> sp.pprint(subs_default(H, ['Z1', 'Z2'], 1, Z1=4))
      V₂
      ── = 1/4
      V₁
  
      Note that keyword arguments for terms not specified in the list of symbol
      names are ignored:
  
      >>> sp.pprint(subs_default(H, ['Z1', 'Z2'], 1, Z1=4, Q=7))
      V₂
      ── = 1/4
      V₁
      '''
      if mode == 'subs':
          swap_f = _subs
          default_swap_f = _subs
      elif mode == 'limit':
          swap_f = _limit
          default_swap_f = _subs
      elif mode == 'limit_default':
          swap_f = _subs
          default_swap_f = _limit
      else:
          raise ValueError('''Unsupported mode.  `mode` must be one of: '''
                           '''('subs', 'limit').''')
  
      result = equation
      for s in symbol_names:
          if s in kwargs:
              if isinstance(kwargs[s], Iterable):
                  continue
              else:
                  result = swap_f(result, s, kwargs[s])
          else:
              result = default_swap_f(result, s, default)
      return result