Returns whether the value has a mixture representation.

    Returns:
        If `val` has a `_has_mixture_` method and its result is not
        NotImplemented, that result is returned. Otherwise, if the value
        has a `_mixture_` method return True if that has a non-default value.
        Returns False if neither function exists.

def has_mixture(val: Any) -> bool:
    """Returns whether the value has a mixture representation.

    Returns:
        If `val` has a `_has_mixture_` method and its result is not
        NotImplemented, that result is returned. Otherwise, if the value
        has a `_mixture_` method return True if that has a non-default value.
        Returns False if neither function exists.
    """
    getter = getattr(val, '_has_mixture_', None)
    result = NotImplemented if getter is None else getter()
    if result is not NotImplemented:
        return result

    # No _has_mixture_ function, use _mixture_ instead
    return mixture(val, None) is not None