code: def _template(node_id, value=None):
      "Check if a template is assigned to it and render that with the value"
      result = []
      select_template_from_node = fetch_query_string('select_template_from_node.sql')
      try:
          result = db.execute(text(select_template_from_node), node_id=node_id)
          template_result = result.fetchone()
          result.close()
          if template_result and template_result['name']:
              template = template_result['name']
  
              if isinstance(value, dict):
                  return render_template(template, **value)
              else:
                  return render_template(template, value=value)
      except DatabaseError as err:
          current_app.logger.error("DatabaseError: %s", err)
  
      # No template assigned to this node so just return the value
      return valuf _template(node_id, value=None):
      "Check if a template is assigned to it and render that with the value"
      result = []
      select_template_from_node = fetch_query_string('select_template_from_node.sql')
      try:
          result = db.execute(text(select_template_from_node), node_id=node_id)
          template_result = result.fetchone()
          result.close()
          if template_result and template_result['name']:
              template = template_result['name']
  
              if isinstance(value, dict):
                  return render_template(template, **value)
              else:
                  return render_template(template, value=value)
      except DatabaseError as err:
          current_app.logger.error("DatabaseError: %s", err)
  
      # No template assigned to this node so just return the value
      return value
docs: Check if a template is assigned to it and render that with the value