code: def compute_accuracy(log_likelihood, qs):
      """
      Function that computes the accuracy term of the variational free energy. This is essentially a stripped down version of `spm_dot` above,
      with fewer conditions / dimension handling in the beginning.
      """
  
      ndims_ll, n_factors = log_likelihood.ndim, len(qs)
  
      dims = list(
          range(ndims_ll - n_factors, n_factors + ndims_ll - n_factors)
      )
      arg_list = [log_likelihood, list(range(ndims_ll))] + list(
          chain(
              *(
                  [qs[xdim_i], [dims[xdim_i]]]
                  for xdim_i in range(n_factors)
              )
          )
      )
  
      return np.einsum(*arg_list)
  
imports: import numpy
  from scipy import special
  from pymdp import utils
  from itertools import chain
label_desc: Use image node_id 16 for calling a global function with example usage: compute_accuracy(log_likelihood, qs) and returns: np