def is_same_host(self, url):
        # TODO: Add optional support for socket.gethostbyname checking.
        scheme, host, port = get_host(url)

        if self.port and not port:
            # Use explicit default port for comparison when none is given.
            port = port_by_scheme.get(scheme)

        return (url.startswith('/') or
                (scheme, host, port) == (self.scheme, self.host, self.port))
:param locations: locations list containig (lat, lon) two-tuples
dataset/ETHPy150Open lmorchard/badg.us/vendor-local/lib/python/requests/packages/urllib3/connectionpool.py/HTTPConnectionPool.is_same_host--crossover with--dataset/ETHPy150Open swistakm/python-gmaps/src/gmaps/polyline.py/encode