def _listify(
    x: T | list[T] | None,
    default: Callable[[], list[T]],
) -> list[T]:
    """
    Convert the input into a list.

    Parameters
    ----------
    x
        The input value to be converted into a list. It can be a single value of type T, a list of
        values of type T, or None.
    default
        A callable that returns a default list when the input value is None.

    Returns
    -------

    list[T]: The converted list.

    Raises:
        None

    Examples:
        _listify(5, lambda: [1, 2, 3])  # Output: [5]
        _listify([1, 2, 3], lambda: [4, 5, 6])  # Output: [1, 2, 3]
        _listify(None, lambda: ['a', 'b', 'c'])  # Output: ['a', 'b', 'c']
    """
    if x is None:
        return default()
    elif not isinstance(x, list):
        return [x]
    else:
        return cast(Any, x)

    Convert the input into a list.

    Parameters
    ----------
    x
        The input value to be converted into a list. It can be a single value of type T, a list of
        values of type T, or None.
    default
        A callable that returns a default list when the input value is None.

    Returns
    -------

    list[T]: The converted list.

    Raises:
        None

    Examples:
        _listify(5, lambda: [1, 2, 3])  # Output: [5]
        _listify([1, 2, 3], lambda: [4, 5, 6])  # Output: [1, 2, 3]
        _listify(None, lambda: ['a', 'b', 'c'])  # Output: ['a', 'b', 'c']
    
great_tables/_formats.py