def one_hot(label, all_labels):
    """One hot encodes a label given all labels"""
    one_hot_arr = [0 for _ in range(len(all_labels))]
    for i, label_i in enumerate(all_labels):
        if label == label_i:
            one_hot_arr[i] = 1
    return one_hot_arr