def find_field(name, field_list, related_query):
 if related_query:
  matches = [f for f in field_list if (f.field.related_query_name() == name)]
 else:
  matches = [f for f in field_list if (f.name == name)]
 if (len(matches) != 1):
  return None
 return matches[0]

def find_field ( name , field_list , related_query ) : if related_query : matches = [ f for f in field_list if ( f . field . related_query_name ( ) == name ) ] else : matches = [ f for f in field_list if ( f . name == name ) ] if ( len ( matches ) != 1 ) : return None return matches [ 0 ]
finds a field with a specific name in a list of field instances .