def METHOD_NAME(self, a, step, mode = 'avg'):
    def aggregateAvg(a):
        assert (len(self.map) == 0 or len(self.map) == len(a.map))
        for idx,item in enumerate(a.map):
            oP = 0
            id1,id2,aP = a.map[idx]
            midx = self.search(id1, id2)
            nP = aP/step + oP *(1-1/step)
            self.map[midx] = (id1,id2,nP)
    def aggregateWeight(a):
        #
        assert (len(self.map) == 0 or len(self.map) == len(a.map))
        for idx,item in enumerate(a.map):
            oP = 0
            id1,id2,aP = a.map[idx]
            if idx < len(self.map):
                oP = self.map[idx][2]
                nP = aP * step + oP
                self.map[idx] = (id1, id2, nP)
            else:
                self.map.append((id1, id2, aP*step))
        pass
    if mode == 'avg':
        return aggregateAvg(a)
    elif mode == 'weight':
        return aggregateWeight(a)
    else:
        print('err, wrong aggregate mode')
        return None