def assert_both_values(actual, expected_plain, expected_color, kind=None):
    """Handle asserts for color and non-color strings in color and non-color tests.

    :param ColorStr actual: Return value of ColorStr class method.
    :param expected_plain: Expected non-color value.
    :param expected_color: Expected color value.
    :param str kind: Type of string to test.
    """
    if kind.endswith('plain'):
        assert actual.value_colors == expected_plain
        assert actual.value_no_colors == expected_plain
        assert actual.has_colors is False
    elif kind.endswith('color'):
        assert actual.value_colors == expected_color
        assert actual.value_no_colors == expected_plain
        if actual.value_colors in '\033':
            assert actual.has_colors is True
        else:
            assert actual.has_colors is False
    else:
        assert actual == expected_plain

    if kind.startswith('ColorStr'):
        assert actual.__class__ == ColorStr
    elif kind.startswith('Color'):
        assert actual.__class__ == Color
dataset/ETHPy150Open Robpol86/colorclass/tests/conftest.py/assert_both_values/swapped operands of `in`