def compare_response_code(url, code):
try:<EOL><INDENT>response = urllib.request.urlopen(url)<EOL><DEDENT>except HTTPError as e:<EOL><INDENT>return e.code == code<EOL><DEDENT>except:<EOL><INDENT>return False<EOL><DEDENT>return response.code == code<EOL>
Compare the response code of url param with code param and returns boolean 
@param url -> string e.g. http://127.0.0.1/index
@param content_type -> int e.g. 404, 500, 400 ..etc