def convert_valuesview_to_tuple(values: ValuesView) -> list[tuple]:
    """Convert ``ValuesView`` to list of tuples for parameter combinations.

    This function takes a ``ValuesView`` object and converts it to a list of tuples
    that can be used for creating parameter combinations. It is particularly useful
    when working with ``itertools.product`` to generate all possible parameter
    combinations.

    The function handles both iterable and non-iterable values:
    - Iterable values (except strings) are converted to tuples
    - Non-iterable values and strings are wrapped in single-element tuples

    Args:
        values: A ``ValuesView`` object containing parameter values to convert

    Returns:
        list[tuple]: A list of tuples where each tuple contains parameter values.
            Single values are wrapped in 1-element tuples.

    Examples:
        Create parameter combinations from a config:

        >>> params = DictConfig({
        ...     "dataset.category": [
        ...         "bottle",
        ...         "cable",
        ...     ],
        ...     "dataset.image_size": 224,
        ...     "model_name": ["padim"],
        ... })
        >>> convert_valuesview_to_tuple(params.values())
        [('bottle', 'cable'), (224,), ('padim',)]

        Use with ``itertools.product`` to get all combinations:

        >>> list(itertools.product(*convert_valuesview_to_tuple(params.values())))
        [('bottle', 224, 'padim'), ('cable', 224, 'padim')]

    Note:
        Strings are treated as non-iterable values even though they are technically
        iterable in Python. This prevents unwanted character-by-character splitting.
    """
    return_list = []
    for value in values:
        if isinstance(value, Iterable) and not isinstance(value, str):
            return_list.append(tuple(value))
        else:
            return_list.append((value,))
    return return_list
Convert ``ValuesView`` to list of tuples for parameter combinations.

    This function takes a ``ValuesView`` object and converts it to a list of tuples
    that can be used for creating parameter combinations. It is particularly useful
    when working with ``itertools.product`` to generate all possible parameter
    combinations.

    The function handles both iterable and non-iterable values:
    - Iterable values (except strings) are converted to tuples
    - Non-iterable values and strings are wrapped in single-element tuples

    Args:
        values: A ``ValuesView`` object containing parameter values to convert

    Returns:
        list[tuple]: A list of tuples where each tuple contains parameter values.
            Single values are wrapped in 1-element tuples.

    Examples:
        Create parameter combinations from a config:

        >>> params = DictConfig({
        ...     "dataset.category": [
        ...         "bottle",
        ...         "cable",
        ...     ],
        ...     "dataset.image_size": 224,
        ...     "model_name": ["padim"],
        ... })
        >>> convert_valuesview_to_tuple(params.values())
        [('bottle', 'cable'), (224,), ('padim',)]

        Use with ``itertools.product`` to get all combinations:

        >>> list(itertools.product(*convert_valuesview_to_tuple(params.values())))
        [('bottle', 224, 'padim'), ('cable', 224, 'padim')]

    Note:
        Strings are treated as non-iterable values even though they are technically
        iterable in Python. This prevents unwanted character-by-character splitting.
    
src/anomalib/utils/config.py