<commit_before>#!/usr/bin/env python

import re

import requests
from bs4 import BeautifulSoup

template = (
"""define service {
       use                      generic-service
       host_name                qc.ca
       service_description      Check http for %s.qc.ca
       check_command            check_http
}
""")

def get_hosts_list():
    url = 'http://gouv.qc.ca/portail/quebec/pgs/commun/gouv/minorg/?lang=fr'
    html = requests.get(url).content
    soup = BeautifulSoup(html)
    hosts = soup.find_all('a', href=re.compile('.qc.ca'))
    res = set()
    for host in hosts:
        r = re.search('://((.*).qc.ca)', host['href'])
        if r is not None:
            res.add(r.group(2))
    print res
    return res

def main():
    for host in get_hosts_list():
        print template % host
<commit_msg>yeah remove useless print<commit_after>#!/usr/bin/env python

import re

import requests
from bs4 import BeautifulSoup

template = (
"""define service {
       use                      generic-service
       host_name                qc.ca
       service_description      Check http for %s.qc.ca
       check_command            check_http
}
""")

def get_hosts_list():
    url = 'http://gouv.qc.ca/portail/quebec/pgs/commun/gouv/minorg/?lang=fr'
    html = requests.get(url).content
    soup = BeautifulSoup(html)
    hosts = soup.find_all('a', href=re.compile('.qc.ca'))
    res = set()
    for host in hosts:
        r = re.search('://((.*).qc.ca)', host['href'])
        if r is not None:
            res.add(r.group(2))
    
    return res

def main():
    for host in get_hosts_list():
        print template % host

{'fraction_non_alphanumeric': 0.13072693952351863, 'fraction_numerical': 0.002443494196701283, 'mean_word_length': 2.0847457627118646, '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': '6479664', 'n_tokens_mistral': 547, 'n_tokens_neox': 524, 'n_words': 127}