def _parse_metadata(self, metadata):
retval = {}<EOL>field_keys = [<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT:state>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",  <EOL>"<STR_LIT>",<EOL>]  <EOL>var_keys = [<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",  <EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",  <EOL>"<STR_LIT>",  <EOL>"<STR_LIT>",<EOL>]  <EOL>lines = metadata.splitlines()<EOL>for line in lines:<EOL><INDENT>if len(line) == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>raw_fields = line.split("<STR_LIT:|>")<EOL>fields = dict(zip(field_keys, raw_fields[<NUM_LIT:1> : len(field_keys)]))<EOL>var_offset = len(field_keys) + <NUM_LIT:1><EOL>var_blocks = (len(raw_fields) - var_offset) // len(<EOL>var_keys<EOL>)  <EOL>vars_only = raw_fields[var_offset:]<EOL>variables = {}<EOL>for offset in range(var_blocks):<EOL><INDENT>var_dict = dict(<EOL>zip(<EOL>var_keys,<EOL>vars_only[<EOL>offset<EOL>* len(var_keys) : (offset + <NUM_LIT:1>)<EOL>* len(var_keys)<EOL>],<EOL>)<EOL>)<EOL>variables[var_dict["<STR_LIT>"]] = var_dict<EOL>var_dict["<STR_LIT>"] = float(var_dict["<STR_LIT>"])<EOL>var_dict["<STR_LIT>"] = float(<EOL>var_dict["<STR_LIT>"]<EOL>)<EOL>del var_dict["<STR_LIT>"]  <EOL><DEDENT>line_val = {"<STR_LIT>": variables}<EOL>line_val.update(fields)<EOL>def dms_to_dd(dms):<EOL><INDENT>parts = dms.split("<STR_LIT:U+0020>")<EOL>sec = int(parts[<NUM_LIT:1>]) * <NUM_LIT> + int(parts[<NUM_LIT:2>])<EOL>return float(parts[<NUM_LIT:0>]) + (<EOL>sec / <NUM_LIT><EOL>)  <EOL><DEDENT>line_val["<STR_LIT>"] = dms_to_dd(line_val["<STR_LIT>"])<EOL>line_val["<STR_LIT>"] = dms_to_dd(line_val["<STR_LIT>"])<EOL>retval[line_val["<STR_LIT>"]] = line_val<EOL><DEDENT>return retval<EOL>
Transforms raw HADS metadata into a dictionary (station code -> props)