#NEWLINE# @ contextmanager #NEWLINE# def file( df ) : #NEWLINE# #INDENT# with tmpfile ( '.hdf5' ) as fn : #NEWLINE# #INDENT# f = pd . HDFStore ( df ) #NEWLINE# f . put ( '/data' , df , format = 'table' , append = True ) #NEWLINE# try : #NEWLINE# #INDENT# ( yield ( fn , f , f . get_storer ( '/data' ) ) ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# f . close ( )