def render_template(value, context=None):
    """
    Render provided template with the provided context.

    :param value: Template string.
    :type value: ``str``

    :param context: Template context.
    :type context: ``dict``
    """
    if not isinstance(value, six.string_types):
        raise TypeError(
            f"The template value needs to be of type string (was {type(value)})."
        )
    context = context or {}

    env = get_jinja_environment(allow_undefined=False)  # nosec
    template = env.from_string(value)
    rendered = template.render(context)

    return rendered

    Render provided template with the provided context.

    :param value: Template string.
    :type value: ``str``

    :param context: Template context.
    :type context: ``dict``
    
st2common/st2common/util/templating.py