code: def test_aggregate_invalid():
      from lasagne.objectives import aggregate
  
      with pytest.raises(ValueError) as exc:
          aggregate(theano.tensor.matrix(), mode="asdf")
      assert "mode must be" in exc.value.args[0]
      with pytest.raises(ValueError) as exc:
          aggregate(theano.tensor.matrix(), mode="normalized_sum")
      assert "require weights" in exc.value.args[0]
  
imports: import numpy
  import theano
  import pytest
label_desc: Use image node_id 11 for calling a global function with example usage: test_aggregate_invalid() without return types