<commit_before># Copyright 2014-2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from rosidl_cmake import convert_camel_case_to_lower_case_underscore
from rosidl_cmake import expand_template
from rosidl_cmake import get_newest_modification_time
from rosidl_cmake import read_generator_arguments
from rosidl_parser import parse_message_file
from rosidl_parser import parse_service_file


def generate_cpp(generator_arguments_file):
    args = read_generator_arguments(generator_arguments_file)

    template_dir = args['template_dir']
    mapping_msgs = {
        os.path.join(template_dir, 'msg.hpp.template'): '%s.hpp',
        os.path.join(template_dir, 'msg__struct.hpp.template'): '%s__struct.hpp',
        os.path.join(template_dir, 'msg__traits.hpp.template'): '%s__traits.hpp',
    }

    mapping_srvs = {
        os.path.join(template_dir, 'srv.hpp.template'): '%s.hpp',
        os.path.join(template_dir, 'srv__struct.hpp.template'): '%s__struct.hpp',
        os.path.join(template_dir, 'srv__traits.hpp.template'): '%s__traits.hpp',
    }
    for template_file in mapping_msgs.keys():
        assert os.path.exists(template_file)
    for template_file in mapping_srvs.keys():
        assert os.path.exists(template_file)

    functions = {
        'get_header_filename_from_msg_name': convert_camel_case_to_lower_case_underscore,
    }
    latest_target_timestamp = get_newest_modification_time(args['target_dependencies'])<commit_msg>add debug information to assert<commit_after># Copyright 2014-2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from rosidl_cmake import convert_camel_case_to_lower_case_underscore
from rosidl_cmake import expand_template
from rosidl_cmake import get_newest_modification_time
from rosidl_cmake import read_generator_arguments
from rosidl_parser import parse_message_file
from rosidl_parser import parse_service_file


def generate_cpp(generator_arguments_file):
    args = read_generator_arguments(generator_arguments_file)

    template_dir = args['template_dir']
    mapping_msgs = {
        os.path.join(template_dir, 'msg.hpp.template'): '%s.hpp',
        os.path.join(template_dir, 'msg__struct.hpp.template'): '%s__struct.hpp',
        os.path.join(template_dir, 'msg__traits.hpp.template'): '%s__traits.hpp',
    }

    mapping_srvs = {
        os.path.join(template_dir, 'srv.hpp.template'): '%s.hpp',
        os.path.join(template_dir, 'srv__struct.hpp.template'): '%s__struct.hpp',
        os.path.join(template_dir, 'srv__traits.hpp.template'): '%s__traits.hpp',
    }
    for template_file in mapping_msgs.keys():
        assert os.path.exists(template_file), 'Could not find template: ' + template_file
    for template_file in mapping_srvs.keys():
        assert os.path.exists(template_file), 'Could not find template: ' + template_file

    functions = {
        'get_header_filename_from_msg_name': convert_camel_case_to_lower_case_underscore,
    }
    latest_target_timestamp = get_newest_modification_time(args['target_dependencies'])
{'fraction_non_alphanumeric': 0.0901999024865919, 'fraction_numerical': 0.005850804485616773, 'mean_word_length': 4.6282578875171465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '931481', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1214, 'n_words': 323}