def printTrace(self, cell_type, src_sent):

        traceFile = settings.opts.outFile + ".trace"
        tF = open(traceFile, 'a')

        nbest_cnt = 0
        hypTraceStack = []
        tgt_key = self.calcCandScore(cell_type)
        for entry in self.table[tgt_key][:]:

            tF.write("TRACE_BEGIN\n")
            hypTraceStack.append(entry)
            tF.write( "#Input  :: %s\n" % (src_sent) )
            tF.write( "#Output :: %s ||| %s\n" % (Hypothesis.getHypothesis(entry), Hypothesis.getFeatVec(entry)) )

            while ( hypTraceStack ):
                trace_entry = hypTraceStack.pop(0)
                for back_pointer in trace_entry.bp:
                    hypTraceStack.insert(0, back_pointer)
                inf_rule = trace_entry.inf_rule
                if inf_rule is not None:    # Non-leaf nodes in derivation
                    tF.write( "%s ||| %s ||| %s ||| %s\n" % ( inf_rule.src, inf_rule.tgt, Hypothesis.getFeatVec(trace_entry), trace_entry.inf_cell ) )
                else:                       # Leaf nodes in derivation
                    tF.write( "%s ||| %s ||| %s |||| %s\n" % ( trace_entry.src, Hypothesis.getHypothesis(trace_entry), Hypothesis.getFeatVec(trace_entry), trace_entry.inf_cell ) )

            tF.write("TRACE_END\n")
            nbest_cnt += 1
            del hypTraceStack[:]
            if nbest_cnt == settings.opts.trace_rules: break
        tF.close()
Reads the payload (=data)
dataset/ETHPy150Open sfu-natlang/Kriya/src/Kriya-Decoder/cell.py/Cell.printTrace--crossover with--dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/pyqode/core/api/client.py/JsonTcpClient._read_payload