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