def readMasterFile(self, mstr):
        IN_FILE = '_IN_FILE'
        INLINE = 'inline'
        ASCII = 'ascii'
        mstr_io = self.preprocessFile(mstr)
        #keep a list of open files, in case more than one parameter type is
        #stored in the same file
        file_ios={}
        while True:
            try:
                command = mstr_io.readWord()
            except IOError:
                break
            if not command.endswith(IN_FILE):
                raise ValueError('Invalid master file command: %s' % command)
            type_name = command[:-len(IN_FILE)]
            obj_type = self.knownObjects[type_name]
            fn = mstr_io.readWord()
            if fn == INLINE:
                self.readFromIO(obj_type,mstr_io)
            else:
                format = mstr_io.readWord()
                if format != ASCII:
                    raise ValueError('Format of %r not supported: %s' % (fn, format))
                if fn in file_ios:
                    file_io =file_ios[fn]
                else:
                    file_io = self.preprocessFile(fn)
                    file_ios[fn]=file_io
                self.readFromIO(obj_type,mstr_io)
dataset/ETHPy150Open uci-cbcl/tree-hmm/gmtkParam/__init__.py/Workspace.readMasterFile/original