<s> sys . path . append ( "<STR_LIT>" ) <EOL> from CIP . logic import geometry_topology_data as gtd <EOL> from CIP . logic import Util <EOL> import os <EOL> import os . path <EOL> import re <EOL> wrong_cases_path = "<STR_LIT>" <EOL> xmls_path = "<STR_LIT>" <EOL> results_path = "<STR_LIT>" <EOL> current_case = "<STR_LIT>" <EOL> caseIds = dict ( ) <EOL> for file_name in os . listdir ( wrong_cases_path ) : <EOL> if Util . get_file_extension ( file_name ) != "<STR_LIT>" : <EOL> continue <EOL> expr = "<STR_LIT>" <EOL> r = re . match ( expr , file_name ) <EOL> caseId = r . group ( "<STR_LIT>" ) <EOL> point = int ( r . group ( "<STR_LIT>" ) ) <EOL> if not caseIds . has_key ( caseId ) : <EOL> caseIds [ caseId ] = [ ] <EOL> caseIds [ caseId ] . append ( point ) <EOL> for caseId , excludedPoints in caseIds . iteritems ( ) : <EOL> geom = gtd . GeometryTopologyData . from_xml_file ( os . path . join ( xmls_path , caseId + "<STR_LIT>" ) ) <EOL> newPoints = [ ] <EOL> for i in range ( len ( geom . points ) ) : <EOL> if i not in excludedPoints : <EOL> newPoints . append ( geom . points [ i ] ) <EOL> geom . points = newPoints <EOL> geom . to_xml_file ( os . path . join ( results_path , caseId + "<STR_LIT>" ) ) <EOL> print ( "<STR_LIT>" . format ( caseId , len ( excludedPoints ) ) ) </s>
