low level config callback
497652
def config_callback(id, option, value)
      ret = Weechat::Hooks::Config.find_by_id(id).call(option, value)
    end
989975
function() {
            //add the proper number of arguments before adding remaining values
            if (!args.length) {
              args = Array(configs.length);
            }
            //fire callback with args and remaining values concatenated
            return callback.apply(null, args.concat(values));
          }
392036
def configure():
    """"""
    log_levels = {
        5: logging.NOTSET,
        4: logging.DEBUG,
        3: logging.INFO,
        2: logging.WARNING,
        1: logging.ERROR,
        0: logging.CRITICAL
    }

    logging.captureWarnings(True)
    root_logger = logging.getLogger()
    if settings.CFG["debug"]:
        details_format = logging.Formatter(
            '%(name)s (%(filename)s:%(lineno)s) [%(levelname)s] %(message)s')
        details_hdl = logging.StreamHandler()
        details_hdl.setFormatter(details_format)
        root_logger.addHandler(details_hdl)
    else:
        brief_format = logging.Formatter('%(message)s')
        console_hdl = logging.StreamHandler()
        console_hdl.setFormatter(brief_format)
        root_logger.addHandler(console_hdl)
    root_logger.setLevel(log_levels[int(settings.CFG["verbosity"])])

    configure_plumbum_log()
    configure_migrate_log()
    configure_parse_log()
1066750
def add_as_lowest(var, value)
      # Don't want to override anything, so just shift in a dummy site config at the lowest level and
      # set the value there.
      configs.append(Config.new(path: :runtime, parent: self, values: { var.to_s => value }))
    end
703165
def config(key, value, local=True):
    
    option = local and '--local' or ''
    run('config %s "%s" "%s"' % (option, key, value))
860702
function monkeyPatch(functionName) {
    var old = app[functionName];
    app[functionName] = function() {
        var args = arguments;
        // Delegate right to old behavior for config getters
        if (functionName === 'get' && arguments.length === 1) {
            return old.apply(app,args);
        } else {
            setTimeout(function() {
                old.apply(app,args);
            },1);
        }
    };
}
453168
function configure(alg, pswd, sto) {
  algorithm = alg;
  password = pswd;
  sessionTimeout = sto;
}
469130
function initMongo(config, callback) {
  
  var self = this;
  
  // Set db
  self.db = new Db(config.database, new Server(config.host, config.port, {}), {safe: true});
  
  // Get client
  self.db.open(function(err, client) {
    if (err) throw err;
    else {
      self.client = client;
      client.collectionNames(function(err, names) {
        if (err) throw err;
        else {
          var name = config.database + '.' + config.collection;
          var exists = names.filter(function(col) {
            if (col.name == name) return col; 
          });
          
          // Collection options
          var opts = {capped: true, size: config.logSize};
          if (config.logLimit != null) opts.max = config.logLimit;
          
          if (exists.length === 0) {
            client.createCollection(config.collection, opts, function(err, collection) {
              if (err) throw err;
              else {
                self.collection = collection;
                callback.call(self);
              }
            });
          } else {
            // Get collection
            client.collection(config.collection, function(err, collection) {
              if (err) throw err;
              else {
                self.collection = collection;
                // Get collection options » Check if collection has already been capped
                collection.options(function(err, options) {
                  if (err) {
                    throw err;
                  } else {
                    // Check if collection's options match log requirements
                    var ready = (options.capped === true && options.size === opts.size);
                    if ('max' in opts) ready = (ready && options.max === opts.max);
                    if (!ready) {
                      // Convert collection to capped if it's not match log requirements
                      var cmd = {"convertToCapped": config.collection, size: opts.size};
                      if ('max' in opts) cmd.max = opts.max;
                      client.command(cmd, function(err) {
                        if (err) throw err;
                        else {
                          callback.call(self);
                        }
                      });
                    } else {
                      callback.call(self);
                    }
                  }
                });
              }
            });
          }
        }
      });
    }
  });
}
9834
function parseOptions(options, callback) {
  "use strict";

  var _ = require('underscore');
  var config = require('./config');

  // get the UID and GID that we should run the workers as (allows workers to drop root privileges)
  if (options.u || options.g) {
    if (semver.gte(process.versions.node, '0.12.0')) {
      uidNumber((options.u ? options.u : null), (options.g ? options.g : null), function (err, uid, gid) {
        if (err) {
          Logger.error('Failed to change UID and GID for child processes.');
          Logger.verbose(err.stack || err.message || err);
        } else {
          options.u = uid;
          options.g = gid;
        }

        _.extend(config, options);
        callback();
      });
    } else {
      Logger.error('Changing UID and GID is only supported on node versions >= 0.12.0.  Ignoring requested UID and/or GID.');

      options.u = '';
      options.g = '';
      
      _.extend(config, options);
      callback();
    }
  } else {
    _.extend(config, options);
    callback();
  }
}
822677
function configureDebugMode (logLevel) {
  // because Listr logs to stdout (not configurable), make debug() do the same
  // otherwise file redirection gets very confusing
  debug.log = function () {
    const line = util.format.apply(util, arguments) + '\n'
    process.stdout.write(line)
  }

  // TTY-related configuration
  const supportsANSI = tty.isatty(process.stdout.fd)
  debug.useColors = () => supportsANSI
  if (!supportsANSI) {
    overrideDebugFormat()
  }

  // enable the right log levels
  if (logLevel === 'trace') debug.enable('*')
  if (logLevel === 'debug') debug.enable('thumbsup:error,thumbsup:warn,thumbsup:info,thumbsup:debug')
  if (logLevel === 'info') debug.enable('thumbsup:error,thumbsup:warn,thumbsup:info')

  // capture any additional console.log() calls, including Listr task updates
  console.log = require('debug')('thumbsup:info')
  console.info = require('debug')('thumbsup:info')
  console.warn = require('debug')('thumbsup:warn')
  console.error = require('debug')('thumbsup:error')
}
599716
def cli(env):
    """"""

    username, secret, endpoint_url, timeout = get_user_input(env)
    new_client = SoftLayer.Client(username=username, api_key=secret, endpoint_url=endpoint_url, timeout=timeout)
    api_key = get_api_key(new_client, username, secret)

    path = '~/.softlayer'
    if env.config_file:
        path = env.config_file
    config_path = os.path.expanduser(path)

    env.out(env.fmt(config.config_table({'username': username,
                                         'api_key': api_key,
                                         'endpoint_url': endpoint_url,
                                         'timeout': timeout})))

    if not formatting.confirm('Are you sure you want to write settings '
                              'to "%s"?' % config_path, default=True):
        raise exceptions.CLIAbort('Aborted.')

    # Persist the config file. Read the target config file in before
    # setting the values to avoid clobbering settings
    parsed_config = utils.configparser.RawConfigParser()
    parsed_config.read(config_path)
    try:
        parsed_config.add_section('softlayer')
    except utils.configparser.DuplicateSectionError:
        pass

    parsed_config.set('softlayer', 'username', username)
    parsed_config.set('softlayer', 'api_key', api_key)
    parsed_config.set('softlayer', 'endpoint_url', endpoint_url)
    parsed_config.set('softlayer', 'timeout', timeout)

    config_fd = os.fdopen(os.open(config_path,
                                  (os.O_WRONLY | os.O_CREAT | os.O_TRUNC),
                                  0o600),
                          'w')
    try:
        parsed_config.write(config_fd)
    finally:
        config_fd.close()

    env.fout("Configuration Updated Successfully")
