In Belgium a borough is the territory of a former municipality that was independent before the big municipal reorganizations in the 1960s-70s. A merged municipality (abbreviated municipality) therefore counts as many boroughs as there were once communities before the merger. A former municipality may call itself a borough if it was an independent municipality on January 1, 1961, the official start date of the great reorganization.

Vladslo-Diksmuide

The name borough has no legal or governing consequences. However, on the basis of the area of the former municipalities it is possible to set up municipal departments. There a local administrative office can be established in a borough hall, often in the former town hall, which offers a limited service for administrative formalities (population, marital status), of which the documents will be sent to the central administration for processing.The police may have a department or commissioner's office on the same premises. Cultural activities (library, meeting rooms) can also be present.

Assignment

Given is a file with all names of the boroughs from a specific region. Each line of the file contains the name of a borough, followed by a tab and the name of the (merger) municipality to which the borough now belongs. Asked:

Example

In the following interactive example session we assume that the file vlaams_gewest.txt is in the current directory.

>>> boroughs = readMunicipalities('vlaams_gewest.txt')
>>> boroughs['Anzegem']
{'Anzegem', 'Gijzelbrechtegem', 'Tiegem', 'Kaster', 'Vichte', 'Ingooigem'}
>>> boroughs['Oostende']
{'Stene', 'Zandvoorde', 'Oostende'}
>>> boroughs['Zonnebeke']
{'Zandvoorde', 'Zonnebeke', 'Geluveld', 'Passendale', 'Beselare'}

>>> searchMunicipalities('Tiegem', boroughs)
{'Anzegem'}
>>> searchMunicipalities('Vladslo', boroughs)
{'Diksmuide'}
>>> searchMunicipalities('Zandvoorde', boroughs)
{'Zonnebeke', 'Oostende'}
>>> searchMunicipalities('Heusden', boroughs)
{'Destelbergen', 'Heusden-Zolder'}
>>> searchMunicipalities('Berchem', boroughs)
{'Antwerpen', 'Kluisbergen'}
>>> searchMunicipalities('Meldert', boroughs)
{'Hoegaarden', 'Lummen', 'Aalst'}
>>> searchMunicipalities('Beveren', boroughs)
{'Beveren', 'Waregem', 'Roeselare', 'Alveringem'}

>>> compounds(boroughs)
{'Knokke-Heist', 'Langemark-Poelkapelle', 'Scherpenheuvel-Zichem', 'Hamont-Achel', 'Houthalen-Helchteren', 'Lo-Reninge', 'Erpe-Mere', 'Spiere-Helkijn', 'Meeuwen-Gruitrode', 'Dilsen-Stokkem', 'Heusden-Zolder', 'Hechtel-Eksel'}