code: def tpe_cat_pseudocounts(counts, prior_weight, p, size):
      if np.prod(size) == 0:
          return []
      if p.ndim == 2:
          assert np.all(p == p[0])
          p = p[0]
      pseudocounts = counts + p.size * (prior_weight * p)
      return pseudocounts / np.sum(pseudocounts)
  
imports: 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 25 for calling a global function with example usage: tpe_cat_pseudocounts(counts, prior_weight, p, size) and returns: unknown, list