'Resolve a proxy via PAC.
Args:
query: QNetworkProxyQuery.
from_file: Whether the proxy info is coming from a file.
Return:
A list of QNetworkProxy objects in order of preference.'

def resolve(self, query, from_file=False):

    if from_file:
        string_flags = QUrl.PrettyDecoded
    else:
        string_flags = QUrl.RemoveUserInfo
        if (query.url().scheme() == 'https'):
            string_flags |= (QUrl.RemovePath | QUrl.RemoveQuery)
    result = self._resolver.call([query.url().toString(string_flags), query.peerHostName()])
    result_str = result.toString()
    if (not result.isString()):
        err = "Got    strange    value    from    FindProxyForURL:    '{}'"
        raise EvalProxyError(err.format(result_str))
    return self._parse_proxy_string(result_str)
