def parse_kegg_entries(f, context=None):
section_id = None<EOL>entry_line = None<EOL>properties = {}<EOL>for lineno, line in enumerate(f):<EOL><INDENT>if line.strip() == '<STR_LIT>':<EOL><INDENT>mark = FileMark(context, entry_line, <NUM_LIT:0>)<EOL>yield KEGGEntry(properties, filemark=mark)<EOL>properties = {}<EOL>section_id = None<EOL>entry_line = None<EOL><DEDENT>else:<EOL><INDENT>if entry_line is None:<EOL><INDENT>entry_line = lineno<EOL><DEDENT>m = re.match(r'<STR_LIT>', line.rstrip())<EOL>if m is not None:<EOL><INDENT>section_id = m.group(<NUM_LIT:1>).lower()<EOL>properties[section_id] = [m.group(<NUM_LIT:2>)]<EOL><DEDENT>elif section_id is not None:<EOL><INDENT>properties[section_id].append(line.strip())<EOL><DEDENT>else:<EOL><INDENT>raise ParseError(<EOL>'<STR_LIT>'.format(lineno))<EOL><DEDENT><DEDENT><DEDENT>
Iterate over entries in KEGG file.