Get Config For A Single Project
@param req
@param res
@param next
17210
function getConfig(req, res, next) {
  var params = {
    appId: req.params.projectid || req.params.id
  };

  forms.getAppConfig(req.connectionOptions, params, formsResultHandlers(constants.resultTypes.formProjects, req, next));
}
794207
function get(req, res, next) {
  var params = {
    appId: req.params.projectid || req.params.id
  };

  forms.getAppFormsForApp(_.extend(req.connectionOptions, params), formsResultHandlers(constants.resultTypes.formProjects, req, next));
}
514844
function serveDereferencedSwaggerFile (req, res, next) {
    if (req.method === "GET" || req.method === "HEAD") {
      let configPath = getConfiguredPath(options.apiPath);
      configPath = util.normalizePath(configPath, router);
      let reqPath = util.normalizePath(req.path, router);

      if (reqPath === configPath) {
        if (context.api) {
          util.debug("%s %s => Sending the Swagger API as JSON", req.method, req.path);
          res.json(context.api);
        }
        else {
          util.warn("WARNING! The Swagger API is empty. Sending an HTTP 500 response to %s %s", req.method, req.path);
          res.status(500).json({});
        }
        return;
      }
    }

    next();
  }
567878
def run_config(self, project, run=None, entity=None):
        
        query = gql('''
        query Model($name: String!, $entity: String!, $run: String!) {
            model(name: $name, entityName: $entity) {
                bucket(name: $run) {
                    config
                    commit
                    patch
                    files(names: ["wandb-metadata.json"]) {
                        edges {
                            node {
                                url
                            }
                        }
                    }
                }
            }
        }
        ''')

        response = self.gql(query, variable_values={
            'name': project, 'run': run, 'entity': entity
        })
        if response['model'] == None:
            raise ValueError("Run {}/{}/{} not found".format(entity, project, run) )
        run = response['model']['bucket']
        commit = run['commit']
        patch = run['patch']
        config = json.loads(run['config'] or '{}')
        if len(run['files']['edges']) > 0:
            url = run['files']['edges'][0]['node']['url']
            res = requests.get(url)
            res.raise_for_status()
            metadata = res.json()
        else:
            metadata = {}
        return (commit, config, patch, metadata)
537967
function getConfig(api /*: any */) /*: BabelCoreOptions */ {
  api.cache.never();

  return {
    babelrc: false,
    presets: presets.map(preset => require.resolve(preset)),
    plugins: plugins.map(plugin => require.resolve(plugin)),
  };
}
176094
function search(req, res, next) {
  var projectForms = req.appformsResultPayload.data || [];
  //Only Want The Project Ids
  projectForms = _.map(projectForms, function(form) {
    if (_.isObject(form)) {
      return form._id;
    } else {
      return form;
    }
  });

  var formsToFind = req.body || [];

  formsToFind = _.filter(projectForms, function(projFormId) {
    return formsToFind.indexOf(projFormId) > -1;
  });

  logger.debug("Middleware: search forms: ", {connection: req.connectionOptions, projectForms: projectForms});

  forms.findForms(req.connectionOptions, formsToFind, function(err, formsList) {
    if (err) {
      return next(err);
    }

    async.map(formsList, function(foundForm, cb) {
      var getParams = {
        "_id": foundForm._id,
        "showAdminFields": false
      };
      forms.getForm(_.extend(_.clone(req.connectionOptions), getParams), cb);
    }, formsResultHandlers(constants.resultTypes.forms, req, next));
  });
}
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;
}
1105280
function makeServeMiddleware(/* config */) {
  return function handle(req, resp, next) {
    if (/^\/.*\.css$/.test(req.url)) {
      resp.end("");
    }
    else {
      next();
    }
  };
}
825959
def get_default_config(self):
        
        config = super(ResqueWebCollector, self).get_default_config()
        config.update({
            'host': 'localhost',
            'port': 5678,
            'path': 'resqueweb',
        })
        return config
