code: def compute_argmax_gaussian_mixture(model, approx_vars):
      approx_vars = approx_vars.intersection(model.input_vars)
      if not approx_vars:
          return {}
      if any(model.reduced_vars):
          raise NotImplementedError
      discrete, gaussian = model.terms
      result = {}
  
      # Compute real argmax.
      real_vars = frozenset(
          v for v in gaussian.input_vars if v.dtype == "real"
      )
      real_approx_vars = real_vars & approx_vars
      if real_approx_vars:
          result.update(compute_argmax(gaussian, real_approx_vars))
  
      # Compute int argmax.
      int_approx_vars = frozenset(
          v for v in model.input_vars & approx_vars if v.dtype != "real"
      )
      if int_approx_vars:
          discrete = discrete + gaussian.reduce(
              ops.logaddexp, real_vars
          )
          result.update(compute_argmax(discrete, int_approx_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 8 for calling a global function with example usage: compute_argmax_gaussian_mixture(model, approx_vars) and returns: result, dict