If put_back is True, put in umlauts; else, take them out!
334226
def replace_umlauts(word, put_back=False):  # use translate()
    ''''''
    if put_back:
        word = word.replace('A', 'ä')
        word = word.replace('O', 'ö')

    else:
        word = word.replace('ä', 'A').replace('\xc3\xa4', 'A')
        word = word.replace('ö', 'O').replace('\xc3\xb6', 'O')

    return word
533576
def safestr(str_):
    '''  '''
    str_ = str_ or ""
    return "".join(x for x in str_ if x.isalnum())
568432
def atone(string, caps=True):
    
    # Fix for unidecode until unidecode stop replace short y by u
    string = _Y_SHORT_REPLACE.sub("y", string)
    if caps is True:
        return unidecode(string)
    a = ""
    for char in string:
        if char.isupper():
            a += char
        else:
            a += unidecode(char)
    return a
760759
public void strBlowAwayCommas() {
        Data.Str d = ((Data.Str)data);
        byte[] buf = d.ptr.buffer;
        int go = d.ptr.start;
        int end = go + d.len;
        for(;go < end;go++) {
            if(buf[go] == ',') {
                d.len--;
                end--;
                System.arraycopy(buf, go+1, buf, go, end-go);
            }
        }
    }
14905
def detect_unicode(str)
      str = detect_unicode_bom(str)

      # Fallback to UTF-8
      if str.encoding == Encoding::BINARY
        str.force_encoding(Encoding::UTF_8)
      end

      str
    end
304766
def replace_escapes(self, m):
        """"""

        groups = m.groupdict()
        esc = m.group(0)
        if groups.get('special'):
            value = BACK_SLASH_TRANSLATION[esc]
        elif groups.get('char'):
            try:
                if esc.endswith('}'):
                    value = chr(int(esc[3:-1], 16))
                else:
                    value = chr(int(esc[2:], 16))
            except Exception:
                value = esc
        elif groups.get('oct'):
            # JavaScript only supports hex range.
            # So \400 would be \40 + '0'
            value = int(esc[1:], 8)
            overflow = ''
            if value > 255:
                value = esc[1:-1]
                overflow + esc[-1]
            value = chr(value) + overflow
        elif('other'):
            value = esc[1:]
        return value.replace('\x00', '\n')
1283890
function backticks(node) {
  if (node.value === twoBackticks) {
    node.value = openingDoubleQuote
  } else if (node.value === twoSingleQuotes) {
    node.value = closingDoubleQuote
  }
}
283206
def symbol
      return unless (colon = accept :colon)
      return undo colon if lookahead(:whitespace)

      if (exp = expression).nil?
        error :symbol
      else
        colon + exp[@value]
      end
    end
1208160
function(all, backslash, comment){
      var spaces = "                                                                                                                                                                                                     ";
      var padding = comment ? spaces.substring(0, comment.length) : "";
      return backslash + " \x12" + padding;
    }
528770
def bool_to_unicode(b):
    """"""
    b = bool(b)
    if b is True:  return u"✅"
    if b is False: return u"❎"
1135195
def asbool(value, true=(b'true', u'true'), false=(b'false', u'false')):
    
    value = value.strip().lower()
    if value in true:  # might raise UnicodeWarning/BytesWarning
        return True
    if value in false:
        return False
    raise TypeError()
319538
function replaceBadCharacters( text ) {
  var i, repl;
  for ( i = 0; i < rLen; i++ ) {
    repl = replacements[i];
    text = text.replace( repl[0], repl[1] );
  }
  return text;
}
270497
def _run_strip_accents(self, text):
        """"""
        text = unicodedata.normalize("NFD", text)
        output = []
        for char in text:
            cat = unicodedata.category(char)
            if cat == "Mn":
                continue
            output.append(char)
        return "".join(output)
155831
def backward_delete_char(event):
    "  "
    if event.arg < 0:
        # When a negative argument has been given, this should delete in front
        # of the cursor.
        deleted = event.current_buffer.delete(count=-event.arg)
    else:
        deleted = event.current_buffer.delete_before_cursor(count=event.arg)

    if not deleted:
        event.cli.output.bell()
748027
def make_code_readable(s):
    

    s = s if isinstance(s, str) else str(s)

    MAP = {",": ",\n", "{": "{\n ", "}": "\n}"}

    ll = []

    state = "open"
    flag_single = False
    flag_double = False
    flag_backslash = False
    for ch in s:
        if flag_backslash:
            flag_backslash = False
            continue

        if ch == "\\":
            flag_backslash = True
            continue

        if flag_single:
            if ch == "'":
                flag_single = False
        elif not flag_double and ch == "'":
            flag_single = True

        if flag_double:
            if ch == '"':
                flag_double = False
        elif not flag_single and ch == '"':
            flag_double = True

        if flag_single or flag_double:
            ll.append(ch)
        else:
            ll.append(MAP.get(ch, ch))

    return "".join(ll)
792267
def surround_previous_word(input_str):
    '''
    
    '''
    start = None
    end = None
    for i, char in enumerate(reversed(input_str)):
        if start is None:
            if char in '{}()[]<>?|':
                return input_str
            elif char != ' ':
                start = i
        else:
            if char in '{}()[]<>?| ':
                end = i
                break
    if start is None:
        return input_str
    if end is None:
        end = len(input_str)
    new_str = ''
    for i, char in enumerate(reversed(input_str)):
        if char == ' ' and i + 1 == start:
            continue
        if i == start:
            new_str += ') '
        elif i == end:
            new_str += '('
        new_str += char
    if end == len(input_str):
        new_str += '('
    return new_str[::-1]
27060
private function unDoubling()
    {
        if ($this->search(array('kk', 'dd', 'tt')) !== false) {
            $this->word = Utf8::substr($this->word, 0, -1);
        }
    }