code: def quantity_from_hdf5(dset):
      
      if 'unit' in dset.attrs and dset.attrs['unit'] is not None:
          unit = u.Unit(dset.attrs['unit'])
      else:
          unit = 1.
  
      return dset[:] * unit
docs: Return an Astropy Quantity object from a key in an HDF5 file,
      group, or dataset. This checks to see if the input file/group/dataset
      contains a ``'unit'`` attribute (e.g., in `f.attrs`).
  
      Parameters
      ----------
      dset : :class:`h5py.DataSet`
  
      Returns
      -------
      q : `astropy.units.Quantity`, `numpy.ndarray`
          If a unit attribute exists, this returns a Quantity. Otherwise, it
          returns a numpy array.