def buy_sell(self, keys, current_time):
        dialogue = ["Would you like to buy or sell an item?"]
        choices = ['Buy', 'Sell', 'Leave']
        self.dialogue_box = self.make_dialogue_box(dialogue, 0)
        self.selection_box = self.make_selection_box(choices)
        self.selection_arrow.rect.topleft = self.arrow_pos_list[self.arrow_index]

        if keys[pg.K_DOWN] and self.allow_input:
            if self.arrow_index < (len(choices) - 1):
                self.arrow_index += 1
                self.allow_input = False
                self.notify(c.CLICK)

        elif keys[pg.K_UP] and self.allow_input:
            if self.arrow_index > 0:
                self.arrow_index -= 1
                self.allow_input = False
                self.notify(c.CLICK)
        elif keys[pg.K_SPACE] and self.allow_input:
            if self.arrow_index == 0:
                self.state = 'select'
                self.allow_input = False
                self.arrow_index = 0
            elif self.arrow_index == 1:
                if self.check_for_sellable_items():
                    self.state = 'sell'
                    self.allow_input = False
                    self.arrow_index = 0
                else:
                    self.state = 'cantsell'
                    self.allow_input = False
                    self.arrow_index = 0
            else:
                self.level.state = 'transition out'
                self.game_data['last state'] = self.level.name

            self.arrow_index = 0
            self.notify(c.CLICK2)

        if not keys[pg.K_SPACE] and not keys[pg.K_DOWN] and not keys[pg.K_UP]:
            self.allow_input = True
Ask player if they want to buy or sell something
dataset/ETHPy150Open justinmeister/The-Stolen-Crown-RPG/data/shopgui.py/Gui.buy_sell