Remove trailing '.' and ':' and tolower.

    >>> _clean_netloc('eXample.coM:')
    'example.com'
964617
def _clean_netloc(netloc):
    
    try:
        return netloc.rstrip('.:').lower()
    except:
        return netloc.rstrip('.:').decode('utf-8').lower().encode('utf-8')
565205
def clean_text(s):
    """"""
    SPACES_RE = re.compile(r'\s+')
    SPECIAL_CHARS_RE = re.compile(r'[^\w\s\.\-\(\)]')
    s = SPACES_RE.sub(' ', s)
    s = s.strip()
    s = SPECIAL_CHARS_RE.sub('', s)
    return s
792145
private String trimLeadingSlashIfNeeded(String rawName) {
        if (rawName != null && rawName.startsWith("/")) {
            return rawName.substring(1);
        }
        return rawName;
    }
862170
def remove_cruft(signal)
      parts = signal.split(".")
      [
        parts[0..-3].join('.'),
        parts.pop
      ].join('.')
    end
983177
private String removeLeadingSlashes(String src) {
        String result = null;
        int i = 0;
        boolean done = false;

        if (src == null)
            return null;

        int len = src.length();
        while ((!done) && (i < len)) {
            if ((src.charAt(i) == '/') || (src.charAt(i) == ' ')) {
                i++;
            } else {
                done = true;
            }
        }

        // If all slashes were stripped off and there was no remainder, then
        // return null.
        if (done) {
            result = src.substring(i);
        }

        return result;
    }
71343
public function cleanString()
		{
			//get rid of newline holders in values
			$this->processString = str_replace('\\\\\\\\n', ' ', $this->processString);

			//replace newline holders with newline
			$this->processString = str_replace('\n', "\n", $this->processString);

			//match returns extra curly bracket at EOL, get rid of it
			$this->processString = substr($this->processString, 0, -1);

			//convert unicode encoded characters to html entities hex
			$this->processString = preg_replace('/\\\\u([0-9a-fA-F]{4})/', '&#x$1;', $this->processString);

			//get rid of escapes added for javascript
			$this->processString = stripslashes($this->processString);
		}
377845
def _remove_trailing_spaces(text: str) -> str:
        
        clean_text = str()

        for line in text.splitlines(True):
            # remove trailing spaces (0x20) and tabs (0x09)
            clean_text += line.rstrip("\x09\x20")

        return clean_text
457140
def clean(ctx, node=False, translations=False, all=False):
    ''''''
    header('Clean all build artifacts')
    patterns = [
        'build', 'dist', 'cover', 'docs/_build',
        '**/*.pyc', '*.egg-info', '.tox', 'udata/static/*'
    ]
    if node or all:
        patterns.append('node_modules')
    if translations or all:
        patterns.append('udata/translations/*/LC_MESSAGES/udata.mo')
    for pattern in patterns:
        info(pattern)
    lrun('rm -rf {0}'.format(' '.join(patterns)))
882935
def endswith_strip(s, endswith='.txt', ignorecase=True):
    
    if ignorecase:
        if s.lower().endswith(endswith.lower()):
            return s[:-len(endswith)]
    else:
        if s.endswith(endswith):
            return s[:-len(endswith)]
    return s
1139211
function removeUselessStackLines(stack) {
  let pretty = stack.split('\n');
  pretty = pretty.filter((line) => {
    return !line.includes('node_modules') && !line.includes('Error');
  });  
  pretty = pretty.join('\n');
  return pretty;
}
371747
def drop_prefix(strings):
    
    strings_without_extensions = [
        s.split(".", 2)[0] for s in strings
    ]

    if len(strings_without_extensions) == 1:
        return [os.path.basename(strings_without_extensions[0])]
    prefix_len = len(os.path.commonprefix(strings_without_extensions))
    result = [string[prefix_len:] for string in strings_without_extensions]
    if len(set(result)) != len(strings):
        # If these operations resulted in a collision, just return the original
        # strings.
        return strings
    return result
369409
function removeUnderscore (filepath) {
  const parts = filepath.split(path.sep)
  const filename = parts.pop().replace(/^_/, '')
  return parts.concat([filename]).join(path.sep)
}
1128213
def _remove_qs(self, url):
        '''
        
        '''
        scheme, netloc, path, query, fragment = urlsplit(url)

        return urlunsplit((scheme, netloc, path, '', fragment))
992031
def clean(ctx, text):
    
    text = conversions.to_string(text, ctx)
    return ''.join([c for c in text if ord(c) >= 32])
1289614
def clean_restricted_chars(path, restricted_chars=restricted_chars):
    '''
    
    '''
    for character in restricted_chars:
        path = path.replace(character, '_')
    return path
575529
def replace_dots_to_underscores_at_last(path):
    
    if path == '':
        return path
    bits = path.split('/')
    bits[-1] = bits[-1].replace('.', '_')
    return '/'.join(bits)
580024
def _clean_line(self, l):
        ''''''

        new_line = self._sub_ip(l)                  # IP substitution
        new_line = self._sub_hostname(new_line)     # Hostname substitution
        new_line = self._sub_keywords(new_line)     # Keyword Substitution

        return new_line