'Factory function. Build a HTTPResponse object from a
httplib.HTTPResponse instance
:param httplibresp: httplib.HTTPResponse instance
:param original_url: Optional \'url_object\' instance.
:return: A HTTPResponse instance'

@classmethod
def from_httplib_resp(cls, httplibresp, original_url=None):

    resp = httplibresp
    (code, msg, hdrs, body) = (resp.code, resp.msg, resp.info(), resp.read())
    hdrs = Headers(hdrs.items())
    if original_url:
        url_inst = URL(resp.geturl(), original_url.encoding)
        url_inst = url_inst.url_decode()
    else:
        url_inst = original_url = URL(resp.geturl())
    httplib_time = DEFAULT_WAIT_TIME
    if hasattr(httplibresp, 'get_wait_time'):
        httplib_time = httplibresp.get_wait_time()
    if isinstance(resp, urllib2.HTTPError):
        charset = getattr(resp.fp, 'encoding', None)
    else:
        charset = getattr(resp, 'encoding', None)
    return cls(code, body, hdrs, url_inst, original_url, msg, charset=charset, time=httplib_time)
