code: def sosfiltfilt(sos, x, axis=-1, padtype="odd", padlen=None):
      """
      A forward-backward digital filter using cascaded second-order sections.
  
      See `filtfilt` for more complete information about this method.
  
      Parameters
      ----------
      sos : array_like
          Array of second-order filter coefficients, must have shape
          ``(n_sections, 6)``. Each row corresponds to a second-order
          section, with the first three columns providing the numerator
          coefficients and the last three providing the denominator
          coefficients.
      x : array_like
          The array of data to be filtered.
      axis : int, optional
          The axis of `x` to which the filter is applied.
          Default is -1.
      padtype : str or None, optional
          Must be 'odd', 'even', 'constant', or None.  This determines the
          type of extension to use for the padded signal to which the filter
          is applied.  If `padtype` is None, no padding is used.  The default
          is 'odd'.
      padlen : int or None, optional
          The number of elements by which to extend `x` at both ends of
          `axis` before applying the filter.  This value must be less than
          ``x.shape[axis] - 1``.  ``padlen=0`` implies no padding.
          The default value is::
  
              3 * (2 * len(sos) + 1 - min((sos[:, 2] == 0).sum(),
                                          (sos[:, 5] == 0).sum()))
  
          The extra subtraction at the end attempts to compensate for poles
          and zeros at the origin (e.g. for odd-order filters) to yield
          equivalent estimates of `padlen` to those of `filtfilt` for
          second-order section filters built with `scipy.signal` functions.
  
      Returns
      -------
      y : ndarray
          The filtered output with the same shape as `x`.
  
      See Also
      --------
      filtfilt, sosfilt, sosfilt_zi, sosfreqz
      """
      sos, n_sections = _validate_sos(sos)
      x = _validate_x(x)
  
      # `method` is "pad"...
      ntaps = 2 * n_sections + 1
      ntaps -= min(
          (sos[:, 2] == 0).sum().item(), (sos[:, 5] == 0).sum().item()
      )
      edge, ext = _validate_pad(padtype, padlen, x, axis, ntaps=ntaps)
  
      # These steps follow the same form as filtfilt with modifications
      zi = sosfilt_zi(
          sos
      )  # shape (n_sections, 4) --> (n_sections, ..., 4, ...)
      zi_shape = [1] * x.ndim
      zi_shape[axis] = 4
      zi.shape = [n_sections] + zi_shape
      x_0 = axis_slice(ext, stop=1, axis=axis)
      (y, zf) = sosfilt(sos, ext, axis=axis, zi=zi * x_0)
      y_0 = axis_slice(y, start=-1, axis=axis)
      (y, zf) = sosfilt(
          sos, axis_reverse(y, axis=axis), axis=axis, zi=zi * y_0
      )
      y = axis_reverse(y, axis=axis)
      if edge > 0:
          y = axis_slice(y, start=edge, stop=-edge, axis=axis)
      return y
  
imports: import warnings
  import cupy
  from cupy._core import internal
  from cupy.linalg import lstsq
  import cupyx.scipy.fft
  from cupyx.scipy.ndimage import _util
  from cupyx.scipy.ndimage import _filters
  from cupyx.scipy.signal import _signaltools_core
  from cupyx.scipy.signal._arraytools import const_ext, even_ext, odd_ext, axis_reverse, axis_slice, axis_assign
  from cupyx.scipy.signal._iir_utils import apply_iir, apply_iir_sos, compute_correction_factors, compute_correction_factors_sos
label_desc: Use image node_id 28 for calling a global function with example usage: sosfiltfilt(sos, x, axis, padtype, padlen) and returns: y