def run(self):
        # print 'creating %s (%d)' % (self.filename, self.estimated_records or 0)
        cache = self.cache(mode='w', estimated_records=self.estimated_records)
        if self.marshaled_data:
            cache_put = cache.put_marshaled
        else:
            cache_put = cache.put
        while True:
            data = self.queue.get()
            if data is None:
                self.queue.task_done()
                break
            if self.merge:
                for d in data:
                    if cache in d[0]:
                        elem = cache.get(d[0])
                        elem.merge(*d[1:])
                        d = elem.to_tuple()
                    cache_put(*d)
            else:
                for d in data:
                    cache_put(*d)
            if self.log:
                self.log(len(data))
            self.queue.task_done()
        cache.close()
dataset/ETHPy150Open omniscale/imposm/imposm/reader.py/CacheWriterProcess.run/swapped operands of `in`