Searches the graph for a sub-graph that matches the given pattern and returns the first match it finds.
(self, pattern)
| 284 | self.remove(n) |
| 285 | |
| 286 | def search(self, pattern): |
| 287 | """Searches the graph for a sub-graph that matches the given pattern |
| 288 | and returns the first match it finds. |
| 289 | """ |
| 290 | for node in self.nodes.values(): |
| 291 | match, following = pattern.match(self, node) |
| 292 | if match: |
| 293 | return match, following |
| 294 | return [], None |
| 295 | |
| 296 | |
| 297 | def sequence_id(self, sequence): |