import ipaddress


def is_ip_network(network, strict=False):
    """Returns True/False if a string is a valid network."""

    network = str(network)

    try:
        ipaddress.ip_network(network, strict)
        return True

    except ValueError:
        return False