code: def exhaust(rule: Callable[[_T], _T]) -> Callable[[_T], _T]:
      """Apply a rule repeatedly until it has no effect"""
  
      def exhaustive_rl(expr: _T) -> _T:
          new, old = rule(expr), expr
          while new != old:
              new, old = rule(new), new
          return new
  
      return exhaustive_rl
  
file_path: sympy/sympy/strategies/core.py
imports: from __future__ import annotations
  from collections.abc import Callable, Mapping
  from typing import TypeVar
  from sys import stdout
label_desc: Use image node_id 2 for calling a global function with example usage: exhaust(rule) and returns: exhaustive_rl, new