code: def add_spectra(self, spectra_dict, key_sort_func=None):
          
          if key_sort_func:
              keys = sorted(spectra_dict.keys(), key=key_sort_func)
          else:
              keys = spectra_dict.keys()
          for label in keys:
              self.add_spectra(label, spectra_dict[label])
docs: Add a dictionary of doses, with an optional sorting function for the
          keys.
  
          Args:
              dos_dict: dict of {label: Dos}
              key_sort_func: function used to sort the dos_dict keys.