code: def _clean(self):
          
          found_ids = {}
          nodes = [self._nodes[_node.Root.ID]]
          while nodes:
              node = nodes.pop()
              found_ids[node.id] = None
              nodes = nodes + node.children
  
          for node_id in self._nodes:
              if node_id in found_ids:
                  continue
              logger.error('Dangling node: %s', node_id)
  
          for node_id in found_ids:
              if node_id in self._nodes:
                  continue
              logger.error('Unregistered node: %s', node_id)
docs: Recursively check that all nodes are reachable.