code: def test_get_or_compute_grads():
      from lasagne.updates import get_or_compute_grads
  
      A = theano.shared(1)
      B = theano.shared(1)
      loss = A + B
      grads = get_or_compute_grads(loss, [A, B])
  
      assert get_or_compute_grads(grads, [A, B]) is grads
  
      with pytest.raises(ValueError):
          get_or_compute_grads(grads, [A])
  
      C = T.scalar()
      with pytest.raises(ValueError):
          get_or_compute_grads(A + C, [A, C])
  
file_path: Lasagne/lasagne/tests/test_updates.py
imports: import pytest
  import numpy
  import theano
  import theano.tensor
  import lasagne
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_or_compute_grads() without return types