def toggle_container(self, kw, toggle):
        obj = self.pc.check_inv_for_keyword(kw)
        # if nothing in inventory, check room
        if not obj:
            obj = self.pc.location.get_item_by_kw(kw)
            if not obj:
                return 'You don\'t see that here.'
        if not obj.has_type('container'):
            return 'That\'s not a container.'
        container = obj.item_types.get('container')
        if toggle == 'close':
            if not container.openable:
                return obj.name.capitalize() % '%s defies your attempts to close it.'
            if container.closed:
                return 'It\'s already closed.'
            container.closed = True
            return 'You close %s.' % obj.name
        else:
            if not container.openable:
                return '%s defies your attempts to open it.' % obj.name.capitalize()
            if not container.closed:
                return 'It\'s already open.'
            container.closed = False
            return 'You open %s.' % obj.name
dataset/ETHPy150Open shinymud/ShinyMUD/src/shinymud/commands/commands.py/ToggleOpen.toggle_container/swapped operands of `%`