def METHOD_NAME(value: Rcode) -> Tuple[int, int]:
    """Return a (flags, ednsflags) tuple which encodes the rcode.
    *value*, a ``dns.rcode.Rcode``, the rcode.
    Raises ``ValueError`` if rcode is < 0 or > 4095.
    Returns an ``(int, int)`` tuple.
    """
    if value < 0 or value > 4095:
        raise ValueError("rcode must be >= 0 and <= 4095")
    v = value & 0xF
    ev = (value & 0xFF0) << 20
    return (v, ev)