def _attr_setter(self, name, typ, attr, attrs):
        """Helper method to populate attributes based on properties."""
        if attrs in attr:
            return

        value = getattr(self, name)

        if not value:
            return

        try:
            attrs[attr] = typ(value)
        except (TypeError, ValueError):
            pass
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/helpers/entity.py/Entity._attr_setter/swapped operands of `in`