Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def reset(self):
helpers.reset_stream(self.__bytes)
self.__extended_rows = self.__iter_extended_rows()
def write(self, source, target, headers, encoding=None):
helpers.ensure_dir(target)
with io.open(target, 'wb') as file:
writer = unicodecsv.writer(file, encoding=encoding, **self.__options)
if headers:
writer.writerow(headers)
for row in source:
writer.writerow(row)