Build a fake designspace with the given UFOs as sources, so that all
        builder functions can rely on the presence of a designspace.
516995
def _fake_designspace(self, ufos):
        
        designspace = designspaceLib.DesignSpaceDocument()

        ufo_to_location = defaultdict(dict)

        # Make weight and width axis if relevant
        for info_key, axis_def in zip(
            ("openTypeOS2WeightClass", "openTypeOS2WidthClass"),
            (WEIGHT_AXIS_DEF, WIDTH_AXIS_DEF),
        ):
            axis = designspace.newAxisDescriptor()
            axis.tag = axis_def.tag
            axis.name = axis_def.name
            mapping = []
            for ufo in ufos:
                user_loc = getattr(ufo.info, info_key)
                if user_loc is not None:
                    design_loc = class_to_value(axis_def.tag, user_loc)
                    mapping.append((user_loc, design_loc))
                    ufo_to_location[ufo][axis_def.name] = design_loc

            mapping = sorted(set(mapping))
            if len(mapping) > 1:
                axis.map = mapping
                axis.minimum = min([user_loc for user_loc, _ in mapping])
                axis.maximum = max([user_loc for user_loc, _ in mapping])
                axis.default = min(
                    axis.maximum, max(axis.minimum, axis_def.default_user_loc)
                )
                designspace.addAxis(axis)

        for ufo in ufos:
            source = designspace.newSourceDescriptor()
            source.font = ufo
            source.familyName = ufo.info.familyName
            source.styleName = ufo.info.styleName
            # source.name = '%s %s' % (source.familyName, source.styleName)
            source.path = ufo.path
            source.location = ufo_to_location[ufo]
            designspace.addSource(source)

        # UFO-level skip list lib keys are usually ignored, except when we don't have a
        # Designspace file to start from. If they exist in the UFOs, promote them to a
        # Designspace-level lib key. However, to avoid accidents, expect the list to
        # exist in none or be the same in all UFOs.
        if any("public.skipExportGlyphs" in ufo.lib for ufo in ufos):
            skip_export_glyphs = {
                frozenset(ufo.lib.get("public.skipExportGlyphs", [])) for ufo in ufos
            }
            if len(skip_export_glyphs) == 1:
                designspace.lib["public.skipExportGlyphs"] = sorted(
                    next(iter(skip_export_glyphs))
                )
            else:
                raise ValueError(
                    "The `public.skipExportGlyphs` list of all UFOs must either not "
                    "exist or be the same in every UFO."
                )

        return designspace
1360581
def build(self, builder):
        """"""

        params = dict(
            OID=self.oid,
            Name=self.name,
            Repeating=bool_to_yes_no(self.repeating),
            IsReferenceData=bool_to_yes_no(self.is_reference_data),
        )

        if self.sas_dataset_name is not None:
            params["SASDatasetName"] = self.sas_dataset_name

        if self.domain is not None:
            params["Domain"] = self.domain

        if self.origin is not None:
            params["Origin"] = self.origin

        if self.role is not None:
            params["Role"] = self.role

        if self.purpose is not None:
            params["Purpose"] = self.purpose

        if self.comment is not None:
            params["Comment"] = self.comment

        builder.start("ItemGroupDef", params)

        for itemref in self.item_refs:
            itemref.build(builder)

        # Extensions always listed AFTER core elements
        for labelref in self.label_refs:
            labelref.build(builder)

        for alias in self.aliases:
            alias.build(builder)

        builder.end("ItemGroupDef")
672985
def generate(env):
    """"""
    SCons.Tool.createSharedLibBuilder(env)
    SCons.Tool.createProgBuilder(env)

    env['LINK']        = '$CC'
    env['LINKFLAGS']   = SCons.Util.CLVar('')
    env['LINKCOM']     = '$LINK -q $LINKFLAGS -e$TARGET $SOURCES $LIBS'
    env['LIBDIRPREFIX']=''
    env['LIBDIRSUFFIX']=''
    env['LIBLINKPREFIX']=''
    env['LIBLINKSUFFIX']='$LIBSUFFIX'
