Creates projectConfig object to be used for quick project property lookup
@param  {Object} datafile JSON datafile representing the project
@return {Object} Object representing project configuration
323438
function(datafile) {
    var projectConfig = fns.cloneDeep(datafile);

    /*
     * Conditions of audiences in projectConfig.typedAudiences are not
     * expected to be string-encoded as they are here in projectConfig.audiences.
     */
    fns.forEach(projectConfig.audiences, function(audience) {
      audience.conditions = JSON.parse(audience.conditions);
    });
    projectConfig.audiencesById = fns.keyBy(projectConfig.audiences, 'id');
    fns.assign(projectConfig.audiencesById, fns.keyBy(projectConfig.typedAudiences, 'id'));

    projectConfig.attributeKeyMap = fns.keyBy(projectConfig.attributes, 'key');
    projectConfig.eventKeyMap = fns.keyBy(projectConfig.events, 'key');
    projectConfig.groupIdMap = fns.keyBy(projectConfig.groups, 'id');

    var experiments;
    fns.forEach(projectConfig.groupIdMap, function(group, Id) {
      experiments = fns.cloneDeep(group.experiments);
      fns.forEach(experiments, function(experiment) {
        projectConfig.experiments.push(fns.assignIn(experiment, {groupId: Id}));
      });
    });

    projectConfig.rolloutIdMap = fns.keyBy(projectConfig.rollouts || [], 'id');
    fns.forOwn(projectConfig.rolloutIdMap, function(rollout) {
      fns.forEach(rollout.experiments || [], function(experiment) {
        projectConfig.experiments.push(fns.cloneDeep(experiment));
        // Creates { <variationKey>: <variation> } map inside of the experiment
        experiment.variationKeyMap = fns.keyBy(experiment.variations, 'key');
      });
    });

    projectConfig.experimentKeyMap = fns.keyBy(projectConfig.experiments, 'key');
    projectConfig.experimentIdMap = fns.keyBy(projectConfig.experiments, 'id');

    projectConfig.variationIdMap = {};
    projectConfig.variationVariableUsageMap = {};
    fns.forEach(projectConfig.experiments, function(experiment) {
      // Creates { <variationKey>: <variation> } map inside of the experiment
      experiment.variationKeyMap = fns.keyBy(experiment.variations, 'key');

      // Creates { <variationId>: { key: <variationKey>, id: <variationId> } } mapping for quick lookup
      fns.assignIn(projectConfig.variationIdMap, fns.keyBy(experiment.variations, 'id'));

      fns.forOwn(experiment.variationKeyMap, function(variation) {
        if (variation.variables) {
          projectConfig.variationVariableUsageMap[variation.id] = fns.keyBy(variation.variables, 'id');
        }
      });
    });

    // Object containing experiment Ids that exist in any feature
    // for checking that experiment is a feature experiment or not.
    projectConfig.experimentFeatureMap = {};

    projectConfig.featureKeyMap = fns.keyBy(projectConfig.featureFlags || [], 'key');
    fns.forOwn(projectConfig.featureKeyMap, function(feature) {
      feature.variableKeyMap = fns.keyBy(feature.variables, 'key');
      fns.forEach(feature.experimentIds || [], function(experimentId) {
        // Add this experiment in experiment-feature map.
        if (projectConfig.experimentFeatureMap[experimentId]) {
          projectConfig.experimentFeatureMap[experimentId].push(feature.id);  
        } else {
          projectConfig.experimentFeatureMap[experimentId] = [feature.id];
        }
        
        var experimentInFeature = projectConfig.experimentIdMap[experimentId];
        if (experimentInFeature.groupId) {
          feature.groupId = experimentInFeature.groupId;
          // Experiments in feature can only belong to one mutex group.
          return false;
        }
      });
    });

    return projectConfig;
  }
1210779
public static FrameworkProjectConfig create(
            final String name,
            final File propertyFile,
            final Properties properties,
            final IFilesystemFramework filesystemFramework
    )
    {

        if (!propertyFile.exists() ) {
            generateProjectPropertiesFile(name, propertyFile, false, properties, true);
        }
        return create(name, propertyFile, filesystemFramework);
    }
