streamcorpus_pipeline/_filters.py
def domain_name_cleanse(raw_string):
    '''extract a lower-case, no-slashes domain name from a raw string
    that might be a URL
    '''
    try:
        parts = urlparse(raw_string)
        domain = parts.netloc.split(':')[0]
    except:
        domain = ''
    if not domain:
        domain = raw_string
    if not domain:
        return ''
    domain = re.sub('\/', '', domain.strip().lower())
    return domain
def domain_name_cleanse(raw_string):
    '''extract a lower-case, no-slashes domain name from a raw string
    that might be a URL
    '''
    try:
        parts = urlparse(raw_string)
        domain = parts.netloc.split(':')[0]
    except:
        domain = ''
    if not domain:
        domain = raw_string
    if not domain:
        return ''
    domain = re.sub('\/', '', domain.strip().lower())
    return domain
def domain_name_cleanse ( raw_string ) : try : parts = urlparse ( raw_string ) domain = parts . netloc . split ( ':' ) [ 0 ] except : domain = '' if not domain : domain = raw_string if not domain : return '' domain = re . sub ( '\/' , '' , domain . strip ( ) . lower ( ) ) return domain
extract a lower-case, no-slashes domain name from a raw string
    that might be a URL
extract a lower - case no - slashes domain name from a raw string that might be a URL