#NEWLINE# def same_origin( current_uri , compare_uri ) : #NEWLINE# #INDENT# parsed_uri = urlparse ( current_uri ) #NEWLINE# parsed_compare = urlparse ( compare_uri ) #NEWLINE# if ( parsed_uri . scheme != parsed_compare . scheme ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( current_uri . hostname != parsed_compare . hostname ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( parsed_uri . port != parsed_compare . port ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return True