@py2_compatible<EOL>def irelay(gen, thru):
gen = iter(gen)<EOL>assert _is_just_started(gen)<EOL>yielder = yield_from(gen)<EOL>for item in yielder:<EOL><INDENT>with yielder:<EOL><INDENT>subgen = thru(item)<EOL>subyielder = yield_from(subgen)<EOL>for subitem in subyielder:<EOL><INDENT>with subyielder:<EOL><INDENT>subyielder.send((yield subitem))<EOL><DEDENT><DEDENT>yielder.send(subyielder.result)<EOL><DEDENT><DEDENT>return_(yielder.result)<EOL>
Create a new generator by relaying yield/send interactions
    through another generator

    Parameters
    ----------
    gen: Generable[T_yield, T_send, T_return]
        the original generator
    thru: ~typing.Callable[[T_yield], ~typing.Generator]
        the generator callable through which each interaction is relayed

    Returns
    -------
    ~typing.Generator
        the relayed generator