<s> from api_keys import GOOGLE_API_KEY <EOL> from business import Business , make_request <EOL> SEARCH_URL = '<STR_LIT>' <EOL> PLACE_URL = '<STR_LIT>' <EOL> def search ( lat , lng , distance ) : <EOL> """<STR_LIT>""" <EOL> url = SEARCH_URL . format ( lat , lng , distance , GOOGLE_API_KEY ) <EOL> place_list = [ ] <EOL> try : <EOL> data = make_request ( url ) <EOL> for result in data [ '<STR_LIT>' ] : <EOL> place = search_place ( result [ '<STR_LIT>' ] ) <EOL> place_list . append ( place ) <EOL> except Exception , e : <EOL> print e <EOL> return place_list <EOL> def search_place ( place_id ) : <EOL> """<STR_LIT>""" <EOL> url = PLACE_URL . format ( place_id , GOOGLE_API_KEY ) <EOL> try : <EOL> data = make_request ( url ) <EOL> place = data [ '<STR_LIT:result>' ] <EOL> return Business ( place [ '<STR_LIT:name>' ] , <EOL> place [ '<STR_LIT>' ] . split ( '<STR_LIT:U+002C>' ) [ <NUM_LIT:0> ] , <EOL> place [ '<STR_LIT>' ] , <EOL> place [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' ) <EOL> except Exception , e : <EOL> print e </s>
