<commit_before># Copyright 2016 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 argparse
import importlib
import os
import sys
import time

# this is needed to allow rclpy to be imported from the build folder
sys.path.insert(0, os.getcwd())


def fill_msg(msg, message_name, i):
    if 'Builtins' == message_name:
        msg.duration_value.sec = int(i)
        msg.duration_value.nanosec = int(100 * i)
        msg.time_value.sec = int(i)
        msg.time_value.nanosec = int(1000 * i)
    elif 'Primitives' == message_name:
        msg.bool_value = True
        msg.byte_value = b'a'
        msg.char_value = 'a'
        msg.float32_value = float(i)
        msg.float64_value = float(i)
        msg.int8_value = int(-i)
        msg.uint8_value = int(i)
        msg.int16_value = int(-i)
        msg.uint16_value = int(i)
        msg.int32_value = int(-i)
        msg.uint32_value = int(i)
        msg.int64_value = int(-i)
        msg.uint64_value = int(i)
        msg.string_value = str(i)
    elif 'FieldsWithSameType' == message_name:
        msg.primitive_values1.bool_value = True
        msg.primitive_values1.byte_value = b'z'
        msg.primitive_values1.char_value = 'z'
        msg.primitive_values1.float32_value = float(i)
        msg.primitive_values1.float64_value = float(i)
        msg.primitive_values1.int8_value = int(-i)
        msg.primitive_values1.uint8_value = int(i)
        msg.primitive_values1.int16_value = int(-i)
        msg.primitive_values1.uint16_value = int(i)
        msg.primitive_values1.int32_value = int(-i)
        msg.primitive_values1.uint32_value = int(i)
        msg.primitive_values1.int64_value = int(-i)
        msg.primitive_values1.uint64_value = int(i)
        msg.primitive_values1.string_value = str(i)
        msg.primitive_values2.bool_value = False
        msg.primitive_values2.byte_value = b'0'
        msg.primitive_values2.char_value = '\0'
        msg.primitive_values2.float32_value = float(i + 1)
        msg.primitive_values2.float64_value = float(i + 1)
        msg.primitive_values2.int8_value = int(-(i + 1))
        msg.primitive_values2.uint8_value = int(i + 1)
        msg.primitive_values2.int16_value = int(-(i + 1))
        msg.primitive_values2.uint16_value = int(i + 1)
        msg.primitive_values2.int32_value = int(-(i + 1))
        msg.primitive_values2.uint32_value = int(i + 1)
        msg.primitive_values2.int64_value = int(-(i + 1))
        msg.primitive_values2.uint64_value = int(i + 1)
        msg.primitive_values2.string_value = str(i + 1)
    elif 'StaticArrayNested' == message_name:
        for j in range(len(msg.primitive_values)):
            msg.primitive_values[j].bool_value = True
            msg.primitive_values[j].byte_value = b'a'
            msg.primitive_values[j].char_value = 'a'
            msg.primitive_values[j].float32_value = float(i + j)
            msg.primitive_values[j].float64_value = float(i + j)
            msg.primitive_values[j].int8_value = int(-(i + j))
            msg.primitive_values[j].uint8_value = int(i + j)
            msg.primitive_values[j].int16_value = int(-(i + j))
            msg.primitive_values[j].uint16_value = int(i + j)
            msg.primitive_values[j].int32_value = int(-(i + j))
            msg.primitive_values[j].uint32_value = int(i + j)
            msg.primitive_values[j].int64_value = int(-(i + j))
            msg.primitive_values[j].uint64_value = int(i + j)
            msg.primitive_values[j].string_value = str(i + j)
    elif 'StaticArrayPrimitives' == message_name:
        msg.bool_values = [True for x in range(len(msg.bool_values))]
        msg.char_values = [str(i + x) for x in range(len(msg.char_values))]
        msg.byte_values = [bytes(i + x) for x in range(len(msg.byte_values))]
        msg.float32_values = [float(i + x) for x in range(len(msg.float32_values))]
        msg.float64_values = [float(i + x) for x in range(len(msg.float32_values))]
        msg.int8_values = [int(-(i + x)) for x in range(len(msg.int8_values))]
        msg.uint8_values = [int(i + x) for x in range(len(msg.uint8_values))]
        msg.int16_values = [int(-(i + x)) for x in range(len(msg.int16_values))]
        msg.uint16_values = [int(i + x) for x in range(len(msg.int16_values))]
        msg.int32_values = [int(-(i + x)) for x in range(len(msg.int16_values))]
        msg.uint32_values = [int(i + x) for x in range(len(msg.int16_values))]
        msg.int64_values = [int(-(i + x)) for x in range(len(msg.int16_values))]
        msg.uint64_values = [int(i + x) for x in range(len(msg.int16_values))]
        msg.string_values = [str(i + x) for x in range(len(msg.string_values))]
    elif 'DynamicArrayPrimitives' == message_name:
        msg.bool_values = [True for x in range(i + 3)]
        msg.byte_values.append(b'a')
        msg.char_values.append('a')
        msg.float32_values = [float(i + x) for x in range(i + 3)]
        msg.float64_values = [float(i + x) for x in range(i + 3)]
        msg.int8_values = [int(-(i + x)) for x in range(i + 3)]
        msg.uint8_values = [int(i + x) for x in range(i + 3)]
        msg.int16_values = [int(-(i + x)) for x in range(i + 3)]
        msg.uint16_values = [int(i + x) for x in range(i + 3)]
        msg.int32_values = [int(-(i + x)) for x in range(i + 3)]
        msg.uint32_values = [int(i + x) for x in range(i + 3)]
        msg.int64_values = [int(-(i + x)) for x in range(i + 3)]
        msg.uint64_values = [int(i + x) for x in range(i + 3)]
        msg.string_values = [str(i + x) for x in range(i + 3)]
    elif 'DynamicArrayNested' == message_name:
        msg.primitive_values = []
        from test_communication.msg import Primitives
        for x in range(i + 3):
            tmpprimitive = Primitives()
            tmpprimitive.bool_value = True
            tmpprimitive.byte_value = b'a'
            tmpprimitive.char_value = 'a'
            tmpprimitive.float32_value = float(x)
            tmpprimitive.float64_value = float(x)
            tmpprimitive.int8_value = int(-x)
            tmpprimitive.uint8_value = int(x)<commit_msg>homogenize fiels assignment for testing<commit_after># Copyright 2016 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 argparse
