Module Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias identifier Import alias Import alias identifier Import alias Import alias Import alias Assign NameStore Str FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Str keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr ListLoad Str keyword NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str keyword NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body If CompareEq Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad body Assign NameStore Str Expr Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareLt NameLoad Num body Assign NameStore BinOpMod Str NameLoad Print Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad Print Str Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad Print Str For NameStore ListLoad NameLoad NameLoad NameLoad body Assign NameStore BinOpMod Str NameLoad Print BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Str Expr Call AttributeLoad NameLoad attr Print Str If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr Str If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr Str If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str Str Str BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str Str Str BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str Str Str BinOpMod Str NameLoad Print Str Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Str If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr Str If Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases body FunctionDef arguments args NameParam NameParam defaults Dict kwarg body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore SubscriptLoad NameLoad Index Num If CompareEq Call NameLoad NameLoad Num body If CompareIn NameLoad AttributeLoad NameLoad attr body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse If BoolOpAnd Call NameLoad NameLoad NameLoad Call NameLoad Call NameLoad NameLoad NameLoad body Return Call Call NameLoad NameLoad NameLoad orelse Raise Call NameLoad NameLoad orelse Assign NameStore SubscriptLoad NameLoad Index Num If CompareIn NameLoad AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse Assign NameStore Call NameLoad NameLoad NameLoad Return Call NameLoad Call AttributeLoad NameLoad attr ListLoad NameLoad decorator_list decorator_list ClassDef bases body FunctionDef arguments args NameParam NameParam defaults ListLoad body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Str attr ListComp BinOpMod AttributeLoad NameLoad attr NameLoad comprehension NameStore AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore Str decorator_list ClassDef bases NameLoad body Assign NameStore Str decorator_list ClassDef bases NameLoad body Assign NameStore Str decorator_list ClassDef bases NameLoad body Assign NameStore Str decorator_list ClassDef bases NameLoad body Assign NameStore Str decorator_list ClassDef bases NameLoad body Assign NameStore Str decorator_list ClassDef bases NameLoad body Assign NameStore Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMod Str NameLoad Assign NameStore Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad keyword BinOpMod Str NameLoad keyword BinOpMod Str NameLoad keyword Str keyword ListLoad keyword NameLoad keyword ListLoad Dict Str Str Str Str Str Str keyword NameLoad keyword ListLoad Dict Str Str Str Str Str Str Str Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad BinOpBitOr BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMod Str NameLoad Assign NameStore Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad keyword BinOpMod Str NameLoad keyword BinOpMod Str NameLoad keyword Str keyword ListLoad keyword NameLoad keyword ListLoad keyword NameLoad keyword ListLoad Dict Str Str Str Str Str Str Str Str Str Str Str Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad BinOpBitOr BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore BinOpMod Str NameLoad Assign NameStore ListLoad Dict Str Str Str Str Str Call NameLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num Str Str NameLoad Dict Str Str Str Str Str Call NameLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num Str Str NameLoad Dict Str Str Str Str Str Call NameLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num Str Str NameLoad Dict Str Str Str Str Str Call NameLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num Str Str NameLoad Assign NameStore ListLoad Dict Str Str Str Str Str Call NameLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num Str Str NameLoad Assign NameStore Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword ListLoad Dict Str Str Str Str Str Str Str Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad BinOpBitOr BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore ListLoad Num Num Num Num Num Num Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad keyword Str decorator_list ClassDef bases NameLoad body Assign NameStore Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Num NameLoad Num Num Num Num Num Num Num Num Num Str body Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str If CompareEq NameLoad NameLoad body Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str If CompareEq NameLoad Num body Assign NameStore Str Assign NameStore Str If CompareEq NameLoad Num body Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Call NameLoad Call NameLoad BinOpDiv NameLoad Call NameLoad NameLoad Assign NameStore Call NameLoad Call NameLoad BinOpMult BinOpDiv NameLoad Call NameLoad NameLoad Num Assign NameStore Call NameLoad Call NameLoad BinOpMult BinOpDiv NameLoad Call NameLoad NameLoad Num Assign NameStore Call NameLoad Call NameLoad BinOpDiv NameLoad Call NameLoad NameLoad Assign NameStore Call NameLoad Call NameLoad BinOpMult BinOpDiv NameLoad Call NameLoad NameLoad Num Assign NameStore Call NameLoad Call NameLoad BinOpMult BinOpDiv NameLoad Call NameLoad NameLoad Num Assign NameStore Call NameLoad Call NameLoad BinOpDiv NameLoad Call NameLoad NameLoad Assign NameStore Call NameLoad Call NameLoad BinOpMult BinOpDiv NameLoad Call NameLoad NameLoad Num Assign NameStore Call NameLoad Call NameLoad BinOpMult BinOpDiv NameLoad Call NameLoad NameLoad Num Assign NameStore Str Assign NameStore Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad BinOpBitOr BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword NameLoad keyword Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If CompareGt BinOpAdd BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num body Assign AttributeStore NameLoad attr NameLoad Assign NameStore BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareNotEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If BoolOpOr CompareEq NameLoad Num CompareEq NameLoad Num CompareEq NameLoad Num CompareEq NameLoad Num body Print Str Raise NameLoad If AttributeLoad NameLoad attr body Print Str Expr Call NameLoad If AttributeLoad NameLoad attr body Print Str Expr Call NameLoad If AttributeLoad NameLoad attr body Print Str Expr Call NameLoad Str Expr Call NameLoad Str Expr Call NameLoad Str Expr Call NameLoad Str Expr Call NameLoad Str Expr Call NameLoad Str If AttributeLoad NameLoad attr body Print Str Expr Call NameLoad NameLoad Print Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str If BoolOpOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Print Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Assign NameStore SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call NameLoad Str Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Print Str Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr If CompareEq NameLoad Num body Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Str Str Str AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad NameLoad attr body Print Str Expr Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Num keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad If AttributeLoad NameLoad attr body Print Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr ListLoad Str Expr Call AttributeLoad NameLoad attr ListLoad Str keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse Print Str Print Str Print Str Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str
N/A N/A re N/A sys N/A glob N/A commands N/A os N/A stat N/A subprocess N/A zipfile N/A rpy2.robjects robjects N/A shutil N/A psycopg2 dbapi2 N/A optparse N/A string N/A time N/A PUBLICMAPPINGPASS publicmapping clear_publicmapping_db N/A N/A N/A N/A N/A db N/A N/A dbapi2 connect database publicmapping user publicmapping password PUBLICMAPPINGPASS N/A cur N/A N/A db cursor N/A redtable N/A redistricting_characteristic redistricting_computedcharacteristic redistricting_computeddistrictscore redistricting_computedplanscore redistricting_contiguityoverride redistricting_district redistricting_geolevel redistricting_geounit redistricting_legislativebody redistricting_legislativedefault redistricting_legislativelevel redistricting_plan redistricting_profile redistricting_scoreargument redistricting_scoredisplay redistricting_scorefunction redistricting_scorepanel redistricting_scorepanel_displays redistricting_scorepanel_score_functions redistricting_subject redistricting_target redistricting_validationcriteria N/A i redtable N/A N/A N/A N/A cur execute N/A truncate table %s CASCADE i N/A N/A N/A db commit N/A N/A N/A db close N/A drop_db N/A N/A N/A N/A N/A olddir N/A N/A os getcwd N/A N/A N/A os chdir /tmp N/A N/A N/A subprocess check_call N/A service tomcat6 stop N/A N/A N/A subprocess check_call N/A service celeryd stop N/A N/A N/A subprocess check_call N/A service apache2 stop N/A N/A N/A subprocess check_call N/A service apache2 restart N/A N/A N/A subprocess check_call N/A service postgresql restart N/A N/A N/A subprocess check_call N/A su postgres -c "dropdb publicmapping" shell True N/A N/A N/A subprocess check_call N/A cat /projects/PublicMapping/DistrictBuilder/sql/publicmapping_db.sql | su postgres -c "psql -f - postgres" shell True N/A N/A N/A subprocess check_call N/A service apache2 start N/A N/A N/A subprocess check_call N/A service tomcat6 start N/A N/A N/A os chdir olddir N/A install_dependencies N/A N/A N/A N/A N/A N/A N/A N/A N/A os path exists /usr/bin/ogrinfo False N/A N/A cmdarg gdal-bin N/A N/A N/A subprocess check_call N/A apt-get install cmdarg N/A get_census_data N/A N/A stateFips N/A N/A N/A N/A stateFips 10 N/A N/A stateFips N/A 0%s stateFips N/A Retrieving census shapefiles... N/A olddir N/A N/A os getcwd N/A N/A N/A os chdir /projects/PublicMapping/data/ N/A cenBlockFilePrefix N/A tl_2010_%s_tabblock10 stateFips N/A cenTractFilePrefix N/A tl_2010_%s_tract10 stateFips N/A cenCountyFilePrefix N/A tl_2010_%s_county10 stateFips N/A cmdarg N/A ftp://ftp2.census.gov/geo/tiger/TIGER2010/TABBLOCK/2010/%s.zip cenBlockFilePrefix N/A N/A N/A subprocess check_call N/A wget -nc cmdarg N/A cmdarg N/A ftp://ftp2.census.gov/geo/tiger/TIGER2010/TRACT/2010/%s.zip cenTractFilePrefix N/A N/A N/A subprocess check_call N/A wget -N cmdarg N/A cmdarg N/A ftp://ftp2.census.gov/geo/tiger/TIGER2010/COUNTY/2010/%s.zip cenCountyFilePrefix N/A N/A N/A subprocess check_call N/A wget -N cmdarg N/A Retrieving additional data... N/A cmdarg N/A https://s3.amazonaws.com/redistricting_supplement_data/redist/%s_redist_data.zip stateFips N/A N/A N/A subprocess check_call N/A wget -N cmdarg N/A cmdarg N/A https://s3.amazonaws.com/redistricting_supplement_data/redist/%s_contiguity_overrides.csv stateFips N/A N/A N/A subprocess call N/A wget -N cmdarg N/A Unzipping files ... N/A i N/A cenBlockFilePrefix cenTractFilePrefix cenCountyFilePrefix N/A N/A zfile N/A %s.zip i N/A N/A Unzipping %s zfile N/A myzip N/A N/A zipfile ZipFile zfile r N/A N/A N/A myzip extractall N/A myzip N/A N/A zipfile ZipFile N/A %s_redist_data.zip stateFips r N/A N/A N/A myzip extractall N/A Reprojecting block shapefile... N/A N/A N/A N/A os path exists census_blocks.shp N/A N/A N/A N/A os remove census_blocks.shp N/A N/A N/A N/A os path exists census_tracts.shp N/A N/A N/A N/A os remove census_tracts.shp N/A N/A N/A N/A os path exists census_counties.shp N/A N/A N/A N/A os remove census_counties.shp N/A N/A N/A subprocess check_call N/A ogr2ogr -overwrite -t_srs EPSG:3785 census_blocks.shp N/A %s.shp cenBlockFilePrefix N/A N/A N/A subprocess check_call N/A ogr2ogr -overwrite -t_srs EPSG:3785 census_tracts.shp N/A %s.shp cenTractFilePrefix N/A N/A N/A subprocess check_call N/A ogr2ogr -overwrite -t_srs EPSG:3785 census_counties.shp N/A %s.shp cenCountyFilePrefix N/A Copying data files... N/A N/A N/A shutil copy N/A %s_redist_data.csv stateFips redist_data.csv N/A N/A N/A N/A os path exists redist_overrides.csv N/A N/A N/A N/A os remove redist_overrides.csv N/A N/A N/A N/A os path exists N/A %s_contiguity_overrides.csv stateFips N/A N/A N/A N/A shutil copy N/A %s_contiguity_overrides.csv stateFips redist_overrides.csv N/A N/A N/A os chdir olddir N/A DictionaryTemplate N/A N/A __init__ N/A N/A self dict N/A N/A keywords N/A N/A N/A self dict dict N/A N/A N/A N/A self dict update keywords N/A __str__ N/A N/A self N/A N/A N/A N/A N/A self _template self N/A __getitem__ N/A N/A self key N/A N/A N/A N/A N/A self _process N/A N/A key split | N/A _process N/A N/A self l N/A N/A N/A arg N/A l N/A 0 N/A N/A N/A len l 1 N/A N/A N/A arg N/A self dict N/A N/A N/A N/A self dict N/A arg N/A N/A N/A N/A hasattr self arg N/A callable N/A getattr self arg N/A N/A N/A N/A getattr self arg N/A N/A N/A KeyError arg N/A N/A func_name N/A l N/A 1 N/A N/A func_name N/A self dict N/A N/A func N/A N/A self dict N/A func_name N/A N/A func N/A getattr self func_name N/A N/A func N/A N/A self _process N/A arg N/A N/A ListTemplate N/A N/A __init__ N/A N/A self input_list N/A N/A N/A N/A N/A self input_list input_list N/A __str__ N/A N/A self N/A N/A N/A N/A N/A join N/A N/A N/A self _template x N/A x N/A self input_list N/A N/A Empty_Template N/A ListTemplate N/A N/A _template N/A SldList_Template N/A DictionaryTemplate N/A N/A _template <?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
  <NamedLayer>
    <Name>%(layername)s</Name>
    <UserStyle>
      <Title>%(layertitle)s</Title>
      <Abstract>%(layerabs)s</Abstract>
      <FeatureTypeStyle>
        %(slst|sli)s
        %(lst|li)s
        %(elst|eli)s
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>
       N/A Sld_Poly_Template N/A ListTemplate N/A N/A _template 
        <Rule>
          <Title>%(title)s</Title>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">%(fill)s</CssParameter>
              <CssParameter name="fill-opacity">%(fillopacity)s</CssParameter>            
	    </Fill>
          </PolygonSymbolizer>
        </Rule>
         N/A Sld_PolyB_Template N/A ListTemplate N/A N/A _template 
        <Rule>
          <Title>%(title)s</Title>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">%(fill)s</CssParameter>
              <CssParameter name="fill-opacity">%(fillopacity)s</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">%(stroke)s</CssParameter>
              <CssParameter name="stroke-width">%(strokewidth)s</CssParameter>
              <CssParameter name="stroke-opacity">%(strokeopacity)s</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
        </Rule>
         N/A Sld_Line_Template N/A ListTemplate N/A N/A _template 
        <Rule>
          <Title>%(title)s</Title>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">%(stroke)s</CssParameter>
              <CssParameter name="stroke-width">%(strokewidth)s</CssParameter>
              <CssParameter name="stroke-opacity">%(strokeopacity)s</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
         N/A Sld_Range_Template N/A ListTemplate N/A N/A _template 
        <Rule>
          <Title>%(bottom)s-%(top)s</Title>
          <ogc:Filter>
            <ogc:And>
              <ogc:PropertyIsLessThan>
                <ogc:PropertyName>%(unit)s</ogc:PropertyName>
                <ogc:Literal>%(top)s</ogc:Literal>
              </ogc:PropertyIsLessThan>
              <ogc:PropertyIsGreaterThanOrEqualTo>
                <ogc:PropertyName>%(unit)s</ogc:PropertyName>
                <ogc:Literal>%(bottom)s</ogc:Literal>
              </ogc:PropertyIsGreaterThanOrEqualTo>
            </ogc:And>
          </ogc:Filter>          
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">%(fill)s</CssParameter>
              <CssParameter name="fill-opacity">%(fillopacity)s</CssParameter>
            </Fill>
          </PolygonSymbolizer>
        </Rule>
         N/A Sld_URange_Template N/A ListTemplate N/A N/A _template 
        <Rule>
          <Title>%(bottom)s-%(top)s</Title>
          <ogc:Filter>
              <ogc:PropertyIsGreaterThanOrEqualTo>
                <ogc:PropertyName>%(unit)s</ogc:PropertyName>
                <ogc:Literal>%(bottom)s</ogc:Literal>
              </ogc:PropertyIsGreaterThanOrEqualTo>
          </ogc:Filter>          
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">%(fill)s</CssParameter>
              <CssParameter name="fill-opacity">%(fillopacity)s</CssParameter>
            </Fill>
          </PolygonSymbolizer>
        </Rule>
         N/A gensld_none N/A N/A geoname N/A N/A N/A target_file N/A /projects/PublicMapping/DistrictBuilder/sld/pmp:%s_none.sld geoname N/A f N/A open target_file w N/A N/A N/A f write N/A str N/A SldList_Template layername N/A %s No fill geoname layertitle N/A %s No Fill geoname layerabs A style showing the boundaries of a geounit with a transparent fill slst N/A sli Empty_Template lst N/A N/A title fill fillopacity Fill #FFFFFF 1.0 li Sld_Poly_Template elst N/A N/A title stroke strokewidth strokeopacity Boundary #555555 3.00 1.0 eli Sld_Line_Template N/A N/A N/A f write N/A N/A N/A f close N/A N/A N/A os chmod target_file N/A N/A N/A stat S_IRUSR N/A stat S_IRGRP N/A stat S_IROTH N/A gensld_boundaries N/A N/A geoname N/A N/A N/A target_file N/A /projects/PublicMapping/DistrictBuilder/sld/pmp:%s_boundaries.sld geoname N/A f N/A open target_file w N/A N/A N/A f write N/A str N/A SldList_Template layername N/A %s Boundaries geoname layertitle N/A %s Boundaries Only geoname layerabs A style showing the boundaries of a geounit slst N/A sli Empty_Template lst N/A li Empty_Template elst N/A N/A title fill fillopacity stroke strokewidth strokeopacity County Boundaries #000000 0.0 #2255FF 2 0.35 eli Sld_PolyB_Template N/A N/A N/A f write N/A N/A N/A f close N/A N/A N/A os chmod target_file N/A N/A N/A stat S_IRUSR N/A stat S_IRGRP N/A stat S_IROTH N/A gensld_choro N/A N/A geoname varname vartitle quantiles N/A N/A N/A N/A gensld_choro_internal geoname varname vartitle quantiles unit number N/A gensld_choro_internal N/A N/A geoname varname vartitle quantiles unit N/A number N/A N/A lvarname N/A N/A string lower varname N/A target_file N/A /projects/PublicMapping/DistrictBuilder/sld/pmp:%s_%s.sld N/A geoname lvarname N/A varabs N/A Grayscale choropleth based on quantiles of %s varname N/A valuelist N/A N/A top bottom fill fillopacity unit N/A str N/A quantiles N/A 4 N/A str N/A quantiles N/A 3 #444444 1.0 unit N/A top bottom fill fillopacity unit N/A str N/A quantiles N/A 3 N/A str N/A quantiles N/A 2 #777777 1.0 unit N/A top bottom fill fillopacity unit N/A str N/A quantiles N/A 2 N/A str N/A quantiles N/A 1 #AAAAAA 1.0 unit N/A top bottom fill fillopacity unit N/A str N/A quantiles N/A 1 N/A str N/A quantiles N/A 0 #EEEEEE 1.0 unit N/A svaluelist N/A N/A top bottom fill fillopacity unit N/A str N/A quantiles N/A 5 N/A str N/A quantiles N/A 4 #000000 1.0 unit N/A f N/A open target_file w N/A N/A N/A f write N/A str N/A SldList_Template layername lvarname layertitle vartitle layerabs varabs slst svaluelist sli Sld_URange_Template lst valuelist li Sld_Range_Template elst N/A N/A title stroke strokewidth strokeopacity Boundary #555555 0.25 1.0 eli Sld_Line_Template N/A N/A N/A f write N/A N/A N/A f close N/A N/A N/A os chmod target_file N/A N/A N/A stat S_IRUSR N/A stat S_IRGRP N/A stat S_IROTH N/A gensld_choro_denquint N/A N/A geoname varname vartitle dummy N/A N/A N/A quantiles N/A 0 0.2 0.4 0.6 0.8 1 N/A N/A gensld_choro_internal geoname varname vartitle quantiles unit percentage N/A Config_Template N/A DictionaryTemplate N/A N/A _template <!-- Define Internal Entities to avoid Repeated Entering of Values -->
