def write(self, proto):
proto.version = TM_VERSION<EOL>self._random.write(proto.random)<EOL>proto.numberOfCols = self.numberOfCols<EOL>proto.cellsPerColumn = self.cellsPerColumn<EOL>proto.initialPerm = float(self.initialPerm)<EOL>proto.connectedPerm = float(self.connectedPerm)<EOL>proto.minThreshold = self.minThreshold<EOL>proto.newSynapseCount = self.newSynapseCount<EOL>proto.permanenceInc = float(self.permanenceInc)<EOL>proto.permanenceDec = float(self.permanenceDec)<EOL>proto.permanenceMax = float(self.permanenceMax)<EOL>proto.globalDecay = float(self.globalDecay)<EOL>proto.activationThreshold = self.activationThreshold<EOL>proto.doPooling = self.doPooling<EOL>proto.segUpdateValidDuration = self.segUpdateValidDuration<EOL>proto.burnIn = self.burnIn<EOL>proto.collectStats = self.collectStats<EOL>proto.verbosity = self.verbosity<EOL>proto.pamLength = self.pamLength<EOL>proto.maxAge = self.maxAge<EOL>proto.maxInfBacktrack = self.maxInfBacktrack<EOL>proto.maxLrnBacktrack = self.maxLrnBacktrack<EOL>proto.maxSeqLength = self.maxSeqLength<EOL>proto.maxSegmentsPerCell = self.maxSegmentsPerCell<EOL>proto.maxSynapsesPerSegment = self.maxSynapsesPerSegment<EOL>proto.outputType = self.outputType<EOL>proto.activeColumns = self.activeColumns<EOL>cellListProto = proto.init("<STR_LIT>", len(self.cells))<EOL>for i, columnSegments in enumerate(self.cells):<EOL><INDENT>columnSegmentsProto = cellListProto.init(i, len(columnSegments))<EOL>for j, cellSegments in enumerate(columnSegments):<EOL><INDENT>cellSegmentsProto = columnSegmentsProto.init(j, len(cellSegments))<EOL>for k, segment in enumerate(cellSegments):<EOL><INDENT>segment.write(cellSegmentsProto[k])<EOL><DEDENT><DEDENT><DEDENT>proto.lrnIterationIdx = self.lrnIterationIdx<EOL>proto.iterationIdx = self.iterationIdx<EOL>proto.segID = self.segID<EOL>if self.currentOutput is None:<EOL><INDENT>proto.currentOutput.none = None<EOL><DEDENT>else:<EOL><INDENT>proto.currentOutput.list = self.currentOutput.tolist()<EOL><DEDENT>proto.pamCounter = self.pamCounter<EOL>proto.collectSequenceStats = self.collectSequenceStats<EOL>proto.resetCalled = self.resetCalled<EOL>proto.avgInputDensity = self.avgInputDensity or -<NUM_LIT:1.0><EOL>proto.learnedSeqLength = self.learnedSeqLength<EOL>proto.avgLearnedSeqLength = self.avgLearnedSeqLength<EOL>proto.prevLrnPatterns = self._prevLrnPatterns<EOL>proto.prevInfPatterns = self._prevInfPatterns<EOL>segmentUpdatesListProto = proto.init("<STR_LIT>",<EOL>len(self.segmentUpdates))<EOL>for i, (key, updates) in enumerate(self.segmentUpdates.items()):<EOL><INDENT>cellSegmentUpdatesProto = segmentUpdatesListProto[i]<EOL>cellSegmentUpdatesProto.columnIdx = key[<NUM_LIT:0>]<EOL>cellSegmentUpdatesProto.cellIdx = key[<NUM_LIT:1>]<EOL>segmentUpdatesProto = cellSegmentUpdatesProto.init("<STR_LIT>",<EOL>len(updates))<EOL>for j, (lrnIterationIdx, segmentUpdate) in enumerate(updates):<EOL><INDENT>segmentUpdateWrapperProto = segmentUpdatesProto[j]<EOL>segmentUpdateWrapperProto.lrnIterationIdx = lrnIterationIdx<EOL>segmentUpdate.write(segmentUpdateWrapperProto.segmentUpdate)<EOL><DEDENT><DEDENT>proto.cellConfidenceT = self.cellConfidence["<STR_LIT:t>"].tolist()<EOL>proto.cellConfidenceT1 = self.cellConfidence["<STR_LIT>"].tolist()<EOL>proto.cellConfidenceCandidate = self.cellConfidence["<STR_LIT>"].tolist()<EOL>proto.colConfidenceT = self.colConfidence["<STR_LIT:t>"].tolist()<EOL>proto.colConfidenceT1 = self.colConfidence["<STR_LIT>"].tolist()<EOL>proto.colConfidenceCandidate = self.colConfidence["<STR_LIT>"].tolist()<EOL>proto.lrnActiveStateT = self.lrnActiveState["<STR_LIT:t>"].tolist()<EOL>proto.lrnActiveStateT1 = self.lrnActiveState["<STR_LIT>"].tolist()<EOL>proto.infActiveStateT = self.infActiveState["<STR_LIT:t>"].tolist()<EOL>proto.infActiveStateT1 = self.infActiveState["<STR_LIT>"].tolist()<EOL>proto.infActiveStateBackup = self.infActiveState["<STR_LIT>"].tolist()<EOL>proto.infActiveStateCandidate = self.infActiveState["<STR_LIT>"].tolist()<EOL>proto.lrnPredictedStateT = self.lrnPredictedState["<STR_LIT:t>"].tolist()<EOL>proto.lrnPredictedStateT1 = self.lrnPredictedState["<STR_LIT>"].tolist()<EOL>proto.infPredictedStateT = self.infPredictedState["<STR_LIT:t>"].tolist()<EOL>proto.infPredictedStateT1 = self.infPredictedState["<STR_LIT>"].tolist()<EOL>proto.infPredictedStateBackup = self.infPredictedState["<STR_LIT>"].tolist()<EOL>proto.infPredictedStateCandidate = self.infPredictedState["<STR_LIT>"].tolist()<EOL>proto.consolePrinterVerbosity = self.consolePrinterVerbosity<EOL>
Populate serialization proto instance.

        :param proto: (BacktrackingTMProto) the proto instance to populate