<commit_before>from django.shortcuts import render
import json

def cforange_filter_integers(request,input_dict,output_dict,widget):
    return render(request, 'interactions/cforange_filter_integers.html',{'widget':widget,'intList':input_dict['intList']})

def cforange_hierarchical_clustering(request,input_dict,output_dict,widget):
    import Orange, orange, sys
    from library import Clustering

    sys.setrecursionlimit(10000)

    ##try:
    #iris = Orange.data.Table("vehicle")
    ##iris = Orange.data.Table("iris") 
    #print len(iris)
    #m = Orange.misc.SymMatrix(len(iris))
    #m = Orange.distance.distance_matrix(iris, Orange.distance.Euclidean)
    #matrix = m
    ######################
    matrix = input_dict['dm']
    #print matrix
    linkage = int(input_dict['linkage'])
    root = Clustering.hierarchical_clustering(linkage, matrix)
    dm_examples = True
    ######################

    
    try:
        attributes = [x.name for x in matrix.items.domain]
    except:
        attributes = ['attribute']
        dm_examples = False<commit_msg>added meta attributes to Hierarchical clustering widget<commit_after>from django.shortcuts import render
import json

def cforange_filter_integers(request,input_dict,output_dict,widget):
    return render(request, 'interactions/cforange_filter_integers.html',{'widget':widget,'intList':input_dict['intList']})

def cforange_hierarchical_clustering(request,input_dict,output_dict,widget):
    import Orange, orange, sys
    from library import Clustering

    sys.setrecursionlimit(10000)

    ##try:
    #iris = Orange.data.Table("vehicle")
    ##iris = Orange.data.Table("iris") 
    #print len(iris)
    #m = Orange.misc.SymMatrix(len(iris))
    #m = Orange.distance.distance_matrix(iris, Orange.distance.Euclidean)
    #matrix = m
    ######################
    matrix = input_dict['dm']
    #print matrix
    linkage = int(input_dict['linkage'])
    root = Clustering.hierarchical_clustering(linkage, matrix)
    dm_examples = True
    ######################

    
    try:
        #attributes = [x.name for x in matrix.items.domain]
        attributes = [x.name for x in matrix.items.domain] + [m.name for m in matrix.items.domain.getmetas().values()]
    except:
        attributes = ['attribute']
        dm_examples = False
{'fraction_non_alphanumeric': 0.1482608695652174, 'fraction_numerical': 0.004347826086956522, 'mean_word_length': 4.1591928251121075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4215334', 'n_tokens_mistral': 753, 'n_tokens_neox': 701, 'n_words': 134}