from typing import Optional


def _filter_key(k: str) -> Optional[str]:
    """Returns None if key k should be omitted; otherwise returns the (possibly modified) key."""
    if k.startswith("return_"):
        return None
    elif k.endswith("_max") or k.endswith("_min"):
        return None
    else:
        k = k.replace("monitor_return", "mr")
        k = k.replace("wrapped_return", "wr")
        return k