Unlikely to be an issue, but would this be better as:
`if node["path"].startswith(pp["path"]):`
(since, theoretically, it could be contained in some other part of the path)