<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def plan(description, stack_action, context, tail=None, reverse=False):
 """A simple helper that builds a graph based plan from a set of stacks. Args: description (str):
 a description of the plan. action (func):
 a function to call for each stack. context (:class:`stacker.context.Context`):
 a :class:`stacker.context.Context` to build the plan from. tail (func):
 an optional function to call to tail the stack progress. reverse (bool):
 if True, execute the graph in reverse (useful for destroy actions). Returns: :class:`plan.Plan`: The resulting plan object """


    def target_fn(*args, **kwargs):
        return COMPLETE

    steps = [
        Step(stack, fn=stack_action, watch_func=tail)
        for stack in context.get_stacks()]

    steps += [
        Step(target, fn=target_fn) for target in context.get_targets()]

    graph = build_graph(steps)

    return build_plan(
        description=description,
        graph=graph,
        targets=context.stack_names,
        reverse=reverse)