(nlist, adj)
| 380 | else: # if nbunch is a sequence of nodes |
| 381 | |
| 382 | def bunch_iter(nlist, adj): |
| 383 | try: |
| 384 | for n in nlist: |
| 385 | if n in adj: |
| 386 | yield n |
| 387 | except TypeError as err: |
| 388 | exc, message = err, err.args[0] |
| 389 | # capture error for non-sequence/iterator nbunch. |
| 390 | if "iter" in message: |
| 391 | exc = EasyGraphError( |
| 392 | "nbunch is not a node or a sequence of nodes." |
| 393 | ) |
| 394 | # capture error for unhashable node. |
| 395 | if "hashable" in message: |
| 396 | exc = EasyGraphError( |
| 397 | f"Node {n} in sequence nbunch is not a valid node." |
| 398 | ) |
| 399 | raise exc |
| 400 | |
| 401 | bunch = bunch_iter(nbunch, self._adj) |
| 402 | return bunch |
nothing calls this directly
no test coverage detected