<commit_before>import requests

from codecs import open

from argparse import ArgumentParser

try:
    import pypandoc
    pypandoc.get_pandoc_version()
except (ImportError) as e:
    raise e
except (OSError):
    # expects a installed pypandoc: pip install pypandoc
    from pypandoc.pandoc_download import download_pandoc
    download_pandoc()


def update_readme():
    url = "https://beta.craft.ai/content/api/python.md"
    r = requests.get(url)

    if r.status_code == 200:
        text = r.text
        with open("README.md", 'w', encoding="utf-8") as f:
            for line in text:
                f.write(line)
            print("Successfully updated README.md")

    # Conversion to rst
    try:
        import pypandoc
        readme = pypandoc.convert("README.md", "rst")
        readme = readme.replace("\r", "")
    except (OSError, ImportError) as e:<commit_msg>get python.md from www instead of beta<commit_after>import requests

from codecs import open

from argparse import ArgumentParser

try:
    import pypandoc
    pypandoc.get_pandoc_version()
except (ImportError) as e:
    raise e
except (OSError):
    # expects a installed pypandoc: pip install pypandoc
    from pypandoc.pandoc_download import download_pandoc
    download_pandoc()


def update_readme():
    url = "http://www.craft.ai/content/api/python.md"
    r = requests.get(url)

    if r.status_code == 200:
        text = r.text
        with open("README.md", 'w', encoding="utf-8") as f:
            for line in text:
                f.write(line)
            print("Successfully updated README.md")

    # Conversion to rst
    try:
        import pypandoc
        readme = pypandoc.convert("README.md", "rst")
        readme = readme.replace("\r", "")
    except (OSError, ImportError) as e:
{'fraction_non_alphanumeric': 0.10375771172181716, 'fraction_numerical': 0.00448681996634885, 'mean_word_length': 2.6707818930041154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1402381', 'n_tokens_mistral': 603, 'n_tokens_neox': 578, 'n_words': 155}