code: def normalize_ratings(
      ratings: Dict[str, float], max_value: float
  ) -> Dict[str, float]:
      # Takse the ratings, makes the max value into max_value, and proportionally
      # distributes the rest of the ratings.
      # Ex [1,2,3,4] and max_value 8 gets converted to [2,4,6,8]
      # Assumes all rankings are >= 0
      # Don't modify in place
      if len(ratings) == 0:
          return ratings
      min_rating = min(ratings.values())
      assert min_rating > 0
      max_rating = max(ratings.values())
      assert max_rating > 0
      normalized_ratings = {}
      for tf, rank in ratings.items():
          normalized_ratings[tf] = rank / max_rating * max_value
      return normalized_ratings
  
file_path: pytorch/tools/testing/target_determination/heuristics/utils.py
imports: import json
  import os
  import subprocess
  from collections import defaultdict
  from pathlib import Path
  from typing import cast, Dict, List, Set, Union
  from warnings import warn
label_desc: Use image node_id 3 for calling a global function with example usage: normalize_ratings(ratings, max_value) and returns: normalized_ratings, ratings