:param args: :class:`argparse.Namespace` object
    :param extra_opts: Map object given to API.load as extra options
336981
def _load_diff(args, extra_opts):
    
    try:
        diff = API.load(args.inputs, args.itype,
                        ac_ignore_missing=args.ignore_missing,
                        ac_merge=args.merge,
                        ac_template=args.template,
                        ac_schema=args.schema,
                        **extra_opts)
    except API.UnknownProcessorTypeError:
        _exit_with_output("Wrong input type '%s'" % args.itype, 1)
    except API.UnknownFileTypeError:
        _exit_with_output("No appropriate backend was found for given file "
                          "'%s'" % args.itype, 1)
    _exit_if_load_failure(diff,
                          "Failed to load: args=%s" % ", ".join(args.inputs))

    return diff
377965
def parse_other_args(opts, options)
      opts.on('-q', '--offline-queueing') do
        options[:offline_queueing] = true
      end

      opts.on('-F', '--filter-params [PARAMS}') do |params|
        options[:filter_params] = params.split(/\s*,\s*/)
      end

      opts.on('--help') do
        puts Usage.scan(__FILE__)
        exit
      end
    end
1207170
def strip_py(arg):
    # type: (str) -> Optional[str]
    
    for ext in PY_EXTENSIONS:
        if arg.endswith(ext):
            return arg[:-len(ext)]
    return None
1172701
def _decode_meta(self, meta, **extra):
        
        _meta = json.loads(meta) if meta else {}
        _meta.update(extra)
        return _meta
638985
def encode_args(args, extra=False):
    
    if not args:
        return ''

    methodargs = ', '.join([encode(a) for a in args])
    if extra:
        methodargs += ', '

    return methodargs
213839
function coerceOptions (opts) {
  return fp.pipe(
    () => (fp.isEmpty(opts) ? {} : opts),
    opts => (fp.isString(opts) ? { name: opts } : opts),
    opts => fp.set('name', fp.getOr(APP_NAME, 'name', opts), opts),
    opts => fp.set('base', extrasToBase(opts), opts),
    fp.pick(WHITELISTED_FIELDS),
    opts => Object.assign({}, DEFAULTS, opts)
  )()

  function extrasToBase (opts) {
    const current = fp.getOr({}, 'base', opts)
    const extras = fp.omit(BLACKLISTED_FIELDS, opts)
    return Object.assign({}, current, extras)
  }
}
87228
def add_command_line_options_argparse(cls, argparser):
        """"""
        import argparse

        class SetParameter(argparse.Action):
            """callback object for ArgumentParser"""

            def __call__(self, parser, namespace, value, option_string=None):
                cls.config[option_string] = value
                if option_string == "--stomp-conf":
                    cls.load_configuration_file(value)

        argparser.add_argument(
            "--stomp-host",
            metavar="HOST",
            default=cls.defaults.get("--stomp-host"),
            help="Stomp broker address, default '%(default)s'",
            type=str,
            action=SetParameter,
        )
        argparser.add_argument(
            "--stomp-port",
            metavar="PORT",
            default=cls.defaults.get("--stomp-port"),
            help="Stomp broker port, default '%(default)s'",
            type=int,
            action=SetParameter,
        )
        argparser.add_argument(
            "--stomp-user",
            metavar="USER",
            default=cls.defaults.get("--stomp-user"),
            help="Stomp user, default '%(default)s'",
            type=str,
            action=SetParameter,
        )
        argparser.add_argument(
            "--stomp-pass",
            metavar="PASS",
            default=cls.defaults.get("--stomp-pass"),
            help="Stomp password",
            type=str,
            action=SetParameter,
        )
        argparser.add_argument(
            "--stomp-prfx",
            metavar="PRE",
            default=cls.defaults.get("--stomp-prfx"),
            help="Stomp namespace prefix, default '%(default)s'",
            type=str,
            action=SetParameter,
        )
        argparser.add_argument(
            "--stomp-conf",
            metavar="CNF",
            default=cls.defaults.get("--stomp-conf"),
            help="Stomp configuration file containing connection information, disables default values",
            type=str,
            action=SetParameter,
        )
1326098
def pool_attr_add(arg, opts, shell_opts):
    

    res = Pool.list({ 'name': arg })
    if len(res) < 1:
        print("No pool with name '%s' found." % arg, file=sys.stderr)
        sys.exit(1)

    p = res[0]

    for avp in opts.get('extra-attribute', []):
        try:
            key, value = avp.split('=', 1)
        except ValueError:
            print("ERROR: Incorrect extra-attribute: %s. Accepted form: 'key=value'\n" % avp, file=sys.stderr)
            sys.exit(1)

        if key in p.avps:
            print("Unable to add extra-attribute: '%s' already exists." % key, file=sys.stderr)
            sys.exit(1)

        p.avps[key] = value

    try:
        p.save()
    except NipapError as exc:
        print("Could not save pool changes: %s" % str(exc), file=sys.stderr)
        sys.exit(1)

    print("Pool '%s' saved." % p.name)
