import ipaddress


def ip_info(**kwargs):
    """ The function check if the given ip address is valid and is a IPv4 or IPv6 """
    try:
        ip_type = ipaddress.ip_network(kwargs.get('address', {}), strict=True)
        return ip_type.version
    except Exception:
        return None