def random_sample(
    size: NdShapeLike | None = None, dtype: npt.DTypeLike = np.float64
) -> float | ndarray:
    """
    random_sample(size=None)

    Return random floats in the half-open interval ``[0.0, 1.0)``.

    Results are from the "continuous uniform" distribution over the
    stated interval.  To sample :math:`Unif[a, b), b > a` multiply
    the output of `random_sample` by `(b-a)` and add `a`::

      (b - a) * random_sample() + a

    Parameters
    ----------
    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 : float or ndarray of floats
        Array of random floats of shape `size` (unless ``size=None``, in which
        case a single float is returned).

    See Also
    --------
    numpy.random.random_sample

    Availability
    --------
    Multiple GPUs, Multiple CPUs
    """
    return uniform(0.0, 1.0, size, dtype)

    random_sample(size=None)

    Return random floats in the half-open interval ``[0.0, 1.0)``.

    Results are from the "continuous uniform" distribution over the
    stated interval.  To sample :math:`Unif[a, b), b > a` multiply
    the output of `random_sample` by `(b-a)` and add `a`::

      (b - a) * random_sample() + a

    Parameters
    ----------
    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 : float or ndarray of floats
        Array of random floats of shape `size` (unless ``size=None``, in which
        case a single float is returned).

    See Also
    --------
    numpy.random.random_sample

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