def parse(station: str, txt: str) -> TafData:
core.valid_station(station)<EOL>while len(txt) > <NUM_LIT:3> and txt[:<NUM_LIT:4>] in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>txt = txt[<NUM_LIT:4>:]<EOL><DEDENT>_, station, time = core.get_station_and_time(txt[:<NUM_LIT:20>].split('<STR_LIT:U+0020>'))<EOL>retwx = {<EOL>'<STR_LIT>': None,<EOL>'<STR_LIT>': txt,<EOL>'<STR_LIT>': None,<EOL>'<STR_LIT>': None,<EOL>'<STR_LIT>': station,<EOL>'<STR_LIT:time>': core.make_timestamp(time)<EOL>}<EOL>txt = txt.replace(station, '<STR_LIT>')<EOL>txt = txt.replace(time, '<STR_LIT>').strip()<EOL>if core.uses_na_format(station):<EOL><INDENT>use_na = True<EOL>units = Units(**NA_UNITS)  <EOL><DEDENT>else:<EOL><INDENT>use_na = False<EOL>units = Units(**IN_UNITS)  <EOL><DEDENT>txt, retwx['<STR_LIT>'] = core.get_taf_remarks(txt)<EOL>lines = core.split_taf(txt)<EOL>parsed_lines = parse_lines(lines, units, use_na)<EOL>if parsed_lines:<EOL><INDENT>parsed_lines[-<NUM_LIT:1>]['<STR_LIT>'], retwx['<STR_LIT>'], retwx['<STR_LIT>']= core.get_temp_min_and_max(parsed_lines[-<NUM_LIT:1>]['<STR_LIT>'])<EOL>if not (retwx['<STR_LIT>'] or retwx['<STR_LIT>']):<EOL><INDENT>parsed_lines[<NUM_LIT:0>]['<STR_LIT>'], retwx['<STR_LIT>'], retwx['<STR_LIT>']= core.get_temp_min_and_max(parsed_lines[<NUM_LIT:0>]['<STR_LIT>'])<EOL><DEDENT>start, end = parsed_lines[<NUM_LIT:0>]['<STR_LIT>'], parsed_lines[<NUM_LIT:0>]['<STR_LIT>']<EOL>parsed_lines[<NUM_LIT:0>]['<STR_LIT>'] = None<EOL>retwx['<STR_LIT>'], retwx['<STR_LIT>'] = start, end<EOL>parsed_lines = core.find_missing_taf_times(parsed_lines, start, end)<EOL>parsed_lines = core.get_taf_flight_rules(parsed_lines)<EOL><DEDENT>if retwx['<STR_LIT>'][<NUM_LIT:0>] == '<STR_LIT:A>':  <EOL><INDENT>parsed_lines[-<NUM_LIT:1>]['<STR_LIT>'], retwx['<STR_LIT>'], retwx['<STR_LIT>']= core.get_oceania_temp_and_alt(parsed_lines[-<NUM_LIT:1>]['<STR_LIT>'])<EOL><DEDENT>retwx['<STR_LIT>'] = [TafLineData(**line) for line in parsed_lines]  <EOL>return TafData(**retwx), units<EOL>
Returns TafData and Units dataclasses with parsed data and their associated units