def _sanitize_input(query: str) -> str:
    """
    Sanitize input and remove whitespace, backtick, and markdown.

    Args:
        query: The query to sanitize

    Returns:
        str: The sanitized query

    """
    # Removes `, whitespace & python from start
    query = re.sub(r"^(\s|`)*(?i:python)?\s*", "", query)
    # Removes whitespace & ` from end
    query = re.sub(r"(\s|`)*$", "", query)
    # Add new line if no new line was appended at the end of the query
    if not query.endswith("\n"):
        query += "\n"
    return query

    Sanitize input and remove whitespace, backtick, and markdown.

    Args:
        query: The query to sanitize

    Returns:
        str: The sanitized query

    
llama-index-integrations/tools/llama-index-tools-azure-code-interpreter/llama_index/tools/azure_code_interpreter/base.py