def encode_classifications(class_list):

    # Iterates through the list, recording all the samples.
    classes = []
    for i in class_list:
        if i not in classes:
            classes.append(i)

    # Creates a list of 0s for each sample.
    encoded = [[0] * len(classes) for i in range(len(class_list))]

    # Iterates through the list to be encoded, marking a 1 in the position for the given label for that sample.
    for e, i in enumerate(class_list):
        encoded[e][classes.index(i)] = 1

    return classes, np.array(encoded)
Set payload data for every issue
dataset/ETHPy150Open calvinschmdt/EasyTensorflow/easy_tensorflow/tf_functions.py/encode_classifications--crossover with--dataset/ETHPy150Open dorneanu/appvulnms/src/modules/converter/xml/burpsuite-scanner.py/Module.set_payload