code: def debug(brule, file=None):
      """Print the input and output expressions at each rule application"""
      if not file:
          from sys import stdout
  
          file = stdout
  
      def write(brl, expr, result):
          file.write("Rule: %s\n" % brl.__name__)
          file.write("In: %s\nOut: %s\n\n" % (expr, result))
  
      return onaction(brule, write)
  
file_path: sympy/sympy/strategies/branch/core.py
label_desc: Use image node_id 4 for calling a global function with example usage: debug(brule, file) and returns: onaction