<commit_before>import subprocess
from datetime import datetime, timedelta
import time
import sched, time
import autoremote
import platform

is_windows = any(platform.win32_ver())

lasthostips = None

hostips = {
    "192.168.1.11": None,
    "192.168.1.12": None,
    "192.168.1.13": None,
    "192.168.1.50": None,
    "192.168.1.51": None,
    "192.168.1.52": None,
    "192.168.1.53": None,
    "192.168.1.54": None,
    "192.168.1.55": None}

# check every X minutes
def timer(sc):
    scanhost()
    sc.enter(5, 1, timer, (sc,))

def isOnLine(ip=None):
    if is_windows:
        output = subprocess.Popen(["ping", "-n", "1", ip],stdout = subprocess.PIPE).communicate()[0]
    else:
        output = subprocess.Popen(["ping", "-C", "1", ip],stdout = subprocess.PIPE).communicate()[0]
    if ('unreachable' in output):
        return False
    else:
        return True

def scanhost():
    global lasthostips
    for ip in hostips:
        if isOnLine (ip) == True:
            hostips[ip] = "Online"
        else:
            hostips[ip] = "Offline"
    if hostips != lasthostips:
        lasthostips = hostips
        for ip in hostips:<commit_msg>Fixed linux ping command line<commit_after>import subprocess
from datetime import datetime, timedelta
import time
import sched, time
import autoremote
import platform

is_windows = any(platform.win32_ver())

lasthostips = None

hostips = {
    "192.168.1.11": None,
    "192.168.1.12": None,
    "192.168.1.13": None,
    "192.168.1.50": None,
    "192.168.1.51": None,
    "192.168.1.52": None,
    "192.168.1.53": None,
    "192.168.1.54": None,
    "192.168.1.55": None}

# check every X minutes
def timer(sc):
    scanhost()
    sc.enter(5, 1, timer, (sc,))

def isOnLine(ip=None):
    if is_windows:
        output = subprocess.Popen(["ping", "-n", "1", ip],stdout = subprocess.PIPE).communicate()[0]
    else:
        output = subprocess.Popen(["ping", "-c", "1", ip],stdout = subprocess.PIPE).communicate()[0]
    if ('unreachable' in output):
        return False
    else:
        return True

def scanhost():
    global lasthostips
    for ip in hostips:
        if isOnLine (ip) == True:
            hostips[ip] = "Online"
        else:
            hostips[ip] = "Offline"
    if hostips != lasthostips:
        lasthostips = hostips
        for ip in hostips:
{'fraction_non_alphanumeric': 0.15219260533104043, 'fraction_numerical': 0.0765262252794497, 'mean_word_length': 2.6302652106084246, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 18, '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': '6865830', 'n_tokens_mistral': 937, 'n_tokens_neox': 836, 'n_words': 207}