def _write_data(self, directory=None, prefix=tempfile.template, codec='null', count=len(RECORDS), sync_interval=avro.datafile.SYNC_INTERVAL):
    old_sync_interval = avro.datafile.SYNC_INTERVAL
    try:
        avro.datafile.SYNC_INTERVAL = sync_interval
        with tempfile.NamedTemporaryFile(delete=False, dir=directory, prefix=prefix) as f:
            writer = DataFileWriter(f, DatumWriter(), self.SCHEMA, codec=codec)
            len_records = len(self.RECORDS)
            for i in range(count):
                writer.append(self.RECORDS[(i % len_records)])
            writer.close()
            self._temp_files.append(f.name)
            return f.name
    finally:
        avro.datafile.SYNC_INTERVAL = old_sync_interval
def _write_data(self, directory=None, prefix=tempfile.template, codec='null', count=len(RECORDS), sync_interval=avro.datafile.SYNC_INTERVAL):
    old_sync_interval = avro.datafile.SYNC_INTERVAL
    try:
        avro.datafile.SYNC_INTERVAL = sync_interval
        with tempfile.NamedTemporaryFile(delete=False, dir=directory, prefix=prefix) as f:
            writer = DataFileWriter(f, DatumWriter(), self.SCHEMA, codec=codec)
            len_records = len(self.RECORDS)
            for i in range(count):
                writer.append(self.RECORDS[(i % len_records)])
            writer.close()
            self._temp_files.append(f.name)
            return f.name
    finally:
        avro.datafile.SYNC_INTERVAL = old_sync_interval