code: def _inputs_swap_needed(mode, shape1, shape2, axes=None):
      # See scipy's documentation in scipy.signal._signaltools
      if mode != "valid" or not shape1:
          return False
      if axes is None:
          axes = tuple(range(len(shape1)))
      not_ok1 = any(shape1[i] < shape2[i] for i in axes)
      not_ok2 = any(shape1[i] > shape2[i] for i in axes)
      if not_ok1 and not_ok2:
          raise ValueError(
              'For "valid" mode, one must be at least '
              "as large as the other in every dimension"
          )
      return not_ok1
  
file_path: cupy/cupyx/scipy/signal/_signaltools_core.py
imports: import math
  import cupy
  from cupy._core import internal
  from cupyx.scipy import fft
  from cupyx.scipy.ndimage import _filters
  from cupyx.scipy.ndimage import _util
label_desc: Use image node_id 4 for calling a global function with example usage: _inputs_swap_needed(mode, shape1, shape2, axes) and returns: not_ok1, False