def _write(fid, data, kind, data_size, FIFFT_TYPE, dtype):
 if isinstance(data, np.ndarray):
  data_size *= data.size
 fid.write(np.array(kind, dtype='>i4').tostring())
 fid.write(np.array(FIFFT_TYPE, dtype='>i4').tostring())
 fid.write(np.array(data_size, dtype='>i4').tostring())
 fid.write(np.array(FIFF.FIFFV_NEXT_SEQ, dtype='>i4').tostring())
 fid.write(np.array(data, dtype=dtype).tostring())

def _write ( fid , data , kind , data_size , FIFFT_TYPE , dtype ) : if isinstance ( data , np . ndarray ) : data_size *= data . size fid . write ( np . array ( kind , dtype = '>i4' ) . tostring ( ) ) fid . write ( np . array ( FIFFT_TYPE , dtype = '>i4' ) . tostring ( ) ) fid . write ( np . array ( data_size , dtype = '>i4' ) . tostring ( ) ) fid . write ( np . array ( FIFF . FIFFV_NEXT_SEQ , dtype = '>i4' ) . tostring ( ) ) fid . write ( np . array ( data , dtype = dtype ) . tostring ( ) )
helper function to standardize output to files .