def mk_0to1_array(lib, shape, dtype=np.float64):
    """
    Constructs an array of the required shape, containing (in C order)
    sequential real values uniformly spaced in the range (0,1].
    """
    size = np.prod(shape)
    if size == 1:
        # Avoid zeros, since those are more likely to cause arithmetic issues
        # or produce degenerate outputs.
        return lib.full(shape, 0.5, dtype=dtype)
    return (mk_seq_array(lib, shape) / size).astype(dtype)

    Constructs an array of the required shape, containing (in C order)
    sequential real values uniformly spaced in the range (0,1].
    
tests/integration/utils/generators.py