def roundtrip(self, save_func, *args, **kwargs):
save_kwds = kwargs.get('<STR_LIT>', {})<EOL>load_kwds = kwargs.get('<STR_LIT>', {})<EOL>file_on_disk = kwargs.get('<STR_LIT>', False)<EOL>if file_on_disk:<EOL><INDENT>target_file = NamedTemporaryFile(delete=False)<EOL>load_file = target_file.name<EOL><DEDENT>else:<EOL><INDENT>target_file = BytesIO()<EOL>load_file = target_file<EOL><DEDENT>try:<EOL><INDENT>arr = args<EOL>save_func(target_file, *arr, **save_kwds)<EOL>target_file.flush()<EOL>target_file.seek(<NUM_LIT:0>)<EOL>if sys.platform == '<STR_LIT:win32>' and not isinstance(target_file, BytesIO):<EOL><INDENT>target_file.close()<EOL><DEDENT>arr_reloaded = np.load(load_file, **load_kwds)<EOL>self.arr = arr<EOL>self.arr_reloaded = arr_reloaded<EOL><DEDENT>finally:<EOL><INDENT>if not isinstance(target_file, BytesIO):<EOL><INDENT>target_file.close()<EOL>if not isinstance(arr_reloaded, np.lib.npyio.NpzFile):<EOL><INDENT>os.remove(target_file.name)<EOL><DEDENT><DEDENT><DEDENT>
save_func : callable
    Function used to save arrays to file.
file_on_disk : bool
    If true, store the file on disk, instead of in a
    string buffer.
save_kwds : dict
    Parameters passed to `save_func`.
load_kwds : dict
    Parameters passed to `numpy.load`.
args : tuple of arrays
    Arrays stored to file.