

def lesslines(url):
    'Takes in html and returns html stripped of any more than 2 successive line returns'
    html = url
    if checkurl(url):
        html = gethtml(url)
        if (not html):
            return None
    pattern = '\\n{2,}'
    pat = re.compile(pattern, (re.IGNORECASE | re.DOTALL))
    less = pat.sub('\\n\\n', html)
    pattern = ' {2,}'
    pat = re.compile(pattern, (re.IGNORECASE | re.DOTALL))
    less = pat.sub('', less)
    return less

dataset/ETHPy150Open miklevin/pipulate/common.py lesslines/original