def sort_labeled_issues(issues)
      sorted_issues = []
      issues.each do |issue|
        label_names = issue["labels"].collect { |l| l["name"] }

        # Add PRs in the order of the @sections array. This will either be the
        # default sections followed by any --add-sections sections in
        # user-defined order, or --configure-sections in user-defined order.
        # Ignore the order of the issue labels from github which cannot be
        # controled by the user.
        @sections.each do |section|
          unless (section.labels & label_names).empty?
            section.issues << issue
            sorted_issues << issue
            break
          end
        end
      end
      issues - sorted_issues
    end
def sort_labeled_issues(issues)
      sorted_issues = []
      issues.each do |issue|
        label_names = issue["labels"].collect { |l| l["name"] }

        # Add PRs in the order of the @sections array. This will either be the
        # default sections followed by any --add-sections sections in
        # user-defined order, or --configure-sections in user-defined order.
        # Ignore the order of the issue labels from github which cannot be
        # controled by the user.
        @sections.each do |section|
          unless (section.labels & label_names).empty?
            section.issues << issue
            sorted_issues << issue
            break
          end
        end
      end
      issues - sorted_issues
    end
Iterates through sections and sorts labeled issues into them based on
 the label mapping. Returns any unmapped or unlabeled issues.

 @param [Array] issues Issues or pull requests.
 @return [Array] Issues that were not mapped into any sections.