<commit_before>import requests
from bs4 import BeautifulSoup


CAPO_URL = 'http://www.capogirogelato.com/flavors.php'
location_numbers = {}
location_numbers['13th Street'] = '1'
location_numbers['Rittenhouse'] = '2'
location_numbers['CapoYunk'] = '3'
location_numbers['CapoPenn'] = '4'


def get_flavor_html(location):
    """Returns a location's daily flavor list HTML."""
    if not location in location_numbers.keys():
        return None

    payload = {'location': location_numbers[location]}
    flavor_html = requests.get(CAPO_URL,params = payload)
    
    if flavor_html.status_code == 200:
        return flavor_html.text
    else:
        return None

def extract_flavors(location, html):
    """Takes HTML and returns dictionary flavor info"""
    flavor_info = {}

    soup = BeautifulSoup(html,'html.parser')

    flavors = soup.find_all('td','flavorbox')
    for flavor in flavors:
        flavor_name = flavor.contents[0].contents[0]
        try:
            flavor_description = flavor.contents[1].contents[0].contents[0]
        except:
            flavor_description = None
        flavor_info[flavor_name] = flavor_description

    return flavor_info

def get_location_flavors(location):
    """Returns a location's daily flavor list as a dict"""
    flavor_html = get_flavor_html(location)
    flavors = extract_flavors(location,flavor_html)
    return flavors

def get_daily_flavors():
    """Returns dict of locations : flavors available today."""
    daily_flavors = {}
    for location in location_numbers.keys():
        daily_flavors[location] = get_location_flavors(location)
    return daily_flavors



if __name__ == '__main__':
    pass
<commit_msg>Added function to print location names<commit_after>import requests
from bs4 import BeautifulSoup


CAPO_URL = 'http://www.capogirogelato.com/flavors.php'
location_numbers = {}
location_numbers['13th Street'] = '1'
location_numbers['Rittenhouse'] = '2'
location_numbers['CapoYunk'] = '3'
location_numbers['CapoPenn'] = '4'

def locations():
    for location in locations.keys():
        print(location)

def get_flavor_html(location):
    """Returns a location's daily flavor list HTML."""
    if not location in location_numbers.keys():
        return None

    payload = {'location': location_numbers[location]}
    flavor_html = requests.get(CAPO_URL,params = payload)
    
    if flavor_html.status_code == 200:
        return flavor_html.text
    else:
        return None

def extract_flavors(location, html):
    """Takes HTML and returns dictionary flavor info"""
    flavor_info = {}

    soup = BeautifulSoup(html,'html.parser')

    flavors = soup.find_all('td','flavorbox')
    for flavor in flavors:
        flavor_name = flavor.contents[0].contents[0]
        try:
            flavor_description = flavor.contents[1].contents[0].contents[0]
        except:
            flavor_description = None
        flavor_info[flavor_name] = flavor_description

    return flavor_info

def get_location_flavors(location):
    """Returns a location's daily flavor list as a dict"""
    flavor_html = get_flavor_html(location)
    flavors = extract_flavors(location,flavor_html)
    return flavors

def get_daily_flavors():
    """Returns dict of locations : flavors available today."""
    daily_flavors = {}
    for location in location_numbers.keys():
        daily_flavors[location] = get_location_flavors(location)
    return daily_flavors
{'fraction_non_alphanumeric': 0.10455607476635514, 'fraction_numerical': 0.008761682242990653, 'mean_word_length': 3.7372060857538036, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1471601', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1031, 'n_words': 244}