def create_tag(self, key=None, category=None, data=None, tagtype=None):
        data = str(data) if data is not None else None
        # try to get old tag

        tag = self.get_tag(key=key, category=category, tagtype=tagtype, global_search=True)
        if tag and data is not None:
            # overload data on tag
            tag.db_data = data
            tag.save()
        elif not tag:
            # create a new tag
            global _Tag
            if not _Tag:
                from evennia.typeclasses.models import Tag as _Tag
            tag = _Tag.objects.create(
                db_key=key.strip().lower() if key is not None else None,
                db_category=category.strip().lower() if category and key is not None else None,
                db_data=data,
                db_tagtype=tagtype.strip().lower() if tagtype is not None else None)
            tag.save()
        return make_iter(tag)[0]

    # object-manager methods
Create a new Tag of the base type associated with this
dataset/ETHPy150Open evennia/evennia/evennia/typeclasses/managers.py/TypedObjectManager.create_tag