code: def test_nonlinearity(self, nonlinearity):
      import lasagne.nonlinearities
  
      if nonlinearity == "leaky_rectify_0":
          from lasagne.nonlinearities import LeakyRectify
  
          theano_nonlinearity = LeakyRectify(leakiness=0)
      elif nonlinearity == "scaled_tanh":
          from lasagne.nonlinearities import ScaledTanH
  
          theano_nonlinearity = ScaledTanH()
      elif nonlinearity == "scaled_tanh_p":
          from lasagne.nonlinearities import ScaledTanH
  
          theano_nonlinearity = ScaledTanH(scale_in=0.5, scale_out=2.27)
      elif nonlinearity.startswith("selu"):
          from lasagne.nonlinearities import SELU, selu
  
          if nonlinearity == "selu":
              theano_nonlinearity = SELU()
          elif nonlinearity == "selu_paper":
              theano_nonlinearity = selu
          elif nonlinearity == "selu_rect":
              theano_nonlinearity = SELU(scale=1, scale_neg=0)
          elif nonlinearity == "selu_custom":
              theano_nonlinearity = SELU(scale=1.21, scale_neg=0.12)
      else:
          theano_nonlinearity = getattr(
              lasagne.nonlinearities, nonlinearity
          )
      np_nonlinearity = getattr(self, nonlinearity)
  
      X = T.matrix()
      X0 = lasagne.utils.floatX(np.random.uniform(-3, 3, (10, 10)))
  
      theano_result = theano_nonlinearity(X).eval({X: X0})
      np_result = np_nonlinearity(X0)
  
      assert np.allclose(theano_result, np_result)
  
imports: import pytest
  import numpy
  import theano.tensor
label_desc: Use image node_id 16 for calling the TestNonlinearities obj's underlying member method code with example usage: obj.test_nonlinearity(nonlinearity) without return types