<commit_before>#include "raptor_api.h"
#include "type/pb_converter.h"
#include "boost/date_time/posix_time/posix_time.hpp"
#include "type/datetime.h"
#include <unordered_set>
#include <chrono>
#include "type/meta_data.h"
#include "fare/fare.h"


namespace navitia { namespace routing {

void fill_section(pbnavitia::Section *pb_section, const type::VehicleJourney* vj,
        const nt::Data & d, bt::ptime now, bt::time_period action_period) {

    if (vj->has_boarding()){
        pb_section->set_type(pbnavitia::boarding);
        return;
    }
    if (vj->has_landing()){
        pb_section->set_type(pbnavitia::landing);
        return;
    }
    auto* vj_pt_display_information = pb_section->mutable_pt_display_informations();
    auto* add_info_vehicle_journey = pb_section->mutable_add_info_vehicle_journey();
    fill_pb_object(vj, d, vj_pt_display_information, 0, now, action_period);
    fill_pb_object(vj, d, add_info_vehicle_journey, 0, now, action_period);
}



pbnavitia::Response make_pathes(const std::vector<navitia::routing::Path>& paths,
        const nt::Data& d, georef::StreetNetwork& worker,
        const type::EntryPoint& origin, const type::EntryPoint& destination,
        const std::vector<bt::ptime>& datetimes, const bool clockwise, const bool show_codes) {
    EnhancedResponse enhanced_response; //wrapper around raw protobuff response to handle ids
    pbnavitia::Response& pb_response = enhanced_response.response;

    bt::ptime now = bt::second_clock::local_time();

    auto temp = worker.get_direct_path();
    if(!temp.path_items.empty()) {
        pb_response.set_response_type(pbnavitia::ITINERARY_FOUND);

        //for each date time we add a direct street journey
        for(bt::ptime datetime : datetimes) {
            pbnavitia::Journey* pb_journey = pb_response.add_journeys();
            pb_journey->set_duration(temp.duration.total_seconds());

            bt::ptime departure;
            if (clockwise) {
                departure = datetime;
            } else {
                departure = datetime - temp.duration;<commit_msg>Kraken: fix requested date for direct path<commit_after>#include "raptor_api.h"
#include "type/pb_converter.h"
#include "boost/date_time/posix_time/posix_time.hpp"
#include "type/datetime.h"
#include <unordered_set>
#include <chrono>
#include "type/meta_data.h"
#include "fare/fare.h"


namespace navitia { namespace routing {

void fill_section(pbnavitia::Section *pb_section, const type::VehicleJourney* vj,
        const nt::Data & d, bt::ptime now, bt::time_period action_period) {

    if (vj->has_boarding()){
        pb_section->set_type(pbnavitia::boarding);
        return;
    }
    if (vj->has_landing()){
        pb_section->set_type(pbnavitia::landing);
        return;
    }
    auto* vj_pt_display_information = pb_section->mutable_pt_display_informations();
    auto* add_info_vehicle_journey = pb_section->mutable_add_info_vehicle_journey();
    fill_pb_object(vj, d, vj_pt_display_information, 0, now, action_period);
    fill_pb_object(vj, d, add_info_vehicle_journey, 0, now, action_period);
}



pbnavitia::Response make_pathes(const std::vector<navitia::routing::Path>& paths,
        const nt::Data& d, georef::StreetNetwork& worker,
        const type::EntryPoint& origin, const type::EntryPoint& destination,
        const std::vector<bt::ptime>& datetimes, const bool clockwise, const bool show_codes) {
    EnhancedResponse enhanced_response; //wrapper around raw protobuff response to handle ids
    pbnavitia::Response& pb_response = enhanced_response.response;

    bt::ptime now = bt::second_clock::local_time();

    auto temp = worker.get_direct_path();
    if(!temp.path_items.empty()) {
        pb_response.set_response_type(pbnavitia::ITINERARY_FOUND);

        //for each date time we add a direct street journey
        for(bt::ptime datetime : datetimes) {
            pbnavitia::Journey* pb_journey = pb_response.add_journeys();
            pb_journey->set_requested_date_time(navitia::to_iso_string_no_fractional(datetime));
            pb_journey->set_duration(temp.duration.total_seconds());

            bt::ptime departure;
            if (clockwise) {
                departure = datetime;
            } else {
                departure = datetime - temp.duration;
{'fraction_non_alphanumeric': 0.11504424778761062, 'fraction_numerical': 0.0009315323707498836, 'mean_word_length': 3.8751418842224745, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7365340', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1397, 'n_words': 268}