@staticmethod
def _aggr_iplist(ranges, rngcls):
    """
        Helper method for creating aggregated IP range from given list of IP ranges.
        """
    if not ranges:
        return None
    ipmin = None
    ipmax = None
    for rng in ranges:
        if ipmin is None or rng.low() < ipmin:
            ipmin = rng.low()
        if ipmax is None or rng.high() > ipmax:
            ipmax = rng.high()
    return rngcls((ipmin, ipmax))
