from typing import Any


def generate_nonetype(value: Any) -> Any:
    """
    Filter for converting the string "None" to the None literal in Jinja templating.
    Note that the string is converted to title-case before being tested, so any variation of casing works too, such as
    "none," "NONE," "NoNe," etc.

    Args:
        value: The value to be adjusted.

    Returns:
        A literal None if "None" was passed in, otherwise returns the value that was passed in.
    """
    if isinstance(value, str) and value.title() == "None":
        result = None
    else:
        result = value
    return result