def METHOD_NAME(instructions, renamer):
    """Rename the nodes in the instructions.
    :param instructions: Iterable of nodes.
    :param renamer: Function that maps nodes to new names
    :return: List of instructions with nodes renamed.
    """
    mapper = Memoizer(_rename_node)
    mapper.renamer = renamer
    return list(map(mapper, instructions))