code: def getAggregator(cls, instanceId, name):
      
      parent = cls.parentMap.get(instanceId)
      while parent:
        stat = cls.getStat(parent, name)
        if stat:
          return stat, parent
        parent = cls.parentMap.get(statsId(parent))
docs: Gets the aggregate stat for the given stat.