The first step is to extract the region code and use it to
construct the id value of the radiobutton. We
also construct a small dictionary for the for=
attribute of the label element, since for is a Python reserved word.