title: How to get rid of lines surrounded by empty spaces?
body: <p>I have a text that looks something like this:</p>
  <pre><code>text
  text
  text
  
  
  to remove
  
  text
  text
  text
  
  
  to remove
   
  
  text
  text
  text
  </code></pre>
  <p>There are blocks of uninterupted text and I need to remove the lines that look like 'to remove' in the above example, there are 2 empty lines above them and 1 empty line below. Is there someway to programmatically remove those lines together with spaces that surround them in Python?</p>