'Core genre identification routine.
Given a pylast entity (album or track), return a list of
tag names for that entity. Return an empty list if the entity is
not found or another error occurs.
If `min_weight` is specified, tags are filtered by weight.'

def _tags_for(self, obj, min_weight=None):

    if isinstance(obj, pylast.Album):
        obj = super(pylast.Album, obj)
    try:
        res = obj.get_top_tags()
    except PYLAST_EXCEPTIONS as exc:
        self._log.debug(u'last.fm    error:    {0}', exc)
        return []
    except Exception as exc:
        self._log.debug(u'{}', traceback.format_exc())
        self._log.error(u'error    in    pylast    library:    {0}', exc)
        return []
    if min_weight:
        res = [el for el in res if (int((el.weight or 0)) >= min_weight)]
    res = [el.item.get_name().lower() for el in res]
    return res
