Removes global _options_ from _args_. This prevents an invalid
 option error from occurring when options are parsed
 again for the command.
189129
def remove_global_options(options, args)
      # TODO: refactor with flipflop, please TJ ! have time to refactor me !
      options.each do |option|
        switches = option[:switches].dup
        next if switches.empty?

        if (switch_has_arg = switches.any? { |s| s =~ /[ =]/ })
          switches.map! { |s| s[0, s.index('=') || s.index(' ') || s.length] }
        end

        switches = expand_optionally_negative_switches(switches)

        past_switch, arg_removed = false, false
        args.delete_if do |arg|
          if switches.any? { |s| s[0, arg.length] == arg }
            arg_removed = !switch_has_arg
            past_switch = true
          elsif past_switch && !arg_removed && arg !~ /^-/
            arg_removed = true
          else
            arg_removed = true
            false
          end
        end
      end
    end
740474
def p_arg1(p):
    
    # a hack to support "clear global"
    p[0] = node.string(value=str(p[1]), lineno=p.lineno(1), lexpos=p.lexpos(1))
818659
def setOptions(self, glob=False, **kwargs):
        
        if glob:
            self.globalOptions.update(kwargs)
        else:
            self.options.update(kwargs)
1210497
def del_option(self, option):
        
        assert isinstance(option, Option)
        while option in list(self._options):
            self._options.remove(option)
841508
def del_option_by_number(self, number):
        
        for o in list(self._options):
            assert isinstance(o, Option)
            if o.number == number:
                self._options.remove(o)
808292
def delete(options = {})
      options = options.merge(option_group_name: @name)
      resp = @client.delete_option_group(options)
      resp.data
    end
1193062
def _clean_flags(args, caller):
    '''
    
    '''
    flags = ''
    if args is None:
        return flags
    allowed = ('a', 'B', 'h', 'H', 'i', 'k', 'l', 'P', 't', 'T', 'x', 'v')
    for flag in args:
        if flag in allowed:
            flags += flag
        else:
            raise CommandExecutionError(
                'Invalid flag passed to {0}'.format(caller)
            )
    return flags
926713
public function removeOption($option)
    {
        if ($this->hasOption($option)) {
            $key = array_search($option, $this->options);
            unset($this->options[$key]);
        }
    }
495046
def delete(*args):
    ''''''
    from syn.base_utils import this_module
    mod = this_module(npop=3)
    yield
    for arg in args:
        name = arg
        if not isinstance(name, STR):
            name = arg.__name__
        delattr(mod, name)
1080197
def _clean_args(sys_argv, args):
    
    base = [x for x in sys_argv if
            x.startswith("-") or not args.datadir == os.path.abspath(os.path.expanduser(x))]
    # Remove installer only options we don't pass on
    base = [x for x in base if x not in set(["--minimize-disk"])]
    if "--nodata" in base:
        base.remove("--nodata")
    else:
        base.append("--data")
    return base
1139023
def exclude_options(ignore_file_path)
      ar = File.read(ignore_file_path)
      ar = ar.split("\n")
      ar.map! do |r|
        r.gsub!(/#.*$/,""); r.gsub!(/^\s*?$/,"")
        r.gsub!(/^\//,"./"); r.gsub!(/\/$/,"/*")
        r
      end
      ar =  ar.delete_if{|r|r==""}
      ar.map! do |r|
        "--exclude '" + r + "'"
      end
      return ar.join(" ")
    end
839650
def _prune_kwargs(kwargs):
    
    allowed_keys = [
        'corner_mask', 'alpha', 'locator', 'extend', 'xunits',
        'yunits', 'antialiased', 'nchunk', 'hatches', 'zorder']
    ignored = [key for key in kwargs.keys() if key not in allowed_keys]
    for key in ignored:
        _warn(
            '{}={} is not an allowed optional parameter and will'
            ' be ignored'.format(key, kwargs[key]))
        kwargs.pop(key, None)
    return kwargs
730159
public void removeGlobals ()
    {
        Iterator<String> i = _imports.iterator();
        while (i.hasNext()) {
            String name = i.next();
            if (name.indexOf('.') == -1) {
                i.remove();
            } else if (name.startsWith("java.lang")) {
                i.remove();
            }
        }
    }
720373
def config_args(self, section="main"):
        
        if self._config_parsed:
            return
        for a in self._filtered_actions("config"):
            for o in a.option_strings:
                try:
                    i = sys.argv.index(o)
                    sys.argv.pop(i)  # remove the option string
                    sys.argv.pop(i)  # remove the value that follows
                except ValueError:
                    pass
        for a in self._sorted_actions():
            self._set_arg(a, section, True)
        self._config_parsed = True
879474
def remove_params(self, *args):
        
        for a in args:
            self._orig_kwargs.pop(a)
        self.kwargs = self._orig_kwargs.copy()
1163497
def drop_flag_values(self):
    
    # An empty scope_to_flags to force all values to come via the config -> env hierarchy alone
    # and empty values in case we already cached some from flags.
    no_flags = {}
    return Options(self._goals,
                   no_flags,
                   self._target_specs,
                   self._passthru,
                   self._passthru_owner,
                   self._help_request,
                   self._parser_hierarchy,
                   self._bootstrap_option_values,
                   self._known_scope_to_info,
                   self._option_tracker,
                   self._unknown_scopes)
1027867
def remove_option(self, section, option):
        
        if self.is_secure_option(section, option) and self.keyring_available:
            s_option = "%s%s" % (section, option)
            self._unsaved[s_option] = ('delete', None)
        ConfigParser.remove_option(self, section, option)