def negative_binomial(
    n: int,
    p: float,
    size: NdShapeLike | None = None,
    dtype: npt.DTypeLike = np.uint32,
) -> ndarray:
    """
    negative_binomial(n, p, size=None)

    Draw samples from a negative binomial distribution.

    Samples are drawn from a negative binomial distribution with specified
    parameters, `n` successes and `p` probability of success where `n`
    is > 0 and `p` is in the interval (0, 1].

    Parameters
    ----------
    n : int
        Parameter of the distribution, > 0.
    p : float
        Parameter of the distribution, > 0 and <=1.
    size : int or tuple of ints, optional
        Output shape.  If the given shape is, e.g., ``(m, n, k)``, then
        ``m * n * k`` samples are drawn.  If size is ``None`` (default),
        a single value is returned.

    Returns
    -------
    out : ndarray or scalar
        Drawn samples from the parameterized negative binomial distribution,
        where each sample is equal to N, the number of failures that
        occurred before a total of n successes was reached.

    See Also
    --------
    numpy.random.negative_binomial

    Availability
    --------
    Multiple GPUs, Multiple CPUs
    """
    return get_static_generator().negative_binomial(n, p, size, dtype)

    negative_binomial(n, p, size=None)

    Draw samples from a negative binomial distribution.

    Samples are drawn from a negative binomial distribution with specified
    parameters, `n` successes and `p` probability of success where `n`
    is > 0 and `p` is in the interval (0, 1].

    Parameters
    ----------
    n : int
        Parameter of the distribution, > 0.
    p : float
        Parameter of the distribution, > 0 and <=1.
    size : int or tuple of ints, optional
        Output shape.  If the given shape is, e.g., ``(m, n, k)``, then
        ``m * n * k`` samples are drawn.  If size is ``None`` (default),
        a single value is returned.

    Returns
    -------
    out : ndarray or scalar
        Drawn samples from the parameterized negative binomial distribution,
        where each sample is equal to N, the number of failures that
        occurred before a total of n successes was reached.

    See Also
    --------
    numpy.random.negative_binomial

    Availability
    --------
    Multiple GPUs, Multiple CPUs
    
cupynumeric/random/_random.py