<!DOCTYPE DistrictBuilder [
    <!ENTITY num_districts_congress "%(num_districts_congress)s">
    <!ENTITY num_districts_house "%(num_districts_house)s">
    <!ENTITY num_districts_senate "%(num_districts_senate)s">
    <!ENTITY pop_congress "%(pop_congress)s">
    <!ENTITY pop_house "%(pop_house)s">
    <!ENTITY pop_senate "%(pop_senate)s">
    <!ENTITY pop_congress_min "%(pop_congress_min)s">
    <!ENTITY pop_house_min "%(pop_house_min)s">
    <!ENTITY pop_senate_min "%(pop_senate_min)s">
    <!ENTITY pop_congress_max "%(pop_congress_max)s">
    <!ENTITY pop_house_max "%(pop_house_max)s">
    <!ENTITY pop_senate_max "%(pop_senate_max)s">
    <!ENTITY target_hisp_congress "%(target_hisp_congress)s">
    <!ENTITY target_hisp_senate "%(target_hisp_senate)s">
    <!ENTITY target_hisp_house "%(target_hisp_house)s">
    <!ENTITY target_bl_congress "%(target_bl_congress)s">
    <!ENTITY target_bl_senate "%(target_bl_senate)s">
    <!ENTITY target_bl_house "%(target_bl_house)s">
    <!ENTITY target_na_senate "%(target_na_senate)s">
    <!ENTITY target_na_house "%(target_na_house)s">
    <!ENTITY target_na_congress "%(target_na_congress)s">
 ]>

