<commit_before>from subprocess import check_output, CalledProcessError
import re
import time

ips_to_ping = ['8.8.8.8', '192.168.1.1']
sleep_seconds = 15 * 60

while(True):
    print(time.strftime("%Y-%m-%d %H:%M:%S") + " --------")
    commands = ['ping -c 4 ' + ip for ip in ips_to_ping]
    try:
        outs = [check_output(cmd.split()) for cmd in commands]
    except CalledProcessError:
        print('one or both pings returned error, poss because 0 packets')
        ### wpa_cli reassociate
        time.sleep(sleep_seconds)
        continue
    for j, b in enumerate(outs):<commit_msg>actual use of wpa_cli to reassociate<commit_after>## usage:
##    python3 check_wifi.py

from subprocess import check_output, CalledProcessError
import re
import time

ips_to_ping = ['8.8.8.8', '192.168.1.1']
sleep_seconds = 15 * 60

while(True):
    print(time.strftime("%Y-%m-%d %H:%M:%S") + " --------")
    commands = ['ping -c 4 ' + ip for ip in ips_to_ping]
    try:
        outs = [check_output(cmd.split()) for cmd in commands]
    except CalledProcessError:
        print('one or both pings returned error, poss because 0 packets')
        output = check_output(['wpa_cli', 'reassociate'])
        print('wpa_cli says ' + str(output))
        time.sleep(sleep_seconds)
        continue
    for j, b in enumerate(outs):
{'fraction_non_alphanumeric': 0.14080242240726723, 'fraction_numerical': 0.028009084027252083, 'mean_word_length': 3.080246913580247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '2073244', 'n_tokens_mistral': 464, 'n_tokens_neox': 431, 'n_words': 122}