def proxies2proxyinfo(proxies):
    """
    Converts proxies dict into a ProxyInfo object
    :param proxies: requests' proxies dict
    :return: ProxyInfo object
    """
    url_components = urlparse(proxies["http"]) if "http" in proxies else urlparse(proxies["https"])

    return httplib2.ProxyInfo(httplib2.socks.PROXY_TYPE_HTTP_NO_TUNNEL, url_components.hostname, url_components.port,
                              proxy_user=url_components.username, proxy_pass=url_components.password)
dataset/ETHPy150Open CartoDB/cartodb-python/cartodb/cartodb.py/proxies2proxyinfo/original