<commit_before>@{
cmds = []
for filename in sorted(wrapper_scripts.keys())
    cmd.append('\\n'.join(wrapper_scripts[filename].replace('\\', '\\\\\\\\').replace('"', '\\"').splitlines())') > wrapper_scripts/@(filename)
}@
@[]@
RUN echo "@('\\n'.join(wrapper_scripts[filename].replace('\\', '\\\\\\\\').replace('"', '\\"').splitlines()))" > /tmp/wrapper_scripts/@(filename)
@[end for]@
@(SNIPPET(
    'builder_shell',
    script='\n'.join([
        'echo "# BEGIN SECTION: Embed wrapper scripts"',
        'rm -fr wrapper_scripts',
        'mkdir wrapper_scripts',
    ] + cmds + [
        'echo "# END SECTION"',
    ]),
))@
@{
import re
cmds = []
if ros_buildfarm_repository.version and re.match('[0-9a-f]{40}', ros_buildfarm_repository.version):
    # cannot create a shallow clone for hashes
    cmds += [
        'python3 -u wrapper_scripts/git.py clone %s ros_buildfarm' % ros_buildfarm_repository.url,
        'git -C ros_buildfarm checkout %s' % ros_buildfarm_repository.version,<commit_msg>get the syntax right and only embed git.py<commit_after>@{
filename = 'git.py'
wrapper_script = wrapper_scripts[filename]
cmd = 'echo "%s" > wrapper_scripts/%s' % ('\\n'.join(wrapper_script.replace('\\', '\\\\\\\\').replace('"', '\\"').splitlines()), filename)
}@
@(SNIPPET(
    'builder_shell',
    script='\n'.join([
        'echo "# BEGIN SECTION: Embed wrapper scripts"',
        'rm -fr wrapper_scripts',
        'mkdir wrapper_scripts',
        cmd,
        'echo "# END SECTION"',
    ]),
))@
@{
import re
cmds = []
if ros_buildfarm_repository.version and re.match('[0-9a-f]{40}', ros_buildfarm_repository.version):
    # cannot create a shallow clone for hashes
    cmds += [
        'python3 -u wrapper_scripts/git.py clone %s ros_buildfarm' % ros_buildfarm_repository.url,
        'git -C ros_buildfarm checkout %s' % ros_buildfarm_repository.version,
{'fraction_non_alphanumeric': 0.19311457772996235, 'fraction_numerical': 0.0053792361484669175, 'mean_word_length': 3.4927536231884058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '5538239', 'n_tokens_mistral': 654, 'n_tokens_neox': 639, 'n_words': 133}