code: def _rank_correlated_tests(
      tests_to_run: List[str],
  ) -> List[str]:
      # Find the tests failures that are correlated with the edited files.
      # Filter the list to only include tests we want to run.
      tests_to_run = set(tests_to_run)
      ratings = _get_ratings_for_tests(tests_to_run)
      prioritize = sorted(ratings, key=lambda x: -ratings[x])
      return prioritize
  
file_path: pytorch/tools/testing/target_determination/heuristics/historical_class_failure_correlation.py
imports: import json
  import os
  from collections import defaultdict
  from typing import Any, cast, Dict, List, Set
  from warnings import warn
  from tools.stats.import_test_stats import ADDITIONAL_CI_FILES_FOLDER, TEST_CLASS_RATINGS_FILE
  from tools.testing.target_determination.heuristics.interface import HeuristicInterface, TestPrioritizations
  from tools.testing.target_determination.heuristics.utils import normalize_ratings, query_changed_files, REPO_ROOT
label_desc: Use image node_id 3 for calling a global function with example usage: _rank_correlated_tests(tests_to_run) and returns: prioritize