def put(self, item, priority=None):
if not self._isfull():<EOL><INDENT>self._memory.append(None)<EOL><DEDENT>position = self._next_position_then_increment()<EOL>old_priority = <NUM_LIT:0> if self._memory[position] is Noneelse (self._memory[position].priority or <NUM_LIT:0>)<EOL>row = _SumRow(item, priority)<EOL>self._memory[position] = row<EOL>self._update_internal_nodes(<EOL>position, (row.priority or <NUM_LIT:0>) - old_priority)<EOL>
Stores a transition in replay memory.

If the memory is full, the oldest entry is replaced.