code: def test_apply_penalty(self):
      from lasagne.regularization import apply_penalty, l2
  
      A = T.vector()
      B = T.matrix()
  
      assert apply_penalty([], l2) == 0
  
      assert equal_computations([apply_penalty(A, l2)], [l2(A)])
  
      assert equal_computations(
          [apply_penalty([A, B], l2)], [sum([l2(A), l2(B)])]
      )
  
file_path: Lasagne/lasagne/tests/test_regularization.py
imports: import pytest
  import numpy
  import theano.tensor
  import lasagne
  from collections import OrderedDict
  from theano.scan_module.scan_utils import equal_computations
  from mock import Mock
label_desc: Use image node_id 2 for calling the TestRegularizationHelpers obj's underlying member method code with example usage: obj.test_apply_penalty() without return types