code: def beforeOnBars(self, strat, bars):
      self.__portfolioReturns.update(strat.getBroker().getEquity())
  
      # Notify that new returns are available.
      self.__event.emit(bars.getDateTime(), self)
  
imports: import math
  from pyalgotrade import stratanalyzer
  from pyalgotrade import observer
  from pyalgotrade import dataseries
label_desc: Use image node_id 7 for calling the ReturnsAnalyzerBase obj's underlying member method code with example usage: obj.beforeOnBars(strat, bars) without return types