def template_escape(text: str) -> str:
    """Returns the text escaped an ready for usage in a Jinja template

    Escapes {{, {% and {#

    Example

    >>> template_escape("{% value }")
    "{{'{%'}} value }"

    Args:
        text (str): The text to escape

    Returns:
        str: Escaped text
    """
    escaped_text = (
        text.replace("{{", "{{'{{'}}").replace("{%", "{{'{%'}}").replace("{#", "{{'{#'}}")
    )
    return escaped_text