import importlib
import os
import sys
import time

# this is needed to allow rclpy to be imported from the build folder
sys.path.insert(0, os.getcwd())


def fill_msg(msg, message_name, i):
    if 'Builtins' == message_name:
        msg.duration_value.sec = int(i)
        msg.duration_value.nanosec = int(100 * i)
        msg.time_value.sec = int(i)
        msg.time_value.nanosec = int(1000 * i)
    elif 'Primitives' == message_name:
        msg.bool_value = True
        msg.byte_value = bytes([i])
        msg.char_value = str(i)[0]
        msg.float32_value = float(i)
        msg.float64_value = float(i)
        msg.int8_value = int(-i)
        msg.uint8_value = int(i)
        msg.int16_value = int(-i)
        msg.uint16_value = int(i)
        msg.int32_value = int(-i)
        msg.uint32_value = int(i)
        msg.int64_value = int(-i)
        msg.uint64_value = int(i)
        msg.string_value = str(i)
    elif 'FieldsWithSameType' == message_name:
        msg.primitive_values1.bool_value = True
        msg.primitive_values1.byte_value = bytes([i])
        msg.primitive_values1.char_value = str(i)[0]
        msg.primitive_values1.float32_value = float(i)
        msg.primitive_values1.float64_value = float(i)
        msg.primitive_values1.int8_value = int(-i)
        msg.primitive_values1.uint8_value = int(i)
        msg.primitive_values1.int16_value = int(-i)
        msg.primitive_values1.uint16_value = int(i)
        msg.primitive_values1.int32_value = int(-i)
        msg.primitive_values1.uint32_value = int(i)
        msg.primitive_values1.int64_value = int(-i)
        msg.primitive_values1.uint64_value = int(i)
        msg.primitive_values1.string_value = str(i)
        msg.primitive_values2.bool_value = False
        msg.primitive_values2.byte_value = bytes([i])
        msg.primitive_values2.char_value = str(i)[0]
        msg.primitive_values2.float32_value = float(i + 1)
        msg.primitive_values2.float64_value = float(i + 1)
        msg.primitive_values2.int8_value = int(-(i + 1))
        msg.primitive_values2.uint8_value = int(i + 1)
        msg.primitive_values2.int16_value = int(-(i + 1))
        msg.primitive_values2.uint16_value = int(i + 1)
        msg.primitive_values2.int32_value = int(-(i + 1))
        msg.primitive_values2.uint32_value = int(i + 1)
        msg.primitive_values2.int64_value = int(-(i + 1))
        msg.primitive_values2.uint64_value = int(i + 1)
        msg.primitive_values2.string_value = str(i + 1)
    elif 'StaticArrayNested' == message_name:
        for j in range(len(msg.primitive_values)):
            msg.primitive_values[j].bool_value = True
            msg.primitive_values[j].byte_value = bytes([i + j])
            msg.primitive_values[j].char_value = str(i + j)[0]
            msg.primitive_values[j].float32_value = float(i + j)
            msg.primitive_values[j].float64_value = float(i + j)
            msg.primitive_values[j].int8_value = int(-(i + j))
            msg.primitive_values[j].uint8_value = int(i + j)
            msg.primitive_values[j].int16_value = int(-(i + j))
            msg.primitive_values[j].uint16_value = int(i + j)
            msg.primitive_values[j].int32_value = int(-(i + j))
            msg.primitive_values[j].uint32_value = int(i + j)
            msg.primitive_values[j].int64_value = int(-(i + j))
            msg.primitive_values[j].uint64_value = int(i + j)
            msg.primitive_values[j].string_value = str(i + j)
    elif 'StaticArrayPrimitives' == message_name:
        msg.bool_values = [True for x in range(len(msg.bool_values))]
        msg.char_values = [str(i + x)[0] for x in range(len(msg.char_values))]
        msg.byte_values = [bytes([i + x]) for x in range(len(msg.byte_values))]
        msg.float32_values = [float(i + x) for x in range(len(msg.float32_values))]
        msg.float64_values = [float(i + x) for x in range(len(msg.float64_values))]
        msg.int8_values = [int(-(i + x)) for x in range(len(msg.int8_values))]
        msg.uint8_values = [int(i + x) for x in range(len(msg.uint8_values))]
        msg.int16_values = [int(-(i + x)) for x in range(len(msg.int16_values))]
        msg.uint16_values = [int(i + x) for x in range(len(msg.uint16_values))]
        msg.int32_values = [int(-(i + x)) for x in range(len(msg.int32_values))]
        msg.uint32_values = [int(i + x) for x in range(len(msg.uint32_values))]
        msg.int64_values = [int(-(i + x)) for x in range(len(msg.int64_values))]
        msg.uint64_values = [int(i + x) for x in range(len(msg.uint64_values))]
        msg.string_values = [str(i + x) for x in range(len(msg.string_values))]
    elif 'DynamicArrayPrimitives' == message_name:
        msg.bool_values = [True for x in range(i + 3)]
        msg.char_values = [str(i + x)[0] for x in range(i + 3)]
        msg.byte_values = [bytes([i + x]) for x in range(i + 3)]
        msg.float32_values = [float(i + x) for x in range(i + 3)]
        msg.float64_values = [float(i + x) for x in range(i + 3)]
        msg.int8_values = [int(-(i + x)) for x in range(i + 3)]
        msg.uint8_values = [int(i + x) for x in range(i + 3)]
        msg.int16_values = [int(-(i + x)) for x in range(i + 3)]
        msg.uint16_values = [int(i + x) for x in range(i + 3)]
        msg.int32_values = [int(-(i + x)) for x in range(i + 3)]
        msg.uint32_values = [int(i + x) for x in range(i + 3)]
        msg.int64_values = [int(-(i + x)) for x in range(i + 3)]
        msg.uint64_values = [int(i + x) for x in range(i + 3)]
        msg.string_values = [str(i + x) for x in range(i + 3)]
    elif 'DynamicArrayNested' == message_name:
        msg.primitive_values = []
        from test_communication.msg import Primitives
        for x in range(i + 3):
            tmpprimitive = Primitives()
            tmpprimitive.bool_value = True
            tmpprimitive.byte_value = bytes([x])
            tmpprimitive.char_value = str(x)[0]
            tmpprimitive.float32_value = float(x)
            tmpprimitive.float64_value = float(x)
            tmpprimitive.int8_value = int(-x)
            tmpprimitive.uint8_value = int(x)
{'fraction_non_alphanumeric': 0.12495326403948254, 'fraction_numerical': 0.03073356763628206, 'mean_word_length': 2.6761957119296316, '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': '5886708', 'n_tokens_mistral': 4853, 'n_tokens_neox': 4649, 'n_words': 1027}