(self, id_list_intersect, id_list_host, replacement=True)
Randomly sample self.block_num - 1 blocks with the same size as id_list_intersect from id_list_host
        :param id_list_intersect: Table in the form (intersect_ENC_id, -1)
        :param id_list_host: Table in the form (ENC_id, -1)
        :param replacement: bool
        :return: id_list_array: List[Table] with disjoint (ENC_id, -1) Tables
Randomly sample self.block_num - 1 blocks with the same size as id_list_intersect from id_list_host
        :param id_list_intersect: Table in the form (intersect_ENC_id, -1)
        :param id_list_host: Table in the form (ENC_id, -1)
        :param replacement: bool
        :return: id_list_array: List[Table] with disjoint (ENC_id, -1) Tables
Randomly sample self . block_num - 1 blocks with the same size as id_list_intersect from id_list_host : param id_list_intersect : Table in the form ( intersect_ENC_id - 1 ) : param id_list_host : Table in the form ( ENC_id - 1 ) : param replacement : bool : return : id_list_array : List [ Table ] with disjoint ( ENC_id - 1 ) Tables
def _fake_blocks(self, id_list_intersect, id_list_host, replacement=True):
        """
        Randomly sample self.block_num - 1 blocks with the same size as id_list_intersect from id_list_host
        :param id_list_intersect: Table in the form (intersect_ENC_id, -1)
        :param id_list_host: Table in the form (ENC_id, -1)
        :param replacement: bool
        :return: id_list_array: List[Table] with disjoint (ENC_id, -1) Tables
        """
        intersect_count = id_list_intersect.count()
        self.target_block_index = random.randint(0, self.block_num - 1)
        for i in range(self.block_num):
            if i == self.target_block_index:
                id_block = id_list_intersect.join(id_list_host, lambda x, y: y)
            else:
                id_block = self.take_exact_sample(data_inst=id_list_host, exact_num=intersect_count)
                if not replacement:
                    id_list_host = id_list_host.subtractByKey(id_block)
            # id_block = self._decrypt_id_list(id_block)
            id_block = id_block.map(lambda k, v: (v, -1))
            self._sync_natural_indexation(id_block, time=i)
def _fake_blocks ( self , id_list_intersect , id_list_host , replacement = True ) : intersect_count = id_list_intersect . count ( ) self . target_block_index = random . randint ( 0 , self . block_num - 1 ) for i in range ( self . block_num ) : if i == self . target_block_index : id_block = id_list_intersect . join ( id_list_host , lambda x , y : y ) else : id_block = self . take_exact_sample ( data_inst = id_list_host , exact_num = intersect_count ) if not replacement : id_list_host = id_list_host . subtractByKey ( id_block ) # id_block = self._decrypt_id_list(id_block) id_block = id_block . map ( lambda k , v : ( v , - 1 ) ) self . _sync_natural_indexation ( id_block , time = i )