code: def qtable_pmf(x, q, qlow, xs, ps):
      qx = np.round(np.atleast_1d(x).astype(float) / q) * q
      is_multiple = np.isclose(qx, x)
      ix = np.round((qx - qlow) / q).astype(int)
      is_inbounds = np.logical_and(ix >= 0, ix < len(ps))
      oks = np.logical_and(is_multiple, is_inbounds)
      rval = np.zeros_like(qx)
      rval[oks] = np.asarray(ps)[ix[oks]]
      if isinstance(x, np.ndarray):
          return rval.reshape(x.shape)
      return float(rval)
  
imports: 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 1 for calling a global function with example usage: qtable_pmf(x, q, qlow, xs, ps) and returns: float, rval