def expand_template(template_name, data, output_file, encoding='utf-8'):
    content = evaluate_template(template_name, data)
    if output_file.exists():
        existing_content = output_file.read_text(encoding=encoding)
        if (existing_content == content):
            return
    elif output_file.parent:
        os.makedirs(str(output_file.parent), exist_ok=True)
    output_file.write_text(content, encoding=encoding)
def expand_template(template_name, data, output_file, encoding='utf-8'):
    content = evaluate_template(template_name, data)
    if output_file.exists():
        existing_content = output_file.read_text(encoding=encoding)
        if (existing_content == content):
            return
    elif output_file.parent:
        os.makedirs(str(output_file.parent), exist_ok=True)
    output_file.write_text(content, encoding=encoding)