def _fake_designspace(self, ufos):
designspace = designspaceLib.DesignSpaceDocument()<EOL>ufo_to_location = defaultdict(dict)<EOL>for info_key, axis_def in zip(<EOL>("<STR_LIT>", "<STR_LIT>"),<EOL>(WEIGHT_AXIS_DEF, WIDTH_AXIS_DEF),<EOL>):<EOL><INDENT>axis = designspace.newAxisDescriptor()<EOL>axis.tag = axis_def.tag<EOL>axis.name = axis_def.name<EOL>mapping = []<EOL>for ufo in ufos:<EOL><INDENT>user_loc = getattr(ufo.info, info_key)<EOL>if user_loc is not None:<EOL><INDENT>design_loc = class_to_value(axis_def.tag, user_loc)<EOL>mapping.append((user_loc, design_loc))<EOL>ufo_to_location[ufo][axis_def.name] = design_loc<EOL><DEDENT><DEDENT>mapping = sorted(set(mapping))<EOL>if len(mapping) > <NUM_LIT:1>:<EOL><INDENT>axis.map = mapping<EOL>axis.minimum = min([user_loc for user_loc, _ in mapping])<EOL>axis.maximum = max([user_loc for user_loc, _ in mapping])<EOL>axis.default = min(<EOL>axis.maximum, max(axis.minimum, axis_def.default_user_loc)<EOL>)<EOL>designspace.addAxis(axis)<EOL><DEDENT><DEDENT>for ufo in ufos:<EOL><INDENT>source = designspace.newSourceDescriptor()<EOL>source.font = ufo<EOL>source.familyName = ufo.info.familyName<EOL>source.styleName = ufo.info.styleName<EOL>source.path = ufo.path<EOL>source.location = ufo_to_location[ufo]<EOL>designspace.addSource(source)<EOL><DEDENT>if any("<STR_LIT>" in ufo.lib for ufo in ufos):<EOL><INDENT>skip_export_glyphs = {<EOL>frozenset(ufo.lib.get("<STR_LIT>", [])) for ufo in ufos<EOL>}<EOL>if len(skip_export_glyphs) == <NUM_LIT:1>:<EOL><INDENT>designspace.lib["<STR_LIT>"] = sorted(<EOL>next(iter(skip_export_glyphs))<EOL>)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>return designspace<EOL>
Build a fake designspace with the given UFOs as sources, so that all
        builder functions can rely on the presence of a designspace.