def _reaction_cartesion_expansion_unqualified_helper(<EOL>graph: BELGraph,<EOL>u: BaseEntity,<EOL>v: BaseEntity,<EOL>d: dict,<EOL>) -> None:
if isinstance(u, Reaction) and isinstance(v, Reaction):<EOL><INDENT>enzymes = _get_catalysts_in_reaction(u) | _get_catalysts_in_reaction(v)<EOL>for reactant, product in chain(itt.product(u.reactants, u.products),<EOL>itt.product(v.reactants, v.products)):<EOL><INDENT>if reactant in enzymes or product in enzymes:<EOL><INDENT>continue<EOL><DEDENT>graph.add_unqualified_edge(<EOL>reactant, product, INCREASES<EOL>)<EOL><DEDENT>for product, reactant in itt.product(u.products, u.reactants):<EOL><INDENT>if reactant in enzymes or product in enzymes:<EOL><INDENT>continue<EOL><DEDENT>graph.add_unqualified_edge(<EOL>product, reactant, d[RELATION],<EOL>)<EOL><DEDENT><DEDENT>elif isinstance(u, Reaction):<EOL><INDENT>enzymes = _get_catalysts_in_reaction(u)<EOL>for product in u.products:<EOL><INDENT>if product in enzymes:<EOL><INDENT>continue<EOL><DEDENT>if v not in u.products and v not in u.reactants:<EOL><INDENT>graph.add_unqualified_edge(<EOL>product, v, INCREASES<EOL>)<EOL><DEDENT>for reactant in u.reactants:<EOL><INDENT>graph.add_unqualified_edge(<EOL>reactant, product, INCREASES<EOL>)<EOL><DEDENT><DEDENT><DEDENT>elif isinstance(v, Reaction):<EOL><INDENT>enzymes = _get_catalysts_in_reaction(v)<EOL>for reactant in v.reactants:<EOL><INDENT>if reactant in enzymes:<EOL><INDENT>continue<EOL><DEDENT>if u not in v.products and u not in v.reactants:<EOL><INDENT>graph.add_unqualified_edge(<EOL>u, reactant, INCREASES<EOL>)<EOL><DEDENT>for product in v.products:<EOL><INDENT>graph.add_unqualified_edge(<EOL>reactant, product, INCREASES<EOL>)<EOL><DEDENT><DEDENT><DEDENT>
Helper to deal with cartension expansion in unqualified edges.