code: def testReentrancy(self):
      handlersData = []
      event = observer.Event()
  
      def handler2():
          handlersData.append(2)
  
      def handler1():
          handlersData.append(1)
          event.subscribe(handler2)
          event.subscribe(handler1)
  
      event.subscribe(handler1)
      event.emit()
      self.assertTrue(handlersData == [1])
      event.emit()
      self.assertTrue(handlersData == [1, 1, 2])
      event.unsubscribe(handler1)
      event.emit()
      self.assertTrue(handlersData == [1, 1, 2, 2])
      event.unsubscribe(handler2)
      event.emit()
      self.assertTrue(handlersData == [1, 1, 2, 2])
  
imports: import datetime
  import copy
  from six.moves import xrange
  from .None import common
  from pyalgotrade import observer
  from pyalgotrade import dispatcher
label_desc: Use image node_id 3 for calling the EventTestCase obj's underlying member method code with example usage: obj.testReentrancy() without return types