#NEWLINE# def _generate_masks( self ) : #NEWLINE# #INDENT# 'Creates left and right masks for all hash lengths.' #NEWLINE# tri_size = ( MAX_HASH_SIZE + 1 ) #NEWLINE# left_mask = np . tril ( np . ones ( ( tri_size , tri_size ) , dtype = int ) ) [ : , 1 : ] #NEWLINE# right_mask = left_mask [ : : ( - 1 ) , : : ( - 1 ) ] #NEWLINE# self . _left_mask = np . packbits ( left_mask ) . view ( dtype = HASH_DTYPE ) #NEWLINE# self . _right_mask = np . packbits ( right_mask ) . view ( dtype = HASH_DTYPE )