parse a string to HSB
553167
function(strVal) {
            strVal = strVal.toLowerCase();
            this.value = this.stringToHSB(strVal) ||  {
                h: 0,
                s: 0,
                b: 0,
                a: 1
            };
        }
845846
@Override
    public Geldbetrag parse(CharSequence text) throws MonetaryParseException {
        return parse(Objects.toString(text));
    }
625818
def from_string(cls, hash, **context):
        """"""
        salt, checksum = parse_mc2(hash, cls.ident, handler=cls)

        return cls(salt=salt, checksum=checksum)
846384
@Override
	protected R parseValueFromString(String s)
	{
		Class<R> range = this.getRange();
		R value = null;
		try
		{
			if (range.equals(double.class))
			{
				value= (R) Double.valueOf(s);
			}
			else if (range.equals(float.class))
			{
				value=  (R) Float.valueOf(s);
			}
			else if (range.equals(int.class))
			{
				value= (R) Integer.valueOf(s);
			}
			else if (range.equals(Boolean.class))
			{
				value= (R) Boolean.valueOf(s);
			}
		}

		catch (NumberFormatException e)

		{
			throw new IllegalBioPAXArgumentException(
					"Failed to convert literal " + s +
					" to " + range.getSimpleName()
					+ " for " + property, e);
		}
		return value;
	}
994066
def parse(self, string, strict=True):
        '''
        '''
        if isinstance(string, bytes):
            errors = 'strict' if strict else 'replace'
            string = string.decode(self.encoding, errors=errors)

        if not self.raw:
            self.raw = string
        else:
            self.raw += string

        lines = unfold_lines(string).splitlines()
        for line in lines:
            if line:
                if ':' not in line:
                    if strict:
                        raise ValueError('Field missing colon.')
                    else:
                        continue

                name, value = line.split(':', 1)
                name = name.strip()
                value = value.strip()
                self.add(name, value)
1062795
function parse (str) {
  if (Buffer.isBuffer(str)) str = str.toString();
  type('str', str, 'String');
  try {
    return JSON.parse(str);
  } catch (ex) {
    ex.message = 'Unable to parse JSON: ' + ex.message + '\nAttempted to parse: ' + str;
    throw ex;
  }
}
1259762
def from_string(string: str):
        

        spec = Spec()
        parse_context = {"current_subpackage": None}
        for line in string.splitlines():
            spec, parse_context = _parse(spec, parse_context, line)
        return spec
318123
def from_str(string):
        
        match = re.match(r'^START READING (\w+) FROM \w+ (\d+)$', string)
        if match:
            return SetReadingEvent(match.group(1), int(match.group(2)))
        else:
            raise EventParseError
600475
def from_s(str)
      str.split(",").each do |eq|
        next unless eq =~ /^(.*)='([^']*)'$/
        # "
        name = Regexp.last_match(1)
        val = Regexp.last_match(2)
        raise MatchRuleException, name unless FILTERS.member?(name.to_sym)
        method(name + "=").call(val)
      end
      self
    end
42146
def parse_string(self):
        """"""
        word = ''

        if self.prior_delim:
            delim = self.prior_delim
            self.prior_delim = None
        else:
            delim = self.char
            word += self.char
            self.update_chars()

        while True:
            if self.char == delim:
                # Check for escaped delimiters
                self.update_chars()
                if self.char == delim:
                    word += 2 * delim
                    self.update_chars()
                else:
                    word += delim
                    break
            elif self.char == '\n':
                self.prior_delim = delim
                break
            else:
                word += self.char
                self.update_chars()

        return word
178922
function (hashString) {
            var pairs = hashString, hashObject = {}, currentPair, currentPairString;
            pairs = (pairs) ? pairs.split(this._separatorRegExp) : [];
            for (var i = 0, size = pairs.length; size > i; i++) {
                currentPairString = pairs[i];
                currentPair = decodeURIComponent(currentPairString).split("=");
                if (currentPair.length == 2) {
                    hashObject[currentPair[0]] = currentPair[1];
                } else {
                    if (currentPairString.indexOf("=") == currentPairString.length) {
                        hashObject[currentPair[0]] = "";
                    } else {
                        hashObject["param" + i] = currentPair[0];
                    }
                }
            }
            return hashObject;
        }
