<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def session_array(slots):
 """ Return a numpy array mapping sessions to slots - Rows corresponds to sessions - Columns correspond to slots """

    # Flatten the list: this assumes that the sessions do not share slots
    sessions = sorted(set([slot.session for slot in slots]))
    array = np.zeros((len(sessions), len(slots)))
    for col, slot in enumerate(slots):
        array[sessions.index(slot.session), col] = 1
    return array