def set_repeat(self, repeat_mode):
<EOL>if int(repeat_mode) == const.REPEAT_STATE_OFF:<EOL><INDENT>state = <NUM_LIT:1><EOL><DEDENT>elif int(repeat_mode) == const.REPEAT_STATE_ALL:<EOL><INDENT>state = <NUM_LIT:2><EOL><DEDENT>elif int(repeat_mode) == const.REPEAT_STATE_TRACK:<EOL><INDENT>state = <NUM_LIT:3><EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>' + str(repeat_mode))<EOL><DEDENT>return self.protocol.send(messages.repeat(state))<EOL>
Change repeat mode.