code: def test_rewrite_ops():
      @rewrite_ops({"+": "sum_op", "*": "prod_op"})
      def product_rule(sum_op, prod_op, lhs, rhs, d):
          """foo"""
          return d(lhs) * rhs + lhs * d(rhs)
  
      actual = product_rule
  
      def product_rule(sum_op, prod_op, lhs, rhs, d):
          """foo"""
          return sum_op(prod_op(d(lhs), rhs), prod_op(lhs, d(rhs)))
  
      expected = product_rule
  
      assert_fn_eq(actual, expected)
      args = (max, operator.add, 1.23, 4.56, lambda x: x**2)
      assert actual(*args) == expected(*args)
  
file_path: funsor/test/test_syntax.py
imports: import operator
  import sys
  import pytest
  from funsor import ops
  from funsor.syntax import rewrite_ops
label_desc: Use image node_id 2 for calling a global function with example usage: test_rewrite_ops() and returns: unknown, sum_op