@staticmethod
    def _parse_proxy_login(conf):
        proxy = {}
        if 'host' in conf and 'port' in conf:
            proxy = {}
            proxy['host'] = conf['host'].encode('utf-8')
            proxy['port'] = conf['port']
            if 'username' in conf:
                if 'password' in conf:
                    proxy['username'] = conf['username'].encode('utf-8')
                    proxy['password'] = conf['password'].encode('utf-8')
                else:
                    print 'Proxy has a username but no password. Ignoring creds.'
        else:
            print 'Host is missing host/port.'
            return None
        return proxy
dataset/ETHPy150Open roglew/pappy-proxy/pappyproxy/config.py/PappyConfig._parse_proxy_login/original