code: def negative_binomial(n, p, size=None):
      if p <= 0 or p >= 1:
          raise ValueError("p must be in the interval (0, 1)")
      if n <= 0:
          raise ValueError("n must be strictly positive")
      # numpy implementation uses scale = (1 - p) / p
      scale = (1 - p) / p
      # poisson requires shape to be a tuple
      if isinstance(size, int):
          size = (size,)
      lambda_ = ivy.gamma(n, scale, shape=size)
      return ivy.poisson(lam=lambda_, shape=size)
  
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back, from_zero_dim_arrays_to_scalar
  from ivy import with_supported_dtypes
label_desc: Use image node_id 16 for calling a global function with example usage: negative_binomial(n, p, size) and returns: ivy