def url_equal(url_1, url_2):
 parse_result_1 = urlparse(url_1)
 parse_result_2 = urlparse(url_2)
 return ((parse_result_1[:4] == parse_result_2[:4]) and (parse_qs(parse_result_1[5]) == parse_qs(parse_result_2[5])))

def url_equal ( url_1 , url_2 ) : parse_result_1 = urlparse ( url_1 ) parse_result_2 = urlparse ( url_2 ) return ( ( parse_result_1 [ : 4 ] == parse_result_2 [ : 4 ] ) and ( parse_qs ( parse_result_1 [ 5 ] ) == parse_qs ( parse_result_2 [ 5 ] ) ) )
compare two urls with query string where ordering does not matter .