helper to get config and callback from the arguments
548634
function parseArguments(args) {
        var defaultConfig = {
            stateKey: 'instances',
            instanceKey: 'id'
        };

        if (typeof args[0] === 'function') {
            return {
                callback: args[0],
                config: defaultConfig
            };
        } else {
            return {
                callback: args[1],
                config: Object.assign({}, defaultConfig, args[0])
            };
        }
    }
811442
function getConfig(config) {
  require('./test.karma.conf')(config);
  config.set({
    autoWatch: true,
    singleRun: false
  });
}
170579
def get_config_for(args, component, prefix=""):
    
    config = {}
    vargs = vars(args)
    for option in component.options:
        if component.options[option].hidden:
            continue
        config[option] = vargs["%s%s" % (prefix, option)]
    return config
1062882
function fetchConfig(cb) {
  return function (name, args) {
    function resultCb(result) {
      console.log(result);
    }
    function jenkinsCb(jenkins) {
      jenkins.fetchViewConfig(name, cli.exitCb(null, resultCb));
    }
    cb(args, jenkinsCb);
  };
}
843349
def _config_getter(get_opt,
                   key,
                   value_regex=None,
                   cwd=None,
                   user=None,
                   password=None,
                   ignore_retcode=False,
                   output_encoding=None,
                   **kwargs):
    '''
    
    '''
    kwargs = salt.utils.args.clean_kwargs(**kwargs)
    global_ = kwargs.pop('global', False)
    if kwargs:
        salt.utils.args.invalid_kwargs(kwargs)

    if cwd is None:
        if not global_:
            raise SaltInvocationError(
                '\'cwd\' argument required unless global=True'
            )
    else:
        cwd = _expand_path(cwd, user)

    if get_opt == '--get-regexp':
        if value_regex is not None \
                and not isinstance(value_regex, six.string_types):
            value_regex = six.text_type(value_regex)
    else:
        # Ignore value_regex
        value_regex = None

    command = ['git', 'config']
    command.extend(_which_git_config(global_, cwd, user, password,
                                     output_encoding=output_encoding))
    command.append(get_opt)
    command.append(key)
    if value_regex is not None:
        command.append(value_regex)
    return _git_run(command,
                    cwd=cwd,
                    user=user,
                    password=password,
                    ignore_retcode=ignore_retcode,
                    failhard=False,
                    output_encoding=output_encoding)
762385
def __get_config():
    '''
    
    '''
    if 'config' not in globals():
        return None
    cfg = globals().get('config', None)
    if cfg is None:
        return None

    if not isinstance(cfg, dict):
        return None
    return cfg
1295835
def find_callback(args, kw=None):
    ''
    if args and callable(args[-1]):
        return args[-1], args[:-1]
    try:
        return kw['callback'], args
    except (KeyError, TypeError):
        return None, args
87102
def _get_config(self, section: str, key: str, fallback: str=object()) -> str:
        
        return self._config.get(section, key, fallback=fallback)
1348575
def parse_args(self):
        
        parser = ArgumentParser(description='',
                                formatter_class=RawTextHelpFormatter)
        parser.add_argument("--generate", action="store", dest='generate',
                            choices=['command', 'docker-run', 'docker-compose',
                                     'ini', 'env', 'kubernetes', 'readme', 'drone-plugin'],
                            help="Generate a template ")
        parser.add_argument("--settings", action="store", dest='settings',
                            help="Specify a settings file. (ie settings.dev)")
        for key, value in self.spec.items():
            if value['type'] in [str, int, float]:
                parser.add_argument(f"--{key.lower()}", action="store", dest=key,
                                    type=value['type'],
                                    choices=value.get("choices"),
                                    help=self.help(value))
            elif value['type'] == bool:
                parser.add_argument(f"--{key.lower()}", action="store", dest=key,
                                    type=lambda x:bool(strtobool(x)),
                                    choices=value.get("choices"),
                                    help=self.help(value))
            elif value['type'] == list:
                parser.add_argument(f"--{key.lower()}", action="store", dest=key,
                                    nargs='+',
                                    choices=value.get("choices"),
                                    help=self.help(value))
            elif value['type'] == dict:
                parser.add_argument(f"--{key.lower()}", action="store", dest=key,
                                    type=json.loads,
                                    choices=value.get("choices"),
                                    help=self.help(value))
        args, _unknown = parser.parse_known_args()
        return args
