MCPcopy Create free account
hub / github.com/apple/ml-facelit / folder_write_bytes

Function folder_write_bytes

facelit/dataset_tool.py:310–315  ·  view source on GitHub ↗
(fname: str, data: Union[bytes, str])

Source from the content-addressed store, hash-verified

308 os.makedirs(dest, exist_ok=True)
309
310 def folder_write_bytes(fname: str, data: Union[bytes, str]):
311 os.makedirs(os.path.dirname(fname), exist_ok=True)
312 with open(fname, 'wb') as fout:
313 if isinstance(data, str):
314 data = data.encode('utf8')
315 fout.write(data)
316 return dest, folder_write_bytes, lambda: None
317
318#----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected