def _determine_value_of_array_index(
    var_type: GenericType, index: int | float | decimal.Decimal | None = None
):
    """Determine the value of an array index.

    Args:
        var_type: The type of the array.
        index: The index of the array.

    Returns:
        The value of the array index.
    """
    origin_var_type = get_origin(var_type) or var_type
    if origin_var_type in types.UnionTypes:
        return unionize(
            *[
                _determine_value_of_array_index(t, index)
                for t in get_args(var_type)
                if t is not type(None)
            ]
        )
    if origin_var_type is range:
        return int
    if origin_var_type in [
        Sequence,
        Iterable,
        list,
        set,
        collections.abc.Sequence,
        collections.abc.Iterable,
    ]:
        args = get_args(var_type)
        return args[0] if args else Any
    if origin_var_type is tuple:
        args = get_args(var_type)
        if len(args) == 2 and args[1] is ...:
            return args[0]
        return (
            args[int(index) % len(args)]
            if args and index is not None
            else (unionize(*args) if args else Any)
        )
    return Any
Determine the value of an array index.

    Args:
        var_type: The type of the array.
        index: The index of the array.

    Returns:
        The value of the array index.
    
reflex/vars/sequence.py