773685
def build(templates=None, schemes=None, base_output_dir=None):
    """"""
    template_dirs = templates or get_template_dirs()
    scheme_files = get_scheme_files(schemes)
    base_output_dir = base_output_dir or rel_to_cwd('output')

    # raise LookupError if there is not at least one template or scheme
    # to work with
    if not template_dirs or not scheme_files:
        raise LookupError

    # raise PermissionError if user has no write acces for $base_output_dir
    try:
        os.makedirs(base_output_dir)
    except FileExistsError:
        pass

    if not os.access(base_output_dir, os.W_OK):
        raise PermissionError

    templates = [TemplateGroup(path) for path in template_dirs]

    build_from_job_list(scheme_files, templates, base_output_dir)
    print('Finished building process.')
94133
def __construct_really (project, name, target_type, prop_set, sources):
    
    if __debug__:
        from .targets import ProjectTarget
        assert isinstance(project, ProjectTarget)
        assert isinstance(name, basestring) or name is None
        assert isinstance(target_type, basestring)
        assert isinstance(prop_set, property_set.PropertySet)
        assert is_iterable_typed(sources, virtual_target.VirtualTarget)
    viable_generators = find_viable_generators (target_type, prop_set)

    result = []

    dout("      *** %d viable generators" % len (viable_generators))

    generators_that_succeeded = []

    for g in viable_generators:
        __active_generators.append(g)
        r = try_one_generator (project, name, g, target_type, prop_set, sources)
        del __active_generators[-1]

        if r:
            generators_that_succeeded.append(g)
            if result:
                output = cStringIO.StringIO()
                print >>output, "ambiguity found when searching for best transformation"
                print >>output, "Trying to produce type '%s' from: " % (target_type)
                for s in sources:
                    print >>output, " - " + s.str()
                print >>output, "Generators that succeeded:"
                for g in generators_that_succeeded:
                    print >>output, " - " + g.id()
                print >>output, "First generator produced: "
                for t in result[1:]:
                    print >>output, " - " + str(t)
                print >>output, "Second generator produced:"
                for t in r[1:]:
                    print >>output, " - " + str(t)
                get_manager().errors()(output.getvalue())
            else:
                result = r;

    return result;
935755
def build_schema(**args)
      return args[:serializer].new(self).build_schema(args) if args[:serializer]

      if (serializer = find_serializer(args[:for]))
        return serializer.new(self).build_schema(args)
      end

      Surrealist.build_schema(instance: self, **args)
    end
272492
def build(self, builder):
        
        builder.start("LocationRef", dict(LocationOID=str(self.oid)))
        builder.end("LocationRef")
637217
def build(self, force=False):
        
        basepath = self.resourcePath()
        if basepath is None:
            return
        
        outpath = self.pluginPath()
        logger = self.logger()
        
        for rsc in os.listdir(basepath):
            rscpath = os.path.join(basepath, rsc)
            if os.path.isfile(rscpath):
                continue

            opts = (projexui.qt.QT_WRAPPER.lower(), rsc)
            xml_file = os.path.join(basepath, '{1}.qrc'.format(*opts))
            py_file = os.path.join(outpath, '{0}_{1}_rc.py'.format(*opts))
            
            # determine the update for the build system
            if os.path.exists(py_file):
                modtime = os.path.getmtime(py_file)
                outdated = force
            else:
                modtime = None
                outdated = True
            
            # generate the XML data for the filepath
            basepath = os.path.normpath(os.path.abspath(basepath))
            rscpath = os.path.join(basepath, rsc)
            xroot = ElementTree.Element('RCC')
            for root, folders, files in os.walk(rscpath):
                if not files:
                    continue
                
                xresource = ElementTree.SubElement(xroot, 'qresource')
                opts = [rsc, root[len(rscpath)+1:].replace(os.path.sep, '/')]
                xresource.set('prefix', '{0}/{1}'.format(*opts).strip('/'))
                
                # add the files to the resource file
                for file in files:
                    filename = os.path.join(root, file)
                    if not outdated and modtime < os.path.getmtime(filename):
                        outdated = True
                    
                    xfile = ElementTree.SubElement(xresource, 'file')
                    xfile.set('alias', file)
                    xfile.text = os.path.relpath(filename, basepath)
            
            # if the resource file is out dated, then save and generate it
            if outdated and len(xroot):
                logger.info('Generating {0} resource file..'.format(xml_file))
                projex.text.xmlindent(xroot)
                ElementTree.ElementTree(xroot).write(xml_file)
                
                projexui.buildResourceFile(xml_file, py_file)
