#NEWLINE# def __init__( self , response = None , status = None , headers = None , mimetype = None , content_type = None , direct_passthrough = False ) : #NEWLINE# #INDENT# if isinstance ( headers , Headers ) : #NEWLINE# #INDENT# self . headers = headers #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not headers ) : #NEWLINE# #INDENT# self . headers = Headers ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . headers = Headers ( headers ) #NEWLINE# #UNINDENT# #UNINDENT# if ( content_type is None ) : #NEWLINE# #INDENT# if ( ( mimetype is None ) and ( 'content-type' not in self . headers ) ) : #NEWLINE# #INDENT# mimetype = self . default_mimetype #NEWLINE# #UNINDENT# if ( mimetype is not None ) : #NEWLINE# #INDENT# mimetype = get_content_type ( mimetype , self . charset ) #NEWLINE# #UNINDENT# content_type = mimetype #NEWLINE# #UNINDENT# if ( content_type is not None ) : #NEWLINE# #INDENT# self . headers [ 'Content-Type' ] = content_type #NEWLINE# #UNINDENT# if ( headers is None ) : #NEWLINE# #INDENT# status = self . default_status #NEWLINE# #UNINDENT# if isinstance ( status , integer_types ) : #NEWLINE# #INDENT# self . status_code = status #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . status = status #NEWLINE# #UNINDENT# self . direct_passthrough = direct_passthrough #NEWLINE# self . _on_close = [ ] #NEWLINE# if ( response is None ) : #NEWLINE# #INDENT# self . response = [ ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( response , ( text_type , bytes , bytearray ) ) : #NEWLINE# #INDENT# self . set_data ( response ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . response = response