def decide_k(airport_code):
if airport_code[:<NUM_LIT:1>].upper() == '<STR_LIT>':<EOL><INDENT>try: <EOL><INDENT>return Airport.objects.get(location_identifier__iexact=airport_code[<NUM_LIT:1>:]).location_identifier<EOL><DEDENT>except Airport.DoesNotExist:<EOL><INDENT>return airport_code<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return airport_code<EOL><DEDENT>
A function to decide if a leading 'K' is throwing off an airport match and return the correct code.