def heat_index_warning_category(hi):
    """Get the category of warning associated with a given heat index (HI).

    Categories are used by the US National Weather Service (NWS) and National
    Oceanic and Atmospheric Administration (NOAA) to issue the following warnings:

    * 0 = No Warning. Satisfactory temperature. Can continue with activity.
    * 1 = Caution: Fatigue is possible with prolonged exposure and activity.
      Continuing activity could result in heat cramps.
    * 2 = Extreme caution: Heat cramps and heat exhaustion are possible.
      Continuing activity could result in heat stroke.
    * 3 = Danger: Heat cramps and heat exhaustion are likely.
      Heat stroke is probable with continued activity.
    * 4 = Extreme danger: Heat stroke is imminent.

    Args:
        hi: Heat index [C]

    Returns:
        category -- An integer indicating the level of warning associated with the
        heat index. Values are one of the following:

        -   0 = No Warning
        -   1 = Caution
        -   2 = Extreme Caution
        -   3 = Danger
        -   4 = Extreme Danger
    """
    if hi < 26.6:
        category = 0
    elif hi < 32.2:
        category = 1
    elif hi < 40.5:
        category = 2
    elif hi < 54.4:
        category = 3
    else:
        category = 4
    return category
