parameters: (
      item,     # type: Tuple[str, InstallRequirement]
      weights,  # type: Dict[Optional[str], int]
  )
return_statement: return weights[name], name
docstring: Key function used to sort install requirements for installation.
  
      Based on the "weight" mapping calculated in ``get_installation_order()``.
      The canonical package name is returned as the second member as a tie-
      breaker to ensure the result is predictable, which is useful in tests.
docstring_summary: Key function used to sort install requirements for installation.
docstring_tokens: Key function used to sort install requirements for installation .
function: def _req_set_item_sorter(
      item,     # type: Tuple[str, InstallRequirement]
      weights,  # type: Dict[Optional[str], int]
  ):
      # type: (...) -> Tuple[int, str]
      """Key function used to sort install requirements for installation.
  
      Based on the "weight" mapping calculated in ``get_installation_order()``.
      The canonical package name is returned as the second member as a tie-
      breaker to ensure the result is predictable, which is useful in tests.
      """
      name = canonicalize_name(item[0])
      return weights[name], name
function_tokens: def _req_set_item_sorter ( item , # type: Tuple[str, InstallRequirement] weights , # type: Dict[Optional[str], int] ) : # type: (...) -> Tuple[int, str] name = canonicalize_name ( item [ 0 ] ) return weights [ name ] , name