def _write_data(self, directory=None, prefix=tempfile.template, codec='null', count=len(RECORDS), **kwargs):
    all_records = ((self.RECORDS * (count // len(self.RECORDS))) + self.RECORDS[:(count % len(self.RECORDS))])
    with tempfile.NamedTemporaryFile(delete=False, dir=directory, prefix=prefix, mode='w+b') as f:
        writer(f, self.SCHEMA, all_records, codec=codec, **kwargs)
        self._temp_files.append(f.name)
    return f.name
def _write_data(self, directory=None, prefix=tempfile.template, codec='null', count=len(RECORDS), **kwargs):
    all_records = ((self.RECORDS * (count // len(self.RECORDS))) + self.RECORDS[:(count % len(self.RECORDS))])
    with tempfile.NamedTemporaryFile(delete=False, dir=directory, prefix=prefix, mode='w+b') as f:
        writer(f, self.SCHEMA, all_records, codec=codec, **kwargs)
        self._temp_files.append(f.name)
    return f.name