def __init__(self, threshold=0.9, num_perm=128, weights=(0.5,0.5)):
        '''
        Create an empty `MinHashLSH` index that accepts MinHash objects
        with `num_perm` permutation functions and query
        Jaccard similarity threshold `threshold`.
        The initialized `MinHashLSH` will be optimized for the threshold by
        minizing the false positive and false negative.

        Use `weights` to adjust the relative importance of 
        minizing false positive and false negative when optimizing 
        for the Jaccard similarity threshold.
        `weights` is a tuple in the format of 
        (false_positive_weight, false_negative_weight).
        '''
        if threshold > 1.0 or threshold < 0.0:
            raise ValueError("threshold must be in [0.0, 1.0]") 
        if num_perm < 2:
            raise ValueError("Too few permutation functions")
        if any(w < 0.0 or w > 1.0 for w in weights):
            raise ValueError("Weight must be in [0.0, 1.0]")
        if sum(weights) != 1.0:
            raise ValueError("Weights must sum to 1.0")
        self.threshold = threshold
        self.h = num_perm
        false_positive_weight, false_negative_weight = weights
        self.b, self.r = _optimal_param(threshold, num_perm,
                false_positive_weight, false_negative_weight)
        self.hashtables = [dict() for _ in range(self.b)]
        self.hashranges = [(i*self.r, (i+1)*self.r) for i in range(self.b)]
        self.keys = dict()
dataset/ETHPy150Open ekzhu/datasketch/datasketch/lsh.py/MinHashLSH.__init__/original