def lookup_station_code( duids: List[str], station_name: str, station_code_map: dict ) -> Optional[str]: station_code = None station_name = station_name.strip() for facility_duid in duids: if facility_duid in station_code_map: station_code = station_code_map[facility_duid] continue if not station_code: station_code = station_name_code_map(station_name) if not station_code: station_code = station_code_from_duids(duids) if not station_code: print( "Coult not get a station code for {}: {}".format( station_name, ",".join(duids) ) ) return station_code
def lookup_station_code(duids: List[str], station_name: str, station_code_map: dict) -> Optional[str]: station_code = None station_name = station_name.strip() for facility_duid in duids: if facility_duid in station_code_map: station_code = station_code_map[facility_duid] continue if not station_code: station_code = station_name_code_map(station_name) if not station_code: station_code = station_code_from_duids(duids) logger.info( "Had to generate station code from duids: {} from {}".format( station_code, ",".join(duids))) return station_code