nodes: 0, module; 1, function_definition; 2, function_name:organize_commands; 3, parameters; 4, block; 5, identifier:corrected_commands; 6, expression_statement; 7, try_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, for_statement; 12, comment:"""Yields sorted commands without duplicates.
  
      :type corrected_commands: Iterable[thefuck.types.CorrectedCommand]
      :rtype: Iterable[thefuck.types.CorrectedCommand]
  
      """; 13, block; 14, except_clause; 15, assignment; 16, assignment; 17, call; 18, identifier:command; 19, identifier:sorted_commands; 20, block; 21, expression_statement; 22, expression_statement; 23, identifier:StopIteration; 24, block; 25, identifier:without_duplicates; 26, set_comprehension; 27, identifier:sorted_commands; 28, call; 29, attribute; 30, argument_list; 31, expression_statement; 32, assignment; 33, yield; 34, return_statement; 35, identifier:command; 36, for_in_clause; 37, if_clause; 38, identifier:sorted; 39, argument_list; 40, identifier:logs; 41, identifier:debug; 42, call; 43, yield; 44, identifier:first_command; 45, call; 46, identifier:first_command; 47, identifier:command; 48, call; 49, comparison_operator:command != first_command; 50, identifier:without_duplicates; 51, keyword_argument; 52, attribute; 53, argument_list; 54, identifier:command; 55, identifier:next; 56, argument_list; 57, identifier:sorted; 58, argument_list; 59, identifier:command; 60, identifier:first_command; 61, identifier:key; 62, lambda; 63, string; 64, identifier:format; 65, call; 66, identifier:corrected_commands; 67, identifier:corrected_commands; 68, keyword_argument; 69, lambda_parameters; 70, attribute; 71, string_content:Corrected commands:; 72, attribute; 73, generator_expression; 74, identifier:key; 75, lambda; 76, identifier:corrected_command; 77, identifier:corrected_command; 78, identifier:priority; 79, string; 80, identifier:join; 81, call; 82, for_in_clause; 83, lambda_parameters; 84, attribute; 85, string_content:,; 86, attribute; 87, argument_list; 88, identifier:cmd; 89, binary_operator:[first_command] + sorted_commands; 90, identifier:command; 91, identifier:command; 92, identifier:priority; 93, string; 94, identifier:format; 95, identifier:cmd; 96, list; 97, identifier:sorted_commands; 98, string_content:{}; 99, identifier:first_command
code: def organize_commands(corrected_commands):
      """Yields sorted commands without duplicates.
  
      :type corrected_commands: Iterable[thefuck.types.CorrectedCommand]
      :rtype: Iterable[thefuck.types.CorrectedCommand]
  
      """
      try:
          first_command = next(corrected_commands)
          yield first_command
      except StopIteration:
          return
  
      without_duplicates = {
          command for command in sorted(
              corrected_commands, key=lambda command: command.priority)
          if command != first_command}
  
      sorted_commands = sorted(
          without_duplicates,
          key=lambda corrected_command: corrected_command.priority)
  
      logs.debug('Corrected commands: '.format(
          ', '.join(u'{}'.format(cmd) for cmd in [first_command] + sorted_commands)))
  
      for command in sorted_commands:
          yield command