<commit_before>import pyspeedtest

def download():
    st = pyspeedtest.SpeedTest()
    dl = st.download()
    dl = ((dl / 1024)/1024)
    return {"download speed":dl}

def upload():
    st = pyspeedtest.SpeedTest()
    ul = st.upload()
    ul = ((ul / 1024)/1024)
    return {"download speed":ul}<commit_msg>Added upload and latency tests<commit_after>import pyspeedtest
import importlib
import pip

try:
        importlib.import_module('pyspeedtest')
        import pyspeedtest
except ImportError:
        import pip
        pip.main(['install', 'pyspeedtest'])
        import pyspeedtest

def download():
    st = pyspeedtest.SpeedTest()
    dl = st.download()
    dl = ((dl / 1024)/1024)
    return {"download speed":dl}

def upload():
    st = pyspeedtest.SpeedTest()
    ul = st.upload()
    ul = ((ul / 1024)/1024)
    return {"upload speed":ul}

def latency():
    st = pyspeedtest.SpeedTest()
    ping = st.ping()
    return {"latency":ping}
{'fraction_non_alphanumeric': 0.13789473684210526, 'fraction_numerical': 0.03368421052631579, 'mean_word_length': 2.9790794979079496, 'pattern_counts': {'":': 5, '<': 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': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '862834', 'n_tokens_mistral': 338, 'n_tokens_neox': 316, 'n_words': 79}