def random_integers(
    low: int,
    high: int | None = None,
    size: NdShapeLike | None = None,
    dtype: np.dtype[Any] | type = int,
) -> int | ndarray | npt.NDArray[Any]:
    """
    random_integers(low, high=None, size=None)

    Random integers of type `np.int_` between `low` and `high`, inclusive.

    Return random integers of type `np.int_` from the "discrete uniform"
    distribution in the closed interval [`low`, `high`].  If `high` is
    None (the default), then results are from [1, `low`]. The `np.int_`
    type translates to the C long integer type and its precision
    is platform dependent.

    This function has been deprecated. Use randint instead.

    Parameters
    ----------
    low : int
        Lowest (signed) integer to be drawn from the distribution (unless
        ``high=None``, in which case this parameter is the *highest* such
        integer).
    high : int, optional
        If provided, the largest (signed) integer to be drawn from the
        distribution (see above for behavior if ``high=None``).
    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.  Default is None, in which case a
        single value is returned.

    Returns
    -------
    out : int or ndarray of ints
        `size`-shaped array of random integers from the appropriate
        distribution, or a single such random int if `size` not provided.

    See Also
    --------
    numpy.random.random_integers

    Availability
    --------
    Multiple GPUs, Multiple CPUs
    """
    if high is None:
        high = low
        low = 0
    return randint(low, high + 1, size, dtype)

    random_integers(low, high=None, size=None)

    Random integers of type `np.int_` between `low` and `high`, inclusive.

    Return random integers of type `np.int_` from the "discrete uniform"
    distribution in the closed interval [`low`, `high`].  If `high` is
    None (the default), then results are from [1, `low`]. The `np.int_`
    type translates to the C long integer type and its precision
    is platform dependent.

    This function has been deprecated. Use randint instead.

    Parameters
    ----------
    low : int
        Lowest (signed) integer to be drawn from the distribution (unless
        ``high=None``, in which case this parameter is the *highest* such
        integer).
    high : int, optional
        If provided, the largest (signed) integer to be drawn from the
        distribution (see above for behavior if ``high=None``).
    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.  Default is None, in which case a
        single value is returned.

    Returns
    -------
    out : int or ndarray of ints
        `size`-shaped array of random integers from the appropriate
        distribution, or a single such random int if `size` not provided.

    See Also
    --------
    numpy.random.random_integers

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