import warnings


def viscosity_H2O(temp):
    """
    Calculates the viscosity (Pa*s) of water at temperature T in Kelvin.

    Warning
    -------
    Function is a fit to data of the viscosity of water at different
    temperatures [0, 100].

    Do not use it outside this range!

    References
    ----------
    CRC Handbook of Chemistry and Physics
        88th Edition
        CRC Press; 88 edition (October 1, 2007)
    """
    a = 3.4175e-4
    b = -0.01276
    c = 3.5857e-5

    if not(273.15 <= temp <= 373.15):
        warnings.warn('This function is only valid within a temperature'
                      'range between [273.15, 373.15] Kelvin!\n'
                      'T = {0:1.3f}'.format(temp))

    return a / (1 + b * temp + c * temp**2)