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

__author__ = "<NAME> <<EMAIL>>"
__version__ = "0.1"
__date__ = "Tue, 21 Nov 2006 22:54:11 +0100"
__copyright__ = "Copyright (c) 2006 <NAME>"
__license__ = "GPL"

from mod_python import apache
from email.Utils import formatdate
import pickle, telnetlib, time, os, sys

def ping(host, timeout = 1):
	cmd = "ping -c 5 -W %d %s >/dev/null" % (timeout, host)
	return not os.system(cmd)

class Rss:
	def __init__(self, req, title, link, desc):
		self.req = req
		self.title = title
		self.desc = desc
		self.link = link
		self.items = []
	def additem(self, title, author, pubDate):<commit_msg>send 5 packets: > 40% is ok idea from ironiq<commit_after>#!/usr/bin/env python

__author__ = "<NAME> <<EMAIL>>"
__version__ = "0.1"
__date__ = "Tue, 21 Nov 2006 22:54:11 +0100"
__copyright__ = "Copyright (c) 2006 <NAME>"
__license__ = "GPL"

from mod_python import apache
from email.Utils import formatdate
import pickle, telnetlib, time, os, sys, re

def ping(host, timeout = 1):
	sock = os.popen("ping -c 5 -W %d %s" % (timeout, host))
	for i in sock.readlines():
		if re.match(".*packets transmitted", i):
			percent = re.sub(r'.*received, (.*)% packet.*', r'\1', i.strip())
			break
	if int(percent) > 40:
		return False
	else:
		return True

class Rss:
	def __init__(self, req, title, link, desc):
		self.req = req
		self.title = title
		self.desc = desc
		self.link = link
		self.items = []
	def additem(self, title, author, pubDate):
{'fraction_non_alphanumeric': 0.1534788540245566, 'fraction_numerical': 0.036834924965893585, 'mean_word_length': 4.006825938566553, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, 'https://': 0, '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': '7574275', 'n_tokens_mistral': 613, 'n_tokens_neox': 541, 'n_words': 174}