# Path: lsh/lsh/lsh_base.py
# class LshBase(object):
# 
#     def run(self, docuemnt):
#         raise NotImplementedError("Subclasses should implement run()")
# 
# Path: lsh/utils/similarity.py
# def jaccard_similarity(set1, set2):
#     return __calculate_jaccard_similairty(set1, set2)
# 
# Path: lsh/utils/similarity.py
# def compute_positive_hash(value):
#     return hash(value) % ((sys.maxsize + 1) * 2)
# 
# Path: lsh/models/documents/jaccard_document.py
# class JaccardDocument(DocumentBase):
#     """
#         This class represents documents used in LSH families for Jaccard Distance
#         based implementations and their corresponding components in this platform.
#     """
# 
#     def __init__(self, original_doc, shingles_list=None, minhash_signatures=None):
#         self.__shingles = shingles_list
#         self.__signatures = minhash_signatures
# 
#         super(JaccardDocument, self).__init__(original_doc)
# 
#     def get_signatures_list(self):
#         return self.__signatures
# 
#     def get_shingles_list(self):
#         return self.__shingles
# 
#     def set_signatures_list(self, value):
#         self.__signatures = value
# 
#     def set_shingles_lists(self, value):
#         self.__shingles = value
# 
#     def get_shingles_as_set(self):
#         return set(self.__shingles)


from lsh.lsh.lsh_base import LshBase
from lsh.utils.similarity import jaccard_similarity
from lsh.utils.similarity import compute_positive_hash
from lsh.models.documents.jaccard_document import JaccardDocument
import copy
        """
        if self.bands and idx < len(self.bands):
            return self.bands[idx]

        return None

    def _get_vector(self, signatures, n, start):
        """
            Slices signatures into lists of n rows.
            :param signatures: list of minhash signatures
            :param n: number of rows to include in slice
            :return: list (vector)
        """
        for i in xrange(start, len(signatures), n):
            #yes, technically this is a list slice not a vector
            return signatures[i:i+n]

    def _calculate_similarity_score(self, document_1, document_2):
        """
            Calculate similarity score for givens documents.
            :param document_1:
            :param document_2:
            :return: 0.0 if score can't be calculated otherwise returns calculated value
        """
        score = 0.0

        if document_1 and document_2:
            shingles_set_1 = document_1.get_shingles_as_set()
            shingles_set_2 = document_2.get_shingles_as_set()


# Path: lsh/lsh/lsh_base.py
# class LshBase(object):
# 
#     def run(self, docuemnt):
#         raise NotImplementedError("Subclasses should implement run()")
# 
# Path: lsh/utils/similarity.py
# def jaccard_similarity(set1, set2):
#     return __calculate_jaccard_similairty(set1, set2)
# 
# Path: lsh/utils/similarity.py
# def compute_positive_hash(value):
#     return hash(value) % ((sys.maxsize + 1) * 2)
# 
# Path: lsh/models/documents/jaccard_document.py
# class JaccardDocument(DocumentBase):
#     """
#         This class represents documents used in LSH families for Jaccard Distance
#         based implementations and their corresponding components in this platform.
#     """
# 
#     def __init__(self, original_doc, shingles_list=None, minhash_signatures=None):
#         self.__shingles = shingles_list
#         self.__signatures = minhash_signatures
# 
#         super(JaccardDocument, self).__init__(original_doc)
# 
#     def get_signatures_list(self):
#         return self.__signatures
# 
#     def get_shingles_list(self):
#         return self.__shingles
# 
#     def set_signatures_list(self, value):
#         self.__signatures = value
# 
#     def set_shingles_lists(self, value):
#         self.__shingles = value
# 
#     def get_shingles_as_set(self):
#         return set(self.__shingles)


# Path: lsh/lsh/lsh_jaccard.py
from lsh.lsh.lsh_base import LshBase
from lsh.utils.similarity import jaccard_similarity
from lsh.utils.similarity import compute_positive_hash
from lsh.models.documents.jaccard_document import JaccardDocument
import copy

        """
        if self.bands and idx < len(self.bands):
            return self.bands[idx]

        return None

    def _get_vector(self, signatures, n, start):
        """
            Slices signatures into lists of n rows.
            :param signatures: list of minhash signatures
            :param n: number of rows to include in slice
            :return: list (vector)
        """
        for i in xrange(start, len(signatures), n):
            #yes, technically this is a list slice not a vector
            return signatures[i:i+n]

    def _calculate_similarity_score(self, document_1, document_2):
        """
            Calculate similarity score for givens documents.
            :param document_1:
            :param document_2:
            :return: 0.0 if score can't be calculated otherwise returns calculated value
        """
        score = 0.0

        if document_1 and document_2:
            shingles_set_1 = document_1.get_shingles_as_set()
            shingles_set_2 = document_2.get_shingles_as_set()


            score = jaccard_similarity(shingles_set_1, shingles_set_2)