code: def check_base_barfeed(testCase, barFeed, barsHaveAdjClose):
      called = {"called": True}
  
      def callback(dateTime, bars):
          called["called"] = True
          testCase.assertEquals(barFeed.getCurrentDateTime(), dateTime)
  
      testCase.assertEquals(barFeed.getCurrentDateTime(), None)
      testCase.assertEquals(
          barFeed.barsHaveAdjClose(), barsHaveAdjClose
      )
      if not barsHaveAdjClose:
          with testCase.assertRaisesRegexp(
              Exception,
              "The barfeed doesn't support adjusted close values.*",
          ):
              barFeed.setUseAdjustedValues(True)
  
      d = dispatcher.Dispatcher()
      d.addSubject(barFeed)
      barFeed.getNewValuesEvent().subscribe(callback)
      d.run()
  
      testCase.assertEquals(called["called"], True)
  
file_path: pyalgotrade/testcases/barfeed_test.py
imports: import datetime
  from .None import common
  from pyalgotrade import barfeed
  from pyalgotrade.barfeed import common
  from pyalgotrade import bar
  from pyalgotrade import dispatcher
label_desc: Use image node_id 1 for calling a global function with example usage: check_base_barfeed(testCase, barFeed, barsHaveAdjClose) without return types