def export_hdf5_v1(dataset, path, column_names=None, byteorder="<STR_LIT:=>", shuffle=False, selection=False, progress=None, virtual=True):
if selection:<EOL><INDENT>if selection == True:  <EOL><INDENT>selection = "<STR_LIT:default>"<EOL><DEDENT><DEDENT>with h5py.File(path, "<STR_LIT:w>") as h5file_output:<EOL><INDENT>h5data_output = h5file_output.require_group("<STR_LIT:data>")<EOL>N = len(dataset) if not selection else dataset.selected_length(selection)<EOL>if N == <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>logger.debug("<STR_LIT>", virtual)<EOL>logger.debug("<STR_LIT>" % (N, path))<EOL>column_names = column_names or dataset.get_column_names(virtual=virtual, strings=True)<EOL>logger.debug("<STR_LIT>" % column_names)<EOL>for column_name in column_names:<EOL><INDENT>dtype = dataset.dtype(column_name)<EOL>if column_name in dataset.get_column_names(strings=True):<EOL><INDENT>column = dataset.columns[column_name]<EOL>shape = (N,) + column.shape[<NUM_LIT:1>:]<EOL><DEDENT>else:<EOL><INDENT>shape = (N,)<EOL><DEDENT>if dtype.type == np.datetime64:<EOL><INDENT>array = h5file_output.require_dataset("<STR_LIT>" % column_name, shape=shape, dtype=np.int64)<EOL>array.attrs["<STR_LIT>"] = dtype.name<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>array = h5file_output.require_dataset("<STR_LIT>" % column_name, shape=shape, dtype=dtype.newbyteorder(byteorder))<EOL><DEDENT>except:<EOL><INDENT>logging.exception("<STR_LIT>" % (column_name, dtype))<EOL><DEDENT><DEDENT>array[<NUM_LIT:0>] = array[<NUM_LIT:0>]  <EOL><DEDENT>random_index_name = None<EOL>column_order = list(column_names)  <EOL>if shuffle:<EOL><INDENT>random_index_name = "<STR_LIT>"<EOL>while random_index_name in dataset.get_column_names():<EOL><INDENT>random_index_name += "<STR_LIT>"<EOL><DEDENT>shuffle_array = h5file_output.require_dataset("<STR_LIT>" + random_index_name, shape=(N,), dtype=byteorder + "<STR_LIT>")<EOL>shuffle_array[<NUM_LIT:0>] = shuffle_array[<NUM_LIT:0>]<EOL>column_order.append(random_index_name)  <EOL><DEDENT>h5data_output.attrs["<STR_LIT>"] = "<STR_LIT:U+002C>".join(column_order)  <EOL><DEDENT>dataset_output = vaex.hdf5.dataset.Hdf5MemoryMapped(path, write=True)<EOL>column_names = vaex.export._export(dataset_input=dataset, dataset_output=dataset_output, path=path, random_index_column=random_index_name,<EOL>column_names=column_names, selection=selection, shuffle=shuffle, byteorder=byteorder,<EOL>progress=progress)<EOL>import getpass<EOL>import datetime<EOL>user = getpass.getuser()<EOL>date = str(datetime.datetime.now())<EOL>source = dataset.path<EOL>description = "<STR_LIT>" % (user, date, source)<EOL>if dataset.description:<EOL><INDENT>description += "<STR_LIT>" + dataset.description<EOL><DEDENT>dataset_output.copy_metadata(dataset)<EOL>dataset_output.description = description<EOL>logger.debug("<STR_LIT>")<EOL>dataset_output.write_meta()<EOL>dataset_output.close_files()<EOL>return<EOL>
:param DatasetLocal dataset: dataset to export
:param str path: path for file
:param lis[str] column_names: list of column names to export or None for all columns
:param str byteorder: = for native, < for little endian and > for big endian
:param bool shuffle: export rows in random order
:param bool selection: export selection or not
:param progress: progress callback that gets a progress fraction as argument and should return True to continue,
        or a default progress bar when progress=True
:param: bool virtual: When True, export virtual columns
:return: