code: def read_losc_hdf5_state(f, path='quality/simple', start=None, end=None,
                           copy=False):
      
      # find data
      dataset = io_hdf5.find_dataset(f, '%s/DQmask' % path)
      maskset = io_hdf5.find_dataset(f, '%s/DQDescriptions' % path)
      # read data
      nddata = dataset[()]
      bits = [bytes.decode(bytes(b), 'utf-8') for b in maskset[()]]
      # read metadata
      epoch = dataset.attrs['Xstart']
      try:
          dt = dataset.attrs['Xspacing']
      except KeyError:
          dt = Quantity(1, 's')
      else:
          xunit = parse_unit(dataset.attrs['Xunits'])
          dt = Quantity(dt, xunit)
      return StateVector(nddata, bits=bits, t0=epoch, name='Data quality',
                         dx=dt, copy=copy).crop(start=start, end=end)
docs: Read a `StateVector` from a LOSC-format HDF file.
  
      Parameters
      ----------
      f : `str`, `h5py.HLObject`
          path of HDF5 file, or open `H5File`
  
      path : `str`
          path of HDF5 dataset to read.
  
      start : `Time`, `~gwpy.time.LIGOTimeGPS`, optional
          start GPS time of desired data
  
      end : `Time`, `~gwpy.time.LIGOTimeGPS`, optional
          end GPS time of desired data
  
      copy : `bool`, default: `False`
          create a fresh-memory copy of the underlying array
  
      Returns
      -------
      data : `~gwpy.timeseries.TimeSeries`
          a new `TimeSeries` containing the data read from disk