code: def render_yaml_template(template: str, env: Optional[Dict] = None):
      render_env = copy.deepcopy(os.environ)
      if env:
          render_env.update(env)
  
      try:
          content = jinja2.Template(template).render(env=render_env)
          return yaml.safe_load(content)
      except Exception as e:
          raise ReleaseTestConfigError(
              f"Error rendering/loading yaml template: {e}"
          ) from e
  
file_path: ray/release/ray_release/template.py
imports: import copy
  import datetime
  import os
  from typing import Optional, Dict, TYPE_CHECKING
  import jinja2
  import yaml
  from ray_release.bazel import bazel_runfile
  from ray_release.config import get_test_cloud_id
  from ray_release.exception import ReleaseTestConfigError
label_desc: Use image node_id 6 for calling a global function with example usage: render_yaml_template(template, env) and returns: yaml