30352
def build(check, sdist):
    """"""
    if check in get_valid_checks():
        check_dir = os.path.join(get_root(), check)
    else:
        check_dir = resolve_path(check)
        if not dir_exists(check_dir):
            abort('`{}` is not an Agent-based Integration or Python package'.format(check))

        check = basepath(check_dir)

    echo_waiting('Building `{}`...'.format(check))

    dist_dir = os.path.join(check_dir, 'dist')
    remove_path(dist_dir)

    result = build_package(check_dir, sdist)
    if result.code != 0:
        abort(result.stdout, result.code)

    echo_info('Build done, artifact(s) in: {}'.format(dist_dir))
    echo_success('Success!')
1083479
def build_cpp(build_context, target, compiler_config, workspace_dir):
    """"""
    rmtree(workspace_dir)
    binary = join(*split(target.name))
    objects = link_cpp_artifacts(build_context, target, workspace_dir, True)
    buildenv_workspace = build_context.conf.host_to_buildenv_path(
        workspace_dir)
    objects.extend(compile_cc(
        build_context, compiler_config, target.props.in_buildenv,
        get_source_files(target, build_context), workspace_dir,
        buildenv_workspace, target.props.cmd_env))
    bin_file = join(buildenv_workspace, binary)
    link_cmd = (
        [compiler_config.linker, '-o', bin_file] +
        objects + compiler_config.link_flags)
    build_context.run_in_buildenv(
        target.props.in_buildenv, link_cmd, target.props.cmd_env)
    target.artifacts.add(AT.binary, relpath(join(workspace_dir, binary),
                         build_context.conf.project_root), binary)
1242971
def actualize_source_type (self, sources, prop_set):
        
        assert is_iterable_typed(sources, VirtualTarget)
        assert isinstance(prop_set, property_set.PropertySet)
        result = []
        for i in sources:
            scanner = None

# FIXME: what's this?
#            if isinstance (i, str):
#                i = self.manager_.get_object (i)

            if i.type ():
                scanner = b2.build.type.get_scanner (i.type (), prop_set)

            r = i.actualize (scanner)
            result.append (r)

        return result
188001
def build(obj: Any, *applicators: Callable[..., Any]) -> Any:
    
    if isinstance(obj, BaseChain):
        return pipe(obj, copy(), *applicators)
    else:
        return pipe(obj, *applicators)
481730
def build(self, validator, namespace, config_key, default, help):
        
        proxy_attrs = validator, namespace, config_key, default
        proxy_key = repr(proxy_attrs)
        if proxy_key in self.proxies:
            return self.proxies[proxy_key]

        value_proxy = proxy.ValueProxy(*proxy_attrs)
        register_value_proxy(namespace, value_proxy, help)
        return self.proxies.setdefault(proxy_key, value_proxy)
1360596
def generate(env):
    """"""
    static_obj, shared_obj = SCons.Tool.createObjBuilders(env)

    for suffix in ASSuffixes:
        static_obj.add_action(suffix, SCons.Defaults.ASAction)
        shared_obj.add_action(suffix, SCons.Defaults.ASAction)
        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)
        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)

    for suffix in ASPPSuffixes:
        static_obj.add_action(suffix, SCons.Defaults.ASPPAction)
        shared_obj.add_action(suffix, SCons.Defaults.ASPPAction)
        static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)
        shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)

    env['AS']        = 'ml'
    env['ASFLAGS']   = SCons.Util.CLVar('/nologo')
    env['ASPPFLAGS'] = '$ASFLAGS'
    env['ASCOM']     = '$AS $ASFLAGS /c /Fo$TARGET $SOURCES'
    env['ASPPCOM']   = '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c /Fo$TARGET $SOURCES'
    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
