from user import test_users from label_data import data import random from query import * id = 0 for u in test_users(20): print "---" u.println() #x = [ (u.rate(d), d.name) for d in data ] #t = random.random() < 0.5 #x = sorted(x, key=lambda (x,y): x)[::-1][0 if t else 1:3 if t else 4] #x = sorted(x, key=lambda (x,y): x)[::-1][0:3] #x = u.rate_and_sort(data) #x = get_them_all_scored(u) x = any_2_dict(get_them_all()) print "User ", id print x id += 1
html = page + get_bottom(data) return html ######## ############ # example usage from user import test_users from geometry import Point print "\n\n\n\n\n\n\n\n\n\n" for u in test_users(1): # get bad weather bad = bad_weather(u, Point(51.0, -3.0), 1000.0) bad_4_map = get_singleton_connected(bad_weather(u, Point(51.0, -3.0), 1000.0)) print len(bad_4_map[0]) + len(bad_4_map[1]) print bad_4_map print "\n\n---\n\n" # get good weather good = good_weather(u, Point(51.0, -3.0), 1000.0) good_4_map = get_singleton_connected(good_weather(u, Point(51.0, -3.0), 1000.0)) print len(good_4_map[0]) + len(good_4_map[1]) print good_4_map print "\n\n---\n\n" # count types print count_types(bad) print count_types(good)