<DistrictBuilder>


    <!-- Define legislative bodies referenced in the system. -->
    <LegislativeBodies>
        <!-- A Legislative body has an ID (for referencing in GeoLevel
            definitions later), a name, and a label for plan items 
            ("District" for Congressional, etc) -->
        <LegislativeBody id="congress" name="Congressional" member="District %%s" maxdistricts="&num_districts_congress;"/>
        <LegislativeBody id="house" name="State House" member="District %%s" maxdistricts="&num_districts_house;" />
        <LegislativeBody id="senate" name="State Senate" member="District %%s" maxdistricts="&num_districts_senate;" />
    </LegislativeBodies>
    <!-- A list of subjects referenced in the system. -->
    <Subjects>       
	 <!-- A Subject is a measurement type, such as "Total Population".            
	 The subject is mapped to an attribute during the import phase,
            and contains a long and short display name. Subjects have IDs
            for referencing in GeoLevel definitions later. -->
        <Subject id="vap_b" field="VAP_B" name="African-American Voting Age Population" short_name="Black VAP " displayed="true" sortkey="1" percentage_denominator="vap" />
        <Subject id="vap_h" field="VAP_H" name="Hispanic or Latino voting age population" short_name="Hispanic VAP" displayed="true" sortkey="2" percentage_denominator="vap" />
        <Subject id="vap_na" field="VAP_NA" name="Native American Voting Age Population" short_name="Nat Amer VAP" displayed="true" sortkey="4" percentage_denominator="vap" />
        %(start_elec)s
        <Subject id="vote_dem" field="VOTE_DEM" name="num likely Democratic voters" short_name="Democratic voters" displayed="true" sortkey="3" percentage_denominator="vote_tot" />
        <Subject id="vote_rep" field="VOTE_REP" name="num likely Republican voters" short_name="Republican voters" displayed="true" sortkey="5" percentage_denominator="vote_tot" />
        <Subject id="vote_tot" field="VOTE_TOT" name="num likely Rep/Dem voters" short_name="Rep+ Dem vote" displayed="false" sortkey="6" />
        <Subject id="vote_dem_norm" field="VOTE_DEM_N" name="num of likely Democratic voters normalized to 50/50 state baseline" short_name="Normal Dem vote" displayed="true" sortkey="18" percentage_denominator="vote_tot_norm" />
        <Subject id="vote_rep_norm" field="VOTE_REP_N" name="num of likely Republican voters normalized to 50/50 state baseline" short_name="Normal Rep vote" displayed="true" sortkey="19" percentage_denominator="vote_tot_norm" />
        <Subject id="vote_tot_norm" field="VOTE_TOT_N" name="number of likely Republican and Democratic voters normalized to 50/50 state baseline" short_name="Normal 2-party vote" displayed="false" sortkey="20" />
        %(end_elec)s
        <Subject id="vap" field="VAP" name="Voting Age Population" short_name="vap" displayed="true" sortkey="7" />
        <Subject id="totpop_b" field="TOTPOP_B" name="African-American" short_name="Black" displayed="false" sortkey="8" percentage_denominator="totpop"/>        
	<Subject id="totpop_h" field="TOTPOP_H" name="Hispanic or Latino" short_name="Hispanic" displayed="false" sortkey="9" percentage_denominator="totpop"/>
	<Subject id="totpop_na" field="TOTPOP_NA" name="Native American" short_name="Nat Amer" displayed="false" sortkey="10" percentage_denominator="totpop"/>
	<Subject id="totpop_a" field="TOTPOP_A" name="Asian Population" short_name="Asian" displayed="false" sortkey="11" percentage_denominator="totpop"/>
	<Subject id="totpop_pi" field="TOTPOP_PI" name="Pacific Islander" short_name="Pac Isl" displayed="false" sortkey="12" percentage_denominator="totpop"/>
	<Subject id="totpop_wnh" field="TOTPOP_WNH" name="White Non-Hispanic" short_name="White" displayed="false" sortkey="13" percentage_denominator="totpop"/>
        <Subject id="totpop" field="TOTPOP" name="Total Population" short_name="Total Pop." displayed="true" sortkey="14"/>
        <Subject id="vap_a" field="VAP_A" name="Asian Voting Age Population" short_name="Asian VAP" displayed="true" sortkey="15" percentage_denominator="vap" />
        <Subject id="vap_pi" field="VAP_PI" name="Pacific Islander Voting Age Population" short_name="Pacific VAP" displayed="true" sortkey="16" percentage_denominator="vap"/>
        <Subject id="vap_wnh" field="VAP_WNH" name="White Non-Hispanic Voting Age Population" short_name="White VAP" displayed="true" sortkey="17" percentage_denominator="vap"/>
   </Subjects>

    <Scoring>
        <ScoreFunctions>
            <!-- A district score that returns a literal value -->
            <ScoreFunction id="district_poptot" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Total Pop" user_selectable="true">
                <SubjectArgument name="value1" ref="totpop" />
            </ScoreFunction>
            <ScoreFunction id="district_totpop_b" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Black VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="totpop_b" />
            </ScoreFunction>
            <ScoreFunction id="district_totpop_h" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Hispanic VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="totpop_h" />
            </ScoreFunction>
            <ScoreFunction id="district_totpop_a" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Asian VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="totpop_a" />
            </ScoreFunction>
            <ScoreFunction id="district_totpop_na" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Native American VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="totpop_na" />
            </ScoreFunction>
            <ScoreFunction id="district_totpop_pi" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Pacific Islander VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="totpop_pi" />
            </ScoreFunction>
            <ScoreFunction id="district_totpop_wnh" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Pacific Islander VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="totpop_wnh" />
            </ScoreFunction>
            <ScoreFunction id="district_vap" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="vap" />
            </ScoreFunction>
            <ScoreFunction id="district_vap_b" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Black VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="vap_b" />
            </ScoreFunction>
            <ScoreFunction id="district_vap_h" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Hispanic VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="vap_h" />
            </ScoreFunction>
            <ScoreFunction id="district_vap_a" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Asian VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="vap_a" />
            </ScoreFunction>
            <ScoreFunction id="district_vap_na" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Native American VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="vap_na" />
            </ScoreFunction>
            <ScoreFunction id="district_vap_pi" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Pacific Islander VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="vap_pi" />
            </ScoreFunction>
            <ScoreFunction id="district_vap_wnh" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Pacific Islander VAP" user_selectable="true">
                <SubjectArgument name="value1" ref="vap_wnh" />
            </ScoreFunction>

            <!-- A district score that returns a percentage -->
            <ScoreFunction id="district_blkvap_percent" type="district"
                calculator="publicmapping.redistricting.calculators.Percent"
                label="Black VAP %%" user_selectable="true">
                <SubjectArgument name="numerator" ref="vap_b" />
                <SubjectArgument name="denominator" ref="vap" />
            </ScoreFunction>
            <ScoreFunction id="district_blkvap_thresh" type="district"
                calculator="publicmapping.redistricting.calculators.Threshold"
                label="Black VAP Threshold">
                <ScoreArgument name="value" ref="district_blkvap_percent" />
                <Argument name="threshold" value="0.5" />
            </ScoreFunction>
            <ScoreFunction id="district_hispvap_percent" type="district"
                calculator="publicmapping.redistricting.calculators.Percent"
                label="Hisp. VAP %%" user_selectable="true">
                <SubjectArgument name="numerator" ref="vap_h" />
                <SubjectArgument name="denominator" ref="vap" />
            </ScoreFunction>
            <ScoreFunction id="district_hispvap_thresh" type="district"
                calculator="publicmapping.redistricting.calculators.Threshold"
                label="Hisp. VAP Threshold">
                <ScoreArgument name="value" ref="district_hispvap_percent" />
                <Argument name="threshold" value="0.5" />
            </ScoreFunction>
            <ScoreFunction id="district_navap_percent" type="district"
                calculator="publicmapping.redistricting.calculators.Percent"
                label="Native American VAP %%" user_selectable="true">
                <SubjectArgument name="numerator" ref="vap_na" />
                <SubjectArgument name="denominator" ref="vap" />
            </ScoreFunction>
            <ScoreFunction id="district_navap_thresh" type="district"
                calculator="publicmapping.redistricting.calculators.Threshold"
                label="Native American VAP Threshold">
                <ScoreArgument name="value" ref="district_navap_percent" />
                <Argument name="threshold" value="0.5" />
            </ScoreFunction>
            <ScoreFunction id="district_avap_percent" type="district"
                calculator="publicmapping.redistricting.calculators.Percent"
                label="Asian VAP %%" user_selectable="true">
                <SubjectArgument name="numerator" ref="vap_a" />
                <SubjectArgument name="denominator" ref="vap" />
            </ScoreFunction>
            <ScoreFunction id="district_avap_thresh" type="district"
                calculator="publicmapping.redistricting.calculators.Threshold"
                label="Asian VAP Threshold">
                <ScoreArgument name="value" ref="district_avap_percent" />
                <Argument name="threshold" value="0.5" />
            </ScoreFunction>
            <ScoreFunction id="district_pivap_percent" type="district"
                calculator="publicmapping.redistricting.calculators.Percent"
                label="Pacific Islander VAP %%" user_selectable="true">
                <SubjectArgument name="numerator" ref="vap_pi" />
                <SubjectArgument name="denominator" ref="vap" />
            </ScoreFunction>
            <ScoreFunction id="district_pivap_thresh" type="district"
                calculator="publicmapping.redistricting.calculators.Threshold"
                label="Pacific Islander VAP Threshold">
                <ScoreArgument name="value" ref="district_pivap_percent" />
                <Argument name="threshold" value="0.5" />
            </ScoreFunction>
            <ScoreFunction id="district_wnhvap_percent" type="district"
                calculator="publicmapping.redistricting.calculators.Percent"
                label="White VAP %%" user_selectable="true">
                <SubjectArgument name="numerator" ref="vap_wnh" />
                <SubjectArgument name="denominator" ref="vap" />
            </ScoreFunction>
            <ScoreFunction id="district_wnhvap_thresh" type="district"
                calculator="publicmapping.redistricting.calculators.Threshold"
                label="White VAP Threshold">
                <ScoreArgument name="value" ref="district_wnhvap_percent" />
                <Argument name="threshold" value="0.5" />
            </ScoreFunction>
                %(start_elec)s
            <ScoreFunction id="district_vote" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Estimated votes" user_selectable="true">
                <SubjectArgument name="value1" ref="vote_tot" />
            </ScoreFunction>
            <ScoreFunction id="district_vote_dem" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Estimated Democratic votes" user_selectable="true">
                <SubjectArgument name="value1" ref="vote_dem" />
            </ScoreFunction>
            <ScoreFunction id="district_vote_rep" type="district"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Estimated votes" user_selectable="true">
                <SubjectArgument name="value1" ref="vote_rep" />
            </ScoreFunction>
            <ScoreFunction id="district_vote_dem_percent" type="district"
                calculator="publicmapping.redistricting.calculators.Percent"
                label="Democratic Predicted Vote %%" user_selectable="true">
                <SubjectArgument name="numerator" ref="vote_dem" />
                <SubjectArgument name="denominator" ref="vote_tot" />
            </ScoreFunction>
            <ScoreFunction id="district_vote_dem_thresh" type="district"
                calculator="publicmapping.redistricting.calculators.Threshold"
                label="Democratic Predicted Vote Threshold">
                <ScoreArgument name="value" ref="district_vote_dem_percent" />
                <Argument name="threshold" value="0.5" />
            </ScoreFunction>
            <ScoreFunction id="district_vote_rep_percent" type="district"
                calculator="publicmapping.redistricting.calculators.Percent"
                label="Republican Predicted Vote %%" user_selectable="true">
                <SubjectArgument name="numerator" ref="vote_rep" />
                <SubjectArgument name="denominator" ref="vote_tot" />
            </ScoreFunction>
            <ScoreFunction id="district_vote_rep_thresh" type="district"
                calculator="publicmapping.redistricting.calculators.Threshold"
                label="Republican Predicted Vote Threshold">
                <ScoreArgument name="value" ref="district_vote_rep_percent" />
                <Argument name="threshold" value="0.5" />
            </ScoreFunction>
                %(end_elec)s

            <!-- A district score that generates classes based on a couple
                ranges around a mean value. -->
            <ScoreFunction id="district_poptot_uitarget_congress" type="district" 
                calculator="publicmapping.redistricting.calculators.Target">
                <SubjectArgument name="value" ref="totpop" />
                <Argument name="target" value="&pop_congress;" />
                <Argument name="range1" value="0.005"/>
                <Argument name="range2" value="0.010"/>
            </ScoreFunction>
            <ScoreFunction id="district_poptot_uitarget_house" type="district"
                calculator="publicmapping.redistricting.calculators.Target">
                <SubjectArgument name="value" ref="totpop" />
                <Argument name="target" value="%(pop_house)s" />
                <Argument name="range1" value="0.05" />
                <Argument name="range2" value="0.10" />
            </ScoreFunction>
            <ScoreFunction id="district_poptot_uitarget_senate" type="district"
                calculator="publicmapping.redistricting.calculators.Target">
                <SubjectArgument name="value" ref="totpop" />
                <Argument name="target" value="%(pop_senate)s" />
                <Argument name="range1" value="0.05" />
                <Argument name="range2" value="0.10" />
            </ScoreFunction>

            <!-- A district score that returns 1(T) if the subject value
                is between the ranges, otherwise returns 0(F). -->
            <ScoreFunction id="district_poptot_range" type="district"
                calculator="publicmapping.redistricting.calculators.Range"
                label="Tot Pop Range">
                <SubjectArgument name="value" ref="totpop" />
                <Argument name="min" value="&pop_congress_min;" />
                <Argument name="max" value="&pop_congress_max;" />
            </ScoreFunction>

            <!-- A district score that is threshold dependent, and returns 
                T/F; this example uses 2 score functions: 1 to combine a 
                set of subjects, and 2 to divide the sum over another 
                subject. -->
            <ScoreFunction id="district_mintot" type="district"
                calculator="publicmapping.redistricting.calculators.Sum">
                <SubjectArgument name="value1" ref="totpop_b" />
                <SubjectArgument name="value2" ref="totpop_h" />
                <SubjectArgument name="value3" ref="totpop_na" />
            </ScoreFunction>
            <ScoreFunction id="district_majmin" type="district"
                calculator="publicmapping.redistricting.calculators.DivideAndThreshold" >
                <ScoreArgument name="numerator" ref="district_mintot" />
                <SubjectArgument name="denominator" ref="totpop" />
                <Argument name="threshold" value="0.5" />
            </ScoreFunction>

            <!-- A custom calculator to calculate compactness, and return
                the raw compactness score. -->
            <ScoreFunction id="district_schwartzberg" type="district"
                calculator="publicmapping.redistricting.calculators.Schwartzberg"
                label="Compactness" user_selectable="true">
            </ScoreFunction>
            
            <!-- A custom calculator to do contiguity, and is boolean. -->
            <ScoreFunction id="district_contiguous" type="district"
                calculator="publicmapping.redistricting.calculators.Contiguity"
                label="Contiguous" user_selectable="true">
            </ScoreFunction>

            <!-- A plan score that aggregates all literal values -->
            <ScoreFunction id="plan_sum_equipop" type="plan" 
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Equal Population">
                <ScoreArgument name="value1" ref="district_poptot_range" />
            </ScoreFunction>
            <ScoreFunction id="plan_all_equipop" type="plan" 
                calculator="publicmapping.redistricting.calculators.Threshold" >
                <ScoreArgument name="value" ref="plan_sum_equipop" />
                <Argument name="threshold" value="0" />
            </ScoreFunction>

            <!-- A plan score that aggregates all districts over a threshold -->
            <ScoreFunction id="plan_count_majmin" type="plan" 
                calculator="publicmapping.redistricting.calculators.Sum">
                <ScoreArgument name="value1" ref="district_majmin" />
            </ScoreFunction>

            <ScoreFunction id="plan_blkvap_thresh" type="plan"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Majority Black Districts" user_selectable="true">
                <ScoreArgument name="value1" ref="district_blkvap_thresh" />
            </ScoreFunction>

            <ScoreFunction id="plan_hispvap_thresh" type="plan"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Majority Hispanic Districts" user_selectable="true">
                <ScoreArgument name="value1" ref="district_hispvap_thresh" />
            </ScoreFunction>

            <ScoreFunction id="plan_navap_thresh" type="plan"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Majority Asian Districts" user_selectable="true">
                <ScoreArgument name="value1" ref="district_navap_thresh" />
            </ScoreFunction>

            <ScoreFunction id="plan_avap_thresh" type="plan"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Majority Asian Districts" user_selectable="true">
                <ScoreArgument name="value1" ref="district_avap_thresh" />
            </ScoreFunction>

            <ScoreFunction id="plan_pivap_thresh" type="plan"
                calculator="publicmapping.redistricting.calculators.Sum">
                <ScoreArgument name="value1" ref="district_pivap_thresh" />
            </ScoreFunction>

            <!-- A plan score that evaluates a threshold, and returns T/F.
                This plan score checks that all districts are within the
                population limits. -->
            <ScoreFunction id="plan_poptot_inrange" type="plan" 
                calculator="publicmapping.redistricting.calculators.Threshold">
                <ScoreArgument name="value" ref="district_poptot_range" />
                <Argument name="threshold" value="0" />
            </ScoreFunction>
           
            <!-- A plan score that evaluates all districts, and returns
                1(T) if there is more than 0 districts that have a minority
                majority. -->
            <ScoreFunction id="plan_major_minor" type="plan"
                calculator="publicmapping.redistricting.calculators.Threshold"
                label="Majority-Minority">
                <ScoreArgument name="value" ref="district_majmin" />
                <Argument name="threshold" value="0" />
            </ScoreFunction>

          <ScoreFunction id="plan_contiguous" type="plan"
                calculator="publicmapping.redistricting.calculators.Sum"
                label="Contiguous">
                <ScoreArgument name="value1" ref="district_contiguous"/>
            </ScoreFunction>

            <ScoreFunction id="b_plan_congress_noncontiguous" type="plan"
                calculator="publicmapping.redistricting.calculators.Contiguity"
                label="Contiguous">
                <Argument name="target" value="&num_districts_congress;" />
            </ScoreFunction>

            <ScoreFunction id="b_plan_house_noncontiguous" type="plan"
                calculator="publicmapping.redistricting.calculators.Contiguity"
                label="Contiguous">
                <Argument name="target" value="&num_districts_house;" />
            </ScoreFunction>

            <ScoreFunction id="b_plan_senate_noncontiguous" type="plan"
                calculator="publicmapping.redistricting.calculators.Contiguity"
                label="Contiguous">
                <Argument name="target" value="&num_districts_senate;" />
            </ScoreFunction>


            <!-- interval score function for population -->
            <ScoreFunction id="a_congressional_population" type="district"
                label="Tot Pop Range (Congress)" user_selectable="true"
                description="Population interval calculator for congressional."
                calculator="publicmapping.redistricting.calculators.Interval">
                <SubjectArgument name="subject" ref="totpop" />
                <Argument name="target" value="&pop_congress;" />
                <Argument name="bound1" value=".005" />
                <Argument name="bound2" value=".01" />
            </ScoreFunction>

            <ScoreFunction id="a_house_population" type="district"
                label="Tot Pop Range (House)" user_selectable="true"
                description="Population interval calculator for house."
                calculator="publicmapping.redistricting.calculators.Interval">
                <SubjectArgument name="subject" ref="totpop" />
                <Argument name="target" value="%(pop_house)s" />
                <Argument name="bound1" value=".005" />
                <Argument name="bound2" value=".01" />
            </ScoreFunction>

            <ScoreFunction id="a_senate_population" type="district"
                label="Tot Pop Range (Senate)" user_selectable="true"
                description="Population interval calculator for senate."
                calculator="publicmapping.redistricting.calculators.Interval">
                <SubjectArgument name="subject" ref="totpop" />
                <Argument name="target" value="%(pop_senate)s" />
                <Argument name="bound1" value=".005" />
                <Argument name="bound2" value=".01" />
            </ScoreFunction>

            <!-- leaderboard functions -->
            <ScoreFunction id="a_congress_plan_count_districts" type="plan"
                calculator="publicmapping.redistricting.calculators.CountDistricts"
                label="Count Districts"
                description="The number of districts in a Congressional redistricting plan must be &num_districts_congress;.">
                <Argument name="target" value="&num_districts_congress;" />
            </ScoreFunction>

            <ScoreFunction id="a_house_plan_count_districts" type="plan"
                calculator="publicmapping.redistricting.calculators.CountDistricts"
                label="Count Districts"
                description="The number of districts in a House of Delegates redistricting plan must be &num_districts_house;.">
                <Argument name="target" value="&num_districts_house;" />
            </ScoreFunction>

            <ScoreFunction id="a_senate_plan_count_districts" type="plan"
                calculator="publicmapping.redistricting.calculators.CountDistricts"
                label="Count Districts"
                description="The number of districts in a State Senate redistricting plan must be &num_districts_senate;.">
                <Argument name="target" value="&num_districts_senate;" />
            </ScoreFunction>


            <ScoreFunction id="a_congress_plan_equipopulation_validation" type="plan"
                calculator="publicmapping.redistricting.calculators.Equipopulation"
                label="Target Pop. &pop_congress;"
                description="The population of each Congressional district must be &pop_congress_min;-&pop_congress_max;">
                <Argument name="min" value="&pop_congress_min;"/>
                <Argument name="max" value="&pop_congress_max;"/>
                <SubjectArgument name="value" ref="totpop"/>
                <Argument name="validation" value="1"/>
            </ScoreFunction>

            <ScoreFunction id="a_congress_plan_equipopulation_summary" type="plan"
                calculator="publicmapping.redistricting.calculators.Equipopulation"
                label="Target Pop. &pop_congress;"
                description="The population of each Congressional district must be &pop_congress_min;-&pop_congress_max;">
                <Argument name="min" value="&pop_congress_min;"/>
                <Argument name="max" value="&pop_congress_max;"/>
                <SubjectArgument name="value" ref="totpop"/>
		<Argument name="target" value="&num_districts_congress;"/>
            </ScoreFunction>

            <ScoreFunction id="a_senate_plan_equipopulation_validation" type="plan"
                calculator="publicmapping.redistricting.calculators.Equipopulation"
                label="Target Pop. %(pop_senate)s"
                description="The population of each Senate district must be &pop_senate_min;-&pop_senate_max;">
                <Argument name="min" value="&pop_senate_min;"/>
                <Argument name="max" value="&pop_senate_max;"/>
                <SubjectArgument name="value" ref="totpop"/>
                <Argument name="validation" value="1"/>
            </ScoreFunction>

            <ScoreFunction id="a_senate_plan_equipopulation_summary" type="plan"
                calculator="publicmapping.redistricting.calculators.Equipopulation"
                label="Target Pop. %(pop_senate)s"
                description="The population of each Senate district must be &pop_senate_min;-&pop_senate_max;">
                <Argument name="min" value="&pop_senate_min;"/>
                <Argument name="max" value="&pop_senate_max;"/>
                <SubjectArgument name="value" ref="totpop"/>
		<Argument name="target" value="&num_districts_senate;"/>
            </ScoreFunction>

            <ScoreFunction id="a_house_plan_equipopulation_validation" type="plan"
                calculator="publicmapping.redistricting.calculators.Equipopulation"
                label="Target Pop. %(pop_house)s"
                description="The population of each House district must be &pop_house_min;-&pop_house_max;">
                <Argument name="min" value="&pop_house_min;"/>
                <Argument name="max" value="&pop_house_max;"/>
                <SubjectArgument name="value" ref="totpop"/>
                <Argument name="validation" value="1"/>
            </ScoreFunction>

            <ScoreFunction id="a_house_plan_equipopulation_summary" type="plan"
                calculator="publicmapping.redistricting.calculators.Equipopulation"
                label="Target Pop. %(pop_house)s"
                description="The population of each House district must be &pop_house_min;-&pop_house_max;">
                <Argument name="min" value="&pop_house_min;"/>
                <Argument name="max" value="&pop_house_max;"/>
                <SubjectArgument name="value" ref="totpop"/>
		<Argument name="target" value="&num_districts_house;"/>
            </ScoreFunction>

            <ScoreFunction id="plan_all_blocks_assigned" type="plan"
                calculator="publicmapping.redistricting.calculators.AllBlocksAssigned"
                label="All Blocks Assigned"
                description="All blocks in the plan must be assigned.">
            </ScoreFunction>


            <ScoreFunction id="plan_all_contiguous" type="plan"
                calculator="publicmapping.redistricting.calculators.AllContiguous"
                label="All Contiguous"
                description="Contiguity means that every part of a district must be reachable from every other part without crossing the district&apos;s borders. All districts within a plan must be contiguous. Water contiguity is permitted. &apos;Point contiguity&apos; or &apos;touch-point contiguity&apos; where two sections of a district are connected at a single point is not permitted.">
            </ScoreFunction>
                %(start_elec)s
            <ScoreFunction id="plan_competitiveness" type="plan"
                calculator="publicmapping.redistricting.calculators.Competitiveness"
                label="Competitiveness"
                description="Each plan&apos;s overall political competitiveness is determined by averaging each district.s &apos;partisan differential&apos;.  The partisan differential of each district is calculated by subtracting the Democratic &apos;partisan index&apos; from the Republican &apos;partisan index&apos;.&lt;br/&gt;&lt;br/&gt;&apos;Heavily&apos; competitive districts are districts with partisan differentials of less than or equal to 5%%. &apos;Generally&apos; competitive districts are districts with partisan differentials of greater than 5%% but less than 10%%.">
                <SubjectArgument name="democratic" ref="vote_dem" />
                <SubjectArgument name="republican" ref="vote_rep" />
            </ScoreFunction>
                %(end_elec)s

            <ScoreFunction id="plan_equivalence" type="plan"
                calculator="publicmapping.redistricting.calculators.Equivalence"
                label="Equal Population"
                description="The Equipopulation score is the difference between the district with the highest population and the district with the lowest population.">
                <SubjectArgument name="value" ref="totpop" />
            </ScoreFunction>

            <ScoreFunction id="plan_majority_minority_blk_congress" type="plan"
                calculator="publicmapping.redistricting.calculators.MajorityMinority"
                label="Black VAP Majority (&gt; 50%%)"
                description="Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.">
                <SubjectArgument name="population" ref="vap" />
                <SubjectArgument name="minority1" ref="vap_b" />
                <Argument name="target" value="&target_bl_congress;" />
            </ScoreFunction>

            <ScoreFunction id="plan_majority_minority_blk_house" type="plan"
                calculator="publicmapping.redistricting.calculators.MajorityMinority"
                label="Black VAP Majority (&gt; 50%%)"
                description="Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.">
                <SubjectArgument name="population" ref="vap" />
                <SubjectArgument name="minority1" ref="vap_b" />
                <Argument name="target" value="&target_bl_house;" />
            </ScoreFunction>

            <ScoreFunction id="plan_majority_minority_blk_senate" type="plan"
                calculator="publicmapping.redistricting.calculators.MajorityMinority"
                label="Black VAP Majority (&gt; 50%%)"
                description="Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.">
                <SubjectArgument name="population" ref="vap" />
                <SubjectArgument name="minority1" ref="vap_b" />
                <Argument name="target" value="&target_bl_senate;" />
            </ScoreFunction>

            <ScoreFunction id="plan_majority_minority_hisp_congress" type="plan"
                calculator="publicmapping.redistricting.calculators.MajorityMinority"
                label="Hisp. VAP Majority (&gt; 50%%)"
                description="Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.">
                <SubjectArgument name="population" ref="vap" />
                <SubjectArgument name="minority1" ref="vap_h" />
                <Argument name="target" value="&target_hisp_congress;" />
            </ScoreFunction>

            <ScoreFunction id="plan_majority_minority_hisp_house" type="plan"
                calculator="publicmapping.redistricting.calculators.MajorityMinority"
                label="Hisp. VAP Majority (&gt; 50%%)"
                description="Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.">
                <SubjectArgument name="population" ref="vap" />
                <SubjectArgument name="minority1" ref="vap_h" />
                <Argument name="target" value="&target_hisp_house;" />
            </ScoreFunction>

            <ScoreFunction id="plan_majority_minority_hisp_senate" type="plan"
                calculator="publicmapping.redistricting.calculators.MajorityMinority"
                label="Hisp. VAP Majority (&gt; 50%%)"
                description="Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.">
                <SubjectArgument name="population" ref="vap" />
                <SubjectArgument name="minority1" ref="vap_h" />
                <Argument name="target" value="&target_hisp_senate;" />
            </ScoreFunction>

            <ScoreFunction id="plan_majority_minority_na_congress" type="plan"
                calculator="publicmapping.redistricting.calculators.MajorityMinority"
                label="Native American Majority (&gt; 50%%)"
                description="Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.">
                <SubjectArgument name="population" ref="vap" />
                <SubjectArgument name="minority1" ref="vap_na" />
                <Argument name="target" value="&target_na_congress;" />
            </ScoreFunction>

            <ScoreFunction id="plan_majority_minority_na_house" type="plan"
                calculator="publicmapping.redistricting.calculators.MajorityMinority"
                label="Native American Majority (&gt; 50%%)"
                description="Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.">
                <SubjectArgument name="population" ref="vap" />
                <SubjectArgument name="minority1" ref="vap_na" />
                <Argument name="target" value="&target_na_house;" />
            </ScoreFunction>

            <ScoreFunction id="plan_majority_minority_na_senate" type="plan"
                calculator="publicmapping.redistricting.calculators.MajorityMinority"
                label="Native American Majority (&gt; 50%%)"
                description="Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.">
                <SubjectArgument name="population" ref="vap" />
                <SubjectArgument name="minority1" ref="vap_na" />
                <Argument name="target" value="&target_na_senate;" />
            </ScoreFunction>

            <ScoreFunction id="plan_majority_minority" type="plan"
                calculator="publicmapping.redistricting.calculators.MajorityMinority"
                label="Majority Minority District"
                description="Compliance with the Voting Rights Act will be assumed if maps include a minority-majority district in any area where a minority group is (as described in Thornburg V. Gingles, 478 U.S. 30, 49 (1986)) &apos;sufficiently large and geographically compact to constitute a majority in a single-member district&apos;.">
                <SubjectArgument name="population" ref="vap" />
                <SubjectArgument name="minority1" ref="vap_b" />
                <SubjectArgument name="minority2" ref="vap_h" />
                <SubjectArgument name="minority3" ref="vap_na" />
                <Argument name="validation" value="1" />
            </ScoreFunction>

                %(start_elec)s
            <ScoreFunction id="plan_repfairness" type="plan"
                calculator="publicmapping.redistricting.calculators.RepresentationalFairness"
                label="Representational Fairness"
                description="Representational fairness is increased when the percentage of districts a party would likely win (based upon the &apos;partisan index&apos; used to determine Competitiveness) closely mirrors that party.s percentage of the statewide vote." >
                <Argument name="range" value="0.05" />
                <SubjectArgument name="normalized democratic" ref="vote_dem_norm" />
                <SubjectArgument name="normalized republican" ref="vote_rep_norm" />
            </ScoreFunction>
                %(end_elec)s

            <ScoreFunction id="plan_schwartzberg" type="plan"
                calculator="publicmapping.redistricting.calculators.Schwartzberg"
                label="Average Compactness"
                description="The competition is using the &apos;Schwartzberg&apos; compactness measure. This measure is a ratio of the perimeter of the district to the circumference of the circle whose area is equal to the area of the district." >
            </ScoreFunction>

        </ScoreFunctions>
        
        <ScorePanels>
            <ScorePanel id="panel_equipop_all" type="plan" position="1"
                title="Equipopulation" template="leaderboard_panel_all.html">
                <Score ref="plan_equivalence" />
            </ScorePanel>
            <ScorePanel id="panel_equipop_mine" type="plan" position="1"
                title="Equipopulation" template="leaderboard_panel_mine.html">
                <Score ref="plan_equivalence" />
            </ScorePanel>
            <ScorePanel id="panel_compact_all" type="plan" position="2"
                title="Schwartzberg" template="leaderboard_panel_all.html">
                <Score ref="plan_schwartzberg" />
            </ScorePanel>
            <ScorePanel id="panel_compact_mine" type="plan" position="2"
                title="Schwartzberg" template="leaderboard_panel_mine.html">
                <Score ref="plan_schwartzberg" />
            </ScorePanel>
                %(start_elec)s
            <ScorePanel id="panel_competitive_all" type="plan" position="3"
                title="Competitiveness" template="leaderboard_panel_all.html">
                <Score ref="plan_competitiveness" />
            </ScorePanel>
            <ScorePanel id="panel_competitive_mine" type="plan" position="3"
                title="Competitiveness" template="leaderboard_panel_mine.html">
                <Score ref="plan_competitiveness" />
            </ScorePanel>
            <ScorePanel id="panel_rf_all" type="plan" position="4"
                title="Representational Fairness" template="leaderboard_panel_all.html">
                <Score ref="plan_repfairness" />
            </ScorePanel>
            <ScorePanel id="panel_rf_mine" type="plan" position="4"
                title="Representational Fairness" template="leaderboard_panel_mine.html">
                <Score ref="plan_repfairness" />
            </ScorePanel>
                %(end_elec)s

            <!-- Summary above all sidebar panels -->
            <ScorePanel id="congressional_panel_summary" type="plan_summary" position="1"
                title="Plan Summary" cssclass="plan_summary congressional" template="plan_summary.html">
	        <Score ref="a_congress_plan_equipopulation_summary"/>
                <Score ref="b_plan_congress_noncontiguous"/>
                <Score ref="plan_majority_minority_blk_congress" />
                <Score ref="plan_majority_minority_hisp_congress" />
		%(start_na)s
                <Score ref="plan_majority_minority_na_congress" />
		%(end_na)s
            </ScorePanel>

            <ScorePanel id="house_panel_summary" type="plan_summary" position="1"
                title="Plan Summary" cssclass="plan_summary house" template="plan_summary.html">
	        <Score ref="a_house_plan_equipopulation_summary"/>
                <Score ref="b_plan_house_noncontiguous"/>
                <Score ref="plan_majority_minority_blk_house" />
                <Score ref="plan_majority_minority_hisp_house" />
		%(start_na)s
                <Score ref="plan_majority_minority_na_house" />
		%(end_na)s
            </ScorePanel>

            <ScorePanel id="senate_panel_summary" type="plan_summary" position="1"
                title="Plan Summary" cssclass="plan_summary senate" template="plan_summary.html">
	        <Score ref="a_senate_plan_equipopulation_summary"/>
                <Score ref="b_plan_senate_noncontiguous"/>
                <Score ref="a_senate_plan_count_districts" />
                <Score ref="plan_majority_minority_blk_senate" />
                <Score ref="plan_majority_minority_hisp_senate" />
		%(start_na)s
                <Score ref="plan_majority_minority_na_senate" />
		%(end_na)s
            </ScorePanel>

            <!-- Basic Information -->
            <ScorePanel id="congresional_panel_info" type="district" position="2"
                title="Basic Information" cssclass="district_basic_info congressional" 
                template="basic_information.html">
                <Score ref="a_congressional_population" />
                <Score ref="district_contiguous" />
                <Score ref="district_schwartzberg" />
            </ScorePanel>

            <ScorePanel id="house_panel_info" type="district" position="2"
                title="Basic Information" cssclass="district_basic_info house" 
                template="basic_information.html">
                <Score ref="a_house_population" />
                <Score ref="district_contiguous" />
                <Score ref="district_schwartzberg" />
            </ScorePanel>
            
            <ScorePanel id="senate_panel_info" type="district" position="2"
                title="Basic Information" cssclass="district_basic_info senate" 
                template="basic_information.html">
                <Score ref="a_senate_population" />
                <Score ref="district_contiguous" />
                <Score ref="district_schwartzberg" />
            </ScorePanel>
            
            <!-- Demographics -->
            <ScorePanel id="congressional_panel_demo" type="district" position="2"
                title="Demographics" cssclass="district_demographics congressional" 
                template="demographics.html">
                %(start_elec)s
                <Score ref="district_vote_dem_percent" />
                %(end_elec)s
                <Score ref="district_blkvap_percent" />
                <Score ref="district_hispvap_percent" />
            </ScorePanel>

            <ScorePanel id="house_panel_demo" type="district" position="2"
                title="Demographics" cssclass="district_demographics house" 
                template="demographics.html">
                %(start_elec)s
                <Score ref="district_vote_dem_percent" />
                %(end_elec)s
                <Score ref="district_blkvap_percent" />
                <Score ref="district_hispvap_percent" />
            </ScorePanel>

            <ScorePanel id="senate_panel_demo" type="district" position="2"
                title="Demographics" cssclass="district_demographics senate" 
                template="demographics.html">
                %(start_elec)s
                <Score ref="district_vote_dem_percent" />
                %(end_elec)s
                <Score ref="district_blkvap_percent" />
                <Score ref="district_hispvap_percent" />
            </ScorePanel>

	     <!-- Needed due to issue https://sourceforge.net/apps/trac/publicmapping/ticket/340 Delete after setup -->
		<ScorePanel id="stats_picker" type="district" position="1" title="Stats Picker" cssclass="hidden" template="demographics.html">
			<Score ref="district_poptot"/>
			<Score ref="district_totpop_b"/>
			<Score ref="district_totpop_h"/>
			<Score ref="district_totpop_a"/>
			<Score ref="district_totpop_na"/>
			<Score ref="district_totpop_pi"/>
			<Score ref="district_totpop_wnh"/>
			<Score ref="district_vap"/>
			<Score ref="district_vap_b"/>
			<Score ref="district_vap_h"/>
			<Score ref="district_vap_a"/>
			<Score ref="district_vap_na"/>
			<Score ref="district_vap_pi"/>
			<Score ref="district_vap_wnh"/>
			<Score ref="district_blkvap_percent"/>
			<Score ref="district_hispvap_percent"/>
			<Score ref="district_avap_percent"/>
			<Score ref="district_navap_percent"/>
			<Score ref="district_pivap_percent"/>
			<Score ref="district_wnhvap_percent"/>
                	%(start_elec)s
			<Score ref="district_vote"/>
			<Score ref="district_vote_dem"/>
			<Score ref="district_vote_rep"/>
			<Score ref="district_vote_dem_percent"/>
			<Score ref="district_vote_rep_percent"/>
                	%(end_elec)s
		</ScorePanel>
        </ScorePanels>
        
        <ScoreDisplays>
            <ScoreDisplay legislativebodyref="congress" type="leaderboard" 
                title="Congressional Leaderboard - All" cssclass="leaderboard congress">
                <ScorePanel ref="panel_equipop_all" />
                <ScorePanel ref="panel_compact_all" />
                %(start_elec)s
                <ScorePanel ref="panel_competitive_all" />
                <ScorePanel ref="panel_rf_all" />
                %(end_elec)s
            </ScoreDisplay>
            <ScoreDisplay legislativebodyref="congress" type="leaderboard" 
                title="Congressional Leaderboard - Mine" cssclass="leaderboard congress">
                <ScorePanel ref="panel_equipop_mine" />
                <ScorePanel ref="panel_compact_mine" />
                %(start_elec)s
                <ScorePanel ref="panel_competitive_all" />
                <ScorePanel ref="panel_rf_mine" />
                %(end_elec)s
            </ScoreDisplay>
            <ScoreDisplay legislativebodyref="house" type="leaderboard" 
                title="State House Leaderboard - All" cssclass="leaderboard house">
                <ScorePanel ref="panel_equipop_all" />
                <ScorePanel ref="panel_compact_all" />
                %(start_elec)s
                <ScorePanel ref="panel_competitive_all" />
                <ScorePanel ref="panel_rf_all" />
                %(end_elec)s
            </ScoreDisplay>
            <ScoreDisplay legislativebodyref="house" type="leaderboard" 
                title="State House Leaderboard - Mine" cssclass="leaderboard house">
                <ScorePanel ref="panel_equipop_mine" />
                <ScorePanel ref="panel_compact_mine" />
                %(start_elec)s
                <ScorePanel ref="panel_competitive_mine" />
                <ScorePanel ref="panel_rf_mine" />
                %(end_elec)s
            </ScoreDisplay>
            <ScoreDisplay legislativebodyref="senate" type="leaderboard" 
                title="State Senate Leaderboard - All" cssclass="leaderboard senate">
                <ScorePanel ref="panel_equipop_all" />
                <ScorePanel ref="panel_compact_all" />
                %(start_elec)s
                <ScorePanel ref="panel_competitive_all" />
                <ScorePanel ref="panel_rf_all" />
                %(end_elec)s
            </ScoreDisplay>
            <ScoreDisplay legislativebodyref="senate" type="leaderboard" 
                title="State Senate Leaderboard - Mine" cssclass="leaderboard senate">
                <ScorePanel ref="panel_equipop_mine" />
                <ScorePanel ref="panel_compact_mine" />
                %(start_elec)s
                <ScorePanel ref="panel_competitive_mine" />
                <ScorePanel ref="panel_rf_mine" />
                %(end_elec)s
            </ScoreDisplay>

             <!-- Sidebar configuration -->
            <ScoreDisplay legislativebodyref="congress" type="sidebar" title="Basic Information" cssclass="basic_information">
                <ScorePanel ref="congressional_panel_summary" />
                <ScorePanel ref="congresional_panel_info" />
            </ScoreDisplay>

            <ScoreDisplay legislativebodyref="congress" type="sidebar" title="Demographics" cssclass="demographics">
                <ScorePanel ref="congressional_panel_summary" />
                <ScorePanel ref="congressional_panel_demo" />
            </ScoreDisplay>

            <ScoreDisplay legislativebodyref="house" type="sidebar" title="Basic Information" cssclass="basic_information">
                <ScorePanel ref="house_panel_summary" />
                <ScorePanel ref="house_panel_info" />
            </ScoreDisplay>

            <ScoreDisplay legislativebodyref="house" type="sidebar" title="Demographics" cssclass="demographics">
                <ScorePanel ref="house_panel_summary" />
                <ScorePanel ref="house_panel_demo" />
            </ScoreDisplay>

            <ScoreDisplay legislativebodyref="senate" type="sidebar" title="Basic Information" cssclass="basic_information">
                <ScorePanel ref="senate_panel_summary" />
                <ScorePanel ref="senate_panel_info" />
            </ScoreDisplay>

            <ScoreDisplay legislativebodyref="senate" type="sidebar" title="Demographics" cssclass="demographics">
                <ScorePanel ref="senate_panel_summary" />
                <ScorePanel ref="senate_panel_demo" />
            </ScoreDisplay>

