<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_from_ufos(self, ufos, output=(), **kwargs):
 """Run toolchain from UFO sources. Args: ufos: List of UFO sources, as either paths or opened objects. output: List of output formats to generate. kwargs: Arguments passed along to save_otfs. """


        if set(output) == {"ufo"}:
            return

        # the `ufos` parameter can be a list of UFO objects
        # or it can be a path (string) with a glob syntax
        ufo_paths = []
        if isinstance(ufos, basestring):
            ufo_paths = glob.glob(ufos)
            ufos = [Font(x) for x in ufo_paths]
        elif isinstance(ufos, list):
            # ufos can be either paths or open Font objects, so normalize them
            ufos = [Font(x) if isinstance(x, basestring) else x for x in ufos]
            ufo_paths = [x.path for x in ufos]
        else:
            raise FontmakeError(
                "UFOs parameter is neither a defcon.Font object, a path or a glob, "
                "nor a list of any of these.",
                ufos,
            )

        need_reload = False
        if "otf" in output:
            self.build_otfs(ufos, **kwargs)
            need_reload = True

        if "ttf" in output:
            if need_reload:
                ufos = [Font(path) for path in ufo_paths]
            self.build_ttfs(ufos, **kwargs)
            need_reload = True