code: def test_binomdist_linspace(
      self, xp, scp, function, dtype, int_dtype
  ):
      import scipy.special  # NOQA
  
      # Skip cases deprecated in SciPy 1.5+ via this Cython code:
      # https://github.com/scipy/scipy/blob/cdb9b034d46c7ba0cacf65a9b2848c5d49c286c4/scipy/special/_legacy.pxd#L39-L43  # NOQA
      # All type casts except `dld->d` should raise a DeprecationWawrning
      # However on the SciPy side, this shows up as a SystemError
      #    SystemError: <class 'DeprecationWarning'> returned a result with an exception set  # NOQA
      safe_cast = xp.result_type(int_dtype, "l") == xp.dtype("l")
      safe_cast &= xp.result_type(int_dtype, dtype) == xp.float64
      if not safe_cast:
          return xp.zeros((1,))
  
      func = getattr(scp.special, function)
      n = xp.linspace(0, 80, 80, dtype=int_dtype)[
          xp.newaxis, :, xp.newaxis
      ]
  
      # broadcast to create k <= n
      k = xp.linspace(0, 1, 10, dtype=dtype)
      k = k[:, xp.newaxis, xp.newaxis] * n
      p = xp.linspace(0, 1, 5, dtype=dtype)[xp.newaxis, xp.newaxis, :]
      return func(k, n, p)
  
imports: import numpy
  import pytest
  import cupy
  from cupy import testing
  import cupyx.scipy.special
label_desc: Use image node_id 2 for calling the TestThreeArgumentDistributions obj's underlying member method code with example usage: obj.test_binomdist_linspace(xp, scp, function, dtype, int_dtype) and returns: func, xp