<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def urlencode(data):
 """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. """

    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)