Flattens a compound of nested iterables.
(iterable)
| 2585 | """ |
| 2586 | |
| 2587 | def flatten_sequence(iterable): |
| 2588 | """ |
| 2589 | Flattens a compound of nested iterables. |
| 2590 | |
| 2591 | """ |
| 2592 | for elm in iter(iterable): |
| 2593 | if hasattr(elm, "__iter__") and not isinstance(elm, (str, bytes)): |
| 2594 | yield from flatten_sequence(elm) |
| 2595 | else: |
| 2596 | yield elm |
| 2597 | |
| 2598 | a = np.asanyarray(a) |
| 2599 | inishape = a.shape |
no outgoing calls
no test coverage detected
searching dependent graphs…