def validate(self):
        if 'action' in self.resource:
            action = self.resource['action']
            if action is not ['allow', 'deny']:
                raise ValueError(
                    "The action attribute must be "
                    "either allow or deny")

        if 'ip_version' in self.resource:
            ip_version = self.resource['ip_version']
            if ip_version not in ['4', '6']:
                raise ValueError(
                    "The ip_version attribute must be "
                    "either 4 or 6")

        if 'protocol' in self.resource:
            protocol = self.resource['protocol']
            if protocol not in ['tcp', 'udp', 'icmp', None]:
                raise ValueError(
                    "The protocol attribute must be "
                    "either tcp, udp, icmp or None")

        return True
dataset/ETHPy150Open cloudtools/troposphere/troposphere/openstack/neutron.py/FirewallRule.validate/operator `not in` -> `is not`