@classmethod<EOL><INDENT>def from_httplib(ResponseCls, r, **response_kw):<DEDENT>
headers = r.msg<EOL>if not isinstance(headers, HTTPHeaderDict):<EOL><INDENT>if PY3: <EOL><INDENT>headers = HTTPHeaderDict(headers.items())<EOL><DEDENT>else: <EOL><INDENT>headers = HTTPHeaderDict.from_httplib(headers)<EOL><DEDENT><DEDENT>strict = getattr(r, '<STR_LIT:strict>', <NUM_LIT:0>)<EOL>resp = ResponseCls(body=r,<EOL>headers=headers,<EOL>status=r.status,<EOL>version=r.version,<EOL>reason=r.reason,<EOL>strict=strict,<EOL>original_response=r,<EOL>**response_kw)<EOL>return resp<EOL>
Given an :class:`httplib.HTTPResponse` instance ``r``, return a
corresponding :class:`urllib3.response.HTTPResponse` object.

Remaining parameters are passed to the HTTPResponse constructor, along
with ``original_response=r``.