201
200
u = urllib2.urlopen(field_data)
204
203
except urllib2.HTTPError, e:
205
204
# 401s are valid; they just mean authorization is required.
206
205
if e.code not in ('401',):
208
207
except: # urllib2.URLError, httplib.InvalidURL, etc.
211
210
def isValidUSState(field_data, all_data):
212
211
"Checks that the given string is a valid two-letter U.S. state abbreviation"
213
212
states = ['AA', 'AE', 'AK', 'AL', 'AP', 'AR', 'AS', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'FM', 'GA', 'GU', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MH', 'MI', 'MN', 'MO', 'MP', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'PR', 'PW', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VI', 'VT', 'WA', 'WI', 'WV', 'WY']
214
213
if field_data.upper() not in states:
217
216
def hasNoProfanities(field_data, all_data):