code: def open_hdf5(filename, mode='r'):
      
      if isinstance(filename, (h5py.Group, h5py.Dataset)):
          return filename
      if isinstance(filename, FILE_LIKE):
          return h5py.File(filename.name, mode)
      return h5py.File(filename, mode)
docs: Wrapper to open a :class:`h5py.File` from disk, gracefully
      handling a few corner cases