@classmethod
    def readFromFile(cls, stream):
        parent_id = stream.readInt()
        branch = cls(parent_id)
        if parent_id == _LEAF:
            branch.default = TreeLeaf.readFromFile(stream)
            branch.comment = stream.comment
            return branch
        else:
            n_quest = stream.readInt()
            questions = []

            while len(questions)< n_quest-1:
                w = stream.readWord()
                if w == '...':
                    questions.extend(range(questions[-1]+1,stream.readInt()+1))

                else:
                    questions.append(int(w))
            #
            #for x in questions:
            #       print str(x)+"\n"
            question = stream.readWord()
            if question != 'default':
                raise ValueError('Expected string "default", not %r' % question)
            #
            branch.comment = stream.comment
            for q in questions:
                answer = cls.readFromFile(stream)
                branch[q] = answer
            branch.default = cls.readFromFile(stream)
            return branch
dataset/ETHPy150Open uci-cbcl/tree-hmm/gmtkParam/__init__.py/TreeBranch.readFromFile/original