code: def clean_dict_keys(d):
      
      new_d = {}
      for (k, v) in d.iteritems():
          new_d[str(k)] = v
      return new_d
docs: Convert all keys of the dict 'd' to (ascii-)strings.
  
      :Raises: UnicodeEncodeError