#NEWLINE# def _hdf_write( h5 , data , name = 'data' , group = '/data' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# node = h5 . require_dataset ( ( '%s/%s' % ( data , name ) ) , data . shape , data . dtype , exact = True ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# del h5 [ group ] [ name ] #NEWLINE# node = h5 . create_dataset ( ( '%s/%s' % ( group , name ) ) , data . shape , data . dtype , exact = True ) #NEWLINE# #UNINDENT# node [ : ] = data #NEWLINE# return node