<!-- Needed due to issue https://sourceforge.net/apps/trac/publicmapping/ticket/340 Delete after setup -->
	<ScoreDisplay legislativebodyref="congress" type="sidebar" title="All Stats" cssclass="hidden"><ScorePanel ref="stats_picker"/></ScoreDisplay>
        </ScoreDisplays>
    </Scoring>


    <Validation>
        <Criteria legislativebodyref="congress">
            <Criterion name="Equipopulation - Congress" description="&lt;p&gt;Your plan does not meet the competition criteria for Equipopulation:&lt;/p&gt;&lt;p&gt; The population of each Congressional district must be &pop_congress_max;-&pop_congress_min;">  
                <Score ref="a_congress_plan_equipopulation_validation" />
            </Criterion>
            <Criterion name="AllContiguous - Congress" 
                description="&lt;p&gt;Your plan does not meet the competition criteria for Contiguity&lt;/p&gt;&lt;p&gt;Every part of a district must be reachable from every other part without crossing the district's borders. All districts within a plan must be contiguous. &lt;/p&gt;">
                <Score ref="plan_all_contiguous" />
            </Criterion>
            <Criterion name="MajorityMinority - Congress" description="">
                <Score ref="plan_majority_minority" />
            </Criterion>
            <Criterion name="CountDistricts - Congress" description="">
                <Score ref="a_congress_plan_count_districts" />
            </Criterion>
            <Criterion name="AllBlocksAssigned - Congress" description="">
                <Score ref="plan_all_blocks_assigned" />
            </Criterion>
        </Criteria>
        <Criteria legislativebodyref="house">
            <Criterion name="Equipopulation - House" description="&lt;p&gt;Your plan does not meet the competition criteria for Equipopulation:&lt;/p&gt;&lt;p&gt;The population of each House of Delegates district must be &pop_house_min; - &pop_house_max;"> 
                <Score ref="a_house_plan_equipopulation_validation" />
            </Criterion>
            <Criterion name="AllContiguous - House" 
                description="&lt;p&gt;Your plan does not meet the competition criteria for Contiguity&lt;/p&gt;&lt;p&gt;Every part of a district must be reachable from every other part without crossing the district's borders. All districts within a plan must be contiguous. &lt;/p&gt;">
                <Score ref="plan_all_contiguous" />
            </Criterion>
            <Criterion name="MajorityMinority - House" description="">
                <Score ref="plan_majority_minority" />
            </Criterion>
            <Criterion name="CountDistricts - House" description="">
                <Score ref="a_house_plan_count_districts" />
            </Criterion>
            <Criterion name="AllBlocksAssigned - House" description="">
                <Score ref="plan_all_blocks_assigned" />
            </Criterion>
        </Criteria>
        <Criteria legislativebodyref="senate">
            <Criterion name="Equipopulation - Senate" description="&lt;p&gt;Your plan does not meet the competition criteria for Equipopulation:&lt;/p&gt;&lt;p&gt;The population of each State Senate district must be &pop_house_min;-&pop_house_max;">
                <Score ref="a_senate_plan_equipopulation_validation" />
            </Criterion>
            <Criterion name="AllContiguous - Senate" 
                description="&lt;p&gt;Your plan does not meet the competition criteria for Contiguity&lt;/p&gt;&lt;p&gt;Every part of a district must be reachable from every other part without crossing the district's borders. All districts within a plan must be contiguous. &lt;/p&gt;">
                <Score ref="plan_all_contiguous" />
            </Criterion>
            <Criterion name="MajorityMinority - Senate" description="">
                <Score ref="plan_majority_minority" />
            </Criterion>
            <Criterion name="CountDistricts - Senate" description="">
                <Score ref="a_senate_plan_count_districts" />
            </Criterion>
            <Criterion name="AllBlocksAssigned - Senate" description="">
                <Score ref="plan_all_blocks_assigned" />
            </Criterion>
        </Criteria>
    </Validation>

    <!--
    Optional configuration for geounits that require special contiguity rules.
    'id' is the portable id of the geounit in which to configure an override.
    'connect_to' is the portable id of the geounit in which the geounit is
    to be considered contiguous with. Tests for contiguity will apply these overrides
    in order to account for contiguity when physical contiguity is not possible.
    For example, an island may need to be marked contiguous with one or more geounits
    on an adjacent coast (possibly containing harbors). 
    <ContiguityOverrides>
        <ContiguityOverride id="510030112012077" connect_to="510030102011065" />
        <ContiguityOverride id="510030112012077" connect_to="510030103003037" />
    </ContiguityOverrides>
    -->

	<!-- Contiguity Overrides, if Any -->
	%(contiguityOverrideString)s

    <GeoLevels>
      <GeoLevel id="block" name="block" min_zoom="6" sort_key="3" tolerance="2.5">

          <Shapefile path="/projects/PublicMapping/data/census_blocks.shp">
              <Fields>

                  <Field name="NAME10" type="name"/>
                  <Field name="GEOID10" type="portable"/>
                  <Field name="STATEFP10" type="tree" pos="0" width="2"/>
                  <Field name="COUNTYFP10" type="tree" pos="1" width="3"/>
                  <Field name="TRACTCE10" type="tree" pos="2" width="6"/>
                  <Field name="BLOCKCE10" type="tree" pos="3" width="4"/>
              </Fields>
          </Shapefile>
          
          <GeoLevelCharacteristics>
              <GeoLevelCharacteristic ref="totpop" />
              <GeoLevelCharacteristic ref="vap" />
              <GeoLevelCharacteristic ref="vap_b" />
              <GeoLevelCharacteristic ref="vap_h" />
              <GeoLevelCharacteristic ref="vap_na" />
              <GeoLevelCharacteristic ref="vap_wnh" />
              <GeoLevelCharacteristic ref="vap_pi" />
              <GeoLevelCharacteristic ref="vap_a" />
              <GeoLevelCharacteristic ref="totpop_wnh" />
              <GeoLevelCharacteristic ref="totpop_pi" />
              <GeoLevelCharacteristic ref="totpop_a" />
              <GeoLevelCharacteristic ref="totpop_b" />
              <GeoLevelCharacteristic ref="totpop_h" />
              <GeoLevelCharacteristic ref="totpop_na" />
                %(start_elec)s
              <GeoLevelCharacteristic ref="vote_dem" />
              <GeoLevelCharacteristic ref="vote_rep" />
              <GeoLevelCharacteristic ref="vote_tot" />
              <GeoLevelCharacteristic ref="vote_dem_norm" />
              <GeoLevelCharacteristic ref="vote_rep_norm" />
              <GeoLevelCharacteristic ref="vote_tot_norm" />
                %(end_elec)s
          </GeoLevelCharacteristics>
         <LegislativeBodies>
              <LegislativeBody ref="congress">
                  <LegislativeTargets>
                      <LegislativeTarget ref="congress_target" default="true" />
                  </LegislativeTargets>
              </LegislativeBody>
              <LegislativeBody ref="house">
                  <LegislativeTargets>
                      <LegislativeTarget ref="house_target" default="true" />
                  </LegislativeTargets>
              </LegislativeBody>
              <LegislativeBody ref="senate">
                  <LegislativeTargets>
                      <LegislativeTarget ref="senate_target" default="true" />
                  </LegislativeTargets>
              </LegislativeBody>
          </LegislativeBodies>

     </GeoLevel>
      <GeoLevel id="tract" name="tract" min_zoom="3" sort_key="2" tolerance="25">
         <Files>
              <Geography path="/projects/PublicMapping/data/census_tracts.shp">
            <Fields>
                      <Field name="NAME10" type="name" />
                      <Field name="GEOID10" type="portable" />
                      <Field name="STATEFP10" type="tree" pos="0" width="2"/>
                      <Field name="COUNTYFP10" type="tree" pos="1" width="3"/>
                      <Field name="TRACTCE10" type="tree" pos="2" width="6"/>
                  </Fields>
              </Geography>
          </Files>
          <GeoLevelCharacteristics>
              <GeoLevelCharacteristic ref="totpop" />
              <GeoLevelCharacteristic ref="vap" />
              <GeoLevelCharacteristic ref="vap_b" />
              <GeoLevelCharacteristic ref="vap_h" />
              <GeoLevelCharacteristic ref="vap_na" />
              <GeoLevelCharacteristic ref="vap_wnh" />
              <GeoLevelCharacteristic ref="vap_pi" />
              <GeoLevelCharacteristic ref="vap_a" />
              <GeoLevelCharacteristic ref="totpop_wnh" />
              <GeoLevelCharacteristic ref="totpop_pi" />
              <GeoLevelCharacteristic ref="totpop_a" />
              <GeoLevelCharacteristic ref="totpop_b" />
              <GeoLevelCharacteristic ref="totpop_h" />
              <GeoLevelCharacteristic ref="totpop_na" />
                %(start_elec)s
              <GeoLevelCharacteristic ref="vote_dem" />
              <GeoLevelCharacteristic ref="vote_rep" />
              <GeoLevelCharacteristic ref="vote_tot" />
              <GeoLevelCharacteristic ref="vote_dem_norm" />
              <GeoLevelCharacteristic ref="vote_rep_norm" />
              <GeoLevelCharacteristic ref="vote_tot_norm" />
                %(end_elec)s
          </GeoLevelCharacteristics>
         <LegislativeBodies>
              <LegislativeBody ref="congress">
                  <Parent ref="block" />
                  <LegislativeTargets>
                      <LegislativeTarget ref="congress_target" default="true" />
                  </LegislativeTargets>
              </LegislativeBody>
              <LegislativeBody ref="house">
                  <Parent ref="block" />
                  <LegislativeTargets>
                      <LegislativeTarget ref="house_target" default="true" />
                  </LegislativeTargets>
              </LegislativeBody>
              <LegislativeBody ref="senate">
                  <Parent ref="block" />
                  <LegislativeTargets>
                      <LegislativeTarget ref="senate_target" default="true" />
                  </LegislativeTargets>
              </LegislativeBody>
          </LegislativeBodies>

      </GeoLevel>

      <GeoLevel id="county" name="county" min_zoom="0" sort_key="1" tolerance="250">
          <Files>
              <Geography path="/projects/PublicMapping/data/census_counties.shp">
                  <Fields>
                      <Field name="NAME10" type="name"/>
                      <Field name="GEOID10" type="portable"/>
                      <Field name="STATEFP10" type="tree" pos="0" width="2"/>
                      <Field name="COUNTYFP10" type="tree" pos="1" width="3"/>
                  </Fields>
              </Geography>
          </Files>
         <GeoLevelCharacteristics>
              <GeoLevelCharacteristic ref="totpop" />
              <GeoLevelCharacteristic ref="vap" />
              <GeoLevelCharacteristic ref="vap_b" />
              <GeoLevelCharacteristic ref="vap_h" />
              <GeoLevelCharacteristic ref="vap_na" />
              <GeoLevelCharacteristic ref="vap_wnh" />
              <GeoLevelCharacteristic ref="vap_pi" />
              <GeoLevelCharacteristic ref="vap_a" />
              <GeoLevelCharacteristic ref="totpop_wnh" />
              <GeoLevelCharacteristic ref="totpop_pi" />
              <GeoLevelCharacteristic ref="totpop_a" />
              <GeoLevelCharacteristic ref="totpop_b" />
              <GeoLevelCharacteristic ref="totpop_h" />
              <GeoLevelCharacteristic ref="totpop_na" />
               %(start_elec)s
              <GeoLevelCharacteristic ref="vote_dem" />
              <GeoLevelCharacteristic ref="vote_rep" />
              <GeoLevelCharacteristic ref="vote_tot" />
              <GeoLevelCharacteristic ref="vote_dem_norm" />
              <GeoLevelCharacteristic ref="vote_rep_norm" />
              <GeoLevelCharacteristic ref="vote_tot_norm" />
                %(end_elec)s
          </GeoLevelCharacteristics>
       <LegislativeBodies>
              <LegislativeBody ref="congress">
                  <Parent ref="tract" />
                  <LegislativeTargets>
                      <LegislativeTarget ref="congress_target" default="true" />
                  </LegislativeTargets>
              </LegislativeBody>
              <LegislativeBody ref="house">
                  <Parent ref="tract" />
                  <LegislativeTargets>
                      <LegislativeTarget ref="house_target" default="true" />
                  </LegislativeTargets>
              </LegislativeBody>
              <LegislativeBody ref="senate">
                  <Parent ref="tract" />
                  <LegislativeTargets>
                      <LegislativeTarget ref="senate_target" default="true" />
                  </LegislativeTargets>
              </LegislativeBody>
          </LegislativeBodies>
      </GeoLevel>
    </GeoLevels>

    <Templates>
        <Template name="Congressional">
            <LegislativeBody ref="congress"/>
             <Blockfile path="/projects/PublicMapping/data/congress_generated_index.csv" />
        </Template>
        <Template name="State House">
            <LegislativeBody ref="house"/>
            <Blockfile path="/projects/PublicMapping/data/house_generated_index.csv" />
        </Template>
        <Template name="State Senate">
            <LegislativeBody ref="senate"/>
            <Blockfile path="/projects/PublicMapping/data/senate_generated_index.csv" />
        </Template>
    </Templates>

    <Project root="/projects/PublicMapping/DistrictBuilder" sessionquota="5" 
             sessiontimeout="15">
        <!-- Database connection information. -->
        <Database name="publicmapping" user="publicmapping" password="publicmapping"/>
        
        <!-- 
        
        Administrative user information. This should match the admin
        user created when the django project is created.
        
        -->
        <Admin user="admin" email="support@publicmapping.org" password="admin"/>
        
        <!-- Configuration items specific to the 'redistricting' app. -->
       <Redistricting>      
	   <MapServer hostname="" ns="pmp" nshref="http://publicmapping.sourceforge.net/"
                adminuser="admin" adminpass="admin" maxfeatures="100" 
                styles="/projects/PublicMapping/DistrictBuilder/sld" />
            <!-- 
            
            Use a GoogleAnalytics account to tract the usage of the 
            application. This requires an account and domain.
            <GoogleAnalytics account="" domain=""/>
            
            -->
            <!-- Upload file size restrictions. This is in KB -->
            <Upload maxsize="2500"/>
            <!-- Undo restrictions -->
            <MaxUndos duringedit="50" afteredit="10" />
            <!-- Leaderboard configuration -->
            <Leaderboard maxranked="10" />
       </Redistricting>
       <Reporting>
            <BardConfigs>
  		 <BardConfig 
                    id="blocks"
                    shape="/projects/PublicMapping/data/census_configured.Rdata" 
                    temp="/projects/PublicMapping/local/reports"
                    transform="/projects/PublicMapping/DistrictBuilder/docs/bard_template.xslt">
                    <PopVars>
                        <PopVar subjectref="totpop" threshold=".01" default="true" />
                        <PopVar subjectref="vap" threshold=".1" />
                    </PopVars>
                    <RatioVars>
                        <!--
                        
                        Set up RatioVars for both ethnicity and political 
                        party.
                        
                        -->
                        <RatioVar id="racialComp" label="Majority Minority Districts" threshold=".5">
                            <Numerators>
                                <Numerator subjectref="totpop_b" />
                                <Numerator subjectref="totpop_h" />
                                <Numerator subjectref="totpop_na" />
                                <Numerator subjectref="totpop_a" />
                                <Numerator subjectref="totpop_pi" />
                                <Numerator subjectref="totpop_wnh" />
                            </Numerators>
                            <Denominator subjectref="totpop" />
                        </RatioVar>
                        <RatioVar id="racialCompVap" label="Majority Minority Districts" threshold=".5">
                            <Numerators>
                                <Numerator subjectref="vap_b" />
                                <Numerator subjectref="vap_h" />
                                <Numerator subjectref="vap_na" />
                                <Numerator subjectref="vap_a" />
                                <Numerator subjectref="vap_pi" />
                                <Numerator subjectref="vap_wnh" />
                            </Numerators>
                            <Denominator subjectref="vap" />
                        </RatioVar>
                %(start_elec)s
                        <RatioVar id="partyControl" label="Party-Controlled Districts" threshold=".5">
                            <Numerators>
                                <Numerator subjectref="vote_dem" />
                                <Numerator subjectref="vote_rep" />
                            </Numerators>
                            <Denominator subjectref="vote_tot" />
                        </RatioVar>
                %(end_elec)s
                    </RatioVars>
                    <SplitVars>
                        <!-- 
                        
                        See whether a given district splits a geography.
                        This can be any higher level geography: a county,
                        VTd, or tract.
                        -->
                        <SplitVar field="COUNTYFP10" label="County" />
                        <SplitVar field="TRACTCE10" label="Tract" />
                    </SplitVars>
                </BardConfig>
            </BardConfigs>
           <BardBodyConfigs>
                <!--
                For each legislative body, map the configuration to the
                geography used to generate reports.
                -->
                <BardBodyConfig
                    id="congress_blocks"
                    legislativebodyref="congress"
                    bardconfigref="blocks" />
                <BardBodyConfig
                    id="house_blocks"
                    legislativebodyref="house"
                    bardconfigref="blocks" />
                <BardBodyConfig
                    id="senate_blocks"
                    legislativebodyref="senate"
                    bardconfigref="blocks" />
            </BardBodyConfigs>
        </Reporting>
        
        <!-- Information about the mailer configuration. -->
        <Mailer server="localhost" port="25" username="" password=""/>
    </Project>
    
