code: def as_dict(self):
          
          return {"@module": self.__class__.__module__,
                  "@class": self.__class__.__name__, "efermi": self.efermi,
                  "energies": list(self.energies),
                  "densities": {str(spin): list(dens)
                                for spin, dens in self.densities.items()}}
docs: Json-serializable dict representation of Dos.