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])
| 821 | yield node |
| 822 | |
| 823 | def find_operations(self, operation: type | tuple[type]) -> Generator[Expr]: |
| 824 | """Search the expression graph for a specific operation type |
| 825 | |
| 826 | Parameters |
| 827 | ---------- |
| 828 | operation |
| 829 | The operation type to search for. |
| 830 | |
| 831 | Returns |
| 832 | ------- |
| 833 | nodes |
| 834 | Generator of `operation` instances. Ordering corresponds |
| 835 | to a depth-first search of the expression graph. |
| 836 | """ |
| 837 | assert ( |
| 838 | isinstance(operation, tuple) |
| 839 | and all(issubclass(e, Expr) for e in operation) |
| 840 | or issubclass(operation, Expr) # type: ignore[arg-type] |
| 841 | ), "`operation` must be an `Expr` subclass)" |
| 842 | return (expr for expr in self.walk() if isinstance(expr, operation)) |
| 843 | |
| 844 | def __getattr__(self, key): |
| 845 | try: |