def examine_mode(mode):
    """
    Returns a numerical index corresponding to a mode

    :param str mode: the subset user wishes to examine
    :return: the numerical index
    """
    if mode == 'test':
        idx_set = 2
    elif mode == 'valid':
        idx_set = 1
    elif mode == 'train':
        idx_set = 0
    else:
        raise NotImplementedError

    return idx_set