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

    Draw samples from a binomial distribution.

    Samples are drawn from a binomial distribution with specified
    parameters, n trials and p probability of success where
    n an integer >= 0 and p is in the interval ``[0,1]``. (n may be
    input as a float, but it is truncated to an integer in use)

    Parameters
    ----------
    n : int
        Parameter of the distribution, >= 0. Floats are also accepted,
        but they will be truncated to integers.
    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 binomial distribution, where
        each sample is equal to the number of successes over the n trials.

    See Also
    --------
    numpy.random.binomial

    Availability
    --------
    Multiple GPUs, Multiple CPUs
    """
    return get_static_generator().binomial(ntrials, p, size, dtype)

    binomial(n, p, size=None)

    Draw samples from a binomial distribution.

    Samples are drawn from a binomial distribution with specified
    parameters, n trials and p probability of success where
    n an integer >= 0 and p is in the interval ``[0,1]``. (n may be
    input as a float, but it is truncated to an integer in use)

    Parameters
    ----------
    n : int
        Parameter of the distribution, >= 0. Floats are also accepted,
        but they will be truncated to integers.
    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 binomial distribution, where
        each sample is equal to the number of successes over the n trials.

    See Also
    --------
    numpy.random.binomial

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