#NEWLINE# def _GetUserCookieFromResponse( self , response ) : #NEWLINE# #INDENT# 'Extracts the user cookie from an HTTP response and returns it if\n    it exists, or returns None if not.' #NEWLINE# user_cookie_header = [ self for h in response . headers . get_list ( 'Set-Cookie' ) if h . startswith ( 'user=' ) ] [ ( - 1 ) ] #NEWLINE# return re . match ( 'user="?([^";]*)' , user_cookie_header ) . group ( 1 )