

def merge(self, ht):
    ' Merge in the results from another hash table '
    assert (self.maxtimebits == ht.maxtimebits)
    ncurrent = len(self.names)
    self.names += ht.names
    self.hashesperid = np.append(self.hashesperid, ht.hashesperid)
    idoffset = ((1 << self.maxtimebits) * ncurrent)
    for hash_ in np.nonzero(ht.counts)[0]:
        allvals = np.r_[(self.table[hash_, :self.counts[ncurrent]], (ht.table[hash_, :ht.counts[hash_]] + idoffset))]
        if (len(allvals) > self.depth):
            somevals = np.random.permutation(allvals)[:self.depth]
            self.table[(hash_,)] = somevals
            self.counts[hash_] += ht.counts[hash_]
        else:
            self.table[hash_, :len(allvals)] = allvals
            self.counts[hash_] = len(allvals)
    self.dirty = True

dataset/ETHPy150Open dpwe/audfprint/hash_table.py HashTable.merge/VarMisuse@108/148 `hash_`->`ncurrent`