code: def _swap_direction(norm):
      if norm in (None, "backward"):
          norm = "forward"
      elif norm == "forward":
          norm = "backward"
      elif norm != "ortho":
          raise ValueError(
              'Invalid norm value %s; should be "backward", '
              '"ortho", or "forward".' % norm
          )
      return norm
  
imports: from scipy._lib._array_api import array_namespace, is_numpy, xp_unsupported_param_msg, is_complex
  from .None import _pocketfft
  import numpy
label_desc: Use image node_id 18 for calling a global function with example usage: _swap_direction(norm) and returns: norm