def METHOD_NAME(dist):
  """
  Sample a key from a dictionary using the values as probabilities (unnormalized)
  """
  cutoff = random()
  dist = log_normalize(dist)
  #print "Normalizer: ", normalizer
  current = 0
  for ii in xrange(len(dist)):
    current += exp(dist[ii])
    if current >= cutoff:
      #print "Chose", i
      return ii
  assert False, "Didn't choose anything: %f %f" % (cutoff, current)