def delete_layer(self, layer):
        if self.artists not in layer:
            return
        for a in self.artists.pop(layer):
            a.clear()

        if isinstance(layer, Data):
            for subset in layer.subsets:
                self.delete_layer(subset)

        if layer is self.display_data:
            for layer in self.artists:
                if isinstance(layer, ImageLayerArtist):
                    self.display_data = layer.data
                    break
            else:
                for artist in self.artists:
                    self.delete_layer(artist.layer)
                self.display_data = None
                self.display_attribute = None

        self._redraw()
dataset/ETHPy150Open glue-viz/glue/glue/viewers/image/client.py/ImageClient.delete_layer/swapped operands of `not in`