<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setup(self):
 """ instantiates all report formats that have been added to this reporter, and calls their setup methods. """


        if self._formats:
            # setup has been run already.
            return

        basedir = self.basedir
        options = self.options
        crumbs = self.get_relative_breadcrumbs()

        fmts = list()
        for fmt_class in self.formats:
            fmt = fmt_class(basedir, options, crumbs)
            fmt.setup()
            fmts.append(fmt)

        self._formats = fmts