def METHOD_NAME(self, connection=None):
    port = 80 if self.__url.port is None else self.__url.port
    if connection:
        self.__conn = connection
        self.timeout = connection.timeout
    elif self.__url.scheme == 'https':
        self.__conn = HTTPSConnection(self.__url.hostname, port, timeout=self.timeout)
    else:
        self.__conn = HTTPConnection(self.__url.hostname, port, timeout=self.timeout)