def read(filename, remove_duplicates=False, data_wrapper=DataWrapper):
with h5py.File(filename, mode='<STR_LIT:r>') as h5file:<EOL><INDENT>version = get_version(h5file)<EOL>if version == '<STR_LIT>':<EOL><INDENT>points, groups = _unpack_v1(h5file)<EOL><DEDENT>elif version == '<STR_LIT>':<EOL><INDENT>stg = next(s for s in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>if s in h5file['<STR_LIT>'])<EOL>points, groups = _unpack_v2(h5file, stage=stg)<EOL><DEDENT><DEDENT>if remove_duplicates:<EOL><INDENT>points, groups = _remove_duplicate_points(points, groups)<EOL><DEDENT>neuron_builder = BlockNeuronBuilder()<EOL>points[:, POINT_DIAMETER] /= <NUM_LIT:2>  <EOL>for id_, row in enumerate(zip_longest(groups,<EOL>groups[<NUM_LIT:1>:, GPFIRST],<EOL>fillvalue=len(points))):<EOL><INDENT>(point_start, section_type, parent_id), point_end = row<EOL>neuron_builder.add_section(id_, int(parent_id), int(section_type),<EOL>points[point_start:point_end])<EOL><DEDENT>return neuron_builder.get_datawrapper(version, data_wrapper=data_wrapper)<EOL>
Read a file and return a `data_wrapper'd` data

    * Tries to guess the format and the H5 version.
    * Unpacks the first block it finds out of ('repaired', 'unraveled', 'raw')

    Parameters:
        remove_duplicates: boolean, If True removes duplicate points
        from the beginning of each section.