#NEWLINE# def find_parent_reference( current_kind , references , kinds_hierarchy ) : #NEWLINE# #INDENT# parent_kind = kinds_hierarchy [ current_kind ] #NEWLINE# for reference in reversed ( references ) : #NEWLINE# #INDENT# if ( reference . kind_hint . kind == parent_kind ) : #NEWLINE# #INDENT# return reference