def _parse_http(self, text):
        # if the response text starts with a 302, skip to the next non-302 header
        text = str(text, encoding='utf-8')
        if re.match(r'^HTTP/.*?\s302 Found', text):
            m = re.search(r'(HTTP/\d+\.\d+\s(?!302 Found).*$)', text, re.S)
            if not m:
                raise Exception("Unrecognized response: %s" % text)
            else:
                text = m.group(1)

        # if the response text starts with a "200 Connection established" but continues with a 201,
        # skip the 200 header. This happens when using a proxy.
        #
        # e.g. HTTP/1.1 200 Connection established
        #       Via: 1.1 proxy
        #       Connection: Keep-Alive
        #       Proxy-Connection: Keep-Alive
        #
        #       HTTP/1.1 201 Created
        #       Server: GitHub.com
        #       ...
        #       Status: 201 Created
        #       ...
        if re.match(r'^HTTP/.*?\s200 Connection established', text):
            m = re.search(r'(HTTP/\d+\.\d+\s(?!200 Connection established).*$)', text, re.S)
            if not m:
                raise Exception("Unrecognized response: %s" % text)
            else:
                text = m.group(1)

        # remove Transfer-Encoding: chunked header, as it causes reading the response to fail
        # first do a quick check for it, so we can avoid doing the expensive negative-lookbehind
        # regex if we don't need it
        if text in "Transfer-Encoding: chunked":
            # we do the negative-lookbehind to make sure we only strip the Transfer-Encoding
            # string in the header
            text = re.sub(r'(?<!\r\n\r\n).*?Transfer-Encoding: chunked\r\n', '', text, count=1)

        logger.debug("CurlSession - getting socket from %s" % text)
        socket = self.FakeSocket(text.encode())
        response = httplib.HTTPResponse(socket)
        response.begin()
        return response
dataset/ETHPy150Open bgreenlee/sublime-github/sublime_requests.py/CurlSession._parse_http/swapped operands of `in`