# Buggy code
def setup_connection(self):
    # on *NIX, the proxy can show up either upper or lowercase.
    # Prefer lower case, and prefer HTTPS over HTTP if the urlscheme
    # is https.
    proxy = os.environ.get("http_proxy", os.environ.get("HTTP_PROXY", ""))
    if urlscheme == "https":
        proxy = os.environ.get("https_proxy", os.environ.get("HTTPS_PROXY", proxy))
    if proxy:
        p = ProxiedTransport()
        p.set_proxy(proxy)
        self.neos = xmlrpclib.ServerProxy(
            urlscheme + "://www.neos-server.org:" + port, transport=p
        )
    else:
        self.neos = xmlrpclib.ServerProxy(urlscheme + "://www.neos-server.org:" + port)
    logger.info("Connecting to the NEOS server ... ")
    try:
        result = self.neos.ping()
        logger.info("OK.")
    except socket.error:
        e = sys.exc_info()[1]
        self.neos = None
        logger.info("Fail.")
        logger.warning("NEOS is temporarily unavailable.\n")


# Traceback (TypeError)
Traceback (most recent call last):
File "/ascldap/users/gseastr/envs/python3.6/bin/pyomo", line 11, in <module>
load_entry_point('Pyomo', 'console_scripts', 'pyomo')()
File "/home/gseastr/envs/pyomo/pyomo/scripting/pyomo_main.py", line 82, in main
retval = _options.func(_options)
File "/home/gseastr/envs/pyomo/pyomo/scripting/driver_help.py", line 456, in help_exec
help_solvers()
File "/home/gseastr/envs/pyomo/pyomo/scripting/driver_help.py", line 373, in help_solvers
kestrel = pyomo.neos.kestrel.kestrelAMPL()
File "/home/gseastr/envs/pyomo/pyomo/neos/kestrel.py", line 66, in __init__
self.setup_connection()
File "/home/gseastr/envs/pyomo/pyomo/neos/kestrel.py", line 87, in setup_connection
result = self.neos.ping()
File "/home/gseastr/envs/python3.6/lib/python3.6/xmlrpc/client.py", line 1112, in __call__
return self.__send(self.__name, args)
File "/home/gseastr/envs/python3.6/lib/python3.6/xmlrpc/client.py", line 1452, in __request
verbose=self.__verbose
File "/home/gseastr/envs/python3.6/lib/python3.6/xmlrpc/client.py", line 1154, in request
return self.single_request(host, handler, request_body, verbose)
File "/home/gseastr/envs/python3.6/lib/python3.6/xmlrpc/client.py", line 1166, in single_request
http_conn = self.send_request(host, handler, request_body, verbose)
TypeError: send_request() takes 4 positional arguments but 5 were given

# Fixed code
def setup_connection(self):
    # on *NIX, the proxy can show up either upper or lowercase.
    # Prefer lower case, and prefer HTTPS over HTTP if the
    # NEOS.scheme is https.
    proxy = os.environ.get("http_proxy", os.environ.get("HTTP_PROXY", ""))
    if NEOS.scheme == "https":
        proxy = os.environ.get("https_proxy", os.environ.get("HTTPS_PROXY", proxy))
    transport = None
    if proxy:
        transport = ProxiedTransport()
        transport.set_proxy(proxy)

    self.neos = xmlrpclib.ServerProxy(
        "%s://%s:%s" % (NEOS.scheme, NEOS.host, NEOS.port), transport=transport
    )

    logger.info("Connecting to the NEOS server ... ")
    try:
        result = self.neos.ping()
        logger.info("OK.")
    except socket.error:
        e = sys.exc_info()[1]
        self.neos = None
        logger.info("Fail.")
        logger.warning("NEOS is temporarily unavailable.\n")