def get_proxy_adapter(proxy_base_adapter, proxies):
    """ Factory function to set correct base adapter for proxy adapter.

    :param proxy_base_adapter: Base http adapter.
    :param proxies: Proxies dict.
    :return: Proxy adapter class.
    """
    class ProxyAdapter(proxy_base_adapter):
        def send(self, *args, **kwargs):
            kwargs['proxies'] = proxies
            return super(ProxyAdapter, self).send(*args, **kwargs)

    return ProxyAdapter