code: def unicode_key(key):
      
      if not isinstance(key, (text_type, binary_type)):
          from mo_logs import Log
          Log.error("{{key|quote}} is not a valid key", key=key)
      return quote(text_type(key))
docs: CONVERT PROPERTY VALUE TO QUOTED NAME OF SAME