def validate_ip(self, indicator):
        """
        To validate if the given indicator is a valid IP.

        Args:
            indicator (str): The IP indicator to be validated.

        Returns:
            bool: True if the indicator is a valid IPv4 or IPv6, False otherwise.
        """
        __method_name = inspect.currentframe().f_code.co_name
        try:
            ip_obj = ipaddress.ip_address(indicator)
            if ip_obj.version == 4:
                applogger.debug("{}(method={}) : {} is a valid IPv4.".format(self.logs_starts_with, __method_name, indicator))
                return True
            elif ip_obj.version == 6:
                applogger.debug("{}(method={}) : {} is a valid IPv6.".format(self.logs_starts_with, __method_name, indicator))
                return True
        except ValueError:
            applogger.debug("{}(method={}) : {} is not a valid IP address.".format(self.logs_starts_with, __method_name, indicator))
        return False

        To validate if the given indicator is a valid IP.

        Args:
            indicator (str): The IP indicator to be validated.

        Returns:
            bool: True if the indicator is a valid IPv4 or IPv6, False otherwise.
        
Solutions/Team Cymru Scout/Data Connectors/TeamCymruScout/SharedCode/utils.py