code: def check_shape(
      interpolator_cls,
      x_shape,
      y_shape,
      deriv_shape=None,
      axis=0,
      extra_args={},
  ):
      np.random.seed(1234)
  
      x = [-1, 0, 1, 2, 3, 4]
      s = list(range(1, len(y_shape) + 1))
      s.insert(axis % (len(y_shape) + 1), 0)
      y = np.random.rand(*((6,) + y_shape)).transpose(s)
  
      # Cython code chokes on y.shape = (0, 3) etc., skip them
      if y.size == 0:
          return
  
      xi = np.zeros(x_shape)
      if interpolator_cls is CubicHermiteSpline:
          dydx = np.random.rand(*((6,) + y_shape)).transpose(s)
          yi = interpolator_cls(x, y, dydx, axis=axis, **extra_args)(xi)
      else:
          yi = interpolator_cls(x, y, axis=axis, **extra_args)(xi)
  
      target_shape = (
          (deriv_shape or ())
          + y.shape[:axis]
          + x_shape
          + y.shape[axis:][1:]
      )
      assert_equal(yi.shape, target_shape)
  
      # check it works also with lists
      if x_shape and y.size > 0:
          if interpolator_cls is CubicHermiteSpline:
              interpolator_cls(
                  list(x), list(y), list(dydx), axis=axis, **extra_args
              )(list(xi))
          else:
              interpolator_cls(
                  list(x), list(y), axis=axis, **extra_args
              )(list(xi))
  
      # check also values
      if xi.size > 0 and deriv_shape is None:
          bs_shape = (
              y.shape[:axis] + (1,) * len(x_shape) + y.shape[axis:][1:]
          )
          yv = y[
              (
                  (
                      slice(
                          None,
                      ),
                  )
                  * (axis % y.ndim)
              )
              + (1,)
          ]
          yv = yv.reshape(bs_shape)
  
          yi, y = np.broadcast_arrays(yi, yv)
          assert_allclose(yi, y)
  
imports: import warnings
  import io
  import numpy
  from numpy.testing import assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_allclose, assert_equal, assert_
  from pytest import raises
  from scipy.interpolate import KroghInterpolator, krogh_interpolate, BarycentricInterpolator, barycentric_interpolate, approximate_taylor_polynomial, CubicHermiteSpline, pchip, PchipInterpolator, pchip_interpolate, Akima1DInterpolator, CubicSpline, make_interp_spline
label_desc: Use image node_id 1 for calling a global function with example usage: check_shape(interpolator_cls, x_shape, y_shape, deriv_shape, axis, extra_args) without return types