code: def _get_func(cls, xp):
      if xp is np:
          from scipy import special
  
          return getattr(special, cls._func_name)
      elif cp is not None and xp is cp:
          from cupyx.scipy import special
  
          return getattr(special, cls._func_name)
      else:
          assert xp is sparse
          return getattr(sparse, cls._func_name)
  
imports: import scipy.special
  from ...core import ExecutableTuple
  from ...None import opcodes
  from ..datasource import tensor
  from ..arithmetic.core import TensorUnaryOp, TensorBinOp, TensorMultiOp
  from ..array_utils import np, cp, issparse, sparse, convert_order, as_same_device, device
label_desc: Use image node_id 2 for calling the TensorSpecialOperandMixin obj's underlying member method code with example usage: obj._get_func(cls, xp) and returns: getattr, getattr, getattr