import ipaddress


def is_ip_address(x: str):
    """
    Checks if x is a valid ip address.
    """
    try:
        ipaddress.ip_address(x)
        return True
    except ValueError:
        return False