code: def urlencode(data):
      
      def dec(string):
          if isinstance(string, bytes):
              string = string.decode("utf-8")
          return quote_plus(string)
  
      return "&".join(
          "%s=%s" % (dec(name), dec(value))
          for name, value in data)
docs: A version of `urllib.urlencode` that isn't insane.
  
      This only cares that `data` is an iterable of iterables. Each sub-iterable
      must be of overall length 2, i.e. a name/value pair.
  
      Unicode strings will be encoded to UTF-8. This is what Django expects; see
      `smart_text` in the Django documentation.