def METHOD_NAME(
    row: dict,
    stations_dict: dict,
    parameter,
):
    vals = {s: v for s, v in row.items() if v is not None}
    if not vals:
        return None, None, None, None
    value = list(vals.values())[0]
    station_id = list(vals.keys())[0][1:]
    distance = stations_dict[station_id][2]
    return parameter, value, distance, station_id