def _scrub_item(self, item, restore=True):
        # Get album art if we need to restore it.
        if restore:
            try:
                mf = mediafile.MediaFile(util.syspath(item.path),
                                         config['id3v23'].get(bool))
            except IOError as exc:
                self._log.error(u'could not open file to scrub: {0}',
                                exc)
            art = mf.art

        # Remove all tags.
        self._scrub(item.path)

        # Restore tags, if enabled.
        if restore:
            self._log.debug(u'writing new tags after scrub')
            item.try_write()
            if art:
                self._log.debug(u'restoring art')
                mf = mediafile.MediaFile(util.syspath(item.path),
                                         config['id3v23'].get(bool))
                mf.art = art
                mf.save()
Remove tags from an Item's associated file and, if `restore`
dataset/ETHPy150Open beetbox/beets/beetsplug/scrub.py/ScrubPlugin._scrub_item