import ipaddress


def is_same_subnet(addr1, addr2, subnet):
    """
    Check whether two given addresses belong to the same subnet
    """

    if ipaddress.ip_network((addr1, subnet), strict=False) == ipaddress.ip_network(
        (addr2, subnet), strict=False
    ):
        return True

    return False