def _parse_species_references(self, name):
for species in self._root.iterfind('<STR_LIT>'.format(<EOL>self._reader._sbml_tag(name),<EOL>self._reader._sbml_tag('<STR_LIT>'))):<EOL><INDENT>species_id = species.get('<STR_LIT>')<EOL>if self._reader._level == <NUM_LIT:1>:<EOL><INDENT>try:<EOL><INDENT>value = int(species.get('<STR_LIT>', <NUM_LIT:1>))<EOL>denom = int(species.get('<STR_LIT>', <NUM_LIT:1>))<EOL>species_value = Fraction(value, denom)<EOL><DEDENT>except ValueError:<EOL><INDENT>message = ('<STR_LIT>'<EOL>'<STR_LIT>'.format(self.id))<EOL>if self._reader._strict:<EOL><INDENT>raise ParseError(message)<EOL><DEDENT>else:<EOL><INDENT>logger.warning(message)<EOL><DEDENT>species_value = Decimal(species.get('<STR_LIT>', <NUM_LIT:1>))<EOL><DEDENT><DEDENT>elif self._reader._level == <NUM_LIT:2>:<EOL><INDENT>value_str = species.get('<STR_LIT>', None)<EOL>if value_str is None:<EOL><INDENT>if '<STR_LIT>' in species:<EOL><INDENT>raise ParseError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>species_value = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>species_value = Decimal(value_str)<EOL><DEDENT><DEDENT>elif self._reader._level == <NUM_LIT:3>:<EOL><INDENT>value_str = species.get('<STR_LIT>', None)<EOL>if value_str is None:<EOL><INDENT>raise ParseError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>species_value = Decimal(value_str)<EOL><DEDENT>if species_value % <NUM_LIT:1> == <NUM_LIT:0>:<EOL><INDENT>species_value = int(species_value)<EOL><DEDENT>yield species_id, species_value<EOL><DEDENT>
Yield species id and parsed value for a speciesReference list