<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_burst(self, freq, amplitude, period, output_state=True):
 """Sets the func generator to burst mode with external trigerring."""


        ncyc = int(period*freq)
        commands = ['FUNC SIN',
                    'BURS:STAT ON',
                    'BURS:MODE TRIG',  # external trigger
                    'TRIG:SOUR EXT',
                    'TRIG:SLOP POS',
                    'FREQ {0}'.format(freq),
                    'VOLT {0}'.format(amplitude),
                    'VOLT:OFFS 0',
                    'BURS:NCYC {0}'.format(ncyc)]
        if output_state is True:
            commands.append('OUTP ON')
        else:
            commands.append('OUTP OFF')

        command_string = '\n'.join(commands)
        print_string = '\n\t' + command_string.replace('\n', '\n\t')
        logging.info(print_string)
        self.instr.write(command_string)