parameters: (self, request, cached)
return_statement: return HTTPResponse(
              body=body,
              preload_content=False,
              **cached["response"]
          )
docstring: Verify our vary headers match and construct a real urllib3
          HTTPResponse object.
docstring_summary: Verify our vary headers match and construct a real urllib3
          HTTPResponse object.
docstring_tokens: Verify our vary headers match and construct a real urllib3 HTTPResponse object .
function: def prepare_response(self, request, cached):
          """Verify our vary headers match and construct a real urllib3
          HTTPResponse object.
          """
          # Special case the '*' Vary value as it means we cannot actually
          # determine if the cached response is suitable for this request.
          if "*" in cached.get("vary", {}):
              return
  
          # Ensure that the Vary headers for the cached response match our
          # request
          for header, value in cached.get("vary", {}).items():
              if request.headers.get(header, None) != value:
                  return
  
          body_raw = cached["response"].pop("body")
  
          try:
              body = io.BytesIO(body_raw)
          except TypeError:
              # This can happen if cachecontrol serialized to v1 format (pickle)
              # using Python 2. A Python 2 str(byte string) will be unpickled as
              # a Python 3 str (unicode string), which will cause the above to
              # fail with:
              #
              #     TypeError: 'str' does not support the buffer interface
              body = io.BytesIO(body_raw.encode('utf8'))
  
          return HTTPResponse(
              body=body,
              preload_content=False,
              **cached["response"]
          )
function_tokens: def prepare_response ( self , request , cached ) : # Special case the '*' Vary value as it means we cannot actually # determine if the cached response is suitable for this request. if "*" in cached . get ( "vary" , { } ) : return # Ensure that the Vary headers for the cached response match our # request for header , value in cached . get ( "vary" , { } ) . items ( ) : if request . headers . get ( header , None ) != value : return body_raw = cached [ "response" ] . pop ( "body" ) try : body = io . BytesIO ( body_raw ) except TypeError : # This can happen if cachecontrol serialized to v1 format (pickle) # using Python 2. A Python 2 str(byte string) will be unpickled as # a Python 3 str (unicode string), which will cause the above to # fail with: # #     TypeError: 'str' does not support the buffer interface body = io . BytesIO ( body_raw . encode ( 'utf8' ) ) return HTTPResponse ( body = body , preload_content = False , * * cached [ "response" ] )