code: def _lower_contraction(x):
      if x.reduced_vars:
          raise NotImplementedError("TODO")
  
      terms = [_lower(term) for term in x.terms]
      bin_op = functools.partial(Binary, x.bin_op)
      return functools.reduce(bin_op, terms)
  
file_path: funsor/funsor/compiler.py
imports: import functools
  import funsor
  from .cnf import Contraction
  from .ops.program import OpProgram, make_tuple
  from .tensor import Tensor
  from .terms import Binary, Funsor, Number, Tuple, Unary, Variable
label_desc: Use image node_id 8 for calling a global function with example usage: _lower_contraction(x) and returns: functools