</DistrictBuilder>

       N/A gen_config N/A N/A num_districts_congress num_districts_senate num_districts_house sum_TOTPOP has_election_data has_vtds conf_na target_na_congress target_hisp_congress target_bl_congress target_na_house target_hisp_house target_bl_house target_na_senate target_hisp_senate target_bl_senate contiguityOverrideString N/A 0 0 False 0 0 0 0 0 0 0 0 0 N/A N/A start_na <!-- N/A start_elec <!-- N/A end_elec --> N/A end_na --> N/A midlevel tract N/A N/A conf_na True N/A N/A start_na N/A end_na N/A midlevel_width 6 N/A midlevel_var TRACTCE10 N/A N/A has_election_data 1 N/A N/A start_elec N/A end_elec N/A N/A has_vtds 1 N/A N/A midlevel vtds N/A midlevel_width 4 N/A midlevel_var VTDST10 N/A pop_congress N/A int N/A round N/A sum_TOTPOP N/A float num_districts_congress N/A pop_congress_max N/A int N/A round N/A N/A sum_TOTPOP N/A float num_districts_congress 1.005 N/A pop_congress_min N/A int N/A round N/A N/A sum_TOTPOP N/A float num_districts_congress 0.995 N/A pop_house N/A int N/A round N/A sum_TOTPOP N/A float num_districts_house N/A pop_house_max N/A int N/A round N/A N/A sum_TOTPOP N/A float num_districts_house 1.1 N/A pop_house_min N/A int N/A round N/A N/A sum_TOTPOP N/A float num_districts_house 0.9 N/A pop_senate N/A int N/A round N/A sum_TOTPOP N/A float num_districts_senate N/A pop_senate_max N/A int N/A round N/A N/A sum_TOTPOP N/A float num_districts_senate 1.1 N/A pop_senate_min N/A int N/A round N/A N/A sum_TOTPOP N/A float num_districts_senate 0.9 N/A target_file /projects/PublicMapping/DistrictBuilder/docs/config_census_generated.xml N/A f N/A open target_file w N/A N/A N/A f write N/A str N/A Config_Template start_elec start_elec end_elec end_elec num_districts_congress num_districts_congress num_districts_house num_districts_house num_districts_senate num_districts_senate pop_congress_max pop_congress_max pop_congress_min pop_congress_min pop_senate_max pop_senate_max pop_senate_min pop_senate_min pop_house_max pop_house_max pop_house_min pop_house_min pop_congress pop_congress pop_senate pop_senate pop_house pop_house start_na start_na end_na end_na target_na_congress target_na_congress target_hisp_congress target_hisp_congress target_bl_congress target_bl_congress target_na_house target_na_house target_hisp_house target_hisp_house target_bl_house target_bl_house target_na_senate target_na_senate target_hisp_senate target_hisp_senate target_bl_senate target_bl_senate contiguityOverrideString contiguityOverrideString N/A N/A N/A f write N/A N/A N/A f close N/A N/A N/A os chmod target_file N/A N/A N/A stat S_IRUSR N/A stat S_IRGRP N/A stat S_IROTH N/A N/A parser N/A N/A optparse OptionParser usage %prog -F[fips_code] -C[num_congressional_districts] -S[num_senate_districts] -H[num_house_districts] version %prog 0.1 N/A N/A N/A parser add_option -F --fips dest stateFips help State two digit FIPS code type int default 0 N/A N/A N/A parser add_option -C --congdist dest congDis help number of congressional districts type int default 0 N/A N/A N/A parser add_option -H --housedist dest houseDis help number of senate districts type int default 0 N/A N/A N/A parser add_option -S --sendist dest senDis help number of house districts type int default 0 N/A N/A N/A parser add_option -i --install dest do_install help Install dependencencies. default False action store_true N/A N/A N/A parser add_option -g --getdata dest do_getdata help Get data. default False action store_true N/A N/A N/A parser add_option -s --gensld dest do_gensld help Generate slds default False action store_true N/A N/A N/A parser add_option -c --genconf dest do_genconf help Generate config file default False action store_true N/A N/A N/A parser add_option -d --dropdb dest do_dropdb help Drop database default False action store_true N/A N/A N/A parser add_option -r --run dest do_run help run setup.py default False action store_true N/A N/A N/A parser add_option --na_inc dest conf_na help Include Native Americans in stats. default False action store_true N/A N/A N/A parser add_option --na_targ_c dest target_na_congress help Number of Native American Congressional Districts for target type int default 0 N/A N/A N/A parser add_option --na_targ_h dest target_na_house help Number of Native American House Districts for target type int default 0 N/A N/A N/A parser add_option --na_targ_s dest target_na_senate help Number of Native American Senate Districts for target type int default 0 N/A N/A N/A parser add_option --hisp_targ_c dest target_hisp_congress help Number of Hispanic Congressional Districts for target type int default 0 N/A N/A N/A parser add_option --hisp_targ_h dest target_hisp_house help Number of Hispanic House Districts for target type int default 0 N/A N/A N/A parser add_option --hisp_targ_s dest target_hisp_senate help Number of Hispanic SenateDistricts for target type int default 0 N/A N/A N/A parser add_option --bl_targ_c dest target_bl_congress help Number of Black Congressional districts for target type int default 0 N/A N/A N/A parser add_option --bl_targ_h dest target_bl_house help Number of Black House districts for target type int default 0 N/A N/A N/A parser add_option --bl_targ_s dest target_bl_senate help Number of Black Senate districts for target type int default 0 N/A N/A parseResults numargs N/A N/A parser parse_args N/A N/A N/A N/A N/A parseResults target_na_congress N/A parseResults target_na_senate N/A parseResults target_na_house 0 N/A N/A N/A parseResults conf_na True N/A allops N/A N/A N/A parseResults do_install N/A N/A parseResults do_getdata N/A N/A parseResults do_gensld N/A N/A parseResults do_genconf N/A N/A parseResults do_dropdb N/A N/A parseResults do_run N/A allops N/A N/A N/A parseResults do_install True N/A N/A parseResults do_getdata True N/A N/A parseResults do_gensld True N/A N/A parseResults do_genconf True N/A N/A parseResults do_dropdb True N/A N/A parseResults do_run True N/A N/A N/A len numargs 0 N/A N/A N/A N/A parser error additional arguments ignored  N/A stateFips N/A parseResults stateFips N/A houseDis N/A parseResults houseDis N/A senDis N/A parseResults senDis N/A congDis N/A parseResults congDis N/A N/A N/A stateFips 0 N/A houseDis 0 N/A senDis 0 N/A congDis 0 N/A N/A Must supply all district arguments N/A ValueError N/A N/A parseResults do_install N/A N/A installing dependencies... N/A N/A install_dependencies N/A N/A parseResults do_dropdb N/A N/A clearing database ... N/A N/A drop_db N/A N/A parseResults do_gensld N/A N/A generating generic sld files ... N/A N/A gensld_none county N/A N/A gensld_none tract N/A N/A gensld_none block N/A N/A gensld_boundaries county N/A N/A gensld_boundaries tract N/A N/A gensld_boundaries block N/A N/A parseResults do_getdata N/A N/A retrieving census data ... N/A N/A get_census_data stateFips N/A merging data... N/A N/A N/A N/A robjects r source /projects/PublicMapping/DistrictBuilder/docs/loadcensus/mergeCensus.R N/A N/A N/A parseResults do_genconf N/A parseResults do_gensld N/A N/A calculating statistics for configs and slds... N/A N/A N/A N/A robjects r source /projects/PublicMapping/DistrictBuilder/docs/loadcensus/calcStats.R N/A sum_TOTPOP N/A N/A N/A robjects r sum_TOTPOP N/A 0 N/A has_election_data N/A N/A N/A robjects r has_election_data N/A 0 N/A N/A parseResults do_genconf N/A N/A N/A N/A N/A robjects r source /projects/PublicMapping/DistrictBuilder/docs/loadcensus/contiguityOverride.R N/A f N/A open /projects/PublicMapping/DistrictBuilder/docs/generated_overrides.xml r N/A contiguityOverrideString N/A N/A f read N/A N/A N/A f close N/A N/A parseResults do_gensld N/A N/A generating choropleth slds ... N/A N/A gensld_choro block TOTPOP Total Population N/A N/A robjects r q_block_TOTPOP N/A N/A gensld_choro_denquint block TOTPOP_H Percent Hispanic Population N/A N/A robjects r q_block_TOTPOP_H N/A N/A gensld_choro_denquint block TOTPOP_B Percent Black Population N/A N/A robjects r q_block_TOTPOP_B N/A N/A gensld_choro_denquint block TOTPOP_NA Percent Native American Population N/A N/A robjects r q_block_TOTPOP_NA N/A N/A gensld_choro block VAP Voting Age Population N/A N/A robjects r q_block_VAP N/A N/A gensld_choro_denquint block VAP_H Percent Voting Age Hispanic Population N/A N/A robjects r q_block_VAP_H N/A N/A gensld_choro_denquint block VAP_B Percent Voting Age Black Population N/A N/A robjects r q_block_VAP_B N/A N/A gensld_choro_denquint block VAP_NA Percent Voting Age Native American Population N/A N/A robjects r q_block_VAP_NA N/A N/A gensld_choro tract TOTPOP Total Population N/A N/A robjects r q_tract_TOTPOP N/A N/A gensld_choro_denquint tract TOTPOP_H Percent Total Hispanic Population N/A N/A robjects r q_tract_TOTPOP_H N/A N/A gensld_choro_denquint tract TOTPOP_B Percent Black Population N/A N/A robjects r q_tract_TOTPOP_B N/A N/A gensld_choro_denquint tract TOTPOP_NA Percent Native American Population N/A N/A robjects r q_tract_TOTPOP_NA N/A N/A gensld_choro tract VAP Voting Age Population N/A N/A robjects r q_tract_VAP N/A N/A gensld_choro_denquint tract VAP_H Percent Voting Age Hispanic Population N/A N/A robjects r q_tract_VAP_H N/A N/A gensld_choro_denquint tract VAP_B Percent Voting Age Black Population N/A N/A robjects r q_tract_VAP_B N/A N/A gensld_choro_denquint tract VAP_NA Percent Voting Age Native American Population N/A N/A robjects r q_tract_VAP_NA N/A N/A gensld_choro county TOTPOP Total Population N/A N/A robjects r q_county_TOTPOP N/A N/A gensld_choro_denquint county TOTPOP_H Percent Hispanic Population N/A N/A robjects r q_county_TOTPOP_H N/A N/A gensld_choro_denquint county TOTPOP_B Percent Black Population N/A N/A robjects r q_county_TOTPOP_B N/A N/A gensld_choro_denquint county TOTPOP_NA Percent Native American Population N/A N/A robjects r q_county_TOTPOP_NA N/A N/A gensld_choro county VAP Voting Age Population N/A N/A robjects r q_county_VAP N/A N/A gensld_choro_denquint county VAP_H Percent Voting Age Hispanic Population N/A N/A robjects r q_county_VAP_H N/A N/A gensld_choro_denquint county VAP_B Percent Voting Age Black Population N/A N/A robjects r q_county_VAP_B N/A N/A gensld_choro_denquint county VAP_NA Percent Voting Age Native American Population N/A N/A robjects r q_county_VAP_NA N/A N/A has_election_data 1 N/A N/A N/A gensld_choro_denquint block VOTE_DEM Percent Predicted Democratic Vote  N/A N/A robjects r q_block_VOTE_DEM N/A N/A gensld_choro_denquint block VOTE_REP Percent Predicted Republican Vote  N/A N/A robjects r q_block_VOTE_REP N/A N/A gensld_choro block VOTE_TOT Predicted Vote  N/A N/A robjects r q_block_VOTE_TOT N/A N/A gensld_choro_denquint tract VOTE_DEM Percent Predicted Democratic Vote  N/A N/A robjects r q_tract_VOTE_DEM N/A N/A gensld_choro_denquint tract VOTE_REP Percent Predicted Republican Vote  N/A N/A robjects r q_tract_VOTE_REP N/A N/A gensld_choro tract VOTE_TOT Predicted Vote  N/A N/A robjects r q_tract_VOTE_TOT N/A N/A gensld_choro_denquint county VOTE_DEM Perecent Predicted Democratic Vote  N/A N/A robjects r q_county_VOTE_DEM N/A N/A gensld_choro_denquint county VOTE_REP Percent Predicted Republican Vote  N/A N/A robjects r q_county_VOTE_REP N/A N/A gensld_choro county VOTE_TOT Predicted Vote  N/A N/A robjects r q_county_VOTE_TOT N/A N/A gensld_choro_denquint block VOTE_DEM_N Percent Predicted Democratic Vote  N/A N/A robjects r q_block_VOTE_DEM_N N/A N/A gensld_choro_denquint block VOTE_REP_N Percent Predicted Republican Vote  N/A N/A robjects r q_block_VOTE_REP_N N/A N/A gensld_choro block VOTE_TOT_N Predicted Vote  N/A N/A robjects r q_block_VOTE_TOT_N N/A N/A gensld_choro_denquint tract VOTE_DEM_N Percent Predicted Democratic Vote  N/A N/A robjects r q_tract_VOTE_DEM_N N/A N/A gensld_choro_denquint tract VOTE_REP_N Percent Predicted Republican Vote  N/A N/A robjects r q_tract_VOTE_REP_N N/A N/A gensld_choro tract VOTE_TOT_N Predicted Vote  N/A N/A robjects r q_tract_VOTE_TOT_N N/A N/A gensld_choro_denquint county VOTE_DEM_N Percent Predicted Democratic Vote  N/A N/A robjects r q_county_VOTE_DEM_N N/A N/A gensld_choro_denquint county VOTE_REP_N Percent Predicted Republican Vote  N/A N/A robjects r q_county_VOTE_REP_N N/A N/A gensld_choro county VOTE_TOT_N Predicted Vote  N/A N/A robjects r q_county_VOTE_TOT_N N/A N/A parseResults do_genconf N/A N/A generating config file ...  N/A N/A gen_config num_districts_congress congDis num_districts_senate senDis num_districts_house houseDis sum_TOTPOP sum_TOTPOP has_election_data has_election_data has_vtds 0 conf_na N/A parseResults conf_na target_na_congress N/A parseResults target_na_congress target_hisp_congress N/A parseResults target_hisp_congress target_bl_congress N/A parseResults target_bl_congress target_na_house N/A parseResults target_na_house target_hisp_house N/A parseResults target_hisp_house target_bl_house N/A parseResults target_bl_house target_na_senate N/A parseResults target_na_senate target_hisp_senate N/A parseResults target_hisp_senate target_bl_senate N/A parseResults target_bl_senate contiguityOverrideString contiguityOverrideString N/A N/A parseResults do_run N/A N/A running setup-py ...  N/A olddir N/A N/A os getcwd N/A N/A N/A os chdir /projects/PublicMapping/DistrictBuilder/django/publicmapping/ N/A N/A N/A subprocess check_call N/A ls N/A N/A N/A subprocess check_call N/A ./setup.py -v2 /projects/PublicMapping/DistrictBuilder/docs/config.xsd /projects/PublicMapping/DistrictBuilder/docs/config_census_generated.xml shell True N/A N/A N/A os chdir olddir N/A N/A 

*** Now run: ***

 N/A (cd /projects/PublicMapping/DistrictBuilder/django/publicmapping/; python setup.py -v2 /projects/PublicMapping/DistrictBuilder/docs/config.xsd /projects/PublicMapping/DistrictBuilder/docs/config_census_generated.xml) N/A Starting celeryd ... N/A N/A N/A subprocess check_call N/A service celeryd start