def build_views(
    string: str,
    dimension_dict: Optional[Dict[str, int]] = None,
    array_function: Optional[Any] = None,
    replace_ellipsis: bool = False,
) -> Tuple[ArrayType, ...]:
    """Builds random numpy arrays for testing.

    Parameters:
        string: List of tensor strings to build
        dimension_dict: Dictionary of index _sizes
        array_function: Function to build the arrays, defaults to np.random.rand
        replace_ellipsis: Replace ellipsis with a string of no collision characters

    Returns:
        The resulting views.

    Examples:
        ```python
        >>> view = build_views('abbc', {'a': 2, 'b':3, 'c':5})
        >>> view[0].shape
        (2, 3, 3, 5)
        ```

    """
    if array_function is None:
        np = pytest.importorskip("numpy")
        array_function = np.random.rand

    views = []
    for shape in build_shapes(string, dimension_dict=dimension_dict, replace_ellipsis=replace_ellipsis):
        if shape:
            views.append(array_function(*shape))
        else:
            views.append(random.random())
    return tuple(views)
Builds random numpy arrays for testing.

    Parameters:
        string: List of tensor strings to build
        dimension_dict: Dictionary of index _sizes
        array_function: Function to build the arrays, defaults to np.random.rand
        replace_ellipsis: Replace ellipsis with a string of no collision characters

    Returns:
        The resulting views.

    Examples:
        ```python
        >>> view = build_views('abbc', {'a': 2, 'b':3, 'c':5})
        >>> view[0].shape
        (2, 3, 3, 5)
        ```

    
opt_einsum/testing.py