def get_successors(puz):
    successors = [(copy.deepcopy(puz).transition(a), [a]) for a in puz.actions()]
    if (args.macro_type != 'primitive'):
        valid_macros = macro_list[puz.blank_idx]
        valid_models = model_list[puz.blank_idx]
        macro_successors = [(copy.deepcopy(puz).apply_macro(model=model), macro) for (macro, model) in zip(valid_macros, valid_models)]
        successors += macro_successors
    return successors
def get_successors(puz):
    successors = [(copy.deepcopy(puz).transition(a), [a]) for a in puz.actions()]
    if (args.macro_type != 'primitive'):
        valid_macros = macro_list[puz.blank_idx]
        valid_models = model_list[puz.blank_idx]
        macro_successors = [(copy.deepcopy(puz).apply_macro(model=model), macro) for (macro, model) in zip(valid_macros, valid_models)]
        successors += macro_successors
    return successors