Search the expression graph for a specific operation type Parameters ---------- operation The operation type to search for. Returns ------- nodes Generator of `operation` instances. Ordering corresponds to a depth-
(self, operation: type | tuple[type])
| 811 | yield node |
| 812 | |
| 813 | def find_operations(self, operation: type | tuple[type]) -> Generator[Expr]: |
| 814 | """Search the expression graph for a specific operation type |
| 815 | |
| 816 | Parameters |
| 817 | ---------- |
| 818 | operation |
| 819 | The operation type to search for. |
| 820 | |
| 821 | Returns |
| 822 | ------- |
| 823 | nodes |
| 824 | Generator of `operation` instances. Ordering corresponds |
| 825 | to a depth-first search of the expression graph. |
| 826 | """ |
| 827 | assert ( |
| 828 | isinstance(operation, tuple) |
| 829 | and all(issubclass(e, Expr) for e in operation) |
| 830 | or issubclass(operation, Expr) # type: ignore |
| 831 | ), "`operation` must be`Expr` subclass)" |
| 832 | return (expr for expr in self.walk() if isinstance(expr, operation)) |
| 833 | |
| 834 | def __getattr__(self, key): |
| 835 | try: |