def parse_element(self, element):
        if isinstance(element, dict):
            # if it has a region, we create a texture from that region.
            # else, we use a full texture.
            if element in 'region':
                texture = self._get_texture_region(element['source'], *element['region'])
            else:
                texture = self._get_texture(element['source'])

            # if it has frame, it is a FrameTexture
            # else, it is a simple texture.
            if 'frame' in element:
                return FrameTextureTemplate(
                    texture,
                    element['frame'],
                    element.get('padding', [0, 0, 0, 0])  # if padding, else 0.
                )
            else:
                return TextureTemplate(texture)
        # if it is of the form {'image': 'test.png'}
        else:
            texture = self._get_texture(element)
            return TextureTemplate(texture)
dataset/ETHPy150Open jorgecarleitao/pyglet-gui/pyglet_gui/theme/parsers.py/TextureParser.parse_element/swapped operands of `in`