code: def _inputs_swap_needed(mode, shape1, shape2, axes=None):
      """Determine if inputs arrays need to be swapped in `"valid"` mode.
  
      If in `"valid"` mode, returns whether or not the input arrays need to be
      swapped depending on whether `shape1` is at least as large as `shape2` in
      every calculated dimension.
  
      This is important for some of the correlation and convolution
      implementations in this module, where the larger array input needs to come
      before the smaller array input when operating in this mode.
  
      Note that if the mode provided is not 'valid', False is immediately
      returned.
  
      """
      if mode != "valid":
          return False
  
      if not shape1:
          return False
  
      if axes is None:
          axes = range(len(shape1))
  
      ok1 = all(shape1[i] >= shape2[i] for i in axes)
      ok2 = all(shape2[i] >= shape1[i] for i in axes)
  
      if not (ok1 or ok2):
          raise ValueError(
              "For 'valid' mode, one must be at least "
              "as large as the other in every dimension"
          )
  
      return not ok1
  
imports: import operator
  import math
  import timeit
  from scipy.spatial import cKDTree
  from .None import sigtools, dlti
  from ._upfirdn import upfirdn, _output_len, _upfirdn_modes
  from scipy import linalg, fft
  from scipy.fft._helper import _init_nd_shape_and_axes
  from scipy._lib._util import prod
  import numpy
  from scipy.special import lambertw
  from .windows import get_window
  from ._arraytools import axis_slice, axis_reverse, odd_ext, even_ext, const_ext
  from .filter_design import cheby1, _validate_sos
  from .fir_filter_design import firwin
  from ._sosfilt import _sosfilt
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: _inputs_swap_needed(mode, shape1, shape2, axes) and returns: unknown, False, False