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

import requests as req, zipfile, io, markdown2 as md, sqlite3, os, shutil

html_tmpl = """<html><head><link rel="stylesheet" type="text/css" href="../style.css"/></head><body><section id="tldr"><div id="page">%content%</div></section></body></html>"""

doc_source = "https://github.com/tldr-pages/tldr/archive/master.zip"
doc_source         = "http://localhost:8000/tldr-master.zip"
docset_path        = "tldrpages.docset"
doc_path_contents  = docset_path + "/Contents/"
doc_path_resources = docset_path + "/Contents/Resources/"
doc_path           = docset_path + "/Contents/Resources/Documents/"
doc_pref           = "tldr-master/pages"

if os.path.exists(doc_path):
    try: shutil.rmtree(doc_path)
    except OSError as e:
        print("Could not delete dirs " + e.strerror)
        raise SystemExit
os.makedirs(doc_path)

try: r = req.get(doc_source)
except req.exceptions.ConnectionError:<commit_msg>fix test url.<commit_after>#!/usr/bin/env python3

import requests as req, zipfile, io, markdown2 as md, sqlite3, os, shutil

html_tmpl = """<html><head><link rel="stylesheet" type="text/css" href="../style.css"/></head><body><section id="tldr"><div id="page">%content%</div></section></body></html>"""

doc_source         = "https://github.com/tldr-pages/tldr/archive/master.zip"
docset_path        = "tldrpages.docset"
doc_path_contents  = docset_path + "/Contents/"
doc_path_resources = docset_path + "/Contents/Resources/"
doc_path           = docset_path + "/Contents/Resources/Documents/"
doc_pref           = "tldr-master/pages"

if os.path.exists(doc_path):
    try: shutil.rmtree(doc_path)
    except OSError as e:
        print("Could not delete dirs " + e.strerror)
        raise SystemExit
os.makedirs(doc_path)

try: r = req.get(doc_source)
except req.exceptions.ConnectionError:
{'fraction_non_alphanumeric': 0.15949918345127925, 'fraction_numerical': 0.005443658138268917, 'mean_word_length': 4.021857923497268, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, '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': '169637', 'n_tokens_mistral': 646, 'n_tokens_neox': 634, 'n_words': 117}