def gen_config(num_districts_congress,num_districts_senate,num_districts_house,sum_TOTPOP,has_election_data=0,has_vtds=0, conf_na=False , 
target_na_congress=0, target_hisp_congress = 0 , target_bl_congress = 0,
target_na_house=0, target_hisp_house = 0 , target_bl_house = 0,
target_na_senate =0, target_hisp_senate = 0 , target_bl_senate = 0, contiguityOverrideString = ""): 

        start_na="<!--"        
        start_elec="<!--"        
	end_elec="-->"
	end_na="-->"
        midlevel="tract"
	if (conf_na==True):
                start_na=""
                end_na=""
        midlevel_width="6"
        midlevel_var="TRACTCE10"        
	if (has_election_data==1):
                start_elec=""
                end_elec=""       
	if (has_vtds==1) :                
		midlevel="vtds"
                midlevel_width="4"
                midlevel_var="VTDST10"        
	pop_congress = int(round((sum_TOTPOP/float(num_districts_congress))))
	pop_congress_max = int(round((sum_TOTPOP/float(num_districts_congress)) * 1.005))
        pop_congress_min = int(round((sum_TOTPOP/float(num_districts_congress)) * 0.995))
	pop_house = int(round((sum_TOTPOP/float(num_districts_house))))
	pop_house_max = int(round((sum_TOTPOP/float(num_districts_house)) * 1.1))
        pop_house_min = int(round((float(num_districts_house)/sum_TOTPOP) * 0.9))
	pop_senate = int(round((sum_TOTPOP/float(num_districts_senate))))
	pop_senate_max = int(round((sum_TOTPOP/float(num_districts_senate)) * 1.1))
        pop_senate_min = int(round((sum_TOTPOP/float(num_districts_senate)) * 0.9))
        target_file = '/projects/PublicMapping/DistrictBuilder/docs/config_census_generated.xml'
        f = open(target_file,'w')
        f.write(str( 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)))
	f.write("\n")
        f.close()
        os.chmod(target_file,stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH)    


###
### MAIN
###

#
#  Get Arguments
#
dataset/ETHPy150Open PublicMapping/DistrictBuilder/docs/loadcensus/configureCensus.py/gen_config/swapped operands of `/`