def calculate_distances(trainlabels, traindata):
    distances = []
    for i in range(len(trainlabels)):
        first_train_example_class1 = traindata[i]
        aux = []
        for j in range (len(trainlabels)):
             if i != j:
                 first_train_example_class2 = traindata[j]
                 d = cosineDistance(first_train_example_class1, first_train_example_class2)
                 aux.append(d)
        distances.append(aux) 
    return distances


###########################################
template_impl : TEMPLATE NAME template_params COLON template_doc_suite
dataset/ETHPy150Open bt3gl/Advanced-Machine-Learning/k-NN/kNN.py/calculate_distances--crossover with--dataset/ETHPy150Open nucleic/enaml/enaml/core/parser.py/p_template_impl3