def lookup_loc(location, country):
 corrected = location_names.get(location)
 if corrected:
  return get_loc_from_db(corrected, country)
 if (location[(-6):] == 'County'):
  return get_loc_from_db(location[:(-6)].strip(), 'Liberia')
 if location.startswith('Western Area'):
  return get_loc_from_db(location[12:].strip(), country)
 if (location in rejected_loc):
  rejected_loc[location] += 1
 else:
  rejected_loc[location] = 1

def lookup_loc ( location , country ) : corrected = location_names . get ( location ) if corrected : return get_loc_from_db ( corrected , country ) if ( location [ ( - 6 ) : ] == 'County' ) : return get_loc_from_db ( location [ : ( - 6 ) ] . strip ( ) , 'Liberia' ) if location . startswith ( 'Western Area' ) : return get_loc_from_db ( location [ 12 : ] . strip ( ) , country ) if ( location in rejected_loc ) : rejected_loc [ location ] += 1 else : rejected_loc [ location ] = 1
location names need to match what we have already .