def to_categorical(y, nb_classes):
    y = np.asarray(y, dtype='int32')
    if not nb_classes:
        nb_classes = np.max(y)+1
    Y = np.zeros((len(y), nb_classes))
    for i in range(len(y)):
        Y[i, y[i]] = 1.
    return Y


# -----------------------
# SEQUENCES PREPROCESSING
# -----------------------
A test that errors coming from the POST API do not
dataset/ETHPy150Open tflearn/tflearn/tflearn/data_utils.py/to_categorical--crossover with--dataset/ETHPy150Open rcbops/glance-buildpackage/glance/tests/functional/test_ssl.py/TestSSL.test_traceback_not_consumed