nodes: 0, module; 1, function_definition; 2, function_name:get_sorted_structure; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, identifier:key; 12, None; 13, identifier:reverse; 14, False; 15, comment:"""
          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.
          """; 16, assignment; 17, call; 18, identifier:sites; 19, call; 20, attribute; 21, argument_list; 22, identifier:sorted; 23, argument_list; 24, attribute; 25, identifier:from_sites; 26, identifier:sites; 27, keyword_argument; 28, identifier:self; 29, keyword_argument; 30, keyword_argument; 31, identifier:self; 32, identifier:__class__; 33, identifier:charge; 34, attribute; 35, identifier:key; 36, identifier:key; 37, identifier:reverse; 38, identifier:reverse; 39, identifier:self; 40, identifier:_charge
code: def get_sorted_structure(self, key=None, reverse=False):
          """
          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.
          """
          sites = sorted(self, key=key, reverse=reverse)
          return self.__class__.from_sites(sites, charge=self._charge)