code: def ap_randint_sampler(
      obs,
      prior_weight,
      low,
      high=None,
      size=(),
      rng=None,
      LF=DEFAULT_LF,
  ):
      # randint can be seen as a categorical with high - low categories
      weights = scope.linear_forgetting_weights(scope.len(obs), LF=LF)
      # if high is None, then low represents high and there is no offset
      domain_size = low if high is None else high - low
      offset = pyll.Literal(0) if high is None else low
      counts = scope.bincount(
          obs, offset=offset, minlength=domain_size, weights=weights
      )
      # -- add in some prior pseudocounts
      pseudocounts = counts + prior_weight
      random_variable = scope.randint_via_categorical(
          pseudocounts / scope.sum(pseudocounts), size=size, rng=rng
      )
      return random_variable
  
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 24 for calling a global function with example usage: ap_randint_sampler(obs, prior_weight, low, high, size, rng, LF) and returns: random_variable