code: def get_sorted_proposal_list(self):
          proposals = {}
          for proposal in self.proposals:
              proposals.setdefault(proposal.scope, []).append(proposal)
          result = []
          for scope in self.scopepref:
              scope_proposals = proposals.get(scope, [])
              scope_proposals = [proposal for proposal in scope_proposals
                                 if proposal.type in self.typerank]
              scope_proposals.sort(key=self._proposal_key)
              result.extend(scope_proposals)
          return result