def item_remove(self, item):
        """Remove an item from the character's inventory."""
        if item in self.inventory:
            if not self.is_npc():
                # items don't get saved when they're added to npc inventories
                # Don't bother removing the owner if we're taking it out of
                # an npc's inventory
                item.owner = None
                item.save()
            self.inventory.remove(item)
dataset/ETHPy150Open shinymud/ShinyMUD/src/shinymud/models/character.py/Character.item_remove/original