from typing import Any


def _int_in_range(value: Any, lower: int, upper: int) -> bool:
    """
    Casts as int and returns True if lower <= value <= upper

    >>> _int_in_range(5, 1, 7)
    True

    """
    try:
        value_int = int(value)
    except (TypeError, ValueError):
        return False
    return lower <= value_int <= upper