Parse domain values for option.
199755
def parse_option(self, option, block_name, *values):
        
        _extra_subs = ('www', 'm', 'mobile')

        if len(values) == 0:  # expect some values here..
            raise ValueError

        for value in values:
            value = value.lower()

            # if it doesn't look like a protocol, assume http
            # (e.g. only domain supplied)
            if not _RE_PROTOCOL.match(value):
                value = 'http://' + value

            # did it parse? pull hostname/domain
            parsed = urlparse.urlparse(value)
            if parsed:
                domain = parsed.hostname

                if domain and _RE_TLD.search(domain):  # must have a TLD
                    # doesn't have subdomain, tack on www, m, and mobile
                    # for good measure. note, this check fails for
                    # multi-part TLDs, e.g. .co.uk
                    domain = _RE_WWW_SUB.sub('', domain)  # strip "www."

                    if len(domain.split('.')) == 2:
                        for sub in _extra_subs:
                            self.domains.add('{0}.{1}'.format(sub, domain))

                    self.domains.add(domain)

        # no domains.. must have failed
        if not self.domains:
            raise ValueError
653792
def parse_view_args(self, req, name, field):
        """"""
        return core.get_value(req.match_info, name, field)
1248290
def _parse_options(opts, delim):
    """"""
    options = {}
    for opt in opts.split(delim):
        key, val = opt.split("=")
        if key.lower() == 'readpreferencetags':
            options.setdefault('readpreferencetags', []).append(val)
        else:
            # str(option) to ensure that a unicode URI results in plain 'str'
            # option names. 'normalized' is then suitable to be passed as
            # kwargs in all Python versions.
            if str(key) in options:
                warnings.warn("Duplicate URI option %s" % (str(key),))
            options[str(key)] = unquote_plus(val)

    # Special case for deprecated options
    if "wtimeout" in options:
        if "wtimeoutMS" in options:
            options.pop("wtimeout")
        warnings.warn("Option wtimeout is deprecated, use 'wtimeoutMS'"
                      " instead")

    return options
1257305
function parseOptions(globals, data, options) {
    if (_.isString(options.filter)) {
        options.filter = resolvePaths(globals, data, options.filter);
    }

    return options;
}
63274
def parse_options(cls, options):
        """"""
        if (not options.putty_select and not options.putty_ignore and
                not options.putty_auto_ignore):
            return

        options._orig_select = options.select
        options._orig_ignore = options.ignore

        options.putty_select = Parser(options.putty_select)._rules
        options.putty_ignore = Parser(options.putty_ignore)._rules

        if options.putty_auto_ignore:
            options.putty_ignore.append(AutoLineDisableRule())

        options.ignore_code = functools.partial(
            putty_ignore_code,
            options,
        )

        options.report._ignore_code = options.ignore_code
510774
def get_vals(self, field, goids=None):
        """"""
        go2nt = self.go2nt
        if goids is None:
            goids = set(go2nt)
        return [getattr(go2nt[go], field) for go in goids]
989747
void parseOption(String option) {
    if (option.isEmpty()) {
      return;
    }

    @SuppressWarnings("StringSplitter")
    String[] keyAndValue = option.split(SPLIT_KEY_VALUE);
    requireArgument(keyAndValue.length <= 2,
        "key-value pair %s with more than one equals sign", option);

    String key = keyAndValue[0].trim();
    String value = (keyAndValue.length == 1) ? null : keyAndValue[1].trim();

    configure(key, value);
  }
43336
function parseNpmOption (option) {
  if (!option || typeof option !== 'string') {
    return option
  }

  const parsedOption = option.replace(/([A-Z])/g, (match, p) => {
    return `-${p.toLowerCase()}`
  })

  return `--${parsedOption}`
}
459008
def parse_options(cls, options):
        
        options = options.copy()
        subdomain = options.pop('subdomain', None)
        endpoint = options.pop('endpoint', None)
        return subdomain, endpoint, options,
999523
def parse_options(options, arg_split:':', valuesep: '=', opt_default: true, keyed_sep: "/")
			return {} unless options
			parsed_options={}
			options=options.split(arg_split) unless options.is_a?(Enumerable)
			options.each do |optvalue|
				opt,value=DR::SimpleParser.parse_namevalue(optvalue,sep: valuesep, default: opt_default)
				parsed_options.set_keyed_value(opt,value, sep: keyed_sep)
			end
			return parsed_options
		end
104271
def get_domain(self, value):
        
        return [k for k, v in self.all if v == value]
1010252
def _parse_option(cls, token):
        
        description = ""
        validator = None

        if " : " in token:
            token, description = tuple(token.split(" : ", 2))

            token = token.strip()

            description = description.strip()

        # Checking validator:
        matches = re.match(r"(.*)\((.*?)\)", token)
        if matches:
            token = matches.group(1).strip()
            validator = matches.group(2).strip()

        shortcut = None

        matches = re.split(r"\s*\|\s*", token, 2)

        if len(matches) > 1:
            shortcut = matches[0].lstrip("-")
            token = matches[1]
        else:
            token = token.lstrip("-")

        default = None
        mode = Option.NO_VALUE

        if token.endswith("=*"):
            mode = Option.MULTI_VALUED
            token = token.rstrip("=*")
        elif token.endswith("=?*"):
            mode = Option.MULTI_VALUED
            token = token.rstrip("=?*")
        elif token.endswith("=?"):
            mode = Option.OPTIONAL_VALUE
            token = token.rstrip("=?")
        elif token.endswith("="):
            mode = Option.REQUIRED_VALUE
            token = token.rstrip("=")

        matches = re.match(r"(.+)(=[?*]*)(.+)", token)
        if matches:
            token = matches.group(1)
            operator = matches.group(2)
            default = matches.group(3)

            if operator == "=*":
                mode = Option.REQUIRED_VALUE | Option.MULTI_VALUED
            elif operator == "=?*":
                mode = Option.MULTI_VALUED
            elif operator == "=?":
                mode = Option.OPTIONAL_VALUE
            elif operator == "=":
                mode = Option.REQUIRED_VALUE

        return _option(token, shortcut, mode, description, default)
334097
def _parse_domain_id(self, config):
        
        match = re.search(r'domain-id (.+)$', config)
        value = match.group(1) if match else None
        return dict(domain_id=value)
939800
def parse_value(self, values):
        """"""
        result = self.get_default_value()

        if not values:
            return result

        if not isinstance(values, list):
            return values

        return [self._cast_value(value) for value in values]
885427
def parse(fmt, stri):
    """"""
    convdef = get_convert_dict(fmt)
    keyvals = regex_formatter.extract_values(fmt, stri)
    for key in convdef.keys():
        keyvals[key] = _convert(convdef[key], keyvals[key])

    return keyvals
652443
def parse_option(self, option, block_name, *values):
        

        # treat arguments as part of the program name (support spaces in name)
        values = [x.replace(' ', '\\ ') if not x.startswith(os.sep) else x
                  for x in [str(v) for v in values]]

        if option == 'close':
            option = 'start_' + option

        key = option.split('_', 1)[0]
        self.paths[key] = set(common.extract_app_paths(values))
1324062
def get_option_value(elem):
    
    value = elem.get("value")
    if value is None:
        value = elem.text.strip()
    if value is None or value == "":
        msg = u"Error parsing value from {}.".format(elem)
        raise ValueError(msg)

    return value