code: def getOrCreateShared(cls, strat):
      name = cls.__name__
      # Get or create the shared ReturnsAnalyzerBase.
      ret = strat.getNamedAnalyzer(name)
      if ret is None:
          ret = ReturnsAnalyzerBase()
          strat.attachAnalyzerEx(ret, name)
      return ret
  
imports: import math
  from pyalgotrade import stratanalyzer
  from pyalgotrade import observer
  from pyalgotrade import dataseries
label_desc: Use image node_id 2 for calling the ReturnsAnalyzerBase obj's underlying member method code with example usage: obj.getOrCreateShared(cls, strat) and returns: ret