filter_nodes() and filter_edges() both work and were tested.