code: def compute_argmax_contract(model, approx_vars):
      for t1 in model.terms:
          for t2 in model.terms:
              if t1 is t2:
                  continue
              if not approx_vars.isdisjoint(
                  t1.input_vars & t2.input_vars
              ):
                  raise ValueError("should never be here")
  
      result = {}
      for term in model.terms:
          result.update(
              compute_argmax(term, approx_vars & term.input_vars)
          )
      return result
  
imports: from collections import OrderedDict
  from functools import reduce, singledispatch
  from funsor.cnf import Contraction, GaussianMixture
  from funsor.delta import Delta
  from funsor.gaussian import Gaussian, _compute_offsets
  from funsor.instrument import debug_logged
  from funsor.integrate import Integrate
  from funsor.interpretations import DispatchedInterpretation
  from funsor.tensor import Tensor, align_tensor
  from funsor.terms import Approximate, Funsor
  from funsor.typing import deep_isinstance
  from .None import ops
label_desc: Use image node_id 9 for calling a global function with example usage: compute_argmax_contract(model, approx_vars) and returns: result