class_docstr: Declarative representation of a finitary sum-product operation.
  
  After normalization via the :func:`~funsor.terms.normalize` interpretation
  contractions will canonically order their terms by type::
  
      Delta, Number, Tensor, Gaussian
class_docstr_tok: ["Declarative","representation","of","a","finitary","sum-product","operation",".","After","normalization","via","the",":","func",":","`","~funsor.terms.normalize","`","interpretation","contractions","will","canonically","order","their","terms","by","type",":",":","Delta",",","Number",",","Tensor",",","Gaussian"]
code: def __str__(self):
      if self.bin_op in _INFIX:
          bin_op = " " + _INFIX[self.bin_op] + " "
          return "({}).reduce({}, {})".format(
              bin_op.join(map(str, self.terms)),
              self.red_op,
              str(set(map(str, self.reduced_vars))),
          )
      return super().__str__()
  
imports: import functools
  import itertools
  from collections import Counter, OrderedDict, defaultdict
  from functools import reduce
  from typing import Tuple, Union
  import opt_einsum
  import funsor
  import funsor.ops
  from funsor.affine import affine_inputs
  from funsor.delta import Delta
  from funsor.domains import find_domain
  from funsor.gaussian import Gaussian
  from funsor.interpretations import eager, normalize, reflect
  from funsor.interpreter import children
  from funsor.ops import DISTRIBUTIVE_OPS, AssociativeOp, NullOp
  from funsor.tensor import Tensor
  from funsor.terms import _INFIX, Align, Binary, Funsor, Number, Reduce, Subs, Unary, Variable, to_funsor
  from funsor.typing import Variadic
  from funsor.util import broadcast_shape, get_backend, quote
label_desc: Use image node_id 3 for calling the Contraction obj's underlying member method code with example usage: obj.__str__() and returns: super, str