1014966
function DefaultData(projectConfig) {
	var defaultData = require(path.resolve(projectConfig.paths.src.views.data, '_default.json'));

	return {
		apply: function apply(data) {
			return merge.recursive(defaultData, data);
		}
	};
}
1298274
function projectConfigAddPaths(config) {

	if(!config.paths.src.hasOwnProperty('views')) {
		config.paths.src.views = {};
	}

	if(!config.paths.src.views.hasOwnProperty('layouts')) {
		config.paths.src.views.layouts = PATH_LAYOUTS;
	}

	if(!config.paths.src.views.hasOwnProperty('helpers')) {
		config.paths.src.views.helpers = PATH_HELPERS;
	}

	if(!config.paths.src.views.hasOwnProperty('data')) {
		config.paths.src.views.data = PATH_DATA;
	}

	if(!config.paths.dest.hasOwnProperty(TASK_NAME)) {
		config.paths.dest[TASK_NAME] = 'public/';
	}

	return config;
}
580772
function findConfig(file) {
  if (file) {
    // Custom config location

    const configFilepath = file[0] === '/'? file : path.join(process.cwd(), file);
    if (!fs.existsSync(configFilepath)) {
      throw new DvhbWebpackError('DvhbWebpack config not found: ' + configFilepath + '.');
    }

    return configFilepath;
  }

  // Search config file in all parent directories

  let configDir;
  try {
    configDir = findup.sync(__dirname, CONFIG_FILENAME);
  }
  catch (exception) {
    throw new DvhbWebpackError('DvhbWebpack config not found: ' + CONFIG_FILENAME + '.');
  }

  return path.join(configDir, CONFIG_FILENAME);
}
319780
private static PropertyLookup createDirectProjectPropertyLookup(
            IFilesystemFramework filesystemFramework,
            String projectName
    )
    {
        PropertyLookup lookup;
        final Properties ownProps = new Properties();
        ownProps.setProperty("project.name", projectName);

        File projectsBaseDir = filesystemFramework.getFrameworkProjectsBaseDir();
        //generic framework properties for a project

        final File propertyFile = getProjectPropertyFile(new File(projectsBaseDir, projectName));
        final Properties projectProps = PropertyLookup.fetchProperties(propertyFile);

        lookup = PropertyLookup.create(projectProps, PropertyLookup.create(ownProps));
        lookup.expand();
        return lookup;
    }
399629
function ConfigFromPath (superConfig, project, version) {
  ConfigFromPath.super_.call(this, superConfig, project, version);

  var strictNS = simpleWrapNS(this.ns);
  strictNS.env = simpleWrapNS(createNamespace(superConfig.getEnvConfig()));

  var files = superConfig._resolvePaths(project, version);
  var loaded = {};

  var generateLoad = function (f) {
    return function (otherVersion) {
      debug('load(%s) in %s', otherVersion, f);
      var dir = path.dirname(f);
      var otherFile = path.resolve(dir, otherVersion + '.js');
      if (loaded[otherFile]) {
        throw new Error('load(' + version + ') conflict in file ' + f);
      }
      try {
        require(otherFile)(strictNS, generateLoad(otherFile));
      } catch (err) {
        if (err.code === 'MODULE_NOT_FOUND') {
          throw new Error('load(' + version + ') fail in file ' + f);
        } else {
          throw err;
        }
      }
    };
  };
  files.forEach(function (f) {
    debug('load %s', f);
    var init = require(f);
    loaded[f] = true;
    if (typeof init !== 'function') {
      throw new Error('bad config file format, `module.exports` must be a function: ' + f);
    }
    init(strictNS, generateLoad(f));
  });

  var loadedFiles = Object.keys(loaded);
  if (loadedFiles.length < 1) {
    throw new Error('cannot find any config files for ' + project + '.' + version);
  } else {
    loadedFiles.forEach(function (f) {
      delete require.cache[f];
    });
  }

  this._loadFinish();
  debug('done');
}
312575
function getDataSource(projectConfig) {
	var api = {};

	api.getDataForPath = function getDataForPath(requestedPath) {
		var templateData, dataPath;

		dataPath = path.resolve(projectConfig.paths.src.views.data, requestedPath + '.json');

		try{
			templateData = require(dataPath);
		} catch(err){
			templateData = {};
		}

		return templateData;
	};

	api.getPaths = function getPaths() {
		return;
	};

	return api;
}
1131720
function(configPath, configNames, config) {
	var configsUsed = [];

	config = config || projectConfig;

	// work with the raw configuration object
	if (config && config.root) {
		config = config.root();
	}

	config = convict(config);
	configPath = path.resolve(appPath, configPath);
	configNames = configNames || [];

	configNames.forEach(function(configName) {
		var file;

		// Ignore local config in production mode
		if (configName == 'local' && nodeEnv === 'production') { return; }

		file = path.join(configPath, 'config-'+configName);
		file += configName === 'default' ? '.js' : '.json';

		if (fs.existsSync(file)) {

			if (configName === 'default') {
				config = convict( require(file) );
				config.load(dynamicDefaults);
			}
			else {
				config.loadFile( file );
			}

			// logging
			configName === 'default' ? configsUsed.push('xtc defaults') : configsUsed.push(configName);
		}
	});

	// be informative
	!process.env.testRun
		&& configsUsed.push('env', 'args')
		&& console.log('configuration:', configsUsed.join(' < '));

	return config;
}
1205924
function configGen() {
  return {
    input: 'src/index.ts',
    moduleContext: {
      [require.resolve('@tweenjs/tween.js')]: 'window'
    },
    output: {
      file: 'dist/web/buttplug.devtools.js',
      format: 'iife',
      name: "ButtplugDevTools",
      globals: { "buttplug": "Buttplug" }
    },
    plugins: [
      nodeResolve({
        jsnext: true,
        main: true,
        extensions: [ '.ts', '.js', '.json' ],
        browser: true
      }),
      postCss(),
      typescript({ tsconfigOverride: { compilerOptions: { module: "ES2015" } } }),
      json(),
      nodeBuiltins(),
      nodeGlobals(),
      commonjs({
        include: ['../../node_modules/**', './node_modules/**', "../buttplug/dist/main/src/**"],
        namedExports: {
          '../buttplug/dist/main/src/index.js': [ 'ButtplugLogger', 'ButtplugLogLevel', 'TestDeviceSubtypeManager' ],
          '../../node_modules/@tweenjs/tween.js/src/Tween.js': [ 'TWEEN', 'Tween' ]
        }
      }),
      autoExternal({
        dependencies: false,
        peerDependencies: true
      }),
      rollupHtml()
    ]
  };
}
789262
private static Path getConfigFilePath(Path projectPath) {
        String pathString = SystemProperty.CONFIGURATION_FILE.value();
        Path path;
        if (pathString == null) {
            path = DEFAULT_CONFIG_FILE;
        } else {
            path = Paths.get(pathString);
        }
        return projectPath.resolve(path);
    }
