def replace(self, var_to_find, replace_by_var):
    """Find a variable `var_to_find` the arguments and replace it by `replace_by_var`."""
    return Term(
        function=self.function,
        args=tuple(replace_by_var if variable == var_to_find else variable
                   for variable in self.arguments),
        specs=self.specs,
        meta=self.meta)
Find a variable `var_to_find` the arguments and replace it by `replace_by_var`.
language/gscan/data/grammar.py