def nodes_by_prefix(self, name): """Return a list of all nodes whose names begin with a given prefix """ return [x for x in self.nodes if x.name.startswith(name)]