<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _insert_additionals(self, fmtos, seen=None):
 """ Insert additional formatoptions into `fmtos`. This method inserts those formatoptions into `fmtos` that are required because one of the following criteria is fullfilled: 1. The :attr:`replot` attribute is True 2. Any formatoption with START priority is in `fmtos` 3. A dependency of one formatoption is in `fmtos` Parameters fmtos: list The list of formatoptions that shall be updated seen: set The formatoption keys that shall not be included. If None, all formatoptions in `fmtos` are used Returns ------- fmtos The initial `fmtos` plus further formatoptions Notes ----- `fmtos` and `seen` are modified in place (except that any formatoption in the initial `fmtos` has :attr:`~Formatoption.requires_clearing` attribute set to True)"""

        def get_dependencies(fmto):
            if fmto is None:
                return []
            return fmto.dependencies + list(chain(*map(
                lambda key: get_dependencies(getattr(self, key, None)),
                fmto.dependencies)))
        seen = seen or {fmto.key for fmto in fmtos}
        keys = {fmto.key for fmto in fmtos}
        self.replot = self.replot or any(
            fmto.requires_replot for fmto in fmtos)
        if self.replot or any(fmto.priority >= START for fmto in fmtos):
            self.replot = True
            self.plot_data = self.data
            new_fmtos = dict((f.key, f) for f in self._fmtos
                             if ((f not in fmtos and is_data_dependent(
                                 f, self.data))))
            seen.update(new_fmtos)
            keys.update(new_fmtos)
            fmtos += list(new_fmtos.values())

        # insert the formatoptions that have to be updated if the plot is
        # changed
        if any(fmto.priority >= BEFOREPLOTTING for fmto in fmtos):
            new_fmtos = dict((f.key, f) for f in self._fmtos
                             if ((f not in fmtos and f.update_after_plot)))
            fmtos += list(new_fmtos.values())
        for fmto in set(self._fmtos).difference(fmtos):
            all_dependencies = get_dependencies(fmto)
            if keys.intersection(all_dependencies):
                fmtos.append(fmto)
        if any(fmto.requires_clearing for fmto in fmtos):
            self.cleared = True
            return list(self._fmtos)
        return fmtos