def _consistent(self):
if len(self.__order) != sum(len(values) for values in self.__index.values()):<EOL><INDENT>return False<EOL><DEDENT>import copy<EOL>tmp = copy.copy(self.__order)<EOL>for key, values in self.__index.items():<EOL><INDENT>for value in values:<EOL><INDENT>if value.name != key:<EOL><INDENT>return False<EOL><DEDENT>if value in tmp:<EOL><INDENT>tmp.remove(value)<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>if isinstance(value, CP2KSection):<EOL><INDENT>if not value._consistent():<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return True<EOL>
Checks the constency between self.__index and self.__order