def get_locations(self):
if not self.zipcode_mapping:<EOL><INDENT>self.download(overwrite=False)<EOL>zipcode_mapping = {}<EOL>with UnicodeReader(self.file_path, delimiter='<STR_LIT:;>', encoding='<STR_LIT>') as csv_reader:<EOL><INDENT>next(csv_reader)<EOL>for line in csv_reader:<EOL><INDENT>zipcode_mapping[int(line[<NUM_LIT:1>])] = Location(<EOL>official_name=line[<NUM_LIT:0>],<EOL>canton=line[<NUM_LIT:5>],<EOL>municipality=line[<NUM_LIT:3>]<EOL>)<EOL><DEDENT><DEDENT>self.zipcode_mapping = zipcode_mapping<EOL><DEDENT>return self.zipcode_mapping<EOL>
Return the zipcodes mapping as a list of ``{zipcode: location}`` dicts.
The zipcodes file will be downloaded if necessary.