code: def negbin_sample(r, p, size):
      # a negative binomial is a gamma-compound-Poisson
      return npr.poisson(npr.gamma(r, p / (1 - p), size=size))
  
file_path: autograd/examples/negative_binomial_maxlike.py
imports: from __future__ import division, print_function
  import autograd.numpy
  import autograd.numpy.random
  from autograd.scipy.special import gammaln
  from autograd import grad
  import scipy.optimize
label_desc: Use image node_id 3 for calling a global function with example usage: negbin_sample(r, p, size) and returns: npr