def unload(self, sql, mode="w"):
        headers, results = self.db.raw(sql)
        w = open(self.filename, mode)
        if self.includeheaders:
            w.write("%s\n" % (self.delimiter.join(map(lambda x: x[0], headers))))
        if results:
            for a in results:
                w.write("%s\n" % (self.delimiter.join(map(self.format, a))))
        w.flush()
        w.close()
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/dbexts.py/Unload.unload/original