code: def get_sorted_structure(self, key=None, reverse=False):
          
          sites = sorted(self, key=key, reverse=reverse)
          return self.__class__.from_sites(sites, charge=self._charge)
docs: Get a sorted copy of the structure. The parameters have the same
          meaning as in list.sort. By default, sites are sorted by the
          electronegativity of the species.
  
          Args:
              key: Specifies a function of one argument that is used to extract
                  a comparison key from each list element: key=str.lower. The
                  default value is None (compare the elements directly).
              reverse (bool): If set to True, then the list elements are sorted
                  as if each comparison were reversed.