<commit_before>#!/usr/bin/python
#
# (C) Legoktm 2008-2009, MIT License
# 
import cgitb; cgitb.enable()
import cgi, sys, urllib2, re, time
import monobook
print "Content-Type: text/html\n"

months = {
	'1':'01',
	'2':'02',
	'3':'03',
	'4':'04',
	'5':'05',
	'6':'06',
	'7':'07',
	'8':'08',
	'9':'09',
	'10':'10',
	'11':'11',
	'12':'12',
}
subpagelink = '<div id="contentSub"><span class="subpages">&lt; <a href="http://toolserver.org/~legoktm/cgi-bin/reflinks.py" title="reflinks.py">Template filler</a></span></div>'

def gettitle(url, errorrep = False):
	try:
		check = urllib2.urlopen(url)
		error = False
		import BeautifulSoup
		soup = BeautifulSoup.BeautifulSoup(check)
		print soup.title.string

		return title
	except urllib2.HTTPError, e:
		error = e
		#print error
		title = internetarch(url)
		if title:
			return title
		if errorrep:
			return error
		return False
#		sys.exit()
#		title = internetarch(url)

	
def deahref(text):
	text = re.findall('<a(.*?)>(.*?)</a>', text)
	try:
		return text[0][1]
	except IndexError:<commit_msg>fix return error<commit_after>#!/usr/bin/python
#
# (C) Legoktm 2008-2009, MIT License
# 
import cgitb; cgitb.enable()
import cgi, sys, urllib2, re, time
import monobook
print "Content-Type: text/html\n"

months = {
	'1':'01',
	'2':'02',
	'3':'03',
	'4':'04',
	'5':'05',
	'6':'06',
	'7':'07',
	'8':'08',
	'9':'09',
	'10':'10',
	'11':'11',
	'12':'12',
}
subpagelink = '<div id="contentSub"><span class="subpages">&lt; <a href="http://toolserver.org/~legoktm/cgi-bin/reflinks.py" title="reflinks.py">Template filler</a></span></div>'

def gettitle(url, errorrep = False):
	try:
		check = urllib2.urlopen(url)
		error = False
		import BeautifulSoup
		soup = BeautifulSoup.BeautifulSoup(check)
		print soup.title.string
		return soup.title.string
	except urllib2.HTTPError, e:
		error = e
		#print error
		title = internetarch(url)
		if title:
			return title
		if errorrep:
			return error
		return False
#		sys.exit()
#		title = internetarch(url)

	
def deahref(text):
	text = re.findall('<a(.*?)>(.*?)</a>', text)
	try:
		return text[0][1]
	except IndexError:
{'fraction_non_alphanumeric': 0.20361560418648905, 'fraction_numerical': 0.049476688867745006, 'mean_word_length': 4.364795918367347, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '3742175', 'n_tokens_mistral': 974, 'n_tokens_neox': 860, 'n_words': 181}