def METHOD_NAME(self) -> None:
    if self.debug:
        for child in self.__children:
            if id(child.parent) != id(self):
                raise AssertionError('Child is missing parent reference')
            child.METHOD_NAME()
        if self.parent:
            if self.__parent_index not in range(len(self.parent)):
                raise AssertionError('Out of range parent index')
            if id(self.parent[self.__parent_index]) != id(self):
                if id(self) in (id(c) for c in self.parent.__children):
                    raise AssertionError('Wrong parent index')
                else:
                    raise AssertionError('Parent is missing child reference')