#NEWLINE# def GetFieldInDocument( document , field_name ) : #NEWLINE# #INDENT# 'Find and return the first field with the provided name in the document.' #NEWLINE# for f in document . field_list ( ) : #NEWLINE# #INDENT# if ( f . name ( ) == field_name ) : #NEWLINE# #INDENT# return f #NEWLINE# #UNINDENT# #UNINDENT# return None