<commit_before>import os.path, subprocess
from distutils.version import LooseVersion
import sys

print(sys.executable)
# check python modules

import pip
def install(package):
    pip.main(['install', package])

def check_module(moduleName, version):
	try: 
		module = __import__(moduleName,globals(), locals(), [], -1)
		ver = module.__version__
		del module
		isGoodVersion = LooseVersion(ver) >= LooseVersion(version)
		if isGoodVersion:
			print moduleName + " version :" + str(ver) + " >= " + version
			return ""
		else:
			print moduleName + " version :" + str(ver) + " <  " + version + " (needs update!)"
			return moduleName + "==" + version
	except ImportError:
		print moduleName + " not installed"
		return moduleName + "==" + version

moduleChecks = []
print "now checking for required python modules:"
moduleChecks.append(check_module("numpy","1.9.0"))
moduleChecks.append(check_module("pandas","0.15.0"))
moduleChecks.append(check_module("patsy","0.3.0"))
# moduleChecks.append(check_module("python-dateutil","2.2"))
moduleChecks.append(check_module("pytz","2014.7"))
moduleChecks.append(check_module("scipy","0.15.1"))
moduleChecks.append(check_module("simplejson","3.8.0"))
moduleChecks.append(check_module("six","1.8.0"))
moduleChecks.append(check_module("statsmodels","0.6.1"))
# moduleChecks.append(check_module("virtualenv","13.1.0"))
moduleChecks = filter(lambda x: len(x)>0, moduleChecks) # filter only modules that
print ""
print str(len(moduleChecks)) + " modules need installation/updating\n"

python_is_ok = True
if len(moduleChecks) > 0:	
	print "would now run the following commands:"
	for package in moduleChecks:
		print "pip install " + package
	print "do you want to install those " + str(len(moduleChecks)) + " modules? (type yes)"
	ans = raw_input()
	if not ans.lower() in ["yes"]:
		print "\nyou chose not to, continuing.. "<commit_msg>add argeparse<commit_after>import os.path, subprocess
from distutils.version import LooseVersion
import sys

print(sys.executable)
# check python modules

import pip
def install(package):
    pip.main(['install', package])

def check_module(moduleName, version):
	try: 
		module = __import__(moduleName,globals(), locals(), [], -1)
		ver = module.__version__
		del module
		isGoodVersion = LooseVersion(ver) >= LooseVersion(version)
		if isGoodVersion:
			print moduleName + " version :" + str(ver) + " >= " + version
			return ""
		else:
			print moduleName + " version :" + str(ver) + " <  " + version + " (needs update!)"
			return moduleName + "==" + version
	except ImportError:
		print moduleName + " not installed"
		return moduleName + "==" + version

moduleChecks = []
print "now checking for required python modules:"
moduleChecks.append(check_module("argparse","1.4.0"))
moduleChecks.append(check_module("numpy","1.9.0"))
moduleChecks.append(check_module("pandas","0.15.0"))
moduleChecks.append(check_module("patsy","0.3.0"))
# moduleChecks.append(check_module("python-dateutil","2.2"))
moduleChecks.append(check_module("pytz","2014.7"))
moduleChecks.append(check_module("scipy","0.15.1"))
moduleChecks.append(check_module("simplejson","3.8.0"))
moduleChecks.append(check_module("six","1.8.0"))
moduleChecks.append(check_module("statsmodels","0.6.1"))
# moduleChecks.append(check_module("virtualenv","13.1.0"))
moduleChecks = filter(lambda x: len(x)>0, moduleChecks) # filter only modules that
print ""
print str(len(moduleChecks)) + " modules need installation/updating\n"

python_is_ok = True
if len(moduleChecks) > 0:	
	print "would now run the following commands:"
	for package in moduleChecks:
		print "pip install " + package
	print "do you want to install those " + str(len(moduleChecks)) + " modules? (type yes)"
	ans = raw_input()
	if not ans.lower() in ["yes"]:
		print "\nyou chose not to, continuing.. "
{'fraction_non_alphanumeric': 0.15534491837809372, 'fraction_numerical': 0.020273828330700367, 'mean_word_length': 5.618466898954704, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '6676193', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1246, 'n_words': 280}