code: def render_template(
      engine, input, output, params, wildcards, config, rule
  ):
      try:
          if engine == "yte":
              from snakemake.template_rendering.yte import YteRenderer
  
              return YteRenderer(
                  input, output, params, wildcards, config
              ).render()
          elif engine == "jinja2":
              from snakemake.template_rendering.jinja2 import (
                  Jinja2Renderer,
              )
  
              return Jinja2Renderer(
                  input, output, params, wildcards, config
              ).render()
          else:
              raise WorkflowError(
                  f"Unsupported template engine {engine} in rule {rule}. "
                  "So far, only yte and jinja2 are supported."
              )
      except Exception as e:
          raise WorkflowError(
              f"Error rendering template in rule {rule}.", e
          )
  
imports: from abc import ABC, abstractmethod
  from snakemake.exceptions import WorkflowError
label_desc: Use image node_id 1 for calling a global function with example usage: render_template(engine, input, output, params, wildcards, config, rule) and returns: YteRenderer, Jinja2Renderer