def find_sparse_mode(self, core, additional, scaling, weights={}):
if len(core) == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>self.lp7(core)<EOL>k = set()<EOL>for reaction_id in core:<EOL><INDENT>flux = self.get_flux(reaction_id)<EOL>if self.is_flipped(reaction_id):<EOL><INDENT>flux *= -<NUM_LIT:1><EOL><DEDENT>if flux >= self._epsilon:<EOL><INDENT>k.add(reaction_id)<EOL><DEDENT><DEDENT>if len(k) == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>self.lp10(k, additional, weights)<EOL>for reaction_id in self._model.reactions:<EOL><INDENT>flux = self.get_flux(reaction_id)<EOL>if abs(flux) >= self._epsilon / scaling:<EOL><INDENT>yield reaction_id<EOL><DEDENT><DEDENT>
Find a sparse mode containing reactions of the core subset.

        Return an iterator of the support of a sparse mode that contains as
        many reactions from core as possible, and as few reactions from
        additional as possible (approximately). A dictionary of weights can be
        supplied which gives further penalties for including specific
        additional reactions.