<commit_before>from framework.log import log

def getLocationDictionary(db):
    try:
        # TODO
        # this is temporary until actual scoring is determined
        sql = """select l.location_id, l.name, l.lat, l.lon, t.score from location l
                inner join temp_scores t on t.location_id = l.location_id
                order by location_id""";
        data = list(db.query(sql))
        
        locations = {}
        
        for item in data:
            locations[item.name] = {'location_id':item.location_id, 'lat':str(item.lat), 'lon':str(item.lon)}
            
        return locations
    except Exception, e:
        log.info("*** couldn't get or write locations")
        log.error(e)
        return None<commit_msg>fixed dynamic scores for map<commit_after>from framework.log import log

def getLocationDictionary(db):
    try:
        # TODO
        # this is temporary until actual scoring is determined
        sql = """select l.location_id, l.name, l.lat, l.lon, t.score from location l
                left join temp_scores t on t.location_id = l.location_id
                order by l.location_id""";
        data = list(db.query(sql))
        
        locations = {}
        
        for item in data:
            locations[item.name] = {'location_id':item.location_id, 'lat':str(item.lat), 'lon':str(item.lon), 'score': (item.score if item.score else 0)}
            
        return locations
    except Exception, e:
        log.info("*** couldn't get or write locations")
        log.error(e)
        return None
{'fraction_non_alphanumeric': 0.10617760617760617, 'fraction_numerical': 0.0006435006435006435, 'mean_word_length': 2.061023622047244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4600552', 'n_tokens_mistral': 442, 'n_tokens_neox': 432, 'n_words': 131}