761898
public GitConfigurationSource build() {
    return new GitConfigurationSource(repositoryURI, tmpPath, tmpRepoPrefix, branchResolver, pathResolver,
        configFilesProvider, propertiesProviderSelector);
  }
1180520
def build_shapes(self):
        
        self.all_shapes = []  # @todo: keep adding?

        qres = self.sparqlHelper.getShapes()

        for candidate in qres:

            test_existing_cl = self.get_any_entity(uri=candidate[0])
            if not test_existing_cl:
                # create it
                self.all_shapes += [OntoShape(candidate[0], None, self.namespaces)]
            else:
                pass

        # add more data
        shacl = rdflib.Namespace('http://www.w3.org/ns/shacl#')

        for aShape in self.all_shapes:

            aShape.rdftype = shacl['Shape']
            aShape.triples = self.sparqlHelper.entityTriples(aShape.uri)
            aShape._buildGraph()  # force construction of mini graph

            aShape.sparqlHelper = self.sparqlHelper

            # attach to a class
            for uri in aShape.getValuesForProperty(shacl['targetClass']):
                aclass = self.get_class(str(uri))
                if aclass:
                    aShape.targetClasses += [aclass]
                    aclass.all_shapes += [aShape]
                    for propertyUri in aShape.getValuesForProperty(shacl['path']): #add shaped properties of this class. later can be used for ontodocs
                        propType = self.get_property(str(propertyUri))
                        if propType:
                            aclass.shapedProperties += [{'shape': aShape, 'property': propType}]



        # sort alphabetically
        self.all_shapes = sorted(self.all_shapes, key=lambda x: x.qname)

        # compute top layer
        exit = []
        for c in self.all_shapes:
            if not c.parents():
                exit += [c]
        self.toplayer_shapes = exit
643884
def _create_nodes(self, env, target = None, source = None):
        
        src_suf = self.get_src_suffix(env)

        target_factory = env.get_factory(self.target_factory)
        source_factory = env.get_factory(self.source_factory)

        source = self._adjustixes(source, None, src_suf)
        slist = env.arg2nodes(source, source_factory)

        pre = self.get_prefix(env, slist)
        suf = self.get_suffix(env, slist)

        if target is None:
            try:
                t_from_s = slist[0].target_from_source
            except AttributeError:
                raise UserError("Do not know how to create a target from source `%s'" % slist[0])
            except IndexError:
                tlist = []
            else:
                splitext = lambda S: self.splitext(S,env)
                tlist = [ t_from_s(pre, suf, splitext) ]
        else:
            target = self._adjustixes(target, pre, suf, self.ensure_suffix)
            tlist = env.arg2nodes(target, target_factory, target=target, source=source)

        if self.emitter:
            # The emitter is going to do str(node), but because we're
            # being called *from* a builder invocation, the new targets
            # don't yet have a builder set on them and will look like
            # source files.  Fool the emitter's str() calls by setting
            # up a temporary builder on the new targets.
            new_targets = []
            for t in tlist:
                if not t.is_derived():
                    t.builder_set(self)
                    new_targets.append(t)

            orig_tlist = tlist[:]
            orig_slist = slist[:]

            target, source = self.emitter(target=tlist, source=slist, env=env)

            # Now delete the temporary builders that we attached to any
            # new targets, so that _node_errors() doesn't do weird stuff
            # to them because it thinks they already have builders.
            for t in new_targets:
                if t.builder is self:
                    # Only delete the temporary builder if the emitter
                    # didn't change it on us.
                    t.builder_set(None)

            # Have to call arg2nodes yet again, since it is legal for
            # emitters to spit out strings as well as Node instances.
            tlist = env.arg2nodes(target, target_factory,
                                  target=orig_tlist, source=orig_slist)
            slist = env.arg2nodes(source, source_factory,
                                  target=orig_tlist, source=orig_slist)

        return tlist, slist