def _resolve_features(self):
for parentid in self.featsbyparent:<EOL><INDENT>parent = self.featsbyid[parentid]<EOL>for child in self.featsbyparent[parentid]:<EOL><INDENT>parent.add_child(child, rangecheck=self.strict)<EOL><DEDENT><DEDENT>for n, record in enumerate(self.records):<EOL><INDENT>if not isinstance(record, Feature):<EOL><INDENT>continue<EOL><DEDENT>if not record.is_multi:<EOL><INDENT>continue<EOL><DEDENT>assert record.multi_rep == record<EOL>newrep = sorted(record.siblings + [record])[<NUM_LIT:0>]<EOL>if newrep != record:<EOL><INDENT>for sib in sorted(record.siblings + [record]):<EOL><INDENT>sib.multi_rep = newrep<EOL>if sib != newrep:<EOL><INDENT>newrep.add_sibling(sib)<EOL><DEDENT><DEDENT>record.siblings = None<EOL><DEDENT>parent = newrep.pseudoify()<EOL>self.records[n] = parent<EOL><DEDENT>if not self.assumesorted:<EOL><INDENT>for seqid in self.inferred_regions:<EOL><INDENT>if seqid not in self.declared_regions:<EOL><INDENT>seqrange = self.inferred_regions[seqid]<EOL>srstring = '<STR_LIT>'.format(<EOL>seqid, seqrange.start + <NUM_LIT:1>, seqrange.end<EOL>)<EOL>seqregion = Directive(srstring)<EOL>self.records.append(seqregion)<EOL><DEDENT><DEDENT><DEDENT>for record in sorted(self.records):<EOL><INDENT>yield record<EOL><DEDENT>self._reset()<EOL>
Resolve Parent/ID relationships and yield all top-level features.