def attendance_numbers(brother, events, accepted_excuses):
    """ Returns the a of the row of the attendance csv containing information about the brother and his
    attendance at events

    :param Brother brother:
        the brother whose information you need the count for

    :param list[Event] events:
        the list of events whose attendance the brother attendance count we need

    :param list[Excuse] accepted_excuses:
        a list of excuses that have been accepted for the brother

    :returns:
        the attendance info/numbers and the list used to populate the brother's row with x, e, u, - to fill their
        attendance at each event
    :rtype: int, int, int, int, list[str]

    """
    events_eligible = 0
    events_attended = 0
    events_excused = 0
    events_unexcused = 0
    event_attendance = []
    # count the number of eligible events, events attended, events excused, and events unexcused for
    # this brother and append to their attendance list the appropriate marking
    for event in events:
        if event.eligible_attendees.filter(id=brother.id).exists():
            events_eligible += 1
            if event.attendees_brothers.filter(id=brother.id).exists():
                event_attendance.append('x')
                events_attended += 1
            elif accepted_excuses.filter(brother=brother, event=event).exists():
                event_attendance.append('e')
                events_excused += 1
            else:
                event_attendance.append('u')
                events_unexcused += 1
        else:
            event_attendance.append('-')
    return events_eligible, events_attended, events_excused, events_unexcused, event_attendance