<commit_before>import sys
import os
import yaml
from jinja2 import Environment, FileSystemLoader

def env_override(value, key):
  return os.getenv(key, value)

def main():
    jinja = Environment(loader=FileSystemLoader("."))
    jinja.filters['env'] = env_override

    template = jinja.get_template("meta-compose.yml")

    with open("meta-compose-data.yml", "r") as fh:
        data = yaml.safe_load(fh)

    composition = template.render(data)

    with open("docker-compose.yml", "w") as fh:
        fh.write(composition)<commit_msg>fix error when no meta-compose-data.yml present<commit_after>import sys
import os
import yaml
from jinja2 import Environment, FileSystemLoader

def env_override(value, key):
  return os.getenv(key, value)

def main():

    template_file_name = "meta-compose.yml"
    data_file_name = "meta-compose-data.yml"

    jinja = Environment(loader=FileSystemLoader("."))
    jinja.filters['env'] = env_override

    template = jinja.get_template(template_file_name)


    if os.path.isfile(data_file_name):
        with open(data_file_name, "r") as fh:
            data = yaml.safe_load(fh)
    else:
        data = {}

    composition = template.render(data)

    with open("docker-compose.yml", "w") as fh:
        fh.write(composition)
{'fraction_non_alphanumeric': 0.12145110410094637, 'fraction_numerical': 0.0015772870662460567, 'mean_word_length': 3.7, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '479203', 'n_tokens_mistral': 448, 'n_tokens_neox': 408, 'n_words': 92}