import ipaddress


def _collapse_cidrs(list_of_cidr_nets: list[str]) -> list[str]:
    """Remove overlapping ip ranges

    Args:
        list_of_cidr_nets (list[str]): IP ranges

    Returns:
        list[str]: IP ranges with overlaps removed
    """
    nets = (ip for _ip in list_of_cidr_nets if (ip := ipaddress.ip_network(_ip)) and isinstance(ip, ipaddress.IPv4Network))
    ip_ranges = [str(ip_range) for ip_range in ipaddress.collapse_addresses(nets)]
    return ip_ranges