992068
function getComponentConfiguration(name) {
    var config = {};
    if (typeof projectConfig[name] === 'object') {
      config = projectConfig[name];
    }
    if (typeof componentConfig[name] === 'object') {
      if (config == null) config = {};
      config = util.extend(true, config, componentConfig[name]);
    }
    if (typeof appConfig[name] === 'object') {
      if (config == null) config = {};
      config = util.extend(true, config, appConfig[name]);
    }
    function ref(obj, str) {
      return str.split(".").reduce(function(o, x) {
        return o[x]
      }, obj);
    }

    if (config == null) {  // if it's null, we search for inner dotted configs.
      try {
        config = ref(projectConfig, name);
      } catch (e) {
      }
      try {
        config = util.extend(true, config || {}, ref(appConfig, name));
      } catch (e) {
      }
    }
    return config;
  }
341576
public Object getDynamic(final String link, final StaplerRequest request, final StaplerResponse response) {
        if ("configureDefaults".equals(link)) {
            Ancestor ancestor = request.findAncestor(AbstractProject.class);
            if (ancestor.getObject() instanceof AbstractProject) {
                AbstractProject<?, ?> project = (AbstractProject<?, ?>)ancestor.getObject();
                return new DefaultGraphConfigurationView(
                        new GraphConfiguration(WarningsProjectAction.getAllGraphs()), project, "warnings",
                        new NullBuildHistory(),
                        project.getAbsoluteUrl() + "/descriptorByName/WarningsPublisher/configureDefaults/");
            }
        }
        return null;
    }
320870
function(req, params) {
    if(!params) {
      params = URL.parse(req.url, true).query;
    }
    var cconfig = this.config.client;
    var next = params.next || cconfig.default_redirection_url;
    var url = cconfig.base_url + next;
    return url;
  }
1079457
function(req, res, next) {
    Tag.findOne({ name: req.params.name }, function(err, tag) {
      if (err) return next(err);
      if (!tag) return res.json(404, { error: 'failed to load tag ' + req.params.name });
      req.tag = tag;
      next();
    });
  }
236250
function getConfig(query) {
	let config = query;

	if (typeof config === 'string') {
		try {
			config = JSON.parse(config.replace(/^\?/, ''));
		} catch(ex) {}
	}

	if (typeof config !== 'object') {
		config = {};
	}

	return config;
}
1182001
function (req, res, next) {
        var ip = IPAddressHelper.getClientIP(req)
            , route = req.miajs.route
            , key = ip + route.path + route.method;

        if (_.isEmpty(route.rateLimits)) {
            next();
            return;
        }

        RateLimiter.checkRateLimitsByKey(key, route.rateLimits).then(function (rateLimiterResult) {
            if (rateLimiterResult.remaining == -1) {
                _logInfo("Rate limit of " + rateLimiterResult.limit + "req/" + rateLimiterResult.timeInterval + "min requests exceeded " + route.requestmethod.toUpperCase() + " " + route.url + " for " + ip);
                res.header("X-Rate-Limit-Limit", rateLimiterResult.limit);
                res.header("X-Rate-Limit-Remaining", 0);
                res.header("X-Rate-Limit-Reset", rateLimiterResult.timeTillReset);
                next(new MiaError({
                    status: 429,
                    err: {
                        'code': 'RateLimitExceeded',
                        'msg': Translator('system', 'RateLimitExceeded')
                    }
                }));
            }
            else {
                res.header("X-Rate-Limit-Limit", rateLimiterResult.limit);
                res.header("X-Rate-Limit-Remaining", rateLimiterResult.remaining);
                res.header("X-Rate-Limit-Reset", rateLimiterResult.timeTillReset);
                next();
            }
        }).catch(function () {
            next();
        });
    }
784469
function set(req, res) {
  var key = '' + req.args[0]
    , value = req.args[1];

  // already validated the config key/value so should be ok
  // to update the in-memory config, some config verification
  // methods perform side-effects, eg: dir
  this.conf.set(key, value);
  res.send(null, Constants.OK);
  if(key === ConfigKey.DIR) {
    this.log.notice('cwd: %s', process.cwd());
  }
}
1206358
function get(req, res) {
  var ptn = '' + req.args[0]
    , keys = this.pattern.filter(ptn, this.conf.getKeys())
    , list = []
    , i
    , k;
  for(i = 0;i < keys.length;i++) {
    k = keys[i];
    list.push(k, '' + this.conf.get(k));
  }
  res.send(null, list);
}