869814
def from_str(string):
        
        match = re.match(r'^READ (\w+) FOR (\d+) \w+S$', string)
        if match:
            return ReadEvent(match.group(1), int(match.group(2)))
        else:
            raise EventParseError
281813
function parseString(str, options){
  var ret = reduce(String(str).split(options.separator), function(ret, pair){
    var eql = indexOf(pair, '=')
      , brace = lastBraceInKey(pair)
      , key = pair.substr(0, brace || eql)
      , val = pair.substr(brace || eql, pair.length)
      , val = val.substr(indexOf(val, '=') + 1, val.length);

    // ?foo
    if ('' == key) key = pair, val = '';
    if ('' == key) return ret;

    return merge(ret, decode(key), decode(val));
  }, { base: {} }).base;

  return compact(ret);
}
646740
def parse(self, string, parent):
        """"""
        result = {}
        for member in self.RE_MEMBERS.finditer(string):
            mems = self._process_member(member, parent, string)
            #The regex match could contain multiple members that were defined
            #on the same line in the code file.
            for onemem in mems:
                result[onemem.name.lower()] = onemem
                
        return result
1106698
def from_string(cls, string):
        
        fields = string.split(None, 2)
        if len(fields) < 2:
            msg = "Not enough fields for public blob: {}"
            raise ValueError(msg.format(fields))
        key_type = fields[0]
        key_blob = decodebytes(b(fields[1]))
        try:
            comment = fields[2].strip()
        except IndexError:
            comment = None
        # Verify that the blob message first (string) field matches the
        # key_type
        m = Message(key_blob)
        blob_type = m.get_text()
        if blob_type != key_type:
            deets = "key type={!r}, but blob type={!r}".format(
                key_type, blob_type
            )
            raise ValueError("Invalid PublicBlob contents: {}".format(deets))
        # All good? All good.
        return cls(type_=key_type, blob=key_blob, comment=comment)
473620
private void parseValue(StringBuffer res, HashMap<String, String> predefs, char preDelim,
                            HashMap<String, String> valids) {
        int len = res.length();

        if (preDelim != (char) 0 && res.charAt(0) != preDelim) {
            if (len == 0) {
                throw new ParseErrorException(HBCIUtils.getLocMsg("EXCMSG_ENDOFSTRG", getPath()));
            }

            // log.("error string: "+res.toString(),log._ERR);
            // log.("current: "+getPath()+":"+type+"("+minsize+","+maxsize+")="+value,log._ERR);
            // log.("predelimiter mismatch (required:"+getPreDelim()+" found:"+temp.charAt(0)+")",log._ERR);
            throw new PredelimErrorException(getPath(), Character.toString(preDelim),
                Character.toString(res.charAt(0)));
        }

        this.value = SyntaxDEFactory.createSyntaxDE(getType(), getPath(), res, minsize, maxsize);

        String valueString = value.toString(0);
        String predefined = predefs.get(getPath());
        if (predefined != null) {
            if (!valueString.equals(predefined)) {
                throw new ParseErrorException(HBCIUtils.getLocMsg("EXCMSG_PREDEFERR",
                    new Object[]{getPath(), predefined, value}));
            }
        }

        boolean atLeastOne = false;
        boolean ok = false;
        if (valids != null) {
            String header = getPath() + ".value";
            for (String key : valids.keySet()) {
                if (key.startsWith(header) &&
                    key.indexOf(".", header.length()) == -1) {

                    atLeastOne = true;
                    String validValue = valids.get(key);
                    if (valueString.equals(validValue)) {
                        ok = true;
                        break;
                    }
                }
            }
        }

        if (atLeastOne && !ok) {
            throw new NoValidValueException(getPath(), valueString);
        }
    }
762941
def parse_string(self):
        """"""
        aliased_value = LITERAL_ALIASES.get(self.current_token.value.lower())
        if aliased_value is not None:
            return aliased_value
        return String(self.current_token.value)