Get data between [ and ] remove ' if exist
    @param s: string to process
495174
def get_key(s):
    '''
    
    '''
    start = s.find("[")
    end = s.find("]")
    if start == -1 or end == -1:
        return None
    if s[start + 1] == "'":
        start += 1
    if s[end - 1] == "'":
        end -= 1
    return s[start + 1:end]
476836
function remove (from, what) {
  // TODO array coerce trick
  if (!_.isArray(what)) { what = [what] }
  return W.map(what, (p) => {
    return fs.unlinkSync(path.resolve(from, p))
  }
  )
}
410259
def processQueryString(self, s):
    
    char_blacklist = set(string.punctuation)
    char_blacklist.remove("'")
    char_blacklist.remove("&")
    char_blacklist = frozenset(char_blacklist)
    return __class__.unpunctuate(s.lower(), char_blacklist=char_blacklist)
420387
private static String split(String s) {
        int i = s.lastIndexOf('.');
        if (i < 0)
            return s;
        else
            return s.substring(i + 1);
    }
908734
@Override
    public V get(String s, int offset, int len) {
        int t = 0;
        for (int i = 0; i < len; ) {
            char c = s.charAt(offset + i++);
            if (isCaseInsensitive() && c < 128)
                c = StringUtils.lowercases[c];

            while (true) {
                int row = ROW_SIZE * t;
                char n = _tree[row];
                int diff = n - c;

                if (diff == 0) {
                    t = _tree[row + EQ];
                    if (t == 0)
                        return null;
                    break;
                }

                t = _tree[row + hilo(diff)];
                if (t == 0)
                    return null;
            }
        }

        return _value[t];
    }
1328330
public static List<String> split(String s, String separator) {
        if (s == null) return null;
        List<String> rslt = null;
        if (s.isEmpty() || isEmpty(separator)) {
            rslt = new ArrayList<>(1);
            rslt.add(s);
            return rslt;
        }

        //return s.split(COMMA_SPLIT); - NOT WORKING when compiled to JS

        int start = 0;
        int p = start;
        do {
            int j = s.indexOf(separator, p);
            if (j == -1) {
                if (rslt == null) {
                    rslt = new ArrayList<>(1);
                    rslt.add(s);
                    return rslt;
                }
                rslt.add(s.substring(start));
                break;
            }
            if (j > 0 && s.charAt(j - 1) == '\\') {
                p = j + 1;
                continue;
            } else {
                if (rslt == null) rslt = new ArrayList<String>();
                rslt.add(s.substring(start, j));
                start = j + 1;
                p = start;
            }

        } while (true);

        return rslt;
    }
828849
def bs(s: int) -> str:
    
    return str(s) if s <= 1 else bs(s >> 1) + str(s & 1)
243978
private boolean findAndRemove(Object e) {
        if (e != null) {
            for (Node pred = null, p = head; p != null; ) {
                Object item = p.item;
                if (p.isData) {
                    if (item != null && item != FORGOTTEN && e.equals(item) &&
                        p.tryMatchData()) {
                        unsplice(pred, p);
                        return true;
                    }
                }
                else if (item == null)
                    break;
                pred = p;
                if ((p = p.next) == UNLINKED) { // stale
                    pred = null;
                    p = head;
                }
            }
        }
        return false;
    }
719264
public static String stripAndTrim(String str, String replaceWith) {
		return stripAndTrim(str, replaceWith, false);
	}
521984
def get_string_from_data(self, offset, data):
        """"""
        
        # OC Patch
        b = None
        
        try:
            b = data[offset]
        except IndexError:
            return ''
        
        s = ''
        while ord(b):
            s += b
            offset += 1
            try:
                b = data[offset]
            except IndexError:
                break
        
        return s
1307887
private static String filter(String s) {
		int len = s.length();
		StringBuilder filtered = new StringBuilder(len);
		int pos = 0;
		while(pos < len) {
			char ch1 = s.charAt(pos++);
			if(Character.isHighSurrogate(ch1)) {
				// Handle surrogates
				if(pos < len) {
					char ch2 = s.charAt(pos++);
					if(Character.isLowSurrogate(ch2)) {
						if(isValidCharacter(Character.toCodePoint(ch1, ch2))) {
							filtered.append(ch1).append(ch2);
						}
					} else {
						// High surrogate not followed by low surrogate, invalid
					}
				} else {
					// High surrogate at end of string, invalid
				}
			} else {
				// Not surrogates
				if(isValidCharacter(ch1)) {
					filtered.append(ch1);
				}
			}
		}
		assert filtered.length() <= len;
		return filtered.length() != len ? filtered.toString() : s;
	}
1217167
function splice(arr, start, remove) {
    var items = [];
    for (var _i = 3; _i < arguments.length; _i++) {
        items[_i - 3] = arguments[_i];
    }
    start = start || 0;
    var head = arr.slice(0, start);
    var tail = arr.slice(start);
    var removed = [];
    if (remove) {
        removed = tail.slice(0, remove);
        tail = tail.slice(remove);
    }
    if (!is_1.isValue(remove)) {
        arr = head.concat(items);
        removed = tail;
    }
    else {
        arr = head.concat(items).concat(tail);
    }
    return {
        array: arr,
        val: removed
    };
}
1040731
def detokenize(s):
    
    print(s)
    s = re.sub("\s+([;:,\.\?!])", "\\1", s)
    s = re.sub("\s+(n't)", "\\1", s)
    return s
582303
public static String remove(String s, String l, String t) {
    if (s.startsWith(l)) {
      s = s.substring(l.length());
    }
    if (s.endsWith(t)) {
      s = s.substring(0, s.length() - t.length());
    }
    return s;
  }
1137133
private static String stripOuterBrackets(String s) {
        try {
            if (S.isEmpty(s))
                return s;
            if (R_.search(s)) {
                // strip out the outer brackets
                s = R_.stringMatched();
                s = s.substring(1);
                s = s.substring(0, s.length() - 1);
            }
        } catch (RuntimeException re) {
            // this unfortunately happens - so at least make it debuggable
            throw re;
        }
  
        return s;
    }
863558
def truncate(s: str, length: int = DEFAULT_CURTAIL) -> str:
    
    if len(s) > length:
        s = s[: length - 1] + '…'
    return s
360540
public static String tryToTrimToSize(String s, int length, boolean trimSuffix) {
        if (s == null || s.isEmpty()) {
            return s;
        } else if (s.length() <= length) {
            return s;
        } else if (s.contains(File.separator)) {
            String before = s.substring(0, s.lastIndexOf(File.separator));
            String after = s.substring(s.lastIndexOf(File.separator));
            if (!trimSuffix && length - after.length() > 4) {
                return Strings.tryToTrimToSize(before, length - after.length(), true) + after;
            } else {
                return Strings.tryToTrimToSize(before, length - 3, true) + File.separator + "..";
            }
        } else {
            return "..";
        }
    }