def _processSegmentUpdates(self, activeColumns):
<EOL>removeKeys = []<EOL>trimSegments = []<EOL>for key, updateList in self.segmentUpdates.items():<EOL><INDENT>c, i = key[<NUM_LIT:0>], key[<NUM_LIT:1>]<EOL>if c in activeColumns:<EOL><INDENT>action = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>if self.doPooling and self.lrnPredictedState['<STR_LIT:t>'][c, i] == <NUM_LIT:1>:<EOL><INDENT>action = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>action = '<STR_LIT>'<EOL><DEDENT><DEDENT>updateListKeep = []<EOL>if action != '<STR_LIT>':<EOL><INDENT>for (createDate, segUpdate) in updateList:<EOL><INDENT>if self.verbosity >= <NUM_LIT:4>:<EOL><INDENT>print("<STR_LIT>", self.lrnIterationIdx, end='<STR_LIT:U+0020>')<EOL>print(segUpdate)<EOL><DEDENT>if self.lrnIterationIdx - createDate > self.segUpdateValidDuration:<EOL><INDENT>continue<EOL><DEDENT>if action == '<STR_LIT>':<EOL><INDENT>trimSegment = self._adaptSegment(segUpdate)<EOL>if trimSegment:<EOL><INDENT>trimSegments.append((segUpdate.columnIdx, segUpdate.cellIdx,<EOL>segUpdate.segment))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>updateListKeep.append((createDate, segUpdate))<EOL><DEDENT><DEDENT><DEDENT>self.segmentUpdates[key] = updateListKeep<EOL>if len(updateListKeep) == <NUM_LIT:0>:<EOL><INDENT>removeKeys.append(key)<EOL><DEDENT><DEDENT>for key in removeKeys:<EOL><INDENT>self.segmentUpdates.pop(key)<EOL><DEDENT>for (c, i, segment) in trimSegments:<EOL><INDENT>self._trimSegmentsInCell(c, i, [segment], minPermanence = <NUM_LIT>,<EOL>minNumSyns = <NUM_LIT:0>)<EOL><DEDENT>
Go through the list of accumulated segment updates and process them
as follows:

if the segment update is too old, remove the update
else if the cell received bottom-up, update its permanences
else if it's still being predicted, leave it in the queue
else remove it.

:param activeColumns TODO: document