#NEWLINE# def interaction_indices( variables ) : #NEWLINE# #INDENT# indices = [ ] #NEWLINE# field_names = [ field . name for field in variables ] #NEWLINE# for definition in variables : #NEWLINE# #INDENT# if hasattr ( definition , 'interaction_fields' ) : #NEWLINE# #INDENT# interaction_indices = [ ] #NEWLINE# for interaction_field in definition . interaction_fields : #NEWLINE# #INDENT# interaction_indices . append ( field_names . index ( interaction_field ) ) #NEWLINE# #UNINDENT# indices . append ( interaction_indices ) #NEWLINE# #UNINDENT# #UNINDENT# return indices