code: def test_standardize():
      # Simple example
      X = np.random.standard_normal((1000, 20)).astype(
          theano.config.floatX
      )
      l_in = InputLayer((None, 20))
      l_std = standardize(
          l_in,
          X.min(axis=0),
          (X.max(axis=0) - X.min(axis=0)),
          shared_axes=0,
      )
      out = get_output(l_std).eval({l_in.input_var: X})
      assert np.allclose(out.max(axis=0), 1.0)
      assert np.allclose(out.min(axis=0), 0.0)
      assert len(get_all_params(l_std)) == 2
      # More complicated example
      X = np.random.standard_normal((50, 3, 100, 10)).astype(
          theano.config.floatX
      )
      mean = X.mean(axis=(0, 2))
      std = X.std(axis=(0, 2))
      l_in = InputLayer((None, 3, None, 10))
      l_std = standardize(l_in, mean, std, shared_axes=(0, 2))
      out = get_output(l_std).eval({l_in.input_var: X})
      assert np.allclose(out.mean(axis=(0, 2)), 0.0, atol=1e-5)
      assert np.allclose(out.std((0, 2)), 1.0, atol=1e-5)
  
imports: from mock import Mock
  import numpy
  import pytest
  import theano
  from lasagne.layers import InputLayer, standardize, get_output, get_all_params
  from lasagne.utils import floatX
label_desc: Use image node_id 1 for calling a global function with example usage: test_standardize() without return types