code: def test_pad_width_per_axis(batch_ndim, val=0):
      from lasagne.theano_extensions.padding import pad
  
      width = (1, 2, 3, 4)
  
      X = T.tensor4()
      X0 = lasagne.utils.floatX(np.ones((2, 3, 4, 5)))
      X_pad_theano = pad(X, width[batch_ndim:], val, batch_ndim).eval(
          {X: X0}
      )
  
      pads = tuple(
          (w, w) if i >= batch_ndim else (0, 0)
          for i, w in enumerate(width)
      )
      X_pad_np = np.pad(X0, pads, mode="constant", constant_values=val)
  
      assert (X_pad_theano == X_pad_np).all()
  
file_path: Lasagne/lasagne/tests/test_theano_extensions.py
imports: import pytest
  import numpy
  import theano.tensor
  import lasagne
label_desc: Use image node_id 8 for calling a global function with example usage: test_pad_width_per_axis(batch_ndim, val) without return types