mvpa2.misc.io.safe_write

mvpa2.misc.io.safe_write(fnout, s, mode='wb')

Helper to write to a file and check result file size to match