def write(fnout, dset, form='binary'): fn = os.path.split(fnout)[1] if not type(fn) is str: if not isinstance(fnout, basestring): raise ValueError("Filename %s should be string" % str) fn = str(fn) # ensure that unicode is converted to string dset['filename'] = fn niml.write(fnout, dset, form, dset2rawniml)
def write(fnout, niml_annot): fn = os.path.split(fnout)[1] if not type(fn) is str: if not isinstance(fnout, basestring): raise ValueError("Filename %s should be string" % str) fn = str(fn) # ensure that unicode is converted to string niml_annot['filename'] = fn form = 'text' niml.write(fnout, niml_annot, form, annot2rawniml)