def get(self, key, default=None, category=None, return_tagobj=False):
        """
        Get the tag for the given key or list of tags.

        Args:
            key (str or list): The tag or tags to retrieve.
            default (any, optional): The value to return in case of no match.
            category (str, optional): The Tag category to limit the
                request to. Note that `None` is the valid, default
                category.
            return_tagobj (bool, optional): Return the Tag object itself
                instead of a string representation of the Tag.

        Returns:
            tags (str, TagObject or list): The matches, either string
                representations of the tags or the Tag objects themselves
                depending on `return_tagobj`.

        """
        if self._cache is None or not _TYPECLASS_AGGRESSIVE_CACHE:
            self._recache()
        ret = []
        category = category.strip().lower() if category is not None else None
        searchkey = ["%s-%s" % (key.strip().lower(), category) if key is not None else None for key in make_iter(key)]
        ret = [val for val in (self._cache.get(keystr) for keystr in searchkey) if val]
        ret = [to_str(tag.db_data) for tag in ret] if return_tagobj else ret
        return ret[0] if len(ret) == 1 else (ret if ret else default)
dataset/ETHPy150Open evennia/evennia/evennia/typeclasses/tags.py/TagHandler.get/original