def METHOD_NAME(
    infra: Infra, train_schedules: Iterator[TrainSchedule], response_payload
) -> List[SimulationOutput]:
    """
    This function process the payload returned by the backend and fill schedules
    """
    n_trains = len(train_schedules)
    base_simulations = response_payload["base_simulations"]
    assert len(base_simulations) == n_trains
    speed_limits = response_payload["speed_limits"]
    assert len(speed_limits) == n_trains
    eco_simulations = response_payload["eco_simulations"]
    electrification_ranges = response_payload["electrification_ranges"]
    assert len(electrification_ranges) in (0, n_trains)
    power_restriction_ranges = response_payload["power_restriction_ranges"]
    assert len(power_restriction_ranges) in (0, n_trains)
    stops = train_schedules[0].path.payload["path_waypoints"]
    track_stops_id = [stop["location"]["track_section"] for stop in stops]
    track_sections = TrackSectionModel.objects.filter(infra=infra, obj_id__in=track_stops_id)
    id_to_tracks = {track.obj_id: track for track in track_sections}
    stops_additional_information = []
    for stop in stops:
        extensions = id_to_tracks[stop["location"]["track_section"]].data.get("extensions") or {}
        ext_sncf = extensions.get("sncf") or {}
        stops_additional_information.append(
            {
                "id": stop.get("id"),
                "name": stop.get("name"),
                "line_code": ext_sncf.get("line_code"),
                "track_number": ext_sncf.get("track_number"),
                "line_name": ext_sncf.get("line_name"),
                "track_name": ext_sncf.get("track_name"),
            }
        )
    return [
        _create_and_fill_simulation_output(
            train_schedule,
            base_simulations[i],
            eco_simulations[i],
            stops_additional_information,
            speed_limits[i],
            electrification_ranges[i] if electrification_ranges else None,
            power_restriction_ranges[i] if power_restriction_ranges else None,
        )
        for i, train_schedule in enumerate(train_schedules)
    ]