from flask import request, Response
from db.repository import Repository
from processing.similarityFiles.miscFunctions import convertSimilarityDictToJSON
#from db.entities import clusterset #REMOVE?

repo = Repository()

def get_similarity(): 
    ''' Gets cluster_similarity from the database.

        :returns: Returns similarity objects from the DB
        :rtype: Dict
    '''  
    result = repo.get_similarity()
    if result is None or len(result) == 0:        
        print("MongoDb Get Error: Response 404")
        return Response(status=404)
    else:
        return result
