#NEWLINE# @ staticmethod #NEWLINE# def selection_pattern( status_code ) : #NEWLINE# #INDENT# '\n        Generate a regex to match a given status code in a response.\n        ' #NEWLINE# pattern = '' #NEWLINE# if ( status_code in [ '301' , '302' ] ) : #NEWLINE# #INDENT# pattern = 'https://.*|/.*' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( status_code != '200' ) : #NEWLINE# #INDENT# pattern = ( base64 . b64encode ( ( '<!DOCTYPE html>' + str ( status_code ) ) ) + '.*' ) #NEWLINE# pattern = pattern . replace ( '+' , '\\+' ) #NEWLINE# #UNINDENT# #UNINDENT# return pattern