MCPcopy Create free account
hub / github.com/SwayStar123/SpeedrunDiT / folder_write_bytes

Function folder_write_bytes

preprocessing/dataset_tools.py:170–175  ·  view source on GitHub ↗
(fname: str, data: Union[bytes, str])

Source from the content-addressed store, hash-verified

168 os.makedirs(dest, exist_ok=True)
169
170 def folder_write_bytes(fname: str, data: Union[bytes, str]):
171 os.makedirs(os.path.dirname(fname), exist_ok=True)
172 with open(fname, 'wb') as fout:
173 if isinstance(data, str):
174 data = data.encode('utf8')
175 fout.write(data)
176 return dest, folder_write_bytes, lambda: None
177
178#----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 2

writeMethod · 0.80
encodeMethod · 0.45

Tested by

no test coverage detected