def request(url, message, **kwargs):
    # Split the URL into constituent components.
    scheme, host, port, path = _spliturl(url)
    body = message.get("body", "")

    # Setup the default headers.
    head = { 
        "Content-Length": str(len(body)),
        "Host": host,
        "User-Agent": "http.py/1.0",
        "Accept": "*/*",
    }

    # Add in the passed in headers.
    for key, value in message["headers"]: 
        head[key] = value

    # Note the HTTP method we're using, defaulting
    # to `GET`.
    method = message.get("method", "GET")
    
    # Note that we do not support proxies in this example
    # If running Python 2.7.9+, disable SSL certificate validation
    if (2, 7, 9) >= sys.version_info:
        unverified_ssl_handler = urllib2.HTTPSHandler(context=ssl._create_unverified_context())
        opener = urllib2.build_opener(unverified_ssl_handler)
    else:
        opener = urllib2.build_opener()

    # Unfortunately, we need to use the hack of 
    # "overriding" `request.get_method` to specify
    # a method other than `GET` or `POST`.
    request = urllib2.Request(url, body, head)
    request.get_method = lambda: method

    # Make the request and get the response
    response = None
    try:
        response = opener.open(request)
    except Exception as e:
        response = e

    # Normalize the response to something the SDK expects, and 
    # return it.
    return {
        'status': response.code, 
        'reason': response.msg,
        'headers': response.info().dict,
        'body': binding.ResponseReader(response)
    }
dataset/ETHPy150Open splunk/splunk-sdk-python/examples/async/async.py/request/swapped operands of `>=`