input: 
  def sort_words_by_length(my_string: str) -> str:
      """Sorts the words in the given string by their length in decreasing alphabetical order.
      >>> sort_words_by_length("This is the string which is to be sorted")
      "string sorted to is This which be the"
      """
      words = my_string.split(' ')
      words_with_length = [(len(word), word) for word in words]
      words_with_length.sort(reverse=True)
      sorted_string = " ".join([i[1] for i in words_with_length])
      return sorted_string
  
output:     words_with_length.sort(key=lambda x: (-x[0], x[1]))