Get the SRID from a string like "SRDI=4326". Used in parsing EWKT.
173745
private static int parseSrid(String ewktPart) {
		if (ewktPart != null && !"".equals(ewktPart)) {
			String[] parts = ewktPart.split("=");
			if (parts.length == 2) {
				try {
					return Integer.parseInt(parts[1]);
				} catch (Exception e) {
				}
			}
		}
		return 0;
	}
723644
def decode(self, ids):
    """"""
    ids = text_encoder.pad_decr(ids)
    subword_ids = ids
    del ids

    subwords = []

    # Some ids correspond to bytes. Because unicode characters are composed of
    # possibly multiple bytes, we attempt to decode contiguous lists of bytes
    # all together. Invalid byte sequences are replaced with the unicode
    # replacement (i.e. unknown) character U+FFFD.
    prev_bytes = []

    def consume_prev_bytes():
      if prev_bytes:
        bytestr = b"".join(prev_bytes)
        bytes_text = bytestr.decode("utf-8", "replace")
        subwords.append(bytes_text)
      return []

    for subword_id in subword_ids:
      subword = self._id_to_subword(subword_id)
      if isinstance(subword, six.binary_type):
        # Byte-encoded
        prev_bytes.append(subword)
      else:
        # If there were bytes previously, convert to unicode.
        prev_bytes = consume_prev_bytes()
        trimmed, add_space = _trim_underscore_and_tell(subword)
        subwords.append(trimmed)
        if add_space:
          subwords.append(" ")
    # If there were trailing bytes, convert to unicode.
    prev_bytes = consume_prev_bytes()

    return tf.compat.as_text("".join(subwords))
1370243
def get_readable_string(integer):
    
    """
    if integer == 9:    #\t
        readable_string = "\\t"
    elif integer == 10: #\r
        readable_string = "\\r"
    elif integer == 13:  #\n
        readable_string = "\\n"
    elif integer == 32:  # space
        readable_string = '__'
    elif integer >= 33 and integer <= 126:  # Readable ascii
        readable_string = ''.join([chr(integer), '.'])
    else:  # rest
        readable_string = int_to_padded_hex_byte(integer)

    return readable_string
114347
function getSignificantKladrId(kladr_id) {
    var significantKladrId = kladr_id.replace(/^(\d{2})(\d*?)(0+)$/g, '$1$2');
    var length = significantKladrId.length;
    var significantLength = -1;
    if (length <= 2) {
        significantLength = 2;
    } else if (length > 2 && length <= 5) {
        significantLength = 5;
    } else if (length > 5 && length <= 8) {
        significantLength = 8;
    } else if (length > 8 && length <= 11) {
        significantLength = 11;
    } else if (length > 11 && length <= 15) {
        significantLength = 15;
    } else if (length > 15) {
        significantLength = 19;
    }
    return text_util.padEnd(significantKladrId, significantLength, "0");
}
213227
private String LPad(String inStr, int maxLen) {
        if (inStr.length() >= maxLen) return inStr.toUpperCase();
        String zeroes = PADCHARS.substring(0, maxLen - inStr.length());
        String retVal = zeroes + inStr;
        return retVal.toUpperCase();
    }
313611
def get_number(s, cast=int):
    
    import string
    d = "".join(x for x in str(s) if x in string.digits)
    return cast(d)
37909
def parse_general_int(s):
    """"""
    mo = re.match(r"(\d+)([KkMGT]?)$", s)
    if mo:
        i, suffix = mo.group(1, 2)
        v = int(i)
        if suffix:
            if suffix == "K" or suffix == "k":
                v *= 1024
            elif suffix == "M":
                v *= (1024 * 1024)
            elif suffix == "G":
                v *= (1024 * 1024 * 1024)
            elif suffix == "T":
                v *= (1024 * 1024 * 1024 * 1024)
            else:
                raise ValueError("invalid integer string %s" % s)
        return v
    else:
        v = int(s)
    return v
239726
def decode_int(self, str):
        
        n = 0
        for c in str:
            n = n * self.BASE + self.ALPHABET_REVERSE[c]
        return n
520044
def _get_c_string(data, position):
    """"""
    end = data.index(b"\x00", position)
    return _utf_8_decode(data[position:end], None, True)[0], end + 1
354949
public String getDefinition_12_063(long srsId) {
		String definition = null;
		if (hasDefinition_12_063()) {
			definition = crsWktExtension.getDefinition(srsId);
		}
		return definition;
	}
45890
def get_substring_idxs(substr, string):
    
    return [match.start() for match in re.finditer(substr, string)]
869645
function(str, len, padChar) {
    str = stringIt(str);
    if (str.length >= len) {
      return str;
    }
    var padStr = getPadding(padChar, len);
    return str + padStr.substr(str.length - len);
  }
933801
function parseSkipString( str , runtime ) {
	var c ;

	for ( ; runtime.i < str.length ; runtime.i ++ ) {
		c = str.charCodeAt( runtime.i ) ;

		// Fastest this way
		if ( c === 0x22 || c === 0x5c ) {	// double quote or backslash
			runtime.i ++ ;

			// double-quote
			if ( c === 0x22 ) { return ; }
		}
	}

	throw new SyntaxError( "Unexpected end" ) ;
}
293583
public static XID parse(String idString) {
		UUID uuid = UUID.fromString(idString);
		return new XID(uuid);
	}
944982
private static String parseName(String s, StringBuilder sb) {
        sb.setLength(0);
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i); 
            switch (c) {
                case '+':
                    sb.append(' ');
                    break;
                case '%':
                    try {
                        sb.append((char) Integer.parseInt(s.substring(i+1, i+3), 
                                16));
                        i += 2;
                    } catch (NumberFormatException e) {
                        // XXX
                        // need to be more specific about illegal arg
                        throw new IllegalArgumentException();
                    } catch (StringIndexOutOfBoundsException e) {
                        String rest  = s.substring(i);
                        sb.append(rest);
                        if (rest.length()==2)
                            i++;
                        }

                        break;
                default:
                    sb.append(c);
                    break;
            }
        }

        return sb.toString();
    }
886103
private Integer getNumId(String idString, boolean isUri) {
		String numString;
		if (isUri) {
			if (!idString.startsWith("http://www.wikidata.org/entity/")) {
				return 0;
			}
			numString = idString.substring("http://www.wikidata.org/entity/Q"
					.length());
		} else {
			numString = idString.substring(1);
		}
		return Integer.parseInt(numString);
	}
896461
def p_expr_id_substr(p):
    
    entry = SYMBOL_TABLE.access_var(p[1], p.lineno(1), default_type=TYPE.string)
    p[0] = None
    if entry is None:
        return

    entry.accessed = True
    p[0] = make_strslice(p.lineno(1), entry, p[2][0], p[2][1])