code: def remove_empties(variable):
      
      import h5py
      for key, val in variable.attrs.items():
          if isinstance(val, h5py._hl.base.Empty):
              variable.attrs.pop(key)
  
      return variable
docs: Remove empty objects from the *variable*'s attrs.