687312
def extra_prepare(self, configuration, args_dict):
        """"""
        aws_syncr = args_dict.pop("aws_syncr")

        self.configuration.update(
            { "$@": aws_syncr.get("extra", "")
            , "aws_syncr": aws_syncr
            , "templates": {}
            , "config_folder": self.configuration_folder
            }
        , source = "<args_dict>"
        )
459774
def get_params_with_extra(self, rule_name, params):
        
        # HACK for prefer-local
        result = []
        extra_params = self._rules_vars_extra.get(rule_name, {})[0]
        _tmp_params = copy.deepcopy(params)
        _fixed_params = {}

        # Save params with list type - this type not changed
        for key, value in _tmp_params.items():
            if isinstance(value, list):
                _fixed_params[key] = value
        _tmp_params = {k: v for k, v in _tmp_params.items() if k not in _fixed_params}

        # extend with extra_vars - like 'any'
        for key, value in _tmp_params.items():
            if not isinstance(value, list) and key:
                _tmp_params[key] = list([value])
            if key in extra_params:
                _tmp_params[key].extend(extra_params[key])

        # get combinations
        keys = sorted(_tmp_params)
        combinations = itertools.product(*(_tmp_params[x] for x in keys))
        for comb in combinations:
            _dict = dict(zip(keys, comb))
            _dict.update(_fixed_params)
            result.append(_dict)

        return result
366579
def vars_args(parser):
    """"""
    parser.add_argument('--extra-vars',
                        dest='extra_vars',
                        help='Extra template variables',
                        default=[],
                        type=str,
                        action='append')
    parser.add_argument('--extra-vars-file',
                        dest='extra_vars_file',
                        help='YAML files full of variables',
                        default=[],
                        type=str,
                        action='append')
194081
def run(opts, args):
        '''
        '''
        setup_options(opts)

        mode = Modes.ONCE
        if len(args) > 0 and hasattr(Modes, args[0].upper()):
            _mode = args.pop(0).upper()
            mode = getattr(Modes, _mode)

        url = None
        if len(args) > 0:
            # A url was specified
            url = args.pop(0)

        plugin_mgr = PluginManager.load_plugin_from_addonxml(mode, url)
        plugin_mgr.run()
1309278
def _call(callable_obj, arg_names, namespace):
    
    arguments = {arg_name: getattr(namespace, arg_name)
                 for arg_name in arg_names}
    return callable_obj(**arguments)
195943
def extra_context(self, worker_ctx, exc_info):
        
        extra = {}
        extra.update(worker_ctx.context_data)

        self.client.extra_context(extra)
517850
def _take_extras(self, item: Parameter) -> Optional[bool]:
        

        index = item.tf_compilation_index()
        if index is not None:
            if item.index == index:
                return True
            _add_index_to_compilations(self.context, index)
        return None
588155
def _add_argument(obj, arg):
        
        argparse_options = {name: value for name, value in arg.options.items() if name in ARGPARSE_SUPPORTED_KWARGS}
        if arg.options_list:
            scrubbed_options_list = []
            for item in arg.options_list:

                if isinstance(item, Deprecated):
                    # don't add expired options to the parser
                    if item.expired():
                        continue

                    class _DeprecatedOption(str):
                        def __new__(cls, *args, **kwargs):
                            instance = str.__new__(cls, *args, **kwargs)
                            return instance

                    option = _DeprecatedOption(item.target)
                    setattr(option, 'deprecate_info', item)
                    item = option
                scrubbed_options_list.append(item)
            return obj.add_argument(*scrubbed_options_list, **argparse_options)

        if 'required' in argparse_options:
            del argparse_options['required']
        if 'metavar' not in argparse_options:
            argparse_options['metavar'] = '<{}>'.format(argparse_options['dest'].upper())
        return obj.add_argument(**argparse_options)
442650
def _extract_extra_keywords(self,params):
        
        extra_keywords = {}
        overridden_object_params = list(self._overridden.param)
        for name, val in params.items():
            if name not in overridden_object_params:
                extra_keywords[name]=val
                # CEBALERT: should we remove name from params
                # (i.e. del params[name]) so that it's only available
                # via extra_keywords()?
        return extra_keywords