#NEWLINE# def percent_records_missing_location( user , method = None ) : #NEWLINE# #INDENT# '\n    Return the percentage of records missing a location parameter.\n    ' #NEWLINE# if ( len ( user . records ) == 0 ) : #NEWLINE# #INDENT# return 0.0 #NEWLINE# #UNINDENT# missing_locations = sum ( [ 1 for record in user . records if ( record . position . _get_location ( user ) is None ) ] ) #NEWLINE# return ( float ( missing_locations ) / len ( user . records ) )