def _make_text_vocab_float_file(): filepath = os.path.join(test.get_temp_dir(), "vocab_freq_float.txt") with open(filepath, "w") as f: writer = csv.writer(f) writer.writerows([ ["and", 0.4], ["life", 0.08], ["the", 0.3], ["to", 0.2], ["universe", 0.02], ]) return filepath
def tmp_dir(self): tmp = tempfile.mkdtemp(dir=test.get_temp_dir()) yield tmp gfile.rmtree(tmp)