code: def idxs_prod(full_idxs, idxs_by_label, llik_by_label):
      """Add all of the  log-likelihoods together by id.
  
      Example arguments:
      full_idxs = [0, 1, ... N-1]
      idxs_by_label = {'node_a': [1, 3], 'node_b': [3]}
      llik_by_label = {'node_a': [0.1, -3.3], node_b: [1.0]}
  
      This would return N elements: [0, 0.1, 0, -2.3, 0, 0, ... ]
      """
      assert len(set(full_idxs)) == len(full_idxs)
      full_idxs = list(full_idxs)
      rval = np.zeros(len(full_idxs))
      pos_of_tid = dict(
          list(zip(full_idxs, list(range(len(full_idxs)))))
      )
      assert set(idxs_by_label.keys()) == set(llik_by_label.keys())
      for nid in idxs_by_label:
          idxs = idxs_by_label[nid]
          llik = llik_by_label[nid]
          assert np.all(np.asarray(idxs) > 1)
          assert len(set(idxs)) == len(idxs)
          assert len(idxs) == len(llik)
          for ii, ll in zip(idxs, llik):
              rval[pos_of_tid[ii]] += ll
      return rval
  
imports: from __future__ import print_function
  from __future__ import absolute_import
  from __future__ import division
  from builtins import str
  from builtins import map
  from builtins import zip
  from builtins import range
  from past.utils import old_div
  import logging
  import time
  import numpy
  from scipy.special import erf
  from .None import pyll
  from .pyll import scope
  from .pyll.stochastic import implicit_stochastic
  from .base import miscs_to_idxs_vals
  from .base import miscs_update_idxs_vals
  from .None import rand
label_desc: Use image node_id 28 for calling a global function with example usage: idxs_prod(full_idxs, idxs_by_label, llik_by_label) and returns: rval