def check_simple_roundtrip(dic, data, n_percents=0, lowmem=False):
    try:
        # create one or more temporary file name(s)
        base_fname = tempfile.mktemp(prefix='nmrgluetest', dir='.')
        tmpfname = base_fname + '_%03d' * n_percents

        # write data to it, read back and check that same
        if lowmem:
            ng.pipe.write_lowmem(tmpfname, dic, data)
            rdic, rdata = ng.pipe.read_lowmem(tmpfname)
            s = tuple([0] * data.ndim)
            assert data[s] == rdata[s]
        else:
            ng.pipe.write(tmpfname, dic, data)
            rdic, rdata = ng.pipe.read(tmpfname)
            assert_array_equal(data, rdata)
        assert dic == rdic

    finally:    # remove the temporary files
        for f in glob.glob(base_fname + "*"):
            os.remove(f)
Populate the dropdown widget for responding to an Incident Report
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/fileio/tests/test_pipe.py/check_simple_roundtrip--crossover with--dataset/ETHPy150Open sahana/eden/modules/s3db/irs.py/S3IRSResponseModel.irs_vehicle_requires