def figure_out_type(value: Any) -> types.GenericType:
    """Figure out the type of the value.

    Args:
        value: The value to figure out the type of.

    Returns:
        The type of the value.
    """
    if isinstance(value, Var):
        return value._var_type
    type_ = type(value)
    if has_args(type_):
        return type_
    if isinstance(value, list):
        if not value:
            return Sequence[NoReturn]
        return Sequence[unionize(*(figure_out_type(v) for v in value))]
    if isinstance(value, set):
        return set[unionize(*(figure_out_type(v) for v in value))]
    if isinstance(value, tuple):
        if not value:
            return tuple[NoReturn, ...]
        if len(value) <= 5:
            return tuple[tuple(figure_out_type(v) for v in value)]
        return tuple[unionize(*(figure_out_type(v) for v in value)), ...]
    if isinstance(value, Mapping):
        if not value:
            return Mapping[NoReturn, NoReturn]
        return Mapping[
            unionize(*(figure_out_type(k) for k in value)),
            unionize(*(figure_out_type(v) for v in value.values())),
        ]
    return type(value)
Figure out the type of the value.

    Args:
        value: The value to figure out the type of.

    Returns:
        The type of the value.
    
reflex/vars/base.py