code: def onaction(brule, fn):
      def onaction_brl(expr):
          for result in brule(expr):
              if result != expr:
                  fn(brule, expr, result)
              yield result
  
      return onaction_brl
  
file_path: sympy/sympy/strategies/branch/core.py
label_desc: Use image node_id 3 for calling a global function with example usage: onaction(brule, fn) and returns: onaction_brl