import math


def bounding_hues_from_renotation(hue, code):
    """
    Returns for a given hue the two bounding hues from
    *Munsell Renotation System* data.

    Parameters
    ----------
    hue : numeric
        *Munsell* *Colorlab* specification hue.
    code : numeric
        *Munsell* *Colorlab* specification code.

    Returns
    -------
    tuple
        Bounding hues.

    References
    ----------
    .. [11]  **The Munsell and Kubelka-Munk Toolbox**:
            *MunsellAndKubelkaMunkToolboxApr2014*:
            *MunsellSystemRoutines/BoundingRenotationHues.m*

    Examples
    --------
    >>> bounding_hues_from_renotation(3.2, 4)
    ((2.5, 4), (5.0, 4))
    """

    if hue % 2.5 == 0:
        if hue == 0:
            hue_cw = 10
            code_cw = (code + 1) % 10
        else:
            hue_cw = hue
            code_cw = code
        hue_ccw = hue_cw
        code_ccw = code_cw
    else:
        hue_cw = 2.5 * math.floor(hue / 2.5)
        hue_ccw = (hue_cw + 2.5) % 10
        if hue_ccw == 0:
            hue_ccw = 10
        code_ccw = code

        if hue_cw == 0:
            hue_cw = 10
            code_cw = (code + 1) % 10
            if code_cw == 0:
                code_cw = 10
        else:
            code_cw = code
        code_ccw = code

    return (hue_cw, code_cw), (hue_ccw, code_ccw)