<commit_before>#!/usr/bin/python

from xml.dom.minidom import parse
import xml.dom.minidom
import sys, getopt
import os

inputfile = ''
exceptionfile = ""

def main(argv):

	global inputfile
	global exceptionfile

	try:
      		opts, args = getopt.getopt(argv,"hi:e:",["inputFile=","exceptionFile"])
	except getopt.GetoptError:
		print 'android_resource_cleaner.py -i <inputfile> -'
		sys.exit(2)
	for opt, arg in opts:
		if opt == '-h':
         		print 'android_resource_cleaner.py -i <inputfile>'
        		sys.exit()
     		elif opt in ("-i", "--inputFile"):
         		inputfile = arg
		elif opt in ("-e", "--exceptionFile"):
			exceptionfile = arg


def xmlParser(inputfile,exceptionfile):

	if not inputfile:
		print 'please enter input file path'
		return 

	DOMTree = xml.dom.minidom.parse(inputfile)
	issuesCollection = DOMTree.documentElement
	
	#exception set
	exceptionSet = set()

	# initialize the exception set with file names
	if exceptionfile:
		fileNames = file(exceptionfile).read().split()
		for fileName in fileNames:
			exceptionSet.add(fileName)
		
	# Get all the issues in the collection
	issues = issuesCollection.getElementsByTagName("issue")
<commit_msg>help option updated with exception option<commit_after>#!/usr/bin/python

from xml.dom.minidom import parse
import xml.dom.minidom
import sys, getopt
import os

inputfile = ''
exceptionfile = ""

def main(argv):

	global inputfile
	global exceptionfile

	try:
      		opts, args = getopt.getopt(argv,"hi:e:",["inputFile=","exceptionFile"])
	except getopt.GetoptError:
		print 'android_resource_cleaner.py -i <inputfile> -'
		sys.exit(2)
	for opt, arg in opts:
		if opt == '-h':
         		print 'android_resource_cleaner.py -i <inputFile> -e <exceptionFile>'
        		sys.exit()
     		elif opt in ("-i", "--inputFile"):
         		inputfile = arg
		elif opt in ("-e", "--exceptionFile"):
			exceptionfile = arg


def xmlParser(inputfile,exceptionfile):

	if not inputfile:
		print 'please enter input file path'
		return 

	DOMTree = xml.dom.minidom.parse(inputfile)
	issuesCollection = DOMTree.documentElement
	
	#exception set
	exceptionSet = set()

	# initialize the exception set with file names
	if exceptionfile:
		fileNames = file(exceptionfile).read().split()
		for fileName in fileNames:
			exceptionSet.add(fileName)
		
	# Get all the issues in the collection
	issues = issuesCollection.getElementsByTagName("issue")

{'fraction_non_alphanumeric': 0.11406055578598093, 'fraction_numerical': 0.0008295313148071339, 'mean_word_length': 3.757396449704142, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '2104137', 'n_tokens_mistral': 814, 'n_tokens_neox': 771, 'n_words': 213}