code: def _validate_sos(sos):
      """Helper to validate a SOS input"""
      sos = cupy.atleast_2d(sos)
      if sos.ndim != 2:
          raise ValueError("sos array must be 2D")
      n_sections, m = sos.shape
      if m != 6:
          raise ValueError("sos array must be shape (n_sections, 6)")
      if not (cupy.abs(sos[:, 3] - 1.0) <= 1e-15).all():
          raise ValueError("sos[:, 3] should be all ones")
      return sos, n_sections
  
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 24 for calling a global function with example usage: _validate_sos(sos) and returns: sos,  n_sections