def generate_similarity_network(W, dataset_observations, scale, margin = 0, print_numbers = False):
    norm_W = W / numpy.max(W)

    (image, draw, boundaries) = create_canvas(dataset_observations, scale, margin)

    for i in range(len(dataset_observations)-1):
        i_position = ((dataset_observations[i][0] - boundaries[0][0])*scale+margin,(dataset_observations[i][1] - boundaries[0][1])*scale+margin)
        for j in range(i+1, len(dataset_observations)):
            if norm_W[i][j] > 0.0:
                j_position = ((dataset_observations[j][0] - boundaries[0][0])*scale+margin,(dataset_observations[j][1] - boundaries[0][1])*scale+margin)
                #print generate_faded_red(norm_W[i][j])
                draw.line([i_position, j_position], width = 2, fill = generate_faded_red(norm_W[i][j]))

    for i in range(len(dataset_observations)):
        position = ((dataset_observations[i][0] - boundaries[0][0])*scale+margin,(dataset_observations[i][1] - boundaries[0][1])*scale+margin)
        draw.point(position, fill="#FFFFFF")
        if print_numbers:
            draw.text(position, str(i), fill="#FFFFFF")

    return image
dataset/ETHPy150Open victor-gil-sepulveda/pyProCT/validation/bidimensional/validationTools.py/generate_similarity_network/original