def handle_input(self, input_str, place=True, check=False):
user = self.get_player()<EOL>pos = self.validate_input(input_str)<EOL>if pos[<NUM_LIT:0>] == '<STR_LIT:u>':<EOL><INDENT>self.undo(pos[<NUM_LIT:1>])<EOL>return pos<EOL><DEDENT>if place:<EOL><INDENT>result = self.set_pos(pos, check)<EOL>return result<EOL><DEDENT>else:<EOL><INDENT>return pos<EOL><DEDENT>
Transfer user input to valid chess position