def open(path, convert=False, shuffle=False, copy_index=True, *args, **kwargs):
import vaex<EOL>try:<EOL><INDENT>if path in aliases:<EOL><INDENT>path = aliases[path]<EOL><DEDENT>if path.startswith("<STR_LIT>") or path.startswith("<STR_LIT>"):  <EOL><INDENT>server, DataFrame = path.rsplit("<STR_LIT:/>", <NUM_LIT:1>)<EOL>server = vaex.server(server, **kwargs)<EOL>DataFrames = server.DataFrames(as_dict=True)<EOL>if DataFrame not in DataFrames:<EOL><INDENT>raise KeyError("<STR_LIT>" % (DataFrame, "<STR_LIT:U+0020>".join(DataFrames.keys())))<EOL><DEDENT>return DataFrames[DataFrame]<EOL><DEDENT>if path.startswith("<STR_LIT>"):<EOL><INDENT>import vaex.distributed<EOL>return vaex.distributed.open(path, *args, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>import vaex.file<EOL>import glob<EOL>filenames = list(sorted(glob.glob(path)))<EOL>ds = None<EOL>if len(filenames) == <NUM_LIT:0>:<EOL><INDENT>raise IOError('<STR_LIT>'.format(path))<EOL><DEDENT>filename_hdf5 = _convert_name(filenames, shuffle=shuffle)<EOL>filename_hdf5_noshuffle = _convert_name(filenames, shuffle=False)<EOL>if len(filenames) == <NUM_LIT:1>:<EOL><INDENT>path = filenames[<NUM_LIT:0>]<EOL>ext = os.path.splitext(path)[<NUM_LIT:1>]<EOL>if os.path.exists(filename_hdf5) and convert:  <EOL><INDENT>if convert:<EOL><INDENT>ds = vaex.file.open(filename_hdf5)<EOL><DEDENT>else:<EOL><INDENT>ds = vaex.file.open(filename_hdf5, *args, **kwargs)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if ext == '<STR_LIT>':  <EOL><INDENT>ds = from_csv(path, copy_index=copy_index, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>ds = vaex.file.open(path, *args, **kwargs)<EOL><DEDENT>if convert:<EOL><INDENT>ds.export_hdf5(filename_hdf5, shuffle=shuffle)<EOL>ds = vaex.file.open(filename_hdf5) <EOL><DEDENT><DEDENT>if ds is None:<EOL><INDENT>if os.path.exists(path):<EOL><INDENT>raise IOError('<STR_LIT>'.format(path))<EOL><DEDENT>if os.path.exists(path):<EOL><INDENT>raise IOError('<STR_LIT>'.format(path))<EOL><DEDENT><DEDENT><DEDENT>elif len(filenames) > <NUM_LIT:1>:<EOL><INDENT>if convert not in [True, False]:<EOL><INDENT>filename_hdf5 = convert<EOL><DEDENT>else:<EOL><INDENT>filename_hdf5 = _convert_name(filenames, shuffle=shuffle)<EOL><DEDENT>if os.path.exists(filename_hdf5) and convert:  <EOL><INDENT>ds = open(filename_hdf5)<EOL><DEDENT>else:<EOL><INDENT>DataFrames = []<EOL>for filename in filenames:<EOL><INDENT>DataFrames.append(open(filename, convert=bool(convert), shuffle=shuffle, **kwargs))<EOL><DEDENT>ds = vaex.dataframe.DataFrameConcatenated(DataFrames)<EOL><DEDENT>if convert:<EOL><INDENT>ds.export_hdf5(filename_hdf5, shuffle=shuffle)<EOL>ds = vaex.file.open(filename_hdf5, *args, **kwargs)<EOL><DEDENT><DEDENT><DEDENT>if ds is None:<EOL><INDENT>raise IOError('<STR_LIT>'.format(path))<EOL><DEDENT>return ds<EOL><DEDENT>except:<EOL><INDENT>logging.getLogger("<STR_LIT>").error("<STR_LIT>" % path)<EOL>raise<EOL><DEDENT>
Open a DataFrame from file given by path.

    Example:

    >>> ds = vaex.open('sometable.hdf5')
    >>> ds = vaex.open('somedata*.csv', convert='bigdata.hdf5')

    :param str path: local or absolute path to file, or glob string
    :param convert: convert files to an hdf5 file for optimization, can also be a path
    :param bool shuffle: shuffle converted DataFrame or not
    :param args: extra arguments for file readers that need it
    :param kwargs: extra keyword arguments
    :param bool copy_index: copy index when source is read via pandas
    :return: return a DataFrame on succes, otherwise None
    :rtype: DataFrame