MCPcopy Create free account
hub / github.com/dask/dask / filetext

Function filetext

dask/utils.py:412–423  ·  view source on GitHub ↗
(text, extension="", open=open, mode="w")

Source from the content-addressed store, hash-verified

410
411@contextmanager
412def filetext(text, extension="", open=open, mode="w"):
413 with tmpfile(extension=extension) as filename:
414 f = open(filename, mode=mode)
415 try:
416 f.write(text)
417 finally:
418 try:
419 f.close()
420 except AttributeError:
421 pass
422
423 yield filename
424
425
426@contextmanager

Callers 15

test_read_csvFunction · 0.90
test_read_csv_indexFunction · 0.90
test_usecolsFunction · 0.90
test_string_blocksizeFunction · 0.90
test_skipinitialspaceFunction · 0.90
test_consistent_dtypesFunction · 0.90
test_empty_csv_fileFunction · 0.90

Calls 2

tmpfileFunction · 0.85
closeMethod · 0.80

Tested by 15

test_read_csvFunction · 0.72
test_read_csv_indexFunction · 0.72
test_usecolsFunction · 0.72
test_string_blocksizeFunction · 0.72
test_skipinitialspaceFunction · 0.72
test_consistent_dtypesFunction · 0.72
test_empty_csv_fileFunction · 0.72