<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _add_sections(self):
        '''Add the found and required sections to the templ_dict.'''
        for section in self.template_sections:
            try:
                sec_start = self._get_section_start_index(section)
            except NonextantSectionException:
                if section in self.sections_not_required:
                    continue
                raise
            sec_end = self._get_section_end_index(section, sec_start)
            section_value = self.template_str[sec_start+1:sec_end].strip()
            section, section_value = self._transform_key_value(
                section,
                section_value,
                self.section_map
            )
            self.templ_dict['actions']['definition'][section] = section_value
            self.template_str = self.template_str[:sec_start+1] + \
                self.template_str[sec_end:]