code: def collapse_2d(x, axis):
      x = cupy.moveaxis(x, axis, -1)
      x_shape = x.shape
      x = x.reshape(-1, x.shape[-1])
      if not x.flags.c_contiguous:
          x = x.copy()
      return x, x_shape
  
file_path: cupy/cupyx/scipy/signal/_iir_utils.py
imports: from itertools import product
  import cupy
  from cupy._core.internal import _normalize_axis_index
  from cupy._core._scalar import get_typename
  from cupy_backends.cuda.api import runtime
  from cupyx.scipy.signal._arraytools import axis_slice
label_desc: Use image node_id 3 for calling a global function with example usage: collapse_2d(x, axis) and returns: x,  x_shape