| 283 | /// list[Node]: the nodes that match the properties name and value |
| 284 | #[pyo3(signature = (properties_dict))] |
| 285 | pub fn find_nodes(&self, properties_dict: HashMap<String, Prop>) -> Vec<PyNode> { |
| 286 | let iter = self.nodes().into_iter().par_bridge(); |
| 287 | let out = iter |
| 288 | .filter(|n| { |
| 289 | let props = n.properties(); |
| 290 | properties_dict.iter().all(|(k, v)| { |
| 291 | if let Some(prop) = props.get(k) { |
| 292 | &prop == v |
| 293 | } else { |
| 294 | false |
| 295 | } |
| 296 | }) |
| 297 | }) |
| 298 | .map(PyNode::from) |
| 299 | .collect::<Vec<_>>(); |
| 300 | |
| 301 | out |
| 302 | } |
| 303 | |
| 304 | /// Gets the nodes in the graph |
| 305 | /// |