code: def test_dispatch():
      observer_a = SimpleObserver()
      observer_b = SimpleObserver()
      observable = Observable(events=EVENTS)
  
      observable.subscribe("a", observer_a)
      observable.subscribe("b", observer_b)
  
      assert observer_a.counter == 0
      assert observer_b.counter == 0
  
      observable.dispatch("b")
      assert observer_a.counter == 0
      assert observer_b.counter == 1
  
      observable.dispatch("a")
      observable.dispatch("b")
      assert observer_a.counter == 1
      assert observer_b.counter == 2
  
      observable.dispatch("a")
      observable.dispatch("c")
      assert observer_a.counter == 2
      assert observer_a.counter == 2
  
file_path: BayesianOptimization/tests/test_observer.py
imports: from bayes_opt.bayesian_optimization import Observable
  from bayes_opt.observer import _Tracker
  from bayes_opt.event import Events
  import os
label_desc: Use image node_id 3 for calling a global function with example usage: test_dispatch() without return types