def load_file(self, file_path):
self._log.info('<STR_LIT>' + file_path)<EOL>agentml = etree.parse(file_path)<EOL>self._schema.assertValid(agentml)<EOL>root = etree.parse(file_path).getroot()<EOL>defaults = {}<EOL>def parse_element(element):<EOL><INDENT>for child in element:<EOL><INDENT>if child.tag == '<STR_LIT>':<EOL><INDENT>Init(self, child, file_path)<EOL><DEDENT>if child.tag == '<STR_LIT>':<EOL><INDENT>self._log.info('<STR_LIT>'.format(group=child.get('<STR_LIT:name>')))<EOL>defaults['<STR_LIT>'] = {child.get('<STR_LIT:name>')}  <EOL>parse_element(child)<EOL>del defaults['<STR_LIT>']<EOL>continue<EOL><DEDENT>if child.tag == '<STR_LIT>':<EOL><INDENT>self._log.info('<STR_LIT>'.format(topic=child.get('<STR_LIT:name>')))<EOL>defaults['<STR_LIT>'] = child.get('<STR_LIT:name>')<EOL>parse_element(child)<EOL>del defaults['<STR_LIT>']<EOL>continue<EOL><DEDENT>if child.tag == '<STR_LIT>':<EOL><INDENT>self._log.info('<STR_LIT>'.format(emotion=child.get('<STR_LIT:name>')))<EOL>defaults['<STR_LIT>'] = child.get('<STR_LIT:name>')<EOL>parse_element(child)<EOL>del defaults['<STR_LIT>']<EOL>continue<EOL><DEDENT>if child.tag == '<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>self.add_trigger(Trigger(self, child, file_path, **defaults))<EOL><DEDENT>except AgentMLError:<EOL><INDENT>self._log.warn('<STR_LIT>', exc_info=True)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>parse_element(root)<EOL>
Load a single AgentML file
:param file_path: Path to the file
:type  file_path: str