def execute(self):
        if not self.args:
            self.pc.update_output('Enter what?\n')
            return
        fail = 'You don\'t see "%s" here.' % self.args
        if self.pc.location:
            # Check the room for the portal object first
            obj = self.pc.location.get_item_by_kw(self.args)
            if obj:
                if 'portal' in obj.item_types:
                    self.go_portal(obj.item_types['portal'])
                else:
                    self.pc.update_output('%s is not a portal.' % obj.name.capitalize())
            else:
                # If the portal isn't in the room, check their inventory
                obj = self.pc.check_inv_for_keyword(self.args)
                if obj:
                    if 'portal' in obj.item_types:
                        # If the portal is in their inventory, make them drop it first
                        # (a portal can't go through itself)
                        Drop(self.pc, self.args, 'drop').execute()
                        self.go_portal(obj.item_types['portal'])
                    else:
                        self.pc.update_output('%s is not a portal.' % obj.name.capitalize())
                else:
                    # We've struck out an all counts -- the player doesn't have a portal
                    self.pc.update_output(fail)
dataset/ETHPy150Open shinymud/ShinyMUD/src/shinymud/commands/commands.py/Enter.execute/original