Use `urlencode` and `urlparse` from six
Use `urlparse` from six