def METHOD_NAME(
    template: dict[str, Any],
    cluster_spec: OCMSpec,
    labels: dict[str, str],
    settings: Optional[dict[str, Any]] = None,
) -> dict[str, Any]:
    body = template["path"]["content"]
    type = template.get("type") or "jinja2"
    extra_curly = type == "extracurlyjinja2"
    vars = json.loads(template.get("variables") or "{}")
    vars["cluster"] = cluster_spec
    vars["labels"] = labels
    rendered = process_jinja2_template(
        body, vars, extra_curly=extra_curly, settings=settings
    )
    return yaml.safe_load(rendered)