code: def get_ranks(values):
      '''
      Converts raw values into ranks for rank correlation coefficients
      :param values: list of values (int/float)
      :return: a dict mapping value -> rank
      '''
      ranks = {}
      sorted_values = sorted(values)
      for i in range(len(sorted_values)):
          value = sorted_values[i]
          if value not in ranks:
              ranks[value] = i + 1
      return rankf get_ranks(values):
      '''
      Converts raw values into ranks for rank correlation coefficients
      :param values: list of values (int/float)
      :return: a dict mapping value -> rank
      '''
      ranks = {}
      sorted_values = sorted(values)
      for i in range(len(sorted_values)):
          value = sorted_values[i]
          if value not in ranks:
              ranks[value] = i + 1
      return ranks
docs: Converts raw values into ranks for rank correlation coefficients
      :param values: list of values (int/float)
      :return: a dict mapping value -> rank