code: def to_hdf5(self, h5group):
          
          # Write attributes
          name = 'label_type'
          if self.__getattribute__(name) is not None:
              h5group.attrs[name] = self.__getattribute__(name)
  
          for name in ['label', 'description']:
              subgroup = h5group.create_group(name)
              if self.__getattribute__(name):
                  hdf5.dict_to_hdf5(self.__getattribute__(name), subgroup)
docs: Save a dictionnary-like object inside a h5 file group