637363
function lintConfig(config) {
  if (!config.path) return logger.halt('null config.path')
  if (!config.path.root) return logger.halt('null config.path.root')
  if (!config.path.client) return logger.halt('null config.path.client')
  if (!config.path.static) return logger.halt('null config.path.static')
  if (!config.path.vendor) return logger.halt('null config.path.vendor')
  config.path.client = config.path.client.replace(/\/$/, '')
  var staticDir = path.join(config.path.root, config.path.static)
  config.$path = {
    source: {
      client: path.join(config.path.root, config.path.client),
      vendor: path.join(config.path.root, config.path.vendor)
    },
    target: {
      static: staticDir,
      client: path.join(staticDir, config.path.client),
      vendor: path.join(staticDir, config.path.vendor)
    }
  }
  return config
}
512213
def cli(ctx, config, quiet):
    """"""
    ctx.obj = {}
    ctx.obj['config'] = load_config(config.read())  # yaml.load(config.read())
    ctx.obj['quiet'] = quiet
    log(ctx, ' * ' + rnd_scotty_quote() + ' * ')
1348700
def configure(**kwargs):
        """"""
        for key in kwargs:
            if key == 'is_logging_enabled':
                Event.is_logging_enabled = kwargs[key]
            elif key == 'collector_queue':
                Event.collector_queue = kwargs[key]
            else:
                Logger.get_logger(__name__).error("Unknown key %s in configure or bad type %s",
                                                  key, type(kwargs[key]))
1170859
def run_configurations(callback, sections_reader):
    """"""
    base = dict(OPTIONS)
    sections = sections_reader()
    if sections is None:
        logger.info("Configuration not found in .ini files. "
                    "Running with default settings")
        recompile()
    elif sections == []:
        logger.info("Configuration does not match current runtime. "
                    "Exiting")
    results = []
    for section, options in sections:
        OPTIONS.clear()
        OPTIONS.update(base)
        OPTIONS.update(options)
        logger.debug("Running configuration from section \"%s\". OPTIONS: %r",
                     section, OPTIONS)
        results.append(callback())
    return results
262314
def _call_config(self, method, *args, **kwargs):
        """"""
        return getattr(self._config, method)(self._section_name, *args, **kwargs)
1045727
def config(host, seq, option, value):
    """"""
    at(host, 'CONFIG', seq, [str(option), str(value)])