def batch_add_ips(ips):
        """
        Adds the given list of IPs to the database if the IP is not already there.
        :param ips: list of IPs
        :return: number of created IPs
        :type ips: list
        :rtype: int
        """
        ips_created = 0
        if len(ips) > 0:
            # for each ip, check if already existent, if not add
            for ip in ips:
                (s0, s1, s2, s3) = ip.split('.')
                (ip_db, is_ip_created) = IP.objects.get_or_create(seg_0=s0, seg_1=s1, seg_2=s2, seg_3=s3, )
                if is_ip_created:
                    ips_created += 1
        return ips_created
Adds the given list of IPs to the database if the IP is not already there.
        :param ips: list of IPs
        :return: number of created IPs
        :type ips: list
        :rtype: int