def iter_params_for_processing(invocation_order, declaration_order):
def sort_key(item):<EOL><INDENT>try:<EOL><INDENT>idx = invocation_order.index(item)<EOL><DEDENT>except ValueError:<EOL><INDENT>idx = float('<STR_LIT>')<EOL><DEDENT>return (not item.is_eager, idx)<EOL><DEDENT>return sorted(declaration_order, key=sort_key)<EOL>
Given a sequence of parameters in the order as should be considered
    for processing and an iterable of parameters that exist, this returns
    a list in the correct order as they should be processed.