

def store(self, name, timehashpairs):
    ' Store a list of hashes in the hash table\n            associated with a particular name (or integer ID) and time.\n        '
    id_ = self.name_to_id(name, add_if_missing=True)
    hashmask = ((1 << self.hashbits) - 1)
    maxtime = (1 << self.maxtimebits)
    timemask = (maxtime - 1)
    sortedpairs = timehashpairs
    idval = (id_ << self.maxtimebits)
    for (time_, hash_) in sortedpairs:
        count = self.counts[hash_]
        time_ &= timemask
        hash_ &= hashmask
        val = (idval + time_)
        if (count < self.depth):
            self.table[(hash_, count)] = val
        else:
            slot = random.randint(0, count)
            if (slot < self.depth):
                self.table[(hash_, slot)] = val
        self.counts[hash_] = (count + 1)
    self.hashesperid[id_] += len(timehashpairs)
    self.dirty = True

dataset/ETHPy150Open dpwe/audfprint/hash_table.py HashTable.store/original