Removes controls chars from text
    
        :return: input except controls chars
331617
def remove_control_chars(self):
        
        esc_key = Literal('\x1b')
        integer = Word(nums)
        escape_seq = Combine(
            esc_key + '[' + Optional(delimitedList(integer, ';')) +
            oneOf(list(alphas)))

        return Suppress(escape_seq).transformString(self.string)
790136
def strip( text ):
        '''
        
        '''
        members = [attr for attr in Colors.__dict__.keys() if not attr.startswith( "__" ) and not attr == 'strip']

        for c in members:
            text = text.replace( vars( Colors )[c], '' )
        return text
661679
function removeFormattingTokens(input) {
        if (input.match(/\[[\s\S]/)) {
            return input.replace(/^\[|\]$/g, "");
        }
        return input.replace(/\\/g, "");
    }
1069037
def remove_esc_chars(text_string):
    '''
    
    '''
    if text_string is None or text_string == "":
        return ""
    elif isinstance(text_string, str):
        return " ".join(re.sub(r'\\\w', "", text_string).split())
    else:
        raise InputError("string not passed as argument")
742129
def unescape(str):
    """"""
    out = ''
    prev_backslash = False
    for char in str:
        if not prev_backslash and char == '\\':
            prev_backslash = True
            continue
        out += char
        prev_backslash = False
    return out
1158236
def clean_strict(text, boundary=WS):
    """"""
    # transliterate to ascii
    text = ascii_text(text)
    # replace punctuation and symbols
    text = CHARACTERS_REMOVE_RE.sub('', text)
    text = category_replace(text)
    # pad out for company type replacements
    text = ''.join((boundary, collapse_spaces(text), boundary))
    return text
59293
def _preprocess_input(self, input):
        '''
        
        '''
        if not re.search(preprocess_chars, input):
            # No characters that we need to preprocess, so continue without.
            return input

        input = self._add_punctuation_spacing(input)

        return input
288313
def command_clean(string, vargs):
    
    valid_chars, invalid_chars = remove_invalid_ipa_characters(
        unicode_string=string,
        return_invalid=True,
        single_char_parsing=vargs["single_char_parsing"]
    )
    print(u"".join(valid_chars))
    print_invalid_chars(invalid_chars, vargs)
567095
def remove_accent_string(string):
    
    return utils.join([add_accent_char(c, Accent.NONE) for c in string])
153578
def strip_prompt(self, a_string):
        """"""
        response_list = a_string.split(self.RESPONSE_RETURN)
        new_response_list = []
        for line in response_list:
            if self.base_prompt not in line:
                new_response_list.append(line)

        output = self.RESPONSE_RETURN.join(new_response_list)
        return self.strip_context_items(output)
972125
def clean_asciidoc(text):
    
    """
    text = re.sub(r'(\b|^)[\[_*]{1,2}([a-zA-Z0-9])', r'"\2', text)
    text = re.sub(r'([a-zA-Z0-9])[\]_*]{1,2}', r'\1"', text)
    return text
1047604
def _backward_delete_char(text, pos):
    """"""
    if pos == 0:
        return text, pos
    return text[:pos - 1] + text[pos:], pos - 1
986199
def strip(self, chars=None):
        
        return self.__class__(
            self._str_strip('strip', chars),
            no_closing=chars and (closing_code in chars),
        )
15579
function stripColon(text) {
    var i = text.indexOf(":");
    if (i >= 0) {
        text = text.substr(i).trim();
        if (text[1] == " ") {
            text = text.substr(1).trim();
        }
    }
    return text;
}
379981
def _is_control(self, char):
        """"""
        # These are technically control characters but we count them as whitespace
        # characters.
        if char in ['\t', '\n', '\r']:
            return False
        cat = unicodedata.category(char)
        if cat.startswith('C'):
            return True
        return False
892771
def _trim(self, somestr):
        
        tmp = RE_LSPACES.sub("", somestr)
        tmp = RE_TSPACES.sub("", tmp)
        return str(tmp)
802151
def remove_non_latin(input_string, also_keep=None):
    
    if also_keep:
        also_keep += [' ']
    else:
        also_keep = [' ']
    latin_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    latin_chars += latin_chars.lower()
    latin_chars += ''.join(also_keep)
    no_latin = "".join([char for char in input_string if char in latin_chars])
    return no_latin