<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def runTemplate(id, data={}):
 """ Run an existing Template and waits for the Result. Prints result to stdout. Args: `id`: ID of the template to run `data`: json data containing the input_vars Returns: An integer as status (0: success, 1: failure) """

        conn = Qubole.agent()
        path = str(id) + "/run"
        res = conn.post(Template.element_path(path), data)
        cmdType = res['command_type']
        cmdId = res['id']
        cmdClass = eval(cmdType)
        cmd = cmdClass.find(cmdId)
        while not Command.is_done(cmd.status):
            time.sleep(Qubole.poll_interval)
            cmd = cmdClass.find(cmd.id)
        return Template.getResult(cmdClass, cmd)