def NormalizeCounter(counter):
  """Returns a normalized version of the dictionary `counter`.

  Does not modify `counter`.

  Returns:
    A new dictionary, in which every value in `counter`
    has been divided by the total to sum up to 1.
  """
  total = sum(counter.values())
  return {key: counter[key] / total for key in counter}