def query(request_line):
    """ Place all key-value pairs from a request URL's query string into a dict.

    Example: request b"GET /page?key1=0.07&key2=0.03&key3=0.13 HTTP/1.1\r\n"
    yields dictionary {'key1': '0.07', 'key2': '0.03', 'key3': '0.13'}.

    :param bytes request_line: the complete HTTP request line
    :return dict: dictionary with zero or more entries
    """
    d = dict()
    p = request_line.find(b"?")  # only look in the query part of a request URL
    if p != -1:
        p_space = request_line.find(b" ", p)
        while True:
            n_start = p + 1
            n_end = request_line.find(b"=", n_start)
            if n_end == -1:
                break
            v_start = n_end + 1
            p_and = request_line.find(b"&", v_start)
            v_end = p_space if p_and == -1 else min(p_space, p_and)
            key = request_line[n_start:n_end].decode("utf-8")
            if key not in d:
                d[key] = request_line[v_start:v_end].decode("utf-8")
            p = v_end
            p = request_line.find(b"&", p)
            if p == -1:
                break
    return d