<commit_before>import re
import urllib3

http = urllib3.PoolManager()
response = http.request('GET', 'https://www.reserveamerica.com/explore/cape-henlopen-state-park/DE/360108/campsites?arrivalDate=2022-07-22&lengthOfStay=2&availStartDate=2022-07-22&pageNumber=0')

body = response.data.decode('utf-8')
site_titles_dirty = re.findall('<title>(.*)</title>', body)
site_titles = list(filter(lambda title: (',' in title), site_titles_dirty))
site_parsed = list(map(lambda s: s.split(', '), site_titles))

class Site:
        def __init__(self, name, type, available):
                self.name = name
                self.type = type
                self.available = available
        def __str__(self):
                return self.name + ':' + self.type + ':' + str(self.available)

type_code_by_name = {'Cabin': 'C', 'Tent Only': 'T', 'Standard': 'S'}

sites = list(map(lambda s: Site(s[0], type_code_by_name[s[1]], s[2] != 'Not Available'), site_parsed))

if len(sites) != 175:
        print('Unexpected number of sites ' + len(sites))

available_sites = list(filter(lambda site: site.available, sites))

if len(available_sites) > 0:
    sites_str = '\n'.join(str(e) for e in available_sites)
    print('Available of ' + str(len(available_sites)) + ': \n' + sites_str)
else:
        print('Nothing available')<commit_msg>Update henlopen.py<commit_after>import re
import urllib3
import winsound

http = urllib3.PoolManager()
response = http.request('GET', 'https://www.reserveamerica.com/explore/cape-henlopen-state-park/DE/360108/campsites?arrivalDate=2022-07-22&lengthOfStay=2&availStartDate=2022-07-22&pageNumber=0')

body = response.data.decode('utf-8')
site_titles_dirty = re.findall('<title>(.*)</title>', body)
site_titles = list(filter(lambda title: (',' in title), site_titles_dirty))
site_parsed = list(map(lambda s: s.split(', '), site_titles))

class Site:
        def __init__(self, name, type, available):
                self.name = name
                self.type = type
                self.available = available
        def __str__(self):
                return self.name + ':' + self.type + ':' + str(self.available)

type_code_by_name = {'Cabin': 'C', 'Tent Only': 'T', 'Standard': 'S'}

sites = list(map(lambda s: Site(s[0], type_code_by_name[s[1]], s[2] != 'Not Available'), site_parsed))

if len(sites) != 175:
        print('Unexpected number of sites ' + len(sites))

available_sites = list(filter(lambda site: site.available, sites))

if len(available_sites) > 0:
    sites_str = '\n'.join(str(e) for e in available_sites)
    print('Available of ' + str(len(available_sites)) + ': \n' + sites_str)
    winsound.Beep(440, 5000)
else:
        print('Nothing available')
{'fraction_non_alphanumeric': 0.16307578008915305, 'fraction_numerical': 0.02786032689450223, 'mean_word_length': 3.914233576642336, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '6858557', 'n_tokens_mistral': 986, 'n_tokens_neox': 926, 'n_words': 186}