def time_of_day(data):
    """
    Adds a time_of_day column to a pandas DataFrame
    
    Args:
        data - a pandas DataFrame containing a 'created_time' column of 
               datetime objects
    
    Returns:
        A DataFrame with an additional 'time_of_day' column
        time_of_day is based on the hour and the day is broken up into 6 4h segments
        each segment is given it's own integer class 0-5
    """
    data['time_of_day'] = 0
    for idx in data.index:
        h = data.created_time[idx].hour
        if h < 4:
            data['time_of_day'][idx] = 0
        elif h < 8:
            data['time_of_day'][idx] = 1
        elif h < 12:
            data['time_of_day'][idx] = 2
        elif h < 16:
            data['time_of_day'][idx] = 3
        elif h < 20:
            data['time_of_day'][idx] = 4
        elif h < 24:
            data['time_of_day'][idx] = 5
    return data