def __init__(self, arg, **kwargs):
        # this event should be fired on animation of sequenced img's
        self.register_event_type('on_texture')

        super(Image, self).__init__()

        self._mipmap = kwargs.get('mipmap', False)
        self._keep_data = kwargs.get('keep_data', False)
        self._nocache = kwargs.get('nocache', False)
        self._size = [0, 0]
        self._image = None
        self._filename = None
        self._texture = None
        self._anim_available = False
        self._anim_index = 0
        self._anim_delay = 0
        self.anim_delay = kwargs.get('anim_delay', .25)
        # indicator of images having been loded in cache
        self._iteration_done = False

        if isinstance(arg, Image):
            for attr in Image.copy_attributes:
                self.__setattr__(attr, arg.__getattribute__(attr))
        elif type(arg) in (Texture, TextureRegion):
            if not hasattr(self, 'textures'):
                self.textures = []
                self.textures.append(arg)
            self._texture = arg
            self._size = self.texture.size
        elif isinstance(arg, ImageLoaderBase):
            self.image = arg
        elif isinstance(arg, BytesIO):
            ext = kwargs.get('ext', None)
            if not ext:
                raise Exception('Inline loading require "ext" parameter')
            filename = kwargs.get('filename')
            if not filename:
                self._nocache = True
                filename = '__inline__'
            self.load_memory(arg, ext, filename)
        elif isinstance(arg, string_types):
            groups = self.data_uri_re.findall(arg)
            if groups:
                self._nocache = True
                imtype, optstr, data = groups[0]
                options = [o for o in optstr.split(';') if o]
                ext = imtype
                isb64 = options in 'base64'
                if data:
                    if isb64:
                        data = b64decode(data)
                    self.load_memory(BytesIO(data), ext)
            else:
                self.filename = arg
        else:
            raise Exception('Unable to load image type {0!r}'.format(arg))
dataset/ETHPy150Open kivy/kivy/kivy/core/image/__init__.py/Image.__init__/swapped operands of `in`