code: def test_emitter_reentrance_allowed_when_blocked2():
      # More realistic re-entrance example
      # The real world case for this might be a longer chain of events
      # where event1's callback knows that what it's doing will trigger
      # the same event so it blocks it:
      # event1 -> foo -> event2 -> bar -> event1 -> (ignored bc blocked).
  
      e1 = EventEmitter(source=None, type="test1")
      e2 = EventEmitter(source=None, type="test2")
      count = 0
  
      @e1.connect
      def foo(x):
          nonlocal count
          count += 1
          with e1.blocker():
              e2()
  
      @e2.connect
      def bar(x):
          nonlocal count
          count += 10
          e1()
  
      e1()
      assert count == 11
  
imports: import unittest
  import copy
  import functools
  from vispy.util.event import Event, EventEmitter
  from vispy.testing import run_tests_if_main, assert_raises, assert_equal
label_desc: Use image node_id 4 for calling a global function with example usage: test_emitter_reentrance_allowed_when_blocked2() without return types