Returns all nodes that share the same parent (incoming node) with the given node, including the node itself.
(self, node)
| 235 | return incoming |
| 236 | |
| 237 | def siblings(self, node): |
| 238 | """Returns all nodes that share the same parent (incoming node) with |
| 239 | the given node, including the node itself. |
| 240 | """ |
| 241 | incoming = self.incoming(node) |
| 242 | # TODO: Not handling the case of multiple incoming nodes yet |
| 243 | if len(incoming) == 1: |
| 244 | incoming = incoming[0] |
| 245 | siblings = self.outgoing(incoming) |
| 246 | return siblings |
| 247 | else: |
| 248 | return [node] |
| 249 | |
| 250 | def __getitem__(self, key): |
| 251 | if isinstance(key, list): |