1193678
function getConfigFromLS() {
    var configStr = localStorage[getFullBSKey(browser_storage_config_1.browserStorageConfig.DB_CONFIG_KEY)];
    if (typeof configStr === 'undefined') {
        return null;
    }
    else {
        return JSON.parse(configStr);
    }
}
808663
def callback(response = {})
      if response.empty?
        raise ArgumentError, "No callback parameters found"
      end

      CallbackResponse.new(response, config)
    end
759663
function(app, namespace, callback){

        self.get(app, function(err, config){
            if (err) {
                //logger.error('gina', 'UTILS:CONFIG:ERR:4', err, __stack);
                console.error(err.stack||err.message);
                callback(err + 'Utils.Config.get(...)');
            }

            try {
                callback( false, getVar('paths.' + namespace, config) );

            } catch (err) {
                var err = new Error('Config.getPath(app, cat, callback): cat not found');
                callback(err)
            }
        })
    }
269847
function getInitialConfigWithoutData(method, [arg1, arg2]) {
  if (typeof arg1 === 'string') {
    const config = { ...arg2 };
    config.url = arg1;
    config.method = method || config.method || 'GET';
    return config;
  } else {
    return arg1;
  }
}
627617
def _get_config(**kwargs):
    '''
    
    '''
    config = {
        'box_type': 'sealedbox',
        'sk': None,
        'sk_file': os.path.join(kwargs['opts'].get('pki_dir'), 'master/nacl'),
        'pk': None,
        'pk_file': os.path.join(kwargs['opts'].get('pki_dir'), 'master/nacl.pub'),
    }

    config_key = '{0}.config'.format(__virtualname__)
    try:
        config.update(__salt__['config.get'](config_key, {}))
    except (NameError, KeyError) as e:
        # likely using salt-run so fallback to __opts__
        config.update(kwargs['opts'].get(config_key, {}))
    # pylint: disable=C0201
    for k in set(config.keys()) & set(kwargs.keys()):
        config[k] = kwargs[k]
    return config
456744
def get_args():
    
    """

    description = "The Daemon send various value for zabbix_sender."
    parser = argparse.ArgumentParser(description)

    parser.add_argument('--config', '-c',
                        default='conf/defaults.cfg',
                        help='Specify "defaults.cfg" file'
                        )

    parser.add_argument('--debug-mode', '-d',
                        action='store_true',
                        help='Turn on debug mode',
                        dest='debug_mode'
                        )

    parser.add_argument('--pid-file', '-p',
                        default=os.path.join(
                            os.path.abspath(os.path.curdir),
                            'blackbird.pid'
                        ),
                        help='pid file location',
                        dest='pid_file'
                        )

    parser.add_argument('--foreground', '-f',
                        default=True,
                        action='store_false',
                        help='Turn on foreground mode',
                        dest='detach_process'
                        )

    parser.add_argument('--version', '-V',
                        default=False,
                        action='store_true',
                        help='Show version information',
                        dest='show_version'
                        )

    args = parser.parse_args()
    args.pid_file = is_pid(args.pid_file)

    return parser.parse_args()
1191791
function checkOpts(config, cb) {
  // jshint eqnull: true

  var prefix = "ragents.createSession(): "

  if (config == null) throw Error(prefix + "config is null")

  if (config.url == null) throw Error(prefix + "config.url is null")
  if (config.key == null) throw Error(prefix + "config.key is null")

  if (null == cb)        throw Error(prefix + "callback is null")
  if (!_.isFunction(cb)) throw Error(prefix + "callback is not a function")
}
1190766
function config (args) {
    // iterate over args merging configuration to either the module or the
    // global configuration
    _.each(args, (val, key) => {
        // configuration to modify
        var config
        // create new object to merge into config
        var merge = {}
        // set key and value to merge
        merge[key] = val
        // if this is a global config option then modify global config
        if (key in defaultGlobalConfig) {
            // merge args over config with custom handler to merge arrays
            _.mergeWith(immutableApp, merge, mergeArrays)
        }
        // if this is module config then set config on module instance
        else if (key in defaultModuleConfig) {
            // merge args over config with custom handler to merge arrays
            _.mergeWith(this, merge, mergeArrays)
        }
        // throw error on invalid configuration option
        else {
            throw new Error('invalid config option '+key)
        }
    })
    // return module
    return this
}