<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run(self, format=None, reduce=False, *args, **kwargs):
 """Generates the underlying graph and prints it. """

        plan = self._generate_plan()
        if reduce:
            # This will performa a transitive reduction on the underlying
            # graph, producing less edges. Mostly useful for the "dot" format,
            # when converting to PNG, so it creates a prettier/cleaner
            # dependency graph.
            plan.graph.transitive_reduction()

        fn = FORMATTERS[format]
        fn(sys.stdout, plan.graph)
        sys.stdout.flush()