(nlist, adj)
| 607 | else: # if nbunch is a sequence of nodes |
| 608 | |
| 609 | def bunch_iter(nlist, adj): |
| 610 | try: |
| 611 | for n in nlist: |
| 612 | if n in adj: |
| 613 | yield n |
| 614 | except TypeError as err: |
| 615 | exc, message = err, err.args[0] |
| 616 | # capture error for non-sequence/iterator nbunch. |
| 617 | if "iter" in message: |
| 618 | exc = EasyGraphError( |
| 619 | "nbunch is not a node or a sequence of nodes." |
| 620 | ) |
| 621 | # capture error for unhashable node. |
| 622 | if "hashable" in message: |
| 623 | exc = EasyGraphError( |
| 624 | f"Node {n} in sequence nbunch is not a valid node." |
| 625 | ) |
| 626 | raise exc |
| 627 | |
| 628 | bunch = bunch_iter(nbunch, self._adj) |
| 629 | return bunch |
nothing calls this directly
no test coverage detected