def _adjustLapsSinceLastBirthForMerge(self, MTracker, kA, kB):
    compList = self.LapsSinceLastBirth.keys()
    newDict = defaultdict(int)
    for kk in compList:
      if kk == kA:
        newDict[kA] = np.maximum(self.LapsSinceLastBirth[kA], self.LapsSinceLastBirth[kB])
      elif kk < kB:
        newDict[kk] = self.LapsSinceLastBirth[kk]
      elif kk > kB:
        newDict[kk-1] = self.LapsSinceLastBirth[kk]
    self.LapsSinceLastBirth = newDict
Flushes as much pending data from the internal write buffer as possible.
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/learnalg/MemoizedOnlineVBLearnAlg.py/MemoizedOnlineVBLearnAlg._adjustLapsSinceLastBirthForMerge--crossover with--dataset/ETHPy150Open d11wtq/dockerpty/dockerpty/io.py/Stream.do_write