code: def qtable_logpmf(x, q, qlow, xs, ps):
      p = qtable_pmf(np.atleast_1d(x), q, qlow, xs, ps)
      # -- this if/else avoids np warning about underflow
      rval = np.zeros_like(p)
      rval[p == 0] = -np.inf
      rval[p != 0] = np.log(p[p != 0])
      if isinstance(x, np.ndarray):
          return rval
      else:
          return float(rval)
  
imports: from __future__ import division
  from builtins import map
  from builtins import object
  from past.utils import old_div
  import numpy
  import numpy.random
  import scipy.stats
  from scipy.stats import rv_continuous
  from scipy.stats._continuous_distns import lognorm_gen
label_desc: Use image node_id 2 for calling a global function with example usage: qtable_logpmf(x, q, qlow, xs, ps) and returns: rval, float