<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _handle_get_cfn_template_response(self, response, application_id, template_id):
 """ Handles the response from the SAR service call :param dict response: the response dictionary from the app repo :param string application_id: the ApplicationId :param string template_id: the unique TemplateId for this application """

        status = response['Status']
        if status != "ACTIVE":
            # Other options are PREPARING and EXPIRED.
            if status == 'EXPIRED':
                message = ("Template for {} with id {} returned status: {}. Cannot access an expired "
                           "template.".format(application_id, template_id, status))
                raise InvalidResourceException(application_id, message)
            self._in_progress_templates.append((application_id, template_id))