Determine if tree contains any specified operands/operators.
(self, *vars)
| 106 | return atoms |
| 107 | |
| 108 | def has(self, *vars): |
| 109 | """Determine if tree contains any specified operands/operators.""" |
| 110 | # Check for matching operator |
| 111 | if any(isinstance(self, var) for var in vars if isinstance(var, type)): |
| 112 | return True |
| 113 | # Check arguments |
| 114 | else: |
| 115 | return any(arg.has(*vars) for arg in self.args if isinstance(arg, Operand)) |
| 116 | |
| 117 | def replace(self, old, new): |
| 118 | """Replace specified operand/operator.""" |
no outgoing calls
no test coverage detected