code: def sorted_proposals(proposals, scopepref=None, typepref=None):
      
      sorter = _ProposalSorter(proposals, scopepref, typepref)
      return sorter.get_sorted_proposal_list()
docs: Sort a list of proposals
  
      Return a sorted list of the given `CodeAssistProposal`\s.
  
      `scopepref` can be a list of proposal scopes.  Defaults to
      ``['parameter_keyword', 'local', 'global', 'imported',
      'attribute', 'builtin', 'keyword']``.
  
      `typepref` can be a list of proposal types.  Defaults to
      ``['class', 'function', 'instance', 'module', None]``.
      (`None` stands for completions with no type like keywords.)