code: def randint_via_categorical(p, rng=None, size=()):
      """
      Only used in tpe because of the chaotic API based on names.
      # ideally we would just use randint above, but to use priors this is a wrapper of
      categorical
      rng = random number generator, typically equals np.random.Generator
      """
  
      return scope.categorical(p, rng, size)
  
imports: import sys
  import numpy
  from .base import scope, as_apply, dfs, rec_eval, clone
label_desc: Use image node_id 13 for calling a global function with example usage: randint_via_categorical(p, rng, size) and returns: scope