def encode(self, encoding):
        netloc = self._host
        if self._port:
            netloc += (b(':') + bytes(self._port))

        result = urlunparse((
            self._scheme, netloc, self._path,
            self._params, self._query, self._fragment
        ))
        return result.decode('utf-8').encode(encoding)
Return the url in an arbitrary encoding
dataset/ETHPy150Open circuits/circuits/circuits/web/url.py/URL.encode