def obtain_tree(): #print 'twitter_helper.py/obtain_tree' all_cities = cities.US + cities.EU cities_names = [cities.short_name(c) for c in cities.NAMES] bboxes = [Bbox(city, name) for city, name in zip(all_cities, cities_names)] return build_tree(bboxes)
def valid_city(city): """Ensure city argument is valid""" import cities city = cities.short_name(city) if city == 'whole' or city in cities.SHORT_KEY: return city raise argparse.ArgumentTypeError('{} is not a known city'.format(city))
def obtain_tree(): all_cities = cities.US + cities.EU cities_names = [cities.short_name(c) for c in cities.NAMES] bboxes = [Bbox(city, name) for city, name in zip(all_cities, cities_names)] return build_tree(bboxes)