439289
def create_project(project, opts = {})
      data, _status_code, _headers = create_project_with_http_info(project, opts)
      return data
    end
341190
@SneakyThrows
    public static DataSource createDataSource(final File yamlFile) {
        YamlRootEncryptRuleConfiguration config = YamlEngine.unmarshal(yamlFile, YamlRootEncryptRuleConfiguration.class);
        return EncryptDataSourceFactory.createDataSource(config.getDataSource(), new EncryptRuleConfigurationYamlSwapper().swap(config.getEncryptRule()));
    }
951456
function (targetFile, configItems) {
            var tempManifest = platformConfig.parseElementtreeSync(targetFile),
                root = tempManifest.getroot();

            _.each(configItems, function (item) {
                // if parent is not found on the root, child/grandchild nodes are searched
                var parentEl = root.find(item.parent) || root.find('*/' + item.parent),
                    data = item.data,
                    childSelector = item.destination,
                    childEl;

                if(!parentEl) {
                    return;
                }

                if(item.type === 'preference') {
                    parentEl.attrib[childSelector] = data.attrib['value'];
                } else {
                    // since there can be multiple uses-permission elements, we need to select them by unique name
                    if(childSelector === 'uses-permission') {
                        childSelector += '[@android:name=\'' + data.attrib['android:name'] + '\']';
                    }

                    childEl = parentEl.find(childSelector);
                    // if child element doesnt exist, create new element
                    if(!childEl) {
                        childEl = new et.Element(item.destination);
                        parentEl.append(childEl);
                    }

                    // copy all config.xml data except for the generated _id property
                    _.each(data, function (prop, propName) {
                        if(propName !== '_id') {
                            childEl[propName] = prop;
                        }
                    });
                }
            });

            fs.writeFileSync(targetFile, tempManifest.write({indent: 4}), 'utf-8');
        }
796841
def _create_project(config):
    """"""
    try:
        response = config.pbclient.create_project(config.project['name'],
                                                  config.project['short_name'],
                                                  config.project['description'])
        check_api_error(response)
        return ("Project: %s created!" % config.project['short_name'])
    except exceptions.ConnectionError:
        return("Connection Error! The server %s is not responding" % config.server)
    except (ProjectNotFound, TaskNotFound):
        raise
1339762
function getBuildOptionsFromConfig(ctx) {
  var chcpBuildOptionsFilePath = path.join(ctx.opts.projectRoot, OPTIONS_FILE_NAME);

  return readObjectFromFile(chcpBuildOptionsFilePath);
}
335340
function getConfig(fpath, defaults) {
  var path = require('path');
  var dpath = path.dirname(path.resolve(fpath));

  function parentpath(fromdir, pattern) {
    var pp = require('parentpath'),
        cwd = process.cwd();
    try {
      process.chdir(fromdir);
      return pp.sync(pattern);
    } catch (e) {
      return null;
    } finally {
      process.chdir(cwd);
    }
  }

  function fromNpm() {
    var config;
    var dir = parentpath(dpath, 'package.json');
    if (dir) {
      try {
        config = require(dir + '/package.json')[MJS_NPM];
        config.__origin__ = dir + '/package.json';
      } catch (e) {
      }
    }
    return config;
  }

  function fromResourceFile() {
    var candidates = [
      parentpath(path, MJS_RC),
      process.env.HOME, process.env.USERPROFILE, process.env.HOMEPATH, process.env.HOMEDRIVE + process.env.HOMEPATH
    ];

    var config;
    for (var i = 0; i < candidates.length; i++) {
      var candidate = candidates[i] + '/' + MJS_RC;
      if (fs.existsSync(candidate)) {
        try {
          config = JSON.parse(fs.readFileSync(candidate));
          config.__origin__ = candidate;
          break;
        } catch (e) {
          showHelpAndExit('Unable to read config from "' + candidate + '": ' + e.message, 1);
        }
      }
    }
    return config;
  }

  var config = fromNpm() || fromResourceFile() || {};
  // Make sure we apply defaults to missing values
  Object.keys(defaults).filter(function (k) {
    return config[k] == null
  }).forEach(function (k) {
    config[k] = defaults[k];
  });
  return config;
}