code: def test_baddestroymap():
      class BadAdd(gof.Op):
          def make_node(self, a, b):
              c = a.type()
              return gof.Apply(self, [a, b], [c])
  
          def perform(self, node, inp, out):
              a, b = inp
              (c,) = out
              c[0] = a
              c[0] += b
  
      x = theano.tensor.dvector()
      y = theano.tensor.dvector()
      f = theano.function([x, y], BadAdd()(x, y), mode="DEBUG_MODE")
  
      try:
          f([1, 2], [3, 4])
          assert False  # failed to raise error
      except debugmode.BadDestroyMap:
          pass
  
imports: from __future__ import absolute_import, print_function, division
  import sys
  import unittest
  from nose.plugins.skip import SkipTest
  import numpy
  from six import reraise
  from theano import config
  from theano import gof
  import theano
  from theano.compat import exc_message
  from theano.compile import debugmode
  import theano.tensor
  from theano.tests import unittest_tools
label_desc: Use image node_id 7 for calling a global function with example usage: